/* Palette taken from the VCP Pickleball Club logo: navy, court blue, lime ball. */
:root {
  --navy: #0b2152;
  --navy-deep: #071634;
  --optic: #c8f23e;
  --optic-soft: #e2f7a5;
  --paper: #f3f6fa;
  --surface: #ffffff;
  --ink: #0b1734;
  --muted: #5b6884;
  --line: #dce3ec;
  --row-hover: #eef3f9;
  --up: #16804d;
  --up-bg: #e3f3ea;
  --down: #bf3a30;
  --down-bg: #fbe8e6;
  --heart: #e5484d;
  --focus: #1857d6;
  --zalo: #0068ff;
  --gold: #e3ad2e;
  --silver: #a9b4c1;
  --bronze: #c47f45;
  /* Match results in charts: dark green, neutral grey, light coral. Checked for colour-blind
     readers (every pair stays apart for protan/deutan vision); the darker reds above are for text. */
  --chart-win: #0e6e40;
  --chart-tie: #8a95a8;
  --chart-loss: #e8806f;

  --font-body: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-score: "Barlow Condensed", "Arial Narrow", sans-serif;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

[hidden] { display: none !important; }

.mobile-only { display: none; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }

/* ---------- Header ---------- */

.site-header { background: var(--navy); color: #fff; }
.site-header :focus-visible { outline-color: var(--optic); }

.header-inner {
  display: flex;
  align-items: center;
  gap: 28px;
  min-height: 76px;
}

/* "Tải app" on iPhones (dock.js), at the right end of the header. */
.app-download {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
  min-height: 38px;
  margin-left: auto;
  padding: 0 15px 0 12px;
  border-radius: 999px;
  background: #fff;
  color: var(--navy);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 2px 10px rgba(2, 14, 41, 0.25);
}
.app-download svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  flex-shrink: 0;
}
.brand img { border-radius: 50%; background: #fff; }
.brand-text {
  display: grid;
  font-family: var(--font-score);
  line-height: 1;
  text-transform: uppercase;
}
.brand-line1 { font-size: 26px; font-weight: 700; letter-spacing: 0.02em; }
.brand-line2 { margin-top: 3px; font-size: 14px; font-weight: 600; letter-spacing: 0.08em; color: var(--optic); }

.menu-toggle {
  display: none;
  place-items: center;
  width: 40px; height: 40px;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: var(--radius-md);
  background: transparent;
  color: #fff;
}
.menu-toggle svg { width: 22px; height: 22px; }
/* The menu button always sits at the right edge, with or without the admin pill before it. */
.menu-toggle[aria-expanded="true"] { border-color: var(--optic); color: var(--optic); }

.sample-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 6px 3px 10px;
  border: 1px dashed rgba(255, 255, 255, 0.4);
  border-radius: 999px;
  background: transparent;
  color: rgba(255, 255, 255, 0.85);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}
.sample-chip:hover { border-color: #fff; color: #fff; }
.sample-chip-x { font-size: 15px; line-height: 1; }

.site-nav { display: flex; gap: clamp(18px, 2.4vw, 36px); margin-left: auto; font-size: 15px; }
.site-nav a {
  text-decoration: none;
  color: rgba(255, 255, 255, 0.8);
  padding: 6px 0;
  border-bottom: 2px solid transparent;
}
.site-nav a:hover { color: #fff; border-bottom-color: var(--optic); }

/* The desktop header exposes the same public destinations as the phone dock. */
.header-more { position: relative; }
.header-more[open] { z-index: 16; }
.header-more summary {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 0; border-bottom: 2px solid transparent;
  color: rgba(255, 255, 255, 0.8); cursor: pointer; list-style: none;
}
.header-more summary::-webkit-details-marker { display: none; }
.header-more summary:hover, .header-more[open] summary { color: #fff; border-bottom-color: var(--optic); }
.header-more-chevron { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; transform: rotate(90deg); }
.header-more[open] .header-more-chevron { transform: rotate(-90deg); }
.hd-more-panel {
  position: absolute; top: calc(100% + 14px); right: 0;
  width: 330px; margin: 0; padding: 6px; list-style: none;
  border: 1px solid var(--line); border-radius: 16px;
  background: var(--surface); box-shadow: 0 16px 40px rgba(7, 22, 52, 0.2);
}
.hd-more-panel li + li { border-top: 1px solid var(--line); }
.site-nav .header-more-link {
  display: grid; grid-template-columns: 36px minmax(0, 1fr) 16px;
  align-items: center; gap: 12px; padding: 12px 10px;
  color: var(--navy); border: 0; border-radius: 10px;
}
.site-nav .header-more-link:hover { color: var(--navy); background: var(--row-hover); border: 0; }
.site-header .header-more-link:focus-visible { outline-color: var(--navy); }
.header-more-icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: #eef2f8; }
.header-more-icon img { display: block; width: 36px; height: 36px; }
.header-more-glyph { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.header-more-text { display: grid; gap: 4px; font-size: 14px; font-weight: 500; line-height: 1.4; }
.header-more-text small { color: var(--muted); font-size: 12px; font-weight: 400; }
.header-more-end { width: 16px; height: 16px; fill: none; stroke: #9aa6ba; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }

/* Registration is the one action the header pushes: a ball-yellow pill with a soft pulse
   and a red "open now" dot. */
.register-cta {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 46px;
  padding: 0 18px 0 14px;
  border-radius: 999px;
  background: var(--optic);
  color: var(--navy-deep);
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  border: 0;
  cursor: pointer;
  animation: register-pulse 2.4s ease-out infinite;
}
.register-cta:hover { background: #c9f647; }
.register-cta:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.register-icon { width: 20px; height: 20px; flex-shrink: 0; }
.register-short { display: none; }
/* Label on top, countdown under it: two short lines keep the pill compact. */
.register-text { display: grid; gap: 3px; line-height: 1; }
.register-countdown {
  font-family: var(--font-score);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
  font-variant-numeric: tabular-nums;
  opacity: 0.85;
}
.register-cta.is-closed { animation: none; background: rgba(255, 255, 255, 0.85); }
.register-cta.is-closed .register-dot { display: none; }
.register-dot {
  position: absolute;
  top: -3px; right: -3px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--heart);
  box-shadow: 0 0 0 2px var(--navy);
}
.register-dot::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--heart);
  animation: register-ping 1.6s ease-out infinite;
}
@keyframes register-pulse {
  0% { box-shadow: 0 0 0 0 rgba(200, 242, 62, 0.55); }
  70%, 100% { box-shadow: 0 0 0 12px rgba(200, 242, 62, 0); }
}
@keyframes register-ping {
  0% { transform: scale(1); opacity: 0.8; }
  80%, 100% { transform: scale(2.6); opacity: 0; }
}

.admin-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: transparent;
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  padding: 6px 8px 6px 14px;
  border-radius: 999px;
  white-space: nowrap;
  text-decoration: none;
}
.admin-pill:hover { border-color: #fff; }
.admin-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
}

/* Only visible after signing in at /admin. */
.admin-pill { border-color: var(--optic); color: var(--optic); }
.admin-pill .admin-dot { background: var(--optic); }
.admin-badge {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 11px;
  background: var(--heart);
  color: #fff;
  font-family: var(--font-score);
  font-size: 15px;
  font-weight: 600;
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  background: var(--navy-deep);
  color: #fff;
  padding: 72px 0 0;
}
/* x: the tower's own x in the photo (53.1%), so it lands at the same share of the width at any
   scale, between the lookup column and the podium.
   y: the photo spans the full width, so its spire sits 5.47vw down; this keeps the tip 48px
   below the top edge at every desktop width. */
.hero-photo { position: absolute; inset: 0; z-index: -2; }
.hero-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 53.1% min(0px, calc(48px - 5.47vw));
}
/* Navy wash: near solid behind the title and stats, clear around the tower, and a dark
   floor for the podium to stand on. */
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(0deg, rgba(7, 22, 52, 0.85) 0%, rgba(7, 22, 52, 0) 42%),
    linear-gradient(90deg, rgba(7, 22, 52, 0.92) 0%, rgba(7, 22, 52, 0.82) 32%, rgba(7, 22, 52, 0.76) 42%, rgba(7, 22, 52, 0.22) 50%, rgba(7, 22, 52, 0.4) 58%, rgba(7, 22, 52, 0.55) 100%);
}
/* Two columns: lookup on the left, the podium standing on the hero's floor on the right.
   The extra height is room for the skyline above the podium. */
.hero-inner {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  align-items: end;
  gap: 32px 72px;
  min-height: 368px;
}
/* Centred against the podium so neither column looks top-heavy. */
.hero-main { align-self: center; padding: 0 0 40px; }

.hero-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
  margin-bottom: 28px;
}
.hero-title {
  margin: 0;
  font-family: var(--font-body);
  font-weight: 800;
  font-size: clamp(34px, 4.4vw, 52px);
  line-height: 1.1;
  letter-spacing: -0.025em;
  /* Box = cap height to baseline, so centring follows the letters rather than the
     room reserved for stacked accents ("ể") and descenders ("g"). */
  text-box: trim-both cap alphabetic;
}

.season-switch {
  display: inline-flex;
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.07);
}
.season-btn {
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: rgba(255, 255, 255, 0.6);
  font-family: var(--font-score);
  font-size: 22px;
  font-weight: 600;
  line-height: 1;
  padding: 11px 16px;
  font-variant-numeric: tabular-nums;
  text-box: trim-both cap alphabetic;
}
.season-btn:hover { color: #fff; }
.season-btn[aria-pressed="true"] { background: var(--optic); color: var(--navy-deep); }
.season-btn:focus-visible { outline: 3px solid var(--optic); outline-offset: 2px; }

/* ---------- Podium ---------- */

.podium { position: relative; --gold: #e9b949; --silver: #c3ccd6; --bronze: #cf8d57; }
/* A soft pool of navy behind the top three, so the city lights stay vivid elsewhere. */
.podium::before {
  content: "";
  position: absolute;
  inset: -110px -100px -90px;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(closest-side, rgba(7, 22, 52, 0.5), rgba(7, 22, 52, 0.42) 50%, rgba(7, 22, 52, 0));
}
/* Names and scores sit over the lit skyline; a soft shadow keeps their edges crisp. */
.podium-title, .step-player, .stat { text-shadow: 0 1px 3px rgba(2, 10, 33, 0.7); }
.podium-title {
  margin: 0 0 16px;
  text-align: center;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.92);
}
.podium-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: end;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.step { display: flex; flex-direction: column; align-items: center; gap: 10px; min-width: 0; }
.step-1 { order: 2; --medal: var(--gold); }
.step-2 { order: 1; --medal: var(--silver); }
.step-3 { order: 3; --medal: var(--bronze); }
.step-player {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  background: none;
  color: #fff;
  text-align: center;
}
.step-player:hover .step-name { text-decoration: underline; text-underline-offset: 3px; }
.step-player:focus-visible { outline: 3px solid var(--optic); outline-offset: 4px; border-radius: 8px; }
.step .avatar {
  width: 56px; height: 56px;
  font-size: 21px;
  box-shadow: 0 0 0 3px var(--navy-deep), 0 0 0 6px var(--medal);
}
.step-1 .avatar { width: 68px; height: 68px; font-size: 25px; }
.step-name {
  display: block;
  max-width: 100%;
  overflow: hidden;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.3;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.step-score {
  font-family: var(--font-score);
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.step-1 .step-score { color: var(--optic); font-size: 34px; }
.step-block {
  display: grid;
  justify-items: center;
  align-content: start;
  width: 100%;
  padding-top: 8px;
  border-top: 4px solid var(--medal);
  border-radius: 10px 10px 0 0;
  /* Frosted navy, so the steps read as solid blocks in front of the city lights. */
  background: linear-gradient(rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.03)), rgba(7, 22, 52, 0.7);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.step-1 .step-block { height: 92px; }
.step-2 .step-block { height: 68px; }
.step-3 .step-block { height: 50px; }
.step-rank {
  font-family: var(--font-score);
  font-size: 34px;
  font-weight: 700;
  line-height: 1;
  color: var(--medal);
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 24px;
}
.stat { display: flex; flex-direction: column; min-width: 0; }
.stat-value {
  font-family: var(--font-score);
  font-size: 30px;
  font-weight: 600;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
}
.stat-label { font-size: 13px; color: rgba(255, 255, 255, 0.84); }
.stat-progress {
  width: 100%;
  max-width: 160px;
  height: 4px;
  margin-top: 8px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.15);
  overflow: hidden;
}
.stat-progress span { display: block; height: 100%; background: var(--optic); }

/* ---------- Notices ---------- */

.notice { border-bottom: 1px solid var(--line); font-size: 14px; }

.notice-sample { background: var(--surface); }
.notice-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-top: 12px;
  padding-bottom: 12px;
}
.notice p { margin: 0; flex: 1; max-width: 80ch; }
.notice-actions { display: flex; flex-wrap: wrap; gap: 8px; flex-shrink: 0; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 500;
  border: 1px solid transparent;
  white-space: nowrap;
  text-decoration: none;
}
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-deep); }
.btn-ghost { background: var(--surface); border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: #b9c4d4; }
.btn-danger { background: transparent; border-color: #efc4bf; color: var(--down); }
.btn-danger:hover { background: var(--down-bg); }
.btn-block { width: 100%; }

.link-btn {
  border: 0;
  background: none;
  padding: 0;
  color: var(--focus);
  font-size: 14px;
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------- VCP Finals ---------- */

.finals { margin-bottom: 28px; }
.finals-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  margin-bottom: 16px;
}
.finals-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--navy);
  border-radius: 999px;
  background: var(--surface);
  color: var(--navy);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.finals-cta:hover { background: var(--navy); color: #fff; }
.video-icon { width: 26px; height: 19px; flex-shrink: 0; color: var(--heart); }
.finals-cta:hover .video-icon { color: #ff6b6f; }
.finals-heading { display: flex; align-items: center; gap: 16px; min-width: 0; }
/* Trophy sits in its own tile beside both lines, so title and subtitle share one left edge. */
.finals-badge {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 56px; height: 56px;
  border-radius: 16px;
  background: #fbf3dc;
}
.trophy { width: 30px; height: 30px; color: var(--gold); }
.finals-heading-text { min-width: 0; }
/* Both lines are trimmed to cap height and baseline, so the badge centres on the letters. */
.finals-title {
  margin: 0;
  font-family: var(--font-body);
  font-size: clamp(24px, 2.8vw, 30px);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--navy);
  text-box: trim-both cap alphabetic;
}
.finals-sub {
  margin: 12px 0 0;
  font-size: 14px;
  line-height: 1.4;
  color: var(--muted);
  text-box: trim-both cap alphabetic;
}

.finals-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 16px;
}

.champions {
  display: grid;
  align-content: start;
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.event-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  border-radius: 12px;
  background: var(--paper);
}
.event-tab {
  display: grid;
  justify-items: start;
  gap: 3px;
  min-width: 0;
  padding: 8px 12px 9px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  text-align: left;
}
.event-tab:hover { color: var(--ink); }
.event-tab[aria-selected="true"] {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(7, 22, 52, 0.14);
}
.tab-cap {
  font-family: var(--font-score);
  font-size: 24px;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.event-tab[aria-selected="true"] .tab-cap { color: var(--navy); }
.tab-kind {
  max-width: 100%;
  overflow: hidden;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.place-1 { --medal: var(--gold); }
.place-2 { --medal: var(--silver); }
.place-3 { --medal: var(--bronze); }
.medal {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--medal);
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.16);
  color: #fff;
  font-family: var(--font-score);
  font-size: 15px;
  font-weight: 700;
}
.medal-lg { width: 40px; height: 40px; font-size: 22px; }
.medal.is-penalty { --medal: var(--down); }

.points {
  padding: 1px 10px;
  border-radius: 999px;
  background: var(--up-bg);
  color: var(--up);
  font-family: var(--font-score);
  font-size: 17px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.points.is-minus { background: var(--down-bg); color: var(--down); }
.points-note { font-size: 12px; color: var(--muted); white-space: nowrap; }

/* The champion pair is the one loud row; runners-up sit quietly beneath it. */
.winner {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  border-radius: var(--radius-md);
  background: #fbf3dc;
}
.winner-text { display: grid; gap: 2px; min-width: 0; }
.winner-label { font-size: 13px; font-weight: 600; color: #8a6412; }
.winner-names { font-size: 19px; font-weight: 600; line-height: 1.3; }
.winner-points { display: grid; justify-items: end; gap: 2px; }
.winner-points .points { padding: 2px 12px; font-size: 22px; }
.winner-points small { font-size: 12px; color: #8a6412; }

.runners { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.runner { padding: 12px 14px 14px; border: 1px solid var(--line); border-radius: var(--radius-md); }
.runner-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}
.runner-head .points { margin-left: auto; }
.runner-pairs { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.runner-pairs li { display: flex; align-items: center; gap: 10px; min-width: 0; font-size: 14px; line-height: 1.35; }

.avatar-pair { display: inline-flex; flex-shrink: 0; }
.avatar-pair .avatar { width: 30px; height: 30px; font-size: 12px; box-shadow: 0 0 0 2px var(--surface); }
.avatar-pair .avatar + .avatar { margin-left: -8px; }
.winner .avatar-pair .avatar { width: 52px; height: 52px; font-size: 19px; background: #fff; box-shadow: 0 0 0 3px #fbf3dc; }
.winner .avatar-pair .avatar + .avatar { margin-left: -14px; }

.name-link {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  color: inherit;
  text-align: left;
  text-decoration: none;
}
.name-link:hover { text-decoration: underline; text-underline-offset: 3px; }

.penalty {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 16px;
  padding: 24px;
  border-radius: var(--radius-lg);
  background: var(--navy-deep);
  color: #fff;
}
.penalty :focus-visible { outline-color: var(--optic); }
.penalty-value {
  font-family: var(--font-score);
  font-size: 76px;
  font-weight: 700;
  line-height: 0.85;
  color: #ff9a8f;
}
.penalty-title { margin: 0; font-size: 17px; font-weight: 600; line-height: 1.35; }
.penalty-sub { margin: 4px 0 0; font-size: 13px; color: rgba(255, 255, 255, 0.65); }
.avatar-stack { display: flex; align-items: center; }
.avatar-stack .avatar {
  width: 36px; height: 36px;
  font-size: 14px;
  background: #1b2f5f;
  color: #dbe4f3;
  box-shadow: 0 0 0 2px var(--navy-deep);
}
.avatar-stack > * + * { margin-left: -8px; }
.stack-more {
  display: grid;
  place-items: center;
  min-width: 36px;
  height: 36px;
  padding: 0 9px;
  border-radius: 18px;
  background: #273b6f;
  box-shadow: 0 0 0 2px var(--navy-deep);
  font-size: 13px;
  font-weight: 600;
}
.btn-on-dark {
  align-self: flex-start;
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}
.btn-on-dark:hover { background: rgba(255, 255, 255, 0.16); }

.penalty-rows { margin: 0; padding: 0; list-style: none; }
.penalty-rows li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.penalty-rows li:last-child { border-bottom: 0; }
.penalty-who { display: grid; min-width: 0; font-size: 15px; }
.penalty-who small { font-size: 13px; color: var(--muted); }

.achievements { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.achievements li { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: center; gap: 10px; font-size: 14px; }
.achievements .medal { width: 24px; height: 24px; font-size: 14px; }

.name-unmatched {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  color: inherit;
  text-align: left;
  text-decoration: underline dashed #d98a1c;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}
.name-unmatched:hover { color: #a85f00; }

.delta-none { font-family: var(--font-score); font-size: 18px; color: #b3bccb; }

.btn-warn { background: #fff4df; border-color: #f1c98a; color: #8a4f00; }
.btn-warn:hover { background: #ffead0; }

/* Matching drawer */
.match-queue { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 18px; }
.queue-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px 4px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-size: 13px;
  font-weight: 500;
}
.queue-chip:hover { border-color: #9fb0ca; }
.queue-chip.is-current { border-color: var(--navy); background: var(--navy); color: #fff; }
.queue-sign {
  padding: 0 7px;
  border-radius: 999px;
  background: var(--up-bg);
  color: var(--up);
  font-family: var(--font-score);
  font-size: 14px;
  font-weight: 600;
}
.queue-sign.is-minus { background: var(--down-bg); color: var(--down); }
.queue-chip.is-current .queue-sign { background: rgba(255, 255, 255, 0.16); color: #fff; }

.match-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: #fbfcfe;
}
.match-step { margin: 0; font-size: 13px; color: var(--muted); }
.match-label { margin: 0; font-size: 26px; font-weight: 800; line-height: 1.2; letter-spacing: -0.02em; color: var(--navy); }
.match-adjustments { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; font-size: 14px; }
.match-adjustments li { display: flex; align-items: center; gap: 10px; }
.match-card .callout { margin: 0; }
.match-search {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  font-size: 15px;
}
.match-candidates { display: grid; gap: 6px; }
.candidate {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 8px 12px 8px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #fff;
  text-align: left;
}
.candidate:hover { border-color: #9fb0ca; }
.candidate[aria-checked="true"] { border-color: var(--navy); box-shadow: 0 0 0 2px var(--navy); }
.candidate.is-over { opacity: 0.5; }
/* Partner list (owner 2026-10-27): who needs a sponsorship to play, and who cannot be picked at all. */
.candidate-need { justify-self: start; margin-top: 4px; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; line-height: 1.4; }
.candidate.is-sponsor .candidate-need { background: var(--optic-soft); color: var(--navy-deep); }
.candidate.is-blocked { cursor: not-allowed; background: var(--paper); }
.candidate.is-blocked:hover { border-color: var(--line); }
.candidate.is-blocked .avatar,
.candidate.is-blocked .candidate-name,
.candidate.is-blocked .candidate-score { opacity: 0.45; }
.candidate.is-blocked .candidate-need { padding: 0; color: var(--down); }
.candidate-text { display: grid; min-width: 0; }
.candidate-name { font-size: 15px; font-weight: 500; }
.candidate-text small { font-size: 13px; color: var(--muted); }
.candidate-score { font-family: var(--font-score); font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; }
.match-card .form-actions .btn-primary:disabled { opacity: 0.45; cursor: not-allowed; }

.auto-matched { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 14px; font-size: 14px; }
.auto-matched summary { cursor: pointer; font-weight: 600; }
.auto-matched ul { display: grid; gap: 2px; margin: 10px 0 0; padding: 0; list-style: none; }
.auto-matched li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 16px minmax(0, 1.3fr) auto;
  align-items: center;
  gap: 8px;
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
}
.auto-matched li:last-child { border-bottom: 0; }
.matched-player { display: grid; min-width: 0; }
.matched-player small { font-size: 12px; color: var(--muted); }

/* ---------- Admin: vintennis.live names ---------- */

/* ---------- Filters ---------- */

.main { padding-top: 24px; padding-bottom: 48px; }

/* ---------- Pinned toolbar (all screen sizes) ---------- */

.list-toolbar {
  position: sticky;
  top: 12px;
  z-index: 12;
  display: grid;
  /* minmax(0, …) keeps the scrolling group row from stretching the toolbar. */
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  margin-bottom: 24px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  /* The second shadow paints page colour into the gap above the pinned bar, so rows never peek through. */
  box-shadow: 0 10px 30px rgba(7, 22, 52, 0.08), 0 -13px 0 1px var(--paper);
}
.filters-open .list-toolbar { z-index: 30; }
.toolbar-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.toolbar-search { position: relative; flex: 1 1 200px; min-width: 0; }
.search-icon {
  position: absolute;
  left: 14px; top: 50%;
  width: 20px; height: 20px;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}
.toolbar-search input {
  width: 100%;
  height: 44px;
  padding: 0 14px 0 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #fff;
  color: var(--ink);
  font-size: 16px;
}
.toolbar-search input::placeholder { color: #8a95ab; }
/* Every control in the toolbar row is exactly 44px tall. */
.toolbar-row .pills { padding: 3px; }
.toolbar-row .pill { min-height: 38px; padding: 0 14px; }
.toolbar-filter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #fff;
  color: var(--navy);
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
}
.toolbar-filter svg { width: 20px; height: 20px; }
.toolbar-filter[aria-expanded="true"] { border-color: var(--navy); box-shadow: 0 0 0 1px var(--navy); }
.filter-count {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 10px;
  background: var(--navy);
  color: #fff;
  font-size: 12px;
}
.toolbar-groups .chips {
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
  /* Fade the right edge so it is clear the row scrolls. */
  -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 40px), transparent);
  mask-image: linear-gradient(to right, #000 calc(100% - 40px), transparent);
  padding-right: 40px;
}
.toolbar-groups .chips::-webkit-scrollbar { display: none; }
.active-filters:not([hidden]) { display: flex; flex-wrap: wrap; gap: 6px; }
.active-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 10px 0 14px;
  border: 0;
  border-radius: 999px;
  background: var(--navy);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
}
.active-chip span { font-size: 17px; line-height: 1; opacity: 0.8; }

.filters {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 2;
  display: none;
  width: min(560px, 100%);
  /* minmax(0, …) stops the scrolling chip row from widening the whole panel on phones. */
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
  padding: 0 20px 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: 0 18px 40px rgba(7, 22, 52, 0.18);
}
.filters-open .filters { display: grid; }
/* Gender, sort and groups already sit in the toolbar on wide screens. */
.filters .filters-row-pills,
.filters .filters-block-groups { display: none; }
.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0 12px;
  border-bottom: 1px solid var(--line);
}
.sheet-title { margin: 0; font-size: 17px; font-weight: 700; }
.sheet-foot { display: flex; justify-content: flex-end; gap: 10px; }
.list-toolbar .scrim { z-index: 1; background: transparent; }
.filters-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
}
.filters-label {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
}

.pills {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: var(--paper);
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  padding: 7px 16px;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
}
.pill:hover { color: var(--ink); }
.pill[aria-pressed="true"] {
  background: var(--navy);
  color: #fff;
  box-shadow: 0 1px 3px rgba(7, 22, 52, 0.25);
}
.pill-count {
  font-family: var(--font-score);
  font-size: 16px;
  font-weight: 600;
  opacity: 0.7;
}
.pills-sort .pill { padding: 7px 14px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  white-space: nowrap;
}
.chip:hover { border-color: #9fb0ca; background: #f8fafd; }
.chip[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: #fff; }
.chip-count {
  font-family: var(--font-score);
  font-size: 16px;
  font-weight: 600;
  color: var(--muted);
}
.chip[aria-pressed="true"] .chip-count { color: var(--optic); }
.chip.is-empty { opacity: 0.45; }

.filters-row-bottom { align-items: flex-end; }

.range-block { flex: 1 1 420px; max-width: 600px; }
.range-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.range-readout {
  font-size: 15px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* Bars are inset by half a thumb so they line up with the slider's travel. */
.histogram {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 64px;
  padding: 0 11px;
}
.bar {
  flex: 1;
  min-width: 0;
  border-radius: 3px 3px 0 0;
  background: #dbe2ec;
  transition: background 120ms;
}
.bar.in-range { background: var(--navy); }

.dual-range { position: relative; height: 26px; }
.dual-track {
  position: absolute;
  left: 11px; right: 11px; top: 50%;
  height: 4px;
  transform: translateY(-50%);
  border-radius: 2px;
  background: var(--line);
}
.dual-fill { position: absolute; top: 0; bottom: 0; border-radius: 2px; background: var(--navy); }
.dual-range input {
  position: absolute;
  left: 0; top: 0;
  width: 100%;
  height: 26px;
  margin: 0;
  background: transparent;
  pointer-events: none;
  -webkit-appearance: none;
  appearance: none;
}
.dual-range input:focus-visible { outline: none; }
.dual-range input::-webkit-slider-runnable-track { height: 26px; background: transparent; }
.dual-range input::-moz-range-track { background: transparent; }
.dual-range input::-webkit-slider-thumb {
  -webkit-appearance: none;
  pointer-events: auto;
  width: 22px; height: 22px;
  margin-top: 2px;
  border-radius: 50%;
  border: 3px solid var(--navy);
  background: #fff;
  box-shadow: 0 1px 4px rgba(7, 22, 52, 0.25);
  cursor: grab;
}
.dual-range input::-moz-range-thumb {
  pointer-events: auto;
  width: 16px; height: 16px;
  border-radius: 50%;
  border: 3px solid var(--navy);
  background: #fff;
  cursor: grab;
}
.dual-range input:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px rgba(47, 95, 208, 0.35); }
.dual-range input:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 4px rgba(47, 95, 208, 0.35); }
.range-scale {
  display: flex;
  justify-content: space-between;
  padding: 2px 4px 0;
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}
.switch:has(input:checked) { border-color: var(--navy); background: #eef3fb; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-track {
  position: relative;
  flex-shrink: 0;
  width: 36px; height: 20px;
  border-radius: 10px;
  background: #c9d3e1;
  transition: background 150ms;
}
.switch-track::after {
  content: "";
  position: absolute;
  top: 2px; left: 2px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(7, 22, 52, 0.3);
  transition: transform 150ms;
}
.switch input:checked + .switch-track { background: var(--navy); }
.switch input:checked + .switch-track::after { transform: translateX(16px); }
.switch input:focus-visible + .switch-track { outline: 3px solid var(--focus); outline-offset: 2px; }
.switch-count {
  font-family: var(--font-score);
  font-size: 16px;
  font-weight: 600;
  color: var(--muted);
}

.result-bar { display: flex; align-items: center; gap: 14px; margin: 18px 0 10px; }
.result-count { margin: 0; font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }

.more-bar { display: grid; justify-items: center; gap: 8px; margin-top: 18px; }
.btn-more {
  min-width: 220px;
  padding: 11px 24px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--navy);
  font-size: 15px;
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(7, 22, 52, 0.06);
}
.btn-more:hover { border-color: var(--navy); }
.more-progress { margin: 0; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------- Board ---------- */

.board {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.board th {
  text-align: left;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: #f8fafc;
}
.board th.c-num { font-family: var(--font-score); font-size: 16px; font-weight: 600; }
.board td {
  padding: 8px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.board tbody tr:last-child td { border-bottom: 0; }
.board tbody tr:hover td { background: var(--row-hover); }

.c-rank { width: 64px; }
.c-group { width: 150px; color: var(--muted); font-size: 14px; }
.c-num { width: 96px; text-align: right; }
.board th.c-num { text-align: right; }
.c-delta { width: 120px; text-align: right; }
.board th.c-delta { text-align: right; }

.rank {
  display: inline-grid;
  place-items: center;
  min-width: 32px;
  height: 32px;
  padding: 0 6px;
  font-family: var(--font-score);
  font-size: 20px;
  font-weight: 600;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.rank.is-podium { background: var(--optic); color: var(--navy-deep); border-radius: 16px; }

.player {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 4px 0;
  border: 0;
  background: transparent;
  text-align: left;
}
.player:hover .player-name { text-decoration: underline; text-underline-offset: 3px; }
.player-text { display: flex; flex-direction: column; min-width: 0; }
.player-line { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; }
.player-name { font-weight: 500; font-size: 15px; }
.player-meta { display: flex; gap: 10px; font-size: 13px; color: var(--muted); }
.meta-group { display: none; }

.tag-pending {
  display: inline-flex;
  align-items: center;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--optic-soft);
  color: #3f560c;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.6;
}

.avatar {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 38px; height: 38px;
  border-radius: 50%;
  background: #e4ebf4;
  color: var(--navy);
  font-weight: 600;
  font-size: 15px;
  overflow: hidden;
}
.avatar { position: relative; }
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.avatar-sm { width: 32px; height: 32px; font-size: 13px; }
.avatar-lg { width: 72px; height: 72px; font-size: 26px; }

.score {
  font-family: var(--font-score);
  font-size: 24px;
  font-weight: 600;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.c-prev .score { color: var(--muted); font-weight: 500; }
.is-previous-season .c-prev .score { color: var(--ink); font-weight: 600; }
.pending { font-size: 13px; color: var(--muted); }
.score.is-carried { color: var(--muted); font-weight: 500; }

.delta {
  display: inline-block;
  min-width: 56px;
  padding: 3px 10px;
  border-radius: 999px;
  font-family: var(--font-score);
  font-size: 17px;
  font-weight: 600;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.delta.up { color: var(--up); background: var(--up-bg); }
.delta.down { color: var(--down); background: var(--down-bg); }
.delta.same { color: var(--muted); font-family: var(--font-body); font-size: 13px; font-weight: 400; }

.score-input {
  width: 84px;
  height: 40px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fbfcfe;
  text-align: right;
  font-family: var(--font-score);
  font-size: 22px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.score-input::placeholder { color: #b3bccb; font-weight: 500; }
.score-input.is-filled { border-color: #9fb0ca; background: #fff; }
.score-input.just-saved { border-color: var(--up); box-shadow: 0 0 0 3px var(--up-bg); }
.score-input[aria-invalid="true"] { border-color: var(--down); box-shadow: 0 0 0 3px var(--down-bg); }

/* Previous-season view hides the comparison columns. */
.is-previous-season .c-cur,
.is-previous-season .c-delta { display: none; }

.empty { padding: 48px 0; text-align: center; color: var(--muted); }
.empty p { margin: 0 0 12px; }

/* Shown while the board loads from the server, or when it could not. */
.board-status { padding: 48px 0; text-align: center; color: var(--muted); }
.board-status p { margin: 0 0 12px; }

/* Spam trap: off-screen, never seen or focused by people. */
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Footer ---------- */

.site-footer { padding: 28px 0 40px; text-align: center; }
.made-by {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-size: 14px;
  color: var(--muted);
}
.made-by a { color: var(--ink); font-weight: 600; text-decoration: none; }
.made-by a:hover { text-decoration: underline; text-underline-offset: 3px; }
.heart {
  width: 17px; height: 17px;
  color: var(--heart);
  transform-origin: center;
  animation: heartbeat 1.3s ease-in-out infinite;
}
@keyframes heartbeat {
  0%, 60%, 100% { transform: scale(1); }
  15% { transform: scale(1.28); }
  30% { transform: scale(1); }
  45% { transform: scale(1.18); }
}

/* ---------- Drawer ---------- */

.scrim {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: rgba(7, 22, 52, 0.45);
}

.drawer {
  position: fixed;
  z-index: 21;
  top: 0; right: 0; bottom: 0;
  width: min(480px, 100%);
  background: var(--surface);
  box-shadow: -12px 0 40px rgba(7, 22, 52, 0.18);
  overflow-y: auto;
  transform: translateX(0);
  transition: transform 220ms ease-out;
}
.drawer.is-entering { transform: translateX(100%); }

.drawer-body {
  --pad-x: 24px;
  --pad-top: 24px;
  --pad-bottom: 24px;
  padding: var(--pad-top) var(--pad-x) var(--pad-bottom);
}

.drawer-head { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 20px; }
.drawer-head .avatar { width: 56px; height: 56px; font-size: 20px; }
.drawer-head h2 { margin: 2px 0 2px; font-size: 20px; font-weight: 600; line-height: 1.3; }
.drawer-meta { display: flex; gap: 12px; font-size: 14px; color: var(--muted); }
.drawer-close {
  margin-left: auto;
  flex-shrink: 0;
  width: 36px; height: 36px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  font-size: 20px;
  line-height: 1;
  color: var(--muted);
}
.drawer-close:hover { color: var(--ink); border-color: #b9c4d4; }

/* Court-side scoreboard: the loud element inside the drawer. */
.scoreboard {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-radius: var(--radius-lg);
  background: var(--navy-deep);
  color: #fff;
  overflow: hidden;
}
.sb-cell { padding: 16px 20px 18px; }
.sb-cell + .sb-cell { border-left: 1px solid rgba(255, 255, 255, 0.14); }
.sb-season {
  display: block;
  font-family: var(--font-score);
  font-size: 18px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.62);
}
.sb-num {
  display: block;
  font-family: var(--font-score);
  font-size: 76px;
  font-weight: 700;
  line-height: 0.95;
  font-variant-numeric: tabular-nums;
}
.sb-cell.is-current .sb-num { color: var(--optic); }
.sb-num.is-empty { color: rgba(255, 255, 255, 0.28); }

.sb-note { margin: 12px 0 0; font-size: 14px; color: var(--muted); }
.sb-note .delta { margin-right: 6px; }

.ranks {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin: 20px 0 0;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.ranks div { background: var(--surface); padding: 10px 12px; }
.ranks dt { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.ranks dd { margin: 2px 0 0; font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; }

.callout {
  margin: 16px 0 0;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: var(--optic-soft);
  font-size: 14px;
}

.drawer-section { margin-top: 28px; }
.drawer-section h3 { margin: 0 0 12px; font-size: 15px; font-weight: 600; }
.hint { margin: 0; font-size: 14px; color: var(--muted); }
.drawer-section .hint + .form { margin-top: 14px; }

.form { display: grid; gap: 14px; }
.form-row { display: grid; gap: 6px; }
.form-row label, .form-row .label { font-size: 13px; font-weight: 500; color: var(--muted); }
.form input[type="text"],
.form input[type="tel"],
.form input[type="password"],
.form .title-input,
.form select,
.form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fbfcfe;
  padding: 9px 12px;
  font-size: 15px;
}
.form input[aria-invalid="true"],
.form select[aria-invalid="true"] { border-color: var(--down); box-shadow: 0 0 0 3px var(--down-bg); }
.form textarea { min-height: 72px; resize: vertical; }
.form input.score-field {
  width: 140px;
  font-family: var(--font-score);
  font-size: 30px;
  font-weight: 600;
  padding: 4px 12px;
  text-align: right;
}
.form-error { margin: 0; font-size: 13px; color: var(--down); }
.form-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.radio-row { display: flex; gap: 16px; }
.radio-row label { display: inline-flex; align-items: center; gap: 6px; font-size: 15px; color: var(--ink); font-weight: 400; }

.avatar-field { display: flex; align-items: center; gap: 16px; }
.form-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }

/* Titles: one box per title, × to drop it, "+ Thêm danh hiệu" for another. */
.titles-field { margin: 0; padding: 0; border: 0; min-width: 0; }
.titles-field legend { padding: 0; margin-bottom: 6px; font-size: 13px; font-weight: 500; color: var(--muted); }
.title-list { display: grid; gap: 8px; }
.title-row { display: flex; align-items: center; gap: 8px; }
.title-row .title-input { flex: 1; min-width: 0; }
.title-remove { width: 40px; height: 40px; font-size: 20px; color: var(--muted); }
.add-title { justify-self: start; margin-top: 8px; color: var(--navy); font-weight: 600; }
.add-title:disabled { opacity: 0.45; cursor: not-allowed; }
.title-chip { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 13px; font-weight: 500; }
.title-chip.is-added { background: var(--up-bg); color: var(--up); }
.title-chip.is-removed { background: var(--down-bg); color: var(--down); text-decoration: line-through; }
.diff-titles { flex-wrap: wrap; }
.title-list-view { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.title-list-view li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: #fbf3dc;
  font-size: 14px;
  font-weight: 600;
}
.title-list-view .trophy { width: 20px; height: 20px; flex-shrink: 0; }
.avatar-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.file-btn { position: relative; cursor: pointer; }
.file-btn:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }

.history { list-style: none; margin: 0; padding: 0; }
.history li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.history li:last-child { border-bottom: 0; }
.history time { font-size: 13px; color: var(--muted); }
.history .history-note { grid-column: 1 / -1; color: var(--muted); }

/* ---------- Player profile ---------- */

/* Dark band at the top: who it is and the score that matters, nothing else. */
.profile-hero {
  margin: calc(-1 * var(--pad-top)) calc(-1 * var(--pad-x)) 0;
  padding: var(--pad-top) var(--pad-x) 28px;
  background: var(--navy-deep);
  color: #fff;
}
.profile-hero :focus-visible { outline-color: var(--optic); }
.profile-id { display: flex; align-items: center; gap: 20px; }
/* Big enough to recognise a face. */
.avatar-xl {
  width: 112px; height: 112px;
  font-size: 42px;
  box-shadow: 0 0 0 4px var(--navy-deep), 0 0 0 7px var(--optic);
}
.profile-name-block { flex: 1; min-width: 0; }
.profile-name { margin: 0; font-size: 24px; font-weight: 800; line-height: 1.2; letter-spacing: -0.02em; text-wrap: balance; }
.profile-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.profile-tags span {
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  font-size: 13px;
  font-weight: 500;
}
.drawer-close.on-dark {
  align-self: flex-start;
  border-color: rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}
.drawer-close.on-dark:hover { background: rgba(255, 255, 255, 0.16); }

/* "Chia sẻ" (share-link.js): a square button beside the profile's main action, and a labelled pill among the
   registration and joining forms' own actions; × stays alone in the corner (owner, 2026-10-27). */
.profile-actions-row .btn.profile-share-btn { flex: 0 0 52px; width: 52px; display: grid; place-items: center; padding: 0; }
.profile-share-btn svg { width: 21px; height: 21px; }
.share-pill {
  display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 14px 0 12px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink);
  font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
}
.share-pill svg { width: 16px; height: 16px; }
.share-pill:hover { border-color: #b9c4d4; }
.share-pill.on-dark { border-color: rgba(255, 255, 255, 0.25); background: rgba(255, 255, 255, 0.08); color: #fff; }
.share-pill.on-dark:hover { background: rgba(255, 255, 255, 0.16); }
.drawer-intro + .share-pill { margin-top: 10px; }
.reg-share { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; font-size: 14px; color: rgba(255, 255, 255, 0.75); }
.reg-share .share-pill { flex-shrink: 0; }

/* This season and the other side by side, labels on one line. The big number spans two rows; on
   the right, last season's number is level with its top and the change level with its foot.
   Thirds, like the rank tiles below, so the dividing line runs on with theirs. */
.profile-score {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-areas:
    "label  label2 label2"
    "num    num2   num2"
    "num    change change";
  margin: 26px 0 0;
}
.profile-score::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc(100% / 3);
  width: 1px;
  background: rgba(255, 255, 255, 0.18);
}
.profile-score dd { margin: 0; }
.profile-score-label.is-other, .profile-other-num, .profile-change { padding-left: 17px; }
.profile-score-label { grid-area: label; margin-bottom: 14px; font-size: 13px; font-weight: 500; color: rgba(255, 255, 255, 0.65); }
.profile-score-label.is-other { grid-area: label2; }
.profile-score-num {
  grid-area: num;
  align-self: end;
  font-family: var(--font-score);
  font-size: 84px;
  font-weight: 700;
  line-height: 1;
  color: var(--optic);
  font-variant-numeric: tabular-nums;
  text-box: trim-both cap alphabetic;
}
.profile-other-num {
  grid-area: num2;
  align-self: start;
  font-family: var(--font-score);
  font-size: 30px;
  font-weight: 600;
  line-height: 1;
  color: #fff;
  font-variant-numeric: tabular-nums;
  text-box: trim-both cap alphabetic;
}
.profile-change { display: flex; grid-area: change; align-self: end; padding-top: 6px; }
.profile-change .delta { min-width: 0; }
.delta.is-same { background: rgba(255, 255, 255, 0.12); color: rgba(255, 255, 255, 0.85); font-family: var(--font-body); font-size: 13px; font-weight: 500; }

.profile-section { margin-top: 26px; }
.profile-heading { margin: 0 0 12px; font-size: 15px; font-weight: 700; }

/* Three ranks as numbers first, captions second. */
.rank-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0; }
.rank-tile {
  display: flex;
  flex-direction: column-reverse;
  gap: 6px;
  min-width: 0;
  padding: 2px 16px;
  border-left: 1px solid var(--line);
}
.rank-tile:first-child { padding-left: 0; border-left: 0; }
.rank-tile dt { overflow: hidden; font-size: 13px; color: var(--muted); white-space: nowrap; text-overflow: ellipsis; }
.rank-tile dd { display: flex; align-items: baseline; gap: 2px; margin: 0; }
.rank-num { font-family: var(--font-score); font-size: 38px; font-weight: 700; line-height: 1; color: var(--navy); }
.rank-total { font-family: var(--font-score); font-size: 17px; font-weight: 600; color: var(--muted); }

.spread { position: relative; display: flex; align-items: flex-end; gap: 2px; height: 56px; margin-top: 34px; }
.spread-bar { flex: 1; min-width: 0; border-radius: 2px 2px 0 0; background: #dfe5ee; }
.spread-bar.is-own { background: var(--navy); }
.spread-pin {
  position: absolute;
  top: -30px; bottom: 0;
  width: 2px;
  margin-left: -1px;
  background: var(--navy);
}
.spread-pin span {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--navy);
  color: #fff;
  font-family: var(--font-score);
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}
/* Near either edge the label leans inward instead of hanging off the drawer. */
.spread-pin.is-end span { left: auto; right: -1px; transform: none; }
.spread-pin.is-start span { left: -1px; transform: none; }
.spread-caption { margin: 10px 0 0; font-size: 14px; color: var(--muted); }
.spread-caption b { color: var(--ink); font-weight: 700; }

.results { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.results li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: var(--paper);
  font-size: 14px;
  font-weight: 500;
}
.results li.place-1 { background: #fbf3dc; }
.results li.is-penalty { background: var(--down-bg); }
.profile-callout { margin-top: 26px; }

/* History as a vertical timeline: a coloured dot per change. */
.timeline { margin: 0; padding: 0; list-style: none; }
.timeline li { position: relative; display: grid; grid-template-columns: 14px minmax(0, 1fr); gap: 14px; padding-bottom: 18px; }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before {
  content: "";
  position: absolute;
  left: 6px; top: 18px; bottom: 0;
  width: 2px;
  background: var(--line);
}
.timeline li:last-child::before { display: none; }
.tl-dot { position: relative; width: 14px; height: 14px; margin-top: 3px; border-radius: 50%; background: #9aa6ba; }
.is-up .tl-dot { background: var(--up); }
.is-down .tl-dot { background: var(--down); }
.tl-title { margin: 0; font-size: 14px; font-weight: 600; }
.tl-meta { display: flex; align-items: center; gap: 12px; margin: 4px 0 0; font-size: 13px; color: var(--muted); }
.tl-scores {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-score);
  font-size: 17px;
  font-weight: 600;
  color: var(--ink);
}
.tl-scores .diff-arrow { width: 14px; height: 14px; }
.tl-note { margin: 4px 0 0; font-size: 13px; color: var(--muted); }

/* Recent matches: the result block carries the outcome in colour and the score in the score face;
   the text beside it says who was across the net, then the partner and the day. */
.matches-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 4px; }
.matches-head .profile-heading { margin-bottom: 0; }
.matches-source {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
}
.matches-source:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.external-icon { width: 13px; height: 13px; flex-shrink: 0; }
.match-list { margin: 0; padding: 0; list-style: none; }
.match {
  display: grid;
  grid-template-columns: 60px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.match:last-child { border-bottom: 0; }
.match:focus { outline: none; }
.match:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: var(--radius-sm); }
.match-result {
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 8px;
  height: 54px;
  border-radius: var(--radius-md);
  background: var(--paper);
  color: var(--muted);
}
.is-win .match-result { background: var(--up-bg); color: var(--up); }
.is-loss .match-result { background: var(--down-bg); color: var(--down); }
.match-score {
  font-family: var(--font-score);
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  text-box: trim-both cap alphabetic;
}
.match-word { font-size: 12px; font-weight: 600; line-height: 1; text-box: trim-both cap alphabetic; }
.match-text { display: grid; gap: 5px; min-width: 0; }
.match-vs { font-size: 14px; font-weight: 600; line-height: 1.4; overflow-wrap: anywhere; }
.match-meta { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--muted); }
.match-with { min-width: 0; overflow-wrap: anywhere; }
.match-with .name-link { color: var(--ink); }
.match-date { flex-shrink: 0; color: inherit; font-variant-numeric: tabular-nums; text-decoration: none; }
.match-date:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
/* Stats card: totals as tiles (same as the rank tiles), the result split, matches per month. */
.match-stats {
  margin: 6px 0 4px;
  padding: 16px 16px 14px;
  border-radius: var(--radius-lg);
  background: var(--paper);
}
.stats-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stats-tiles .rank-tile { border-left-color: #d3dbe6; }
/* A one-line box for "%": a taller box would lift its number above the number in the next tile. */
.stats-tiles .rank-total { line-height: 1; }
.fill-win { background: var(--chart-win); }
.fill-tie { background: var(--chart-tie); }
.fill-loss { background: var(--chart-loss); }
.result-split { display: flex; gap: 2px; height: 10px; margin-top: 18px; border-radius: 5px; overflow: hidden; }
.result-split span { min-width: 3px; }
.result-legend { display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 10px 0 0; padding: 0; list-style: none; font-size: 13px; color: var(--muted); }
.result-legend li { display: flex; align-items: center; }
.result-legend b { margin-right: 4px; color: var(--ink); font-weight: 600; }
.key { display: inline-block; width: 10px; height: 10px; margin-right: 6px; border-radius: 2px; }
.month-chart {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  height: 64px;
  margin-top: 22px;
  border-bottom: 1px solid #d3dbe6;
}
.month-col {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  height: 100%;
  padding: 0;
  border: 0;
  background: none;
}
.month-bar { display: flex; flex-direction: column-reverse; gap: 2px; width: 14px; max-width: 70%; border-radius: 4px 4px 0 0; overflow: hidden; }
.month-bar span { min-height: 2px; }
.month-col:hover .month-bar { opacity: 0.8; }
/* The picked month: a navy tick under its column. */
.month-col[aria-pressed="true"]::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -6px;
  width: 14px;
  height: 3px;
  margin-left: -7px;
  border-radius: 2px;
  background: var(--navy);
}
.month-axis {
  display: flex;
  justify-content: space-between;
  /* Labels start and end where the first and last columns do (a 14px column centred in a 1/12 slot). */
  padding: 0 calc((100% / 12 - 14px) / 2);
  margin-top: 10px;
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.month-readout { margin: 6px 0 0; font-size: 13px; color: var(--muted); }
.month-readout b { color: var(--ink); font-weight: 600; }
.matches-more { min-height: 44px; margin-top: 10px; }
.matches-more[aria-disabled="true"] { opacity: 0.6; cursor: progress; }
.matches-error { margin-top: 10px; }
.match.is-skeleton .match-result { background: var(--paper); }
.sk-line { display: block; width: 78%; height: 12px; border-radius: 6px; background: var(--paper); }
.sk-line.is-short { width: 46%; }
@media (prefers-reduced-motion: no-preference) {
  .match.is-skeleton { animation: skeleton-pulse 1.1s ease-in-out infinite alternate; }
}
@keyframes skeleton-pulse { to { opacity: 0.5; } }

/* The main action stays on screen at the foot of the drawer. */
.profile-actions {
  position: sticky;
  bottom: 0;
  z-index: 2;
  margin: 28px calc(-1 * var(--pad-x)) calc(-1 * var(--pad-bottom));
  padding: 14px var(--pad-x) calc(14px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: var(--surface);
  box-shadow: 0 -10px 24px rgba(7, 22, 52, 0.06);
}
.profile-actions-row { display: flex; gap: 10px; }
.profile-actions-row .btn { flex: 1; }
.btn-lg { min-height: 50px; padding: 0 20px; border-radius: 12px; font-size: 16px; font-weight: 600; }
.btn-primary.btn-lg { box-shadow: 0 6px 16px rgba(11, 33, 82, 0.25); }
.btn-icon { width: 20px; height: 20px; flex-shrink: 0; }

/* Edit view header */
.subview-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.subview-title { flex: 1; min-width: 0; }
.subview-title h2 { margin: 0; font-size: 18px; font-weight: 700; line-height: 1.3; }
.subview-title p { margin: 2px 0 0; overflow: hidden; font-size: 14px; color: var(--muted); white-space: nowrap; text-overflow: ellipsis; }
.icon-btn {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 40px; height: 40px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--ink);
}
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn:hover { border-color: #b9c4d4; }
.subview-head + .callout { margin: 0 0 18px; }
#edit-form .avatar-field { margin-bottom: 4px; }

/* Review queue */
.review-count { margin: 4px 0 0; font-size: 14px; color: var(--muted); }
.requests { display: grid; gap: 12px; }
.request {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}
.request-head { display: flex; align-items: center; gap: 10px; }
.request-player {
  border: 0;
  background: none;
  padding: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  text-align: left;
}
.request-player:hover { text-decoration: underline; text-underline-offset: 3px; }
.request-meta { display: block; font-size: 13px; color: var(--muted); }
.diff { display: grid; gap: 8px; margin: 0; }
.diff-row { display: grid; grid-template-columns: 76px 1fr; align-items: center; gap: 10px; }
.diff-row dt { font-size: 13px; color: var(--muted); }
.diff-row dd { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 0; }
.diff-from { color: var(--muted); text-decoration: line-through; text-decoration-color: rgba(91, 104, 132, 0.5); }
.diff-from .avatar { opacity: 0.55; }
.diff-to { font-weight: 600; }
.diff-score { font-family: var(--font-score); font-size: 22px; line-height: 1; }
.diff-arrow { width: 16px; height: 16px; flex-shrink: 0; color: var(--muted); }
.request-by { margin: 0; font-size: 13px; color: var(--muted); }
.request-note { margin: 0; padding: 8px 10px; border-radius: var(--radius-sm); background: var(--paper); font-size: 14px; }
.request-actions { display: flex; gap: 8px; }

/* ---------- Tournament registration (drawer) ---------- */

/* Same dark band as the player profile: what the tournament is and the three rules that matter. */
.reg-hero {
  /* flow-root: the facts' top margin stays inside the navy band instead of leaving a white gap. */
  display: flow-root;
  margin: 0 calc(-1 * var(--pad-x));
  padding: 0 var(--pad-x) 22px;
  background: var(--navy-deep);
  color: #fff;
}
/* Title row and step bar: pinned to the top while the form scrolls under them. */
.reg-bar {
  position: sticky;
  top: 0;
  z-index: 3;
  margin: calc(-1 * var(--pad-top)) calc(-1 * var(--pad-x)) 0;
  padding: var(--pad-top) var(--pad-x) 12px;
  background: var(--navy-deep);
  color: #fff;
}
/* Five steps as five bars: lime once filled in, white for the next one to do. */
.reg-stepper {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  margin-top: 14px;
}
.reg-stepper-item {
  display: grid;
  align-content: start;
  gap: 7px;
  min-width: 0;
  padding: 6px 0 4px;
  border: 0;
  background: none;
  font: inherit;
  text-align: left;
  color: rgba(255, 255, 255, 0.55);
  cursor: pointer;
}
.reg-stepper-bar { height: 4px; border-radius: 2px; background: rgba(255, 255, 255, 0.18); }
.reg-stepper-label { overflow: hidden; font-size: 12px; font-weight: 600; line-height: 1.2; white-space: nowrap; text-overflow: ellipsis; }
.reg-stepper-item.is-done { color: var(--optic); }
.reg-stepper-item.is-done .reg-stepper-bar { background: var(--optic); }
.reg-stepper-item[aria-current="step"] { color: #fff; }
.reg-stepper-item[aria-current="step"] .reg-stepper-bar { background: #fff; }
.reg-hero :focus-visible,
.reg-bar :focus-visible { outline-color: var(--optic); }
.reg-hero-top { display: flex; align-items: center; gap: 14px; }
.reg-badge {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 52px; height: 52px;
  border-radius: 50%;
  background: var(--optic);
  color: var(--navy-deep);
}
.reg-badge svg { width: 28px; height: 28px; }
.reg-hero-text { flex: 1; min-width: 0; }
/* Both lines trimmed to cap height and baseline, so the ball centres on the letters. */
.reg-title {
  margin: 0;
  font-size: 21px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.01em;
  text-box: trim-both cap alphabetic;
}
.reg-dates {
  margin: 10px 0 0;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.72);
  text-box: trim-both cap alphabetic;
}
.reg-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 10px 0 0;
}
.reg-fact {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 12px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.08);
}
.reg-fact dt { font-size: 12px; font-weight: 500; line-height: 1.3; color: rgba(255, 255, 255, 0.65); }
.reg-fact dd { display: grid; gap: 8px; margin: 0; }
.reg-fact-value {
  font-family: var(--font-score);
  font-size: 30px;
  font-weight: 700;
  line-height: 1;
  color: var(--optic);
  font-variant-numeric: tabular-nums;
  text-box: trim-both cap alphabetic;
}
.reg-fact-note { font-size: 12px; line-height: 1.35; color: rgba(255, 255, 255, 0.75); }

.reg-form { gap: 0; }
.reg-section { display: grid; gap: 12px; padding-top: 26px; }
.reg-heading-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.reg-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--navy);
}
.reg-heading-text { text-box: trim-both cap alphabetic; }
/* Step numbers: the form really is a sequence (who, what, how to reach you). */
.reg-step {
  display: inline-block;
  width: 24px;
  height: 24px;
  padding: 7px 0;
  border-radius: 50%;
  background: var(--navy);
  color: #fff;
  font-family: var(--font-score);
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  text-align: center;
  text-box: trim-both cap alphabetic;
}
.reg-step svg { display: none; }
/* A step filled in: its number turns into a tick. */
.reg-heading.is-done .reg-step { padding: 5px; background: var(--optic); color: var(--navy-deep); }
.reg-heading.is-done .reg-step-n { display: none; }
.reg-heading.is-done .reg-step svg { display: block; width: 14px; height: 14px; }
.reg-heading:focus { outline: none; }
.reg-counter {
  display: inline-block;
  padding: 7px 10px;
  border-radius: 999px;
  background: var(--paper);
  color: var(--navy);
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  text-box: trim-both cap alphabetic;
}
.reg-existing { margin: 0; }

/* Person search: a search box with matches listed underneath. */
.reg-who, .reg-partner { display: grid; gap: 10px; }
.picker-search { position: relative; display: block; }
.picker-search .search-icon {
  position: absolute;
  top: 50%; left: 14px;
  width: 20px; height: 20px;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}
.form .picker-search input {
  width: 100%;
  height: 48px;
  padding: 0 14px 0 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #fbfcfe;
  font-size: 16px;
}
.form .picker-search input[aria-invalid="true"] { border-color: var(--down); box-shadow: 0 0 0 3px var(--down-bg); }
.picker-results { display: grid; gap: 6px; }
.picker-results:empty { display: none; }
.picker-empty { padding: 2px; }
.picker-alt {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  margin: 0;
  font-size: 14px;
  color: var(--muted);
}
.picker-alt span { color: #b9c4d4; }

.reg-person {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  padding: 10px 14px 10px 10px;
  border: 1px solid var(--navy);
  border-radius: var(--radius-md);
  background: #f5f8fc;
  box-shadow: 0 0 0 1px var(--navy);
}
.reg-person .avatar { width: 44px; height: 44px; font-size: 17px; }
.reg-person-text { display: grid; gap: 2px; min-width: 0; }
.reg-person-name { font-weight: 600; overflow-wrap: anywhere; }
.reg-person-text small { font-size: 13px; color: var(--muted); }
.reg-person-score { display: grid; justify-items: end; gap: 6px; }
.reg-person-score small { font-size: 11px; line-height: 1; color: var(--muted); }
.reg-person-score b {
  font-family: var(--font-score);
  font-size: 26px;
  font-weight: 700;
  line-height: 1;
  color: var(--navy);
  font-variant-numeric: tabular-nums;
  text-box: trim-both cap alphabetic;
}

.reg-manual { display: grid; gap: 14px; }
.seg {
  display: inline-flex;
  justify-self: start;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: var(--paper);
}
.seg:has(input[aria-invalid="true"]) { box-shadow: 0 0 0 2px var(--down); }
.seg-option { position: relative; cursor: pointer; }
.seg-option input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.seg-option span {
  display: inline-block;
  min-width: 76px;
  padding: 0 18px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  line-height: 36px;
  text-align: center;
  color: var(--muted);
}
.seg-option input:checked + span { background: var(--navy); color: #fff; box-shadow: 0 1px 3px rgba(7, 22, 52, 0.25); }
.seg-option input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }

/* Event cards: the whole row is the checkbox; ticking a pair event opens its partner box. */
.reg-events { display: grid; gap: 8px; }
.reg-event {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
}
.reg-event.is-selected { border-color: var(--navy); box-shadow: 0 0 0 1px var(--navy); }
.reg-event-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
  min-height: 60px;
  padding: 12px 12px 12px 14px;
  cursor: pointer;
}
.reg-event.is-blocked .reg-event-head { cursor: not-allowed; }
.reg-event.is-blocked .reg-event-name,
.reg-event.is-blocked .reg-chip:not(.is-blocked),
.reg-event.is-blocked .reg-box,
.reg-event.is-blocked .reg-event-icon { opacity: 0.45; }
.reg-box {
  display: grid;
  place-items: center;
  width: 24px; height: 24px;
  margin-top: -1px;
  border: 2px solid #b9c4d4;
  border-radius: 7px;
  background: #fff;
  color: transparent;
}
.reg-box svg { width: 16px; height: 16px; }
.reg-check:checked + .reg-box { border-color: var(--navy); background: var(--navy); color: var(--optic); }
.reg-check:focus-visible + .reg-box { outline: 3px solid var(--focus); outline-offset: 2px; }
.reg-check[aria-invalid="true"] + .reg-box { border-color: var(--down); }
.reg-event-text { display: grid; gap: 6px; min-width: 0; }
.reg-event-name { font-size: 15px; font-weight: 700; color: var(--ink); }
/* The rules that matter, one chip each, readable without opening anything. */
.reg-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.reg-chips:empty { display: none; }
.reg-chip {
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--paper);
  color: var(--navy);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
  white-space: nowrap;
}
.reg-chip.is-blocked { padding: 2px 7px; border: 1px solid var(--line); background: none; color: var(--muted); }
.reg-event.is-selected .reg-chip { background: var(--optic-soft); color: var(--navy-deep); }
/* Under a ticked pair or team event: who it is with, or what is still missing. */
.reg-event-mate { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; }
.reg-event-mate::before { content: ""; flex-shrink: 0; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.reg-event-mate.is-todo { color: var(--navy); }
.reg-event-mate.is-todo::before { border: 2px solid currentColor; background: none; }
.reg-event-mate.is-set { color: var(--up); }
.reg-event-mate.is-over { color: var(--down); }
.reg-event-icon { display: grid; place-items: center; width: 34px; height: 26px; color: #a3afc3; }
.reg-event-icon svg { width: 28px; height: 24px; }
.reg-event.is-selected .reg-event-icon { color: var(--navy); }
.reg-detail {
  display: grid;
  gap: 10px;
  padding: 12px 14px 14px;
  border-top: 1px dashed var(--line);
}
.reg-partner > .label { font-size: 13px; font-weight: 500; color: var(--muted); }
.reg-seeking {
  margin: 0;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--optic-soft);
  font-size: 14px;
}
/* Every one-line box in the form is the same height, so side-by-side fields line up. */
.reg-form input[type="text"],
.reg-form input[type="tel"] { height: 48px; padding-top: 0; padding-bottom: 0; border-radius: var(--radius-md); }
.reg-form input.score-field { width: 100%; font-size: 24px; }
.form input.year-field {
  width: 140px;
  font-family: var(--font-score);
  font-size: 24px;
  font-weight: 600;
}

/* Partners and teammates (step 3): one card per ticked pair or team event. */
.reg-teams { display: grid; gap: 12px; }
.reg-team {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
}
.reg-team-head { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 15px; font-weight: 700; color: var(--ink); }
.reg-team-icon { display: grid; flex-shrink: 0; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--paper); color: var(--navy); }
.reg-team-icon svg { width: 24px; height: 21px; }
.reg-empty {
  margin: 0;
  padding: 14px;
  border: 1px dashed #c3cedd;
  border-radius: var(--radius-md);
  font-size: 14px;
  color: var(--muted);
}

/* Pair or team total against the cap, as a bar: a segment per known score, a tick at the cap and the
   sponsorship tolerance hatched after it. Green when it fits, red when it doesn't. */
.score-gauge { display: grid; gap: 8px; padding: 12px; border-radius: var(--radius-sm); background: var(--paper); }
.gauge-head,
.gauge-foot { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; margin: 0; }
.gauge-label { font-size: 13px; font-weight: 600; color: var(--muted); }
.gauge-math {
  font-family: var(--font-score);
  font-size: 18px;
  font-weight: 600;
  line-height: 1;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.gauge-math b { font-size: 22px; }
.gauge-cap { color: var(--muted); }
.gauge-track { position: relative; display: flex; height: 12px; margin: 4px 0; border-radius: 6px; background: #dfe6ef; }
.gauge-seg { position: relative; z-index: 1; height: 100%; background: var(--navy); }
.gauge-seg:first-child { border-radius: 6px 0 0 6px; }
.gauge-seg.is-mate { background: #5d77a6; box-shadow: inset 2px 0 0 var(--paper); }
.gauge-tol { position: absolute; top: 0; bottom: 0; background: repeating-linear-gradient(135deg, var(--optic) 0 4px, #d9f580 4px 8px); }
.gauge-tick { position: absolute; z-index: 2; top: -4px; bottom: -4px; width: 2px; margin-left: -1px; border-radius: 1px; background: var(--ink); }
.score-gauge.is-ok .gauge-seg { background: var(--up); }
.score-gauge.is-ok .gauge-seg.is-mate { background: #4ea677; }
.score-gauge.is-over .gauge-seg { background: var(--down); }
.score-gauge.is-over .gauge-seg.is-mate { background: #d9776d; }
.gauge-foot { font-size: 13px; font-weight: 600; color: var(--muted); }
.score-gauge.is-ok .gauge-note { color: var(--up); }
.score-gauge.is-over .gauge-note { color: var(--down); }
.gauge-tol-text { color: var(--navy); white-space: nowrap; }
.gauge-warn { margin: 0; font-size: 13px; font-weight: 600; color: var(--down); }
/* Over the cap but within what a sponsorship covers: one tap picks that level. */
.gauge-fix {
  justify-self: start;
  min-height: 36px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: var(--navy);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
}

/* The entry fee as a ticket: the amount above the perforation, how it adds up below. */
.reg-fee {
  display: grid;
  padding: 16px 16px 14px;
  border-radius: var(--radius-md);
  background: var(--navy-deep);
  color: #fff;
}
.reg-fee-top {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 12px;
  margin: 0;
  padding-bottom: 14px;
  border-bottom: 2px dashed rgba(255, 255, 255, 0.24);
}
.reg-fee-top::before,
.reg-fee-top::after {
  content: "";
  position: absolute;
  bottom: -9px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--surface);
}
.reg-fee-top::before { left: -24px; }
.reg-fee-top::after { right: -24px; }
.reg-fee-label { font-size: 14px; font-weight: 600; color: rgba(255, 255, 255, 0.8); }
.reg-fee-amount {
  font-family: var(--font-score);
  font-size: 34px;
  font-weight: 700;
  line-height: 1;
  color: var(--optic);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.reg-fee-rows { display: grid; gap: 8px; margin: 14px 0 0; padding: 0; list-style: none; font-size: 14px; }
.reg-fee-rows li { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.reg-fee-who { display: grid; gap: 2px; min-width: 0; font-weight: 600; }
.reg-fee-who small { font-size: 13px; font-weight: 500; color: rgba(255, 255, 255, 0.72); }
.reg-fee-num { font-family: var(--font-score); font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.reg-fee-note { margin: 12px 0 0; font-size: 13px; line-height: 1.45; color: rgba(255, 255, 255, 0.72); }

/* Sponsorship, last on the form and shown open: three tier cards, apart from the fee. */
.reg-sponsor {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
}
.reg-sponsor-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; margin: 0; }
#reg-sponsor-need { display: grid; gap: 6px; }
#reg-sponsor-need:empty { display: none; }
.reg-sponsor-need { display: flex; align-items: center; gap: 8px; margin: 0; padding: 8px 10px; border-radius: var(--radius-sm); background: var(--down-bg); font-size: 13px; font-weight: 600; color: var(--down); }
.reg-sponsor-need svg { flex-shrink: 0; width: 16px; height: 16px; }
.reg-sponsor-need.is-met { background: var(--up-bg); color: var(--up); }
.reg-sponsor-title { font-size: 15px; font-weight: 700; color: var(--ink); }
.reg-sponsor-value { font-size: 13px; font-weight: 500; color: var(--muted); }
.reg-sponsor-value.is-picked { font-size: 14px; font-weight: 600; color: var(--up); }
.reg-tiers { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.reg-tier {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 12px 4px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  text-align: center;
  cursor: pointer;
}
.reg-tier-balls { display: flex; gap: 2px; height: 18px; color: var(--navy); }
.reg-tier-balls svg { width: 18px; height: 18px; }
.reg-tier-amount { font-size: 16px; font-weight: 700; color: var(--ink); white-space: nowrap; }
.reg-tier-gain { font-size: 14px; font-weight: 600; color: var(--up); white-space: nowrap; }
.reg-tier-check {
  position: absolute;
  top: 6px;
  right: 6px;
  display: none;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--navy);
  color: #fff;
}
.reg-tier-check svg { width: 12px; height: 12px; }
.reg-tier:has(input:checked) { border-color: var(--navy); background: var(--optic-soft); box-shadow: 0 0 0 1px var(--navy); }
.reg-tier:has(input:checked) .reg-tier-check { display: grid; }
.reg-tier:has(input:focus-visible),
.reg-tier-none:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
/* "Không tài trợ": the default, a small radio under the cards. */
.reg-tier-none { justify-self: center; cursor: pointer; }
.reg-tier-none span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
}
.reg-tier-none span::before {
  content: "";
  width: 16px;
  height: 16px;
  border: 2px solid #b9c4d4;
  border-radius: 50%;
  box-sizing: border-box;
}
.reg-tier-none:has(input:checked) span { background: var(--paper); color: var(--ink); }
.reg-tier-none:has(input:checked) span::before { border-color: var(--navy); background: radial-gradient(circle, var(--navy) 0 3.5px, transparent 4px); }
.reg-sponsor-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}
.reg-sponsor-info {
  display: grid;
  flex-shrink: 0;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--muted);
  cursor: pointer;
}
.reg-sponsor-info svg { width: 18px; height: 18px; }
.reg-sponsor-info[aria-expanded="true"] { background: var(--paper); color: var(--ink); }
.reg-sponsor-more { margin: 0; padding: 8px 10px; border-radius: var(--radius-sm); background: var(--paper); font-size: 13px; color: var(--ink); }
.reg-done-sponsor { margin: 0; font-size: 14px; font-weight: 600; color: var(--ink); }
.reg-done-fee { width: 100%; margin: 4px 0; text-align: left; }

/* Paying the fee: the VietQR code, the bank details with copy buttons (owner 2026-10-27). */
.reg-pay {
  display: grid;
  justify-items: center;
  gap: 12px;
  width: 100%;
  padding: 18px 16px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  text-align: left;
}
.reg-pay-title { justify-self: start; margin: 0; font-size: 16px; font-weight: 700; color: var(--navy); }
.reg-pay-qr {
  display: grid;
  place-items: center;
  width: min(260px, 100%);
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #fff;
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}
.reg-pay-qr svg { display: block; width: 100%; height: 100%; }
.reg-pay-hint { margin: 0; font-size: 13px; line-height: 1.45; color: var(--muted); text-align: center; }
.reg-pay-save { gap: 8px; }
.reg-pay-rows { display: grid; width: 100%; margin: 0; }
.reg-pay-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; padding: 6px 0; border-top: 1px solid var(--line); font-size: 14px; }
.reg-pay-row dt { flex-shrink: 0; color: var(--muted); }
.reg-pay-row dd { display: flex; align-items: center; gap: 8px; min-width: 0; margin: 0; text-align: right; overflow-wrap: anywhere; }
.reg-pay-row dd b { font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.reg-pay-row dd > span { min-width: 0; }
.reg-pay-row dd b.is-num { white-space: nowrap; }
.reg-pay-copy {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  gap: 4px;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--navy);
  cursor: pointer;
}
.reg-pay-copy svg { width: 15px; height: 15px; }
.reg-pay-copy:hover { border-color: var(--navy); }
/* Narrow phones: the label above, the value and its copy button on one line under it. */
@media (max-width: 374px) {
  .reg-pay-row { flex-wrap: wrap; gap: 2px 8px; }
  .reg-pay-row dt { width: 100%; font-size: 13px; }
  .reg-pay-row dd { width: 100%; justify-content: space-between; text-align: left; }
}

/* Before sending: everything on one card, the fee and any sponsorship on lines of their own. */
.reg-review { display: grid; gap: 6px; margin-top: 26px; padding: 14px 16px 6px; border-radius: var(--radius-md); background: var(--paper); }
.reg-review-title { margin: 0; font-size: 15px; font-weight: 700; color: var(--navy); }
.reg-review-list { display: grid; margin: 0; }
.reg-review-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 14px; }
.reg-review-row:first-child { border-top: 0; }
.reg-review-row dt { flex-shrink: 0; max-width: 48%; font-weight: 500; color: var(--muted); }
.reg-review-row dd { min-width: 0; margin: 0; font-weight: 600; text-align: right; color: var(--ink); overflow-wrap: anywhere; }
.reg-review-score { margin-left: 4px; font-family: var(--font-score); font-size: 16px; color: var(--muted); }
.reg-review-missing { font-weight: 500; color: var(--muted); }
.reg-review-missing.is-over { font-weight: 600; color: var(--down); }
.reg-review-row.is-money dd b { font-family: var(--font-score); font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.reg-review-row.is-money dd small { display: block; font-size: 12px; font-weight: 500; color: var(--muted); }

.reg-help {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 26px 0 0;
  padding: 12px;
  border: 1px dashed #c3cedd;
  border-radius: var(--radius-md);
  color: var(--ink);
  font-size: 14px;
  text-decoration: none;
}
.reg-help:hover { border-color: var(--navy); }
/* The organisers' number, and the tournament's Zalo group under it. */
.reg-help-links { display: grid; gap: 8px; margin-top: 26px; }
.reg-help-links .reg-help { margin: 0; }
.reg-help-group { justify-content: flex-start; padding: 10px 10px 10px 12px; border-style: solid; border-color: #b8d3ff; background: #f1f6ff; font-weight: 600; }
.reg-help-group:hover { border-color: var(--zalo); }
.reg-help-logo { flex-shrink: 0; width: 30px; height: 30px; }
.reg-help-join { margin-left: auto; padding: 6px 14px; border-radius: 999px; background: var(--zalo); color: #fff; font-size: 13px; font-weight: 700; }
.reg-help b { color: var(--navy); font-variant-numeric: tabular-nums; }
.reg-help-icon {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: #0068ff;
  color: #fff;
}
.reg-help-icon svg { width: 17px; height: 17px; }
.reg-actions { display: grid; gap: 10px; }
/* The fee so far beside the send button, so ticking an event shows what it costs. */
.reg-actions-row { display: flex; align-items: center; gap: 12px; }
.reg-actions-row .btn { flex-shrink: 0; }
/* The banner form (/entry): four steps, and no total beside the send button. */
.reg-stepper.is-plain { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.reg-actions-row.is-plain .reg-total { display: none; }
.reg-actions-row.is-plain .btn { flex: 1; }
.reg-total { display: grid; flex: 1; gap: 4px; min-width: 0; margin: 0; }
.reg-total-label { overflow: hidden; font-size: 12px; font-weight: 500; color: var(--muted); white-space: nowrap; text-overflow: ellipsis; }
.reg-total-num { font-family: var(--font-score); font-size: 24px; font-weight: 700; line-height: 1; color: var(--navy); font-variant-numeric: tabular-nums; white-space: nowrap; }

.reg-done-top { display: flex; justify-content: flex-end; }
.reg-done { display: grid; justify-items: center; gap: 10px; padding: 4px 0; text-align: center; }
.reg-done-icon {
  display: grid;
  place-items: center;
  width: 72px; height: 72px;
  border-radius: 50%;
  background: var(--optic);
  color: var(--navy-deep);
}
.reg-done-icon svg { width: 38px; height: 38px; }
.reg-done-icon.is-closed { background: var(--paper); color: var(--muted); }
.reg-done-title { margin: 8px 0 0; font-size: 24px; font-weight: 800; letter-spacing: -0.01em; color: var(--navy); }
.reg-done-title:focus { outline: none; }
.reg-done-name { margin: 0; font-weight: 600; }
.reg-done-list { display: grid; gap: 8px; width: 100%; margin: 8px 0; padding: 0; list-style: none; text-align: left; }
.reg-done-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: var(--paper);
  font-size: 14px;
}
.reg-done-event { font-weight: 700; }
.reg-done-with { color: var(--muted); text-align: right; }

/* ---------- Admin page (#admin) ---------- */

.admin-view { padding-top: 32px; padding-bottom: 48px; }

.admin-title {
  margin: 0;
  font-size: clamp(26px, 3vw, 32px);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--navy);
  text-box: trim-both cap alphabetic;
}

.admin-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: -1px;
  padding: 12px 0;
  border-bottom: 3px solid transparent;
  color: var(--muted);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.admin-tab:hover { color: var(--ink); }
.admin-tab[aria-current="page"] { border-bottom-color: var(--navy); color: var(--navy); }

.meter { display: block; height: 6px; border-radius: 3px; background: var(--paper); overflow: hidden; }
.meter span { display: block; height: 100%; border-radius: 3px; background: #e9a23b; }

/* Registrations: one card per entry (owner's choice 526 A, 2026-11-20). The event, the team's points out of the cap and
   the status on top; one row per player with the points right beside the name and the fee tick at the row's end; the
   contact, the transfer and the actions in the footer (Huỷ and Xoá as quiet red text). */
.entries { display: grid; grid-template-columns: minmax(0, 1fr); row-gap: 12px; }
.entry { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); }
.entry.is-pending { border-color: #f1d39c; }
.entry.is-cancelled { background: #f7f9fc; }

/* The pairing dialog's rows (pairDrawerHtml) keep their own three columns. */
.entry-person { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; min-width: 0; }
.entry-person-text { display: grid; min-width: 0; }
.entry-name { font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.entry-person-text small { font-size: 12px; color: var(--muted); }
.entry-score { font-family: var(--font-score); font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; }
.entry-person.is-empty { grid-template-columns: minmax(0, 1fr); }

.status-tag {
  display: inline-block;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.status-tag.is-pending { background: #fff4df; color: #8a4f00; }
.status-tag.is-confirmed { background: var(--up-bg); color: var(--up); }
.status-tag.is-cancelled { background: var(--paper); color: var(--muted); }
.status-tag.is-sample { border: 1px dashed #c3cedd; color: var(--muted); }
/* Declared sponsorship: amber until the organisers have the money, green after. */
.status-tag.is-sponsor { background: #fff4df; color: #8a4f00; }
.status-tag.is-sponsor.is-received { background: var(--up-bg); color: var(--up); }

/* Entry fees: how much has come in, and a tick under each name (owner 2026-10-26). */

.requests-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
.admin-view .request { background: var(--surface); }

@media (max-width: 374px) {
  .reg-stepper { gap: 4px; }
  .reg-stepper-label { font-size: 11px; }
}

@media (max-width: 720px) {
  .reg-title { font-size: 19px; }
  .reg-badge { width: 44px; height: 44px; }
  .reg-badge svg { width: 24px; height: 24px; }
  .reg-facts { gap: 6px; }
  .reg-fact { padding: 10px; }
  .reg-fact-value { font-size: 26px; }
  /* 16px text stops iPhones from zooming into the form. */
  .reg-form input[type="text"], .reg-form input[type="tel"], .reg-form textarea { font-size: 16px; }
  .reg-person { grid-template-columns: auto minmax(0, 1fr) auto; }
  .reg-person .reg-change { grid-column: 2 / -1; justify-self: start; }

  .admin-view { padding-top: 24px; }

  /* Registration cards on phones (526 A): the fee tick under the name, the footer stacked. */

  .requests-grid { grid-template-columns: minmax(0, 1fr); }
}


/* ---------- Toast ---------- */

.toast {
  position: fixed;
  z-index: 30;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 16px);
  max-width: calc(100% - 32px);
  padding: 12px 18px;
  border-radius: var(--radius-md);
  background: var(--navy-deep);
  color: #fff;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease-out, transform 160ms ease-out;
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
.toast.is-error { background: var(--down); }

/* ---------- Responsive ---------- */

/* ---------- Phone-only pieces (hidden on wider screens) ---------- */

.runners-toggle { display: none; }

/* ---------- Admin login page ---------- */

/* Board 570 (admin redesign, 22/11/2026): a light page under the club's bar; the crest, "Quản trị CLB", the
   wordmark, then the sign-in buttons (account.js) and the password behind "Dùng mật khẩu" (admin/login.js). */
.login-page { min-height: 100vh; min-height: 100dvh; margin: 0; background: #f2f3f7; color: var(--ink); }
.login-top { display: flex; align-items: center; min-height: 64px; padding: 0 16px; background: var(--navy); }
.login-top .brand { color: #fff; }
.login-top .brand img { width: 44px; height: 44px; }
.login { display: grid; justify-items: center; gap: 10px; width: min(420px, calc(100% - 32px)); margin: 0 auto; padding: 44px 0 40px; }
.login-crest { width: 96px; height: 96px; }
.login-card { width: 100%; padding: 0; background: transparent; color: var(--ink); text-align: center; }
.login-card .form-row { margin-top: 12px; text-align: left; }
.login-password { margin-top: 18px; }
.login-submit { margin-top: 16px; }
.login-title { margin: 8px 0 0; font-size: 28px; font-weight: 600; line-height: 1.2; letter-spacing: -0.015em; color: var(--navy); }
.login-wordmark { margin: 6px 0 0; font-size: 24px; }
.login-card .hint { display: none; }
.login-card input { min-height: 48px; font-size: 16px; }
.login-submit { min-height: 52px; font-size: 16px; border-radius: 26px; }
.login-back { margin-top: 6px; font-size: 15px; color: var(--muted); }
.login-back:hover { color: var(--navy); }

@media (max-width: 1020px) {
  .site-header { position: relative; z-index: 15; }
  .menu-toggle { display: grid; }
  .header-inner { gap: 16px; }
  /* Below desktop the menu drops down under the header bar. */
  .site-nav {
    display: none;
    position: absolute;
    top: 100%; left: 0; right: 0;
    flex-direction: column;
    gap: 0;
    padding: 4px 20px 12px;
    background: var(--navy);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 16px 28px rgba(7, 22, 52, 0.35);
  }
  .site-nav.is-open { display: flex; }
  .header-more summary { justify-content: space-between; padding: 13px 0; }
  .hd-more-panel { position: static; width: 100%; margin: 4px 0 8px; }
  .register-cta { margin-left: auto; }
  .site-nav a { padding: 13px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
  .site-nav a:last-child { border-bottom: 0; }
  .site-nav a:hover { border-bottom-color: rgba(255, 255, 255, 0.08); color: var(--optic); }
  .hero-inner { gap: 32px 36px; }
  /* Below ~850px the photo is height-bound; top-aligned keeps the spire in view either way. */
  .hero-photo img { object-position: 53.1% 0; }
  .finals-grid { grid-template-columns: minmax(0, 1fr); }
  .penalty { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: flex-start; gap: 16px 24px; }
  .penalty-value { font-size: 64px; }
  .penalty .avatar-stack { margin-left: auto; }
}

@media (max-width: 720px) {
  .wrap { padding: 0 16px; }
  .header-inner { min-height: 64px; gap: 10px; }
  .brand { gap: 10px; }
  .brand img { width: 42px; height: 42px; }
  .brand-line1 { font-size: 20px; }
  .brand-line2 { font-size: 11px; letter-spacing: 0.06em; }
  .site-nav { padding: 4px 16px 12px; }
  .admin-pill { font-size: 13px; padding: 5px 6px 5px 12px; }

  .hero { padding: 28px 0 0; }
  /* Portrait crop is centred on the tower, which then lines up with the winner's step. */
  .hero-photo img { object-position: 50% 0; }
  /* One column: the wash runs top to bottom instead of left to right. */
  .hero::after {
    background: linear-gradient(180deg, rgba(7, 22, 52, 0.62) 0%, rgba(7, 22, 52, 0.58) 34%, rgba(7, 22, 52, 0.58) 58%, rgba(7, 22, 52, 0.92) 100%);
  }
  .hero-inner { grid-template-columns: minmax(0, 1fr); gap: 4px; min-height: 0; }
  /* The vertical wash already covers the podium; the tower stays bright behind the winner. */
  .podium::before { display: none; }
  .hero-main { padding-bottom: 20px; }
  .hero-head { margin-bottom: 18px; gap: 10px 14px; }
  .season-btn { font-size: 20px; padding: 3px 12px; }
  .podium-title { margin-bottom: 12px; }
  .step { gap: 8px; }
  .step-player { gap: 4px; }
  .step .avatar { width: 44px; height: 44px; font-size: 17px; box-shadow: 0 0 0 2px var(--navy-deep), 0 0 0 4px var(--medal); }
  .step-1 .avatar { width: 52px; height: 52px; font-size: 20px; }
  .step-name { font-size: 12.5px; }
  .step-score { font-size: 22px; }
  .step-1 .step-score { font-size: 26px; }
  .step-1 .step-block { height: 60px; }
  .step-2 .step-block { height: 44px; }
  .step-3 .step-block { height: 32px; }
  .step-block { padding-top: 4px; }
  .step-rank { font-size: 24px; }

  .event-tabs { display: flex; overflow-x: auto; scrollbar-width: none; }
  .event-tabs::-webkit-scrollbar { display: none; }
  .event-tab { flex: 0 0 auto; }
  .winner { grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; padding: 14px; }
  .winner .medal-lg { display: none; }
  .winner .avatar-pair .avatar { width: 40px; height: 40px; font-size: 15px; }
  .winner-names { font-size: 16px; }
  .winner-points .points { font-size: 19px; }
  .runners { grid-template-columns: minmax(0, 1fr); }
  /* The −5 card shrinks to a strip; the names live behind "Xem danh sách". */
  .penalty { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 4px 14px; padding: 16px; }
  .penalty > div { flex: 1; min-width: 0; }
  .penalty-value { font-size: 52px; }
  .penalty-title { font-size: 15px; }
  .penalty .avatar-stack { display: none; }
  .penalty .btn-on-dark { width: 100%; min-height: 44px; margin-top: 10px; }
  .search input { height: 52px; font-size: 16px; }
  .stats { gap: 10px; margin-top: 20px; }
  .stat-value { font-size: 26px; }
  .stat-progress { width: 140px; }

  .notice-inner { flex-direction: column; align-items: stretch; gap: 10px; }

  .main { padding-top: 16px; }
  .filters { padding: 14px 16px 16px; gap: 16px; }
  .filters-row { gap: 10px; }
  .pills { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
  .pill { padding: 6px 12px; }
  .pills-sort { width: 100%; }
  .pills-sort .pill { flex: 1 1 auto; justify-content: center; padding: 6px 8px; font-size: 13px; }
  /* Group chips scroll sideways on phones instead of stacking. */
  .chips {
    flex-wrap: nowrap;
    overflow-x: auto;
    margin: 0 -16px;
    padding: 0 16px 2px;
    scrollbar-width: none;
  }
  .chips::-webkit-scrollbar, .pills::-webkit-scrollbar { display: none; }
  .range-block { flex-basis: 100%; }
  /* The board's "changed" filter only: other screens' switches sit in rows and keep their own size (owner 23/11). */
  #changed-wrap { width: 100%; }
  .switch-count { margin-left: auto; }

  .board thead { display: none; }
  .board, .board tbody { display: block; }
  .board tbody tr {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) auto;
    grid-template-areas:
      "rank player cur"
      "rank player delta";
    align-items: center;
    column-gap: 8px;
    padding: 8px 12px;
    border-bottom: 1px solid var(--line);
  }
  .board tbody tr:last-child { border-bottom: 0; }
  .board td { padding: 0; border: 0; background: transparent !important; }
  .board .c-rank { grid-area: rank; width: auto; }
  .board .c-player { grid-area: player; }
  .board .c-cur { grid-area: cur; width: auto; }
  .board .c-delta { grid-area: delta; width: auto; }
  .board .c-group,
  .board .c-prev { display: none; }
  .meta-group { display: inline; }
  .mobile-only { display: inline; }
  .desktop-only { display: none; }
  .c-delta .pending { font-size: 12px; }
  .delta { min-width: 0; padding: 1px 8px; font-size: 15px; }
  .delta.same { padding: 0; }

  /* In the 2025 view the 2025 score takes the score slot. */
  .is-previous-season tbody tr { grid-template-areas: "rank player prev"; }
  .is-previous-season .c-prev { display: block; grid-area: prev; width: auto; }

  .score-input { width: 76px; height: 40px; }

  /* Phones: the drawer covers exactly the visible screen. A 90vh sheet ran off the top on iPhone,
     because Safari's vh also counts the area behind its address bar; dvh follows what is visible. */
  .drawer {
    top: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    height: 100dvh;
    max-height: none;
    border-radius: 0;
    box-shadow: none;
    overscroll-behavior: contain;
  }
  .drawer.is-entering { transform: translateY(100%); }
  .drawer-body { --pad-x: 16px; --pad-top: 20px; --pad-bottom: 20px; }
  /* Title and close button stay pinned while the content scrolls under them. */
  .reg-bar,
  .subview-head,
  .drawer-head {
    position: sticky;
    top: 0;
    z-index: 3;
  }
  .subview-head,
  .drawer-head {
    margin: calc(-1 * var(--pad-top)) calc(-1 * var(--pad-x)) 16px;
    padding: var(--pad-top) var(--pad-x) 12px;
    background: var(--surface);
    box-shadow: 0 1px 0 var(--line);
  }
  /* 16px text in form fields: Safari zooms the whole page into any smaller field and stays zoomed. */
  .form input[type="text"],
  .form input[type="tel"],
  .form input[type="password"],
  .form .title-input,
  .form select,
  .form textarea { font-size: 16px; }
  .sb-num { font-size: 64px; }
  .avatar-xl { width: 96px; height: 96px; font-size: 36px; }
  .profile-score-label.is-other, .profile-other-num, .profile-change { padding-left: 13px; }
  .profile-name { font-size: 21px; }
  .profile-score-num { font-size: 72px; }
  .rank-tile { padding: 2px 12px; }
  .rank-num { font-size: 34px; }
  .ranks dd { font-size: 19px; }
}

/* The preview-only sample chip gives way to the club name on narrow phones. */
@media (max-width: 560px) {
  .sample-chip { display: none; }
  .admin-dot { display: none; }
  /* Room for the register button: the admin pill keeps only its count. */
  .admin-pill [data-i18n="admin.pill"] { display: none; }
}

@media (max-width: 420px) {
  .register-cta { height: 44px; padding: 0 14px 0 10px; font-size: 14px; }
  .register-long { display: none; }
  .register-short { display: inline; }
  .register-countdown { font-size: 12px; }
  /* Signed-in admins also get the admin pill, so the register button shrinks to its ball icon. */
  .header-inner:has(.admin-pill:not([hidden])) .register-cta { width: 40px; padding: 0; justify-content: center; }
  .header-inner:has(.admin-pill:not([hidden])) .register-text { display: none; }
}

/* 320px screens (iPhone SE 1st gen, any iPhone with Display Zoom): logo, register button and menu
   only. The club name stays in the link for screen readers. */
@media (max-width: 374px) {
  .header-inner { gap: 8px; }
  .brand-text {
    position: absolute;
    width: 1px; height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
}

/* ---------- Phones: list-first layout ---------- */

@media (max-width: 720px) {
  /* Search + filter button stay on screen while scrolling the list. */
  .list-toolbar {
    top: 0;
    gap: 8px;
    margin: 0 -16px 16px;
    padding: 10px 16px;
    border: 0;
    border-radius: 0;
    background: var(--paper);
    box-shadow: 0 1px 0 var(--line);
  }
  .toolbar-only { display: none !important; }
  .list-toolbar .scrim { background: rgba(7, 22, 52, 0.45); }
  .toolbar-row { flex-wrap: nowrap; gap: 8px; }
  .toolbar-search { flex: 1 1 auto; }
  .toolbar-search .search-icon { left: 12px; }
  .toolbar-search input { padding-left: 40px; }

  /* The filter panel becomes a bottom sheet. */
  .filters {
    position: fixed;
    top: auto; left: 0; right: 0; bottom: 0;
    display: grid;
    width: auto;
    z-index: 25;
    max-height: 88vh;
    max-height: 88dvh;
    overflow-y: auto;
    padding: 0 16px;
    gap: 18px;
    border: 0;
    border-radius: 18px 18px 0 0;
    box-shadow: 0 -12px 40px rgba(7, 22, 52, 0.22);
    transform: translateY(105%);
    visibility: hidden;
    transition: transform 220ms ease-out, visibility 0s linear 220ms;
  }
  .filters-open .filters { transform: none; visibility: visible; transition: transform 220ms ease-out; }
  #filters-scrim { z-index: 24; }
  .sheet-head {
    position: sticky;
    top: 0;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0 -16px;
    padding: 14px 16px 12px;
    border-bottom: 1px solid var(--line);
    background: var(--surface);
  }
  .sheet-title { margin: 0; font-size: 17px; font-weight: 600; }
  .sheet-foot {
    position: sticky;
    bottom: 0;
    display: flex;
    gap: 10px;
    margin: 0 -16px;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    background: var(--surface);
  }
  .sheet-foot .btn { flex: 1; min-height: 48px; font-size: 15px; }
  .filters .filters-row-pills { display: flex; }
  .filters .filters-block-groups { display: block; }
  .filters .chips { flex-wrap: wrap; overflow: visible; margin: 0; padding: 0; }
  .filters .pills { width: 100%; }
  .filters .pill { flex: 1; justify-content: center; min-height: 40px; }
  .chip { min-height: 40px; }
  .switch { min-height: 48px; }

  .result-bar { margin-top: 14px; }

  /* Finals: champions first, runners-up on request. */
  .runners-toggle {
    display: block;
    width: 100%;
    min-height: 44px;
    border: 1px dashed #c3cedd;
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--navy);
    font-size: 14px;
    font-weight: 600;
  }
  .runners { display: none; }
  .runners.is-open { display: grid; }
  .finals-cta { width: 100%; }
  /* Season switch lines up with the menu and filter buttons on the right edge. */
  .hero-head { justify-content: space-between; }
  .winner { grid-template-columns: auto minmax(0, 1fr) auto; }
  .winner .medal-lg { display: grid; width: 32px; height: 32px; font-size: 18px; }
  .winner .avatar-pair { display: none; }

  .made-by a { padding: 10px 0; }
  .champions { gap: 12px; padding: 12px; }
  .event-tab { min-height: 52px; }
  .finals-head { row-gap: 18px; margin-bottom: 14px; }
  .finals-badge { width: 48px; height: 48px; border-radius: 14px; }
  .finals-heading { gap: 14px; }

  /* Comfortable touch targets. */
  .season-btn { min-height: 40px; padding: 4px 14px; }
  .menu-toggle { width: 44px; height: 44px; }
  .name-link, .name-unmatched { padding: 4px 0; }
  .btn-more { width: 100%; min-height: 48px; }
}

@media (prefers-reduced-motion: reduce) {
  .drawer, .toast, .bar, .filters { transition: none; }
  .heart, .register-cta, .register-dot::after { animation: none; }
}

@media (max-width: 720px) {
  /* Name over its board player, actions on their own line. */

  /* Names keep their taller touch area without making a match line taller than its neighbours. */
  .match .name-link { margin: -4px 0; }
}

/* ---------- Optical alignment ----------
   Numbers are set in Barlow Condensed, whose digits have no descenders. Trimming their box to
   cap height and baseline lets centring follow the digits themselves, so a score sits level
   with the name beside it and a count sits in the middle of its badge. */

.score,
.stat-value,
.step-score,
.step-rank,
.sb-num,
.sb-season,
.tab-cap,
.penalty-value,
.candidate-score { text-box: trim-both cap alphabetic; }
.score { display: inline-block; }
.stat-value { margin-bottom: 8px; }
.sb-num { margin-top: 12px; }
.event-tab { gap: 6px; }
.step-block { padding-top: 12px; }

.rank,
.delta,
.points,
.queue-sign,
.filter-count,
.admin-badge {
  display: inline-block;
  line-height: 1;
  text-align: center;
  text-box: trim-both cap alphabetic;
}
.rank { min-width: 32px; padding: 9px 6px; }
.delta, .points { padding: 6px 10px; }
.queue-sign { padding: 4px 7px; }
.filter-count, .admin-badge { min-width: 20px; padding: 6px; }
.delta.same { padding: 0; }

/* A word and its count sit on one line, sharing a baseline; the line itself is centred in the pill. */
.pill, .chip {
  display: inline-block;
  min-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  line-height: 36px;
  text-align: center;
  white-space: nowrap;
}
.pill-count, .chip-count { margin-left: 8px; line-height: 1; }
.pills-sort .pill { padding-top: 0; padding-bottom: 0; }
.toolbar-row .pill { min-height: 0; line-height: 38px; }

/* Score cells: no text strut, so the trimmed digits sit exactly in the middle of the row. */
.board .c-num { line-height: 0; }
.board .c-num .pending { line-height: 1.5; }

@media (max-width: 720px) {
  .delta { padding: 5px 8px; }
  .pill, .chip { line-height: 40px; }
}

/* Browsers without text-box trimming (older Safari, Firefox): the digits stay within ~1px of
   centre, but badges keep the font's full line box, so their padding shrinks to hold the same size. */
@supports not (text-box: trim-both cap alphabetic) {
  .match-result { gap: 3px; }
  .finals-sub { margin-top: 4px; }
  .board .c-num { line-height: 1; }
  .rank { padding: 6px; }
  .delta, .points { padding: 3px 10px; }
  .queue-sign { padding: 1px 7px; }
  .filter-count, .admin-badge { padding: 3px 6px; }
  .reg-step { padding: 5px 0; }
  .reg-counter { padding: 5px 10px; }
  .season-btn { padding: 8px 16px; }
  .stat-value { margin-bottom: 4px; }
  .sb-num { margin-top: 4px; }
  .step-block { padding-top: 8px; }
}

/* ---------- Lão tướng tag and members' personal details ---------- */

:root {
  --veteran-bg: #fbefd0;
  --veteran-ink: #6b4805;
}

/* Lão tướng sits next to the group: warm gold, so it reads as an honour rather than a status. */
.tag-veteran {
  display: inline-flex;
  align-items: center;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--veteran-bg);
  color: var(--veteran-ink);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.6;
  white-space: nowrap;
}
/* Group and tag on one line: the column is widened just enough for "Silent1000 · Lão tướng". Narrower
   tablets keep the old column (names need the room) and put the tag under the group. */
.group-cell { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.board .c-group { width: 188px; }
@media (max-width: 1020px) {
  .board .c-group { width: 150px; }
  .group-cell { flex-direction: column; align-items: flex-start; gap: 4px; }
}
/* With the Lão tướng tag the line can run out of room on narrow phones: wrap whole words, never inside "Hội 1". */
.player-meta { flex-wrap: wrap; align-items: center; row-gap: 2px; }
.player-meta > span { white-space: nowrap; }
/* Wide screens show the tag in the group column; phones, which hide that column, under the name. */
.player-meta .tag-veteran { display: none; padding: 0 7px; font-size: 11px; }
@media (max-width: 720px) {
  /* Last on the line, so when a long group name leaves no room the whole tag drops below as a badge. */
  .player-meta .tag-veteran { display: inline-flex; order: 1; }
}

.chip-veteran { border-color: #ecd59a; background: var(--veteran-bg); color: var(--veteran-ink); font-weight: 600; }
.chip-veteran .chip-count { color: var(--veteran-ink); }
.chip-veteran:hover { border-color: var(--gold); background: #f8e7bb; }
.chip-veteran[aria-pressed="true"] { border-color: var(--gold); background: var(--gold); color: var(--navy-deep); }
.chip-veteran[aria-pressed="true"] .chip-count { color: var(--navy-deep); }

.profile-tags .is-veteran { background: var(--gold); color: var(--navy-deep); font-weight: 600; }
/* Building and birth year under the tags: icon + text, bright enough to be noticed on the navy band. */
.profile-facts { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 10px 0 0; font-size: 15px; font-weight: 500; color: #fff; }
.profile-facts .fact { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.profile-facts .fact-icon { width: 18px; height: 18px; flex-shrink: 0; color: var(--optic); }

/* Admin-only contact card on the profile, and the matching block in the edit form. */
.lock-icon { width: 16px; height: 16px; flex-shrink: 0; }
.private-card { padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius-lg); }
.private-title { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; font-size: 15px; font-weight: 700; }
.private-title .lock-icon { color: var(--muted); }
.private-title span { margin-left: auto; font-size: 12px; font-weight: 500; color: var(--muted); }
.private-list { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; margin: 0; font-size: 15px; }
.private-list dt { font-size: 13px; color: var(--muted); line-height: 22px; }
.private-list dd { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 0; line-height: 22px; font-variant-numeric: tabular-nums; }
.private-list a { color: var(--navy); font-weight: 600; }
.private-list .private-zalo { font-weight: 500; }

.details-field { display: grid; gap: 10px; min-width: 0; margin: 0; padding: 12px 16px 16px; border: 1px solid var(--line); border-radius: var(--radius-lg); }
.details-field legend { display: inline-flex; align-items: center; gap: 6px; padding: 0 6px; margin-left: -6px; font-size: 13px; font-weight: 600; color: var(--ink); }
.details-field .lock-icon { color: var(--muted); }
.details-field .hint { font-size: 13px; }

/* ---------- Profile image (download / share) ---------- */

.card-view { display: grid; gap: 14px; }
/* The image keeps its 9:16 shape and fits the screen under the header and buttons. */
.card-image,
.card-frame {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: calc(100dvh - 250px);
  aspect-ratio: 9 / 16;
  margin: 0 auto;
  border-radius: 16px;
  box-shadow: 0 12px 32px rgba(7, 22, 52, 0.28);
}
.card-frame {
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 14px;
  width: min(100%, calc((100dvh - 250px) * 9 / 16));
  background: var(--navy-deep);
  color: rgba(255, 255, 255, 0.85);
  font-size: 15px;
  text-align: center;
}
.card-frame p { margin: 0; }
@media (prefers-reduced-motion: no-preference) {
  .card-frame.is-making p { animation: skeleton-pulse 0.9s ease-in-out infinite alternate; }
}
.card-actions { display: flex; gap: 10px; }
.card-actions .btn { flex: 1; }
.card-hint { text-align: center; font-size: 13px; }

/* Tower + birth date row of the profile form: two columns like "Hội/nhóm · Giới tính" on wider screens,
   one under the other on phones (a date box needs the full width there). */
/* Selects and the date box share one fixed height: left to themselves they come out 41–46px
   depending on the browser and the text, and side by side that shows. */
.form select { height: 42px; }
.form input[type="date"] {
  width: 100%;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fbfcfe;
  padding: 9px 12px;
  font: inherit;
  font-size: 15px;
  color: var(--ink);
}
.form input[type="date"]::-webkit-date-and-time-value { text-align: left; }
.form input[type="date"][aria-invalid="true"] { border-color: var(--down); box-shadow: 0 0 0 3px var(--down-bg); }
.form-hint { margin-top: -6px; font-size: 13px; }
@media (max-width: 720px) {
  .form-grid-2.stack-phone { grid-template-columns: minmax(0, 1fr); }
  .form input[type="date"] { font-size: 16px; }
}

/* ---------- Home page: the tournament's Zalo group (above the club photos) ---------- */

/* Zalo's own blue, so the group reads as Zalo at a glance (owner 2026-10-28: "để người dùng dễ thấy nhất"). */
.home-zalo,
.zalo-big {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--zalo);
  color: #fff;
  text-decoration: none;
}
.home-zalo { margin: 0 0 14px; padding: 14px 18px; border-radius: 16px; box-shadow: 0 8px 20px rgba(0, 104, 255, 0.18); }
.home-zalo[hidden] { display: none; }
.home-zalo:focus-visible, .zalo-big:focus-visible { outline: 3px solid var(--navy); outline-offset: 3px; }
.zalo-logo { flex-shrink: 0; width: 52px; height: 52px; padding: 2px; border-radius: 50%; background: #fff; }
.zalo-logo img { display: block; width: 100%; height: 100%; }
.home-zalo-text,
.zalo-big-text { display: grid; flex: 1; gap: 2px; min-width: 0; }
.home-zalo-kicker { font-size: 12px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: rgba(255, 255, 255, 0.8); }
.home-zalo-title { font-size: 19px; font-weight: 800; letter-spacing: -0.01em; }
.home-zalo-sub { overflow: hidden; font-size: 13.5px; color: rgba(255, 255, 255, 0.85); white-space: nowrap; text-overflow: ellipsis; }
.home-zalo-go {
  flex-shrink: 0;
  padding: 0 18px;
  border-radius: 999px;
  background: #fff;
  color: var(--zalo);
  font-size: 14.5px;
  font-weight: 700;
  line-height: 40px;
}
.home-zalo:hover .home-zalo-go { background: #e8f0ff; }
@media (max-width: 720px) {
  .home-zalo { gap: 12px; padding: 12px 14px; }
  .home-zalo .zalo-logo { width: 46px; height: 46px; }
  .home-zalo-kicker { font-size: 11.5px; }
  .home-zalo-title { font-size: 16.5px; }
  .home-zalo-sub { font-size: 12.5px; }
  .home-zalo-go { padding: 0 14px; font-size: 13.5px; line-height: 36px; }
}
/* Narrow phones: the group's name and the button only. */
@media (max-width: 374px) {
  .home-zalo .zalo-logo { width: 38px; height: 38px; }
  .home-zalo-sub { display: none; }
  .home-zalo-kicker { white-space: nowrap; }
}

/* The confirmation's button into the group. */
.zalo-big { width: 100%; margin: 4px 0; padding: 14px 16px; border-radius: var(--radius-md); text-align: left; }
.zalo-big-text b { font-size: 16px; font-weight: 700; }
.zalo-big-text small { font-size: 13px; line-height: 1.4; color: rgba(255, 255, 255, 0.88); }
.zalo-big-go { flex-shrink: 0; width: 22px; height: 22px; }

/* ---------- Home page: banner of club photos (above the toolbar) ---------- */

/* The height is fixed from the first paint, so nothing below moves when the photos arrive. */
.home-gallery { position: relative; height: 128px; margin: 0 0 20px; overflow: hidden; border-radius: 16px; background: var(--navy-deep); }
.home-gallery-photos { position: absolute; inset: 0 0 0 30%; display: flex; gap: 3px; }
.home-gallery-photos a { flex: 0 0 auto; height: 100%; background: #102356; }
.home-gallery-photos a:focus-visible { outline: 3px solid var(--optic); outline-offset: -3px; }
.home-gallery-photos img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform 300ms ease; }
.home-gallery-photos a:hover img { transform: scale(1.04); }
/* The words sit on a band that fades into the photos; clicks pass through to the photos under the fade. */
.home-gallery-text {
  position: absolute;
  inset: 0 auto 0 0;
  width: 52%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  padding: 0 28px;
  background: linear-gradient(90deg, var(--navy-deep) 0, var(--navy-deep) 56%, rgba(7, 22, 52, 0) 100%);
  color: #fff;
  pointer-events: none;
}
.home-gallery-kicker { font-size: 13px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--optic); }
.home-gallery-count { font-size: 22px; font-weight: 800; letter-spacing: -0.01em; }
.home-gallery-latest { font-size: 14px; color: rgba(255, 255, 255, 0.72); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.home-gallery-go {
  position: absolute;
  right: 18px;
  bottom: 16px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  background: var(--optic);
  color: var(--navy-deep);
  font-size: 14.5px;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 6px 18px rgba(4, 9, 23, 0.35);
}
.home-gallery-go:hover { background: #c4f72f; }
.home-gallery-go svg { width: 18px; height: 18px; }
@media (max-width: 720px) {
  .home-gallery { height: 112px; margin-bottom: 14px; }
  .home-gallery-photos { left: 38%; }
  .home-gallery-text { width: 74%; padding: 0 16px; }
  .home-gallery-kicker { font-size: 11.5px; }
  .home-gallery-count { font-size: 18px; }
  .home-gallery-latest { max-width: 58%; font-size: 12.5px; }
  .home-gallery-go { right: 12px; bottom: 12px; height: 36px; padding: 0 12px; font-size: 13.5px; }
}
@media (prefers-reduced-motion: reduce) {
  .home-gallery-photos img { transition: none; }
}

/* ---------- Photo gallery (/gallery/) ---------- */

.site-nav a[aria-current="page"] { color: #fff; border-bottom-color: var(--optic); }
.gx { --bar-h: 64px; --gap: 6px; --r: 8px; background: #fff; }
.gx .site-footer { background: #fff; }

/* ---------- Page head ---------- */

.gx-head { display: grid; gap: 28px; padding-top: 40px; padding-bottom: 28px; }
.gx-head-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px 24px; }
.gx-title {
  margin: 0;
  font-weight: 800;
  font-size: clamp(32px, 4vw, 44px);
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--ink);
  text-box: trim-both cap alphabetic;
}
/* A row of the people in the photos, as wide as the page; "see all" opens the People tab. */
.gx-crowd { --face: 56px; --face-gap: 12px; display: flex; align-items: center; gap: 20px; min-height: calc(var(--face) + 8px); }
.gx-crowd-faces { display: flex; flex: 1; min-width: 0; gap: var(--face-gap); padding: 4px 0; }
.gx-crowd-faces.is-full { justify-content: space-between; }
.gx-crowd-face {
  flex: 0 0 auto;
  width: var(--face);
  height: var(--face);
  padding: 0;
  border: 0;
  border-radius: 50%;
  overflow: hidden;
  background: #eef1f6;
  transition: transform 180ms ease, box-shadow 180ms ease;
}
.gx-crowd-face img { display: block; width: 100%; height: 100%; object-fit: cover; }
.gx-crowd-face:hover, .gx-crowd-face:focus-visible { transform: translateY(-3px); box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--navy); outline: none; }
.gx-crowd-face[aria-pressed="true"] { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--navy); }
.gx-crowd-all {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
  height: 44px;
  padding: 0 14px 0 18px;
  border: 0;
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  font-size: 14.5px;
  font-weight: 600;
  white-space: nowrap;
}
.gx-crowd-all:hover { background: #e3e9f3; }
.gx-crowd-more { display: none; }
.gx-crowd-all svg { width: 18px; height: 18px; }
.gx-head-actions { display: flex; align-items: center; gap: 8px; }
.gx-upload, .gx-me {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 48px;
  padding: 0 20px 0 16px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
}
.gx-upload { border: 0; background: var(--navy); color: #fff; }
.gx-upload:hover { background: var(--navy-deep); }
.gx-me { border: 1px solid var(--line); background: #fff; color: var(--ink); font-weight: 600; }
.gx-me:hover { border-color: #9fb0ca; }
.gx-upload svg, .gx-me svg { width: 20px; height: 20px; flex-shrink: 0; }

/* ---------- Tabs ---------- */

.gx-main { padding-bottom: 72px; min-height: 70vh; }
.gx-tabs { display: flex; align-items: center; gap: 28px; border-bottom: 1px solid var(--line); }
.gx-tabs > button[data-tab] {
  position: relative;
  padding: 12px 0 14px;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 15px;
  font-weight: 600;
}
.gx-tabs > button[data-tab]:hover { color: var(--ink); }
.gx-tabs > button[aria-current="page"] { color: var(--ink); }
.gx-tabs > button[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 2px;
  border-radius: 2px;
  background: var(--navy);
}
.gx-privacy {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  padding: 8px 0;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 13.5px;
}
.gx-privacy:hover { color: var(--ink); }
.gx-privacy svg { width: 16px; height: 16px; }

/* ---------- Toolbar ---------- */

.gx-bar {
  position: sticky;
  top: 0;
  z-index: 15;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 0;
  background: #fff;
}
.gx-bar.is-stuck { box-shadow: 0 1px 0 var(--line); }
.gx-search { position: relative; flex: 0 1 340px; }
.gx-search > svg { position: absolute; left: 14px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.gx-search input {
  width: 100%;
  height: 42px;
  padding: 0 14px 0 40px;
  border: 0;
  border-radius: 999px;
  background: var(--paper);
  font-size: 15px;
}
.gx-search input:focus { outline: none; box-shadow: 0 0 0 2px var(--navy); background: #fff; }
.gx-filters { display: flex; gap: 6px; }
.gx-filter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 42px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}
.gx-filter:hover, .gx-filter[aria-expanded="true"] { background: var(--paper); }
.gx-filter::after {
  content: "";
  width: 7px; height: 7px;
  margin: -4px 0 0 2px;
  border-right: 1.8px solid currentColor;
  border-bottom: 1.8px solid currentColor;
  transform: rotate(45deg);
  opacity: 0.5;
}
.gx-filter.is-on { background: #e9eef8; color: var(--navy); }
.gx-filter-all { display: none; }
.gx-filter-all::after { display: none; }
.gx-filter-all svg { width: 18px; height: 18px; }
.gx-filter-n { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--navy); color: #fff; font-size: 11.5px; line-height: 18px; text-align: center; }
.gx-views { display: inline-flex; gap: 2px; margin-left: auto; }
.gx-views button {
  display: grid;
  place-items: center;
  width: 40px; height: 40px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #93a0b6;
}
.gx-views button:hover { color: var(--ink); background: var(--paper); }
.gx-views button[aria-checked="true"] { color: var(--navy); background: #e9eef8; }
.gx-views svg { width: 19px; height: 19px; fill: currentColor; }

/* Popovers */
.gx-pop {
  position: absolute;
  top: calc(100% + 4px);
  z-index: 3;
  width: min(360px, calc(100vw - 32px));
  max-height: min(70vh, 540px);
  overflow-y: auto;
  padding: 16px;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 2px 6px rgba(7, 22, 52, 0.06), 0 24px 60px rgba(7, 22, 52, 0.18);
}
.gx-pop-title { margin: 0 0 12px; font-size: 15px; font-weight: 700; }
.gx-pop-search { width: 100%; height: 40px; padding: 0 14px; border: 0; border-radius: 999px; background: var(--paper); font-size: 15px; }
.gx-pop-search:focus { outline: none; box-shadow: 0 0 0 2px var(--navy); background: #fff; }
.gx-pop-note { margin: 10px 0 0; font-size: 13px; color: var(--muted); }
.gx-pop-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 14px; }
.gx-pop-foot .btn { min-height: 38px; border-radius: 999px; padding: 0 18px; }
.gx-checks { display: grid; margin: 8px 0 0; padding: 0; list-style: none; }
.gx-check {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 4px 6px;
  border-radius: 10px;
  cursor: pointer;
}
.gx-check:hover { background: var(--paper); }
.gx-check input { width: 18px; height: 18px; accent-color: var(--navy); flex-shrink: 0; }
.gx-check-text { flex: 1; min-width: 0; font-size: 14.5px; font-weight: 500; }
.gx-check-text small { display: block; font-size: 12px; font-weight: 400; color: var(--muted); }
.gx-check-n { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.gx-check.is-empty { cursor: default; opacity: 0.45; }
.gx-check.is-empty:hover { background: none; }
.gx-pop-sub { margin: 16px 0 0; padding-top: 14px; border-top: 1px solid #eef1f6; font-size: 13px; font-weight: 700; color: var(--muted); }
.gx-sorts { display: flex; gap: 6px; margin-bottom: 14px; }
.gx-sorts button { flex: 1; height: 38px; border: 0; border-radius: 999px; background: var(--paper); font-size: 13.5px; font-weight: 600; color: var(--muted); }
.gx-sorts button:hover { color: var(--ink); }
.gx-sorts button[aria-pressed="true"] { background: var(--navy); color: #fff; }
.gx-years { display: grid; gap: 16px; }
.gx-year-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 8px; }
.gx-year-head button { padding: 0; border: 0; background: none; font-size: 16px; font-weight: 700; color: var(--ink); }
.gx-year-head span { font-size: 12.5px; color: var(--muted); }
.gx-months { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; }
.gx-month {
  height: 36px;
  border: 0;
  border-radius: 8px;
  background: var(--paper);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}
.gx-month:disabled { background: transparent; color: #c3cad6; font-weight: 500; cursor: default; }
.gx-month:not(:disabled):hover { background: #e3e9f3; }
.gx-month[aria-pressed="true"], .gx-month[aria-pressed="true"]:not(:disabled):hover { background: var(--navy); color: #fff; }

/* Active filters: quiet text chips */
.gx-active { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 2px 0 10px; }
.gx-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 32px;
  padding: 0 4px 0 12px;
  border-radius: 999px;
  background: #e9eef8;
  color: var(--navy);
  font-size: 13.5px;
  font-weight: 600;
}
.gx-chip button { display: grid; place-items: center; width: 24px; height: 24px; border: 0; border-radius: 50%; background: transparent; color: var(--navy); font-size: 16px; line-height: 1; }
.gx-chip button:hover { background: rgba(11, 33, 82, 0.12); }
.gx-text-btn { padding: 4px 6px; border: 0; background: none; color: var(--muted); font-size: 13.5px; font-weight: 600; }
.gx-text-btn:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Photos ---------- */

.gx-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 32px; margin-top: 8px; }
.gx-body.has-rail { grid-template-columns: minmax(0, 1fr) 84px; }
.gx-day + .gx-day { margin-top: 36px; }
.gx-day-head {
  position: sticky;
  top: calc(var(--bar-h) - 1px);
  z-index: 4;
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 0;
  padding: 10px 0 12px;
  background: #fff;
}
.gx-day-date { margin: 0; font-size: 16px; font-weight: 700; color: var(--ink); }
.gx-day-album { padding: 0; border: 0; background: none; color: var(--muted); font-size: 14.5px; font-weight: 500; text-align: left; }
.gx-day-album:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.gx-day-album.is-title { color: var(--ink); font-size: inherit; font-weight: inherit; }
.gx-day-n { margin-left: auto; font-size: 13px; color: var(--muted); white-space: nowrap; }

.gx-flow { display: grid; gap: var(--gap); }
.gx-row { display: flex; gap: var(--gap); }
.gx-tile { position: relative; display: block; flex: 0 0 auto; overflow: hidden; border-radius: var(--r); background: #eef1f6; }
.gx-tile img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform 400ms ease, filter 200ms ease; }
.gx-tile::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(4, 9, 23, 0.55), rgba(4, 9, 23, 0) 40%);
  opacity: 0;
  transition: opacity 200ms ease;
}
.gx-tile:hover::after, .gx-tile:focus-visible::after { opacity: 1; }
.gx-tile:hover img { transform: scale(1.02); }
.gx-tile-names {
  position: absolute;
  z-index: 1;
  left: 12px; right: 12px; bottom: 10px;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  opacity: 0;
  transition: opacity 200ms ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gx-tile:hover .gx-tile-names, .gx-tile:focus-visible .gx-tile-names { opacity: 1; }
.gx-tile:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.gx-square { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--gap); }
.gx-square .gx-tile { aspect-ratio: 1; }

/* List: thumbnail, when, where, who */
.gx-list { margin: 0; padding: 0; list-style: none; }
.gx-li {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr) minmax(0, 1.4fr) auto;
  align-items: center;
  gap: 20px;
  padding: 10px 0;
  border-bottom: 1px solid #eef1f6;
}
.gx-li-thumb { display: block; width: 112px; height: 76px; overflow: hidden; border-radius: 8px; background: #eef1f6; }
.gx-li-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gx-li-when { display: grid; gap: 2px; line-height: 1.35; }
.gx-li-when b { font-size: 14.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.gx-li-when button { justify-self: start; padding: 0; border: 0; background: none; color: var(--muted); font-size: 13.5px; text-align: left; }
.gx-li-when button:hover { color: var(--ink); text-decoration: underline; }
.gx-li-people { font-size: 14px; color: var(--ink); line-height: 1.5; }
.gx-li-people a { color: inherit; text-decoration: none; }
.gx-li-people a:hover { text-decoration: underline; text-underline-offset: 3px; }
.gx-li-none { color: #a3adbf; }
.gx-icon-btn { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; color: var(--muted); }
.gx-icon-btn:hover { background: var(--paper); color: var(--ink); }
.gx-icon-btn svg { width: 18px; height: 18px; }

/* ---------- Albums ---------- */

.gx-albums { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 32px 20px; margin-top: 20px; }
.gx-album { display: grid; gap: 12px; padding: 0; border: 0; background: none; text-align: left; color: var(--ink); }
.gx-album-cover { display: block; aspect-ratio: 4 / 3; overflow: hidden; border-radius: 12px; background: #eef1f6; }
.gx-album-cover img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 400ms ease; }
.gx-album:hover .gx-album-cover img { transform: scale(1.03); }
.gx-album h3 { margin: 0; font-size: 16px; font-weight: 700; line-height: 1.35; }
.gx-album p { margin: 2px 0 0; font-size: 13.5px; color: var(--muted); }

/* ---------- People ---------- */

.gx-people-tools { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 20px 0 8px; }
.gx-people-tools p { margin: 0; font-size: 14px; color: var(--muted); }
.gx-people { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 28px 16px; margin-top: 16px; }
.gx-person {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink);
  text-align: center;
}
.gx-person-pic { display: block; width: 104px; height: 104px; overflow: hidden; border-radius: 50%; background: #eef1f6; transition: transform 200ms ease; }
.gx-person-pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gx-person-pic > span { display: grid; place-items: center; width: 100%; height: 100%; font-size: 34px; font-weight: 600; color: var(--navy); }
.gx-person:hover .gx-person-pic { transform: scale(1.04); }
.gx-person b { font-size: 14.5px; font-weight: 600; line-height: 1.3; }
.gx-person small { display: block; margin-top: 2px; font-size: 12.5px; font-weight: 400; color: var(--muted); }

.gx-people-tools .gx-search { flex: 0 1 300px; }
.gx-people-none { grid-column: 1 / -1; margin: 24px 0; color: var(--muted); }

/* One album's or one person's photos */
.gx-album-head { display: flex; align-items: center; gap: 16px; margin: 4px 0 20px; }
.gx-album-head > div { flex: 1; min-width: 0; }
.gx-album-head h2 { margin: 0; font-size: 24px; font-weight: 700; letter-spacing: -0.01em; }
.gx-album-head p { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 4px 0 0; font-size: 14px; color: var(--muted); }
.gx-album-head a { color: var(--navy); font-weight: 600; text-decoration: none; }
.gx-album-head a:hover { text-decoration: underline; text-underline-offset: 3px; }
.gx-album-head + .gx-person-head { margin-top: -4px; }
/* "Chia sẻ" an album: its link (share-link.js). */
.gx-share-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  min-height: 36px;
  padding: 0 14px 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
}
.gx-share-btn svg { width: 17px; height: 17px; }
.gx-share-btn:hover { border-color: #b9c4d4; }
.gx-person-head { display: flex; align-items: center; gap: 16px; margin: 4px 0 20px; }
.gx-person-head-pic { display: block; width: 64px; height: 64px; flex-shrink: 0; overflow: hidden; border-radius: 50%; background: #eef1f6; }
.gx-person-head-pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gx-person-head-pic span { display: grid; place-items: center; width: 100%; height: 100%; font-size: 24px; font-weight: 600; color: var(--navy); }
.gx-person-head > div { flex: 1; min-width: 0; }
.gx-person-head h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -0.01em; }
.gx-person-head p { display: flex; gap: 14px; margin: 4px 0 0; font-size: 14px; color: var(--muted); }
.gx-person-head a { color: var(--navy); font-weight: 600; text-decoration: none; }
.gx-person-head a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* Timeline rail */
.gx-rail {
  position: sticky;
  top: calc(var(--bar-h) + 12px);
  align-self: start;
  display: grid;
  gap: 2px;
  max-height: calc(100vh - var(--bar-h) - 40px);
  overflow-y: auto;
  font-size: 12.5px;
}
.gx-rail b { margin-top: 10px; font-size: 13px; font-weight: 700; color: var(--ink); }
.gx-rail b:first-child { margin-top: 0; }
.gx-rail button { justify-self: start; padding: 3px 0; border: 0; background: none; color: #93a0b6; font-weight: 500; }
.gx-rail button:hover { color: var(--ink); }
.gx-rail button.is-here { color: var(--navy); font-weight: 700; }

.gx-status { padding: 56px 0; text-align: center; color: var(--muted); }
.gx-empty { padding: 72px 16px; text-align: center; color: var(--muted); }
.gx-empty p { margin: 0 0 16px; }

/* Search suggestions */
.gx-suggest {
  position: absolute;
  z-index: 5;
  top: calc(100% + 6px);
  left: 0;
  width: max(100%, 320px);
  margin: 0;
  padding: 6px;
  list-style: none;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 2px 6px rgba(7, 22, 52, 0.06), 0 20px 50px rgba(7, 22, 52, 0.16);
}
.gx-suggest button { display: grid; width: 100%; padding: 8px 10px; border: 0; border-radius: 8px; background: transparent; text-align: left; font-weight: 500; }
.gx-suggest button:hover, .gx-suggest button:focus-visible { background: var(--paper); }
.gx-suggest small { font-size: 12px; font-weight: 400; color: var(--muted); }
.gx-suggest-none { padding: 8px 10px; color: var(--muted); font-size: 14px; }

/* ---------- Viewer ---------- */

.gv {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr) auto;
  background: #080b13;
  color: #fff;
}
.gv :focus-visible { outline-color: var(--optic); }
.gv-top { display: flex; align-items: center; gap: 12px; padding: 10px 14px; }
.gv-heading { flex: 1; min-width: 0; }
.gv-title { margin: 0; font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gv-sub { margin: 2px 0 0; font-size: 13px; color: rgba(255, 255, 255, 0.55); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.gv-tools { display: flex; gap: 4px; }
.gv-icon { display: inline-grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 50%; background: transparent; color: #fff; text-decoration: none; }
.gv-icon:hover, .gv-icon[aria-pressed="true"] { background: rgba(255, 255, 255, 0.1); }
.gv-icon svg { width: 21px; height: 21px; }
.gv-main { display: grid; grid-template-columns: minmax(0, 1fr) auto; min-height: 0; }
.gv-stage { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 0 10px; min-height: 0; }
/* The swipe surface: one finger is ours (gallery.js), two fingers pinch-zoom as usual; zoomed in, panning is the page's. */
.gv-figure { position: relative; height: 100%; margin: 0; min-height: 0; overflow: hidden; touch-action: pinch-zoom; animation: gv-open 220ms ease-out; }
.gv.is-zoomed .gv-figure { touch-action: auto; }
.gv-track { position: absolute; top: 0; bottom: 0; left: 0; display: flex; gap: 24px; will-change: transform; transform: translate3d(calc(-1 * (var(--gv-slide, 100vw) + 24px)), 0, 0); }
.gv-slide { position: relative; flex: 0 0 auto; width: var(--gv-slide, 100vw); height: 100%; }
.gv-figure img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; user-select: none; -webkit-user-select: none; -webkit-user-drag: none; -webkit-touch-callout: none; }
.gv:focus { outline: none; }
.gv { background-color: rgba(8, 11, 19, var(--gv-fade, 1)); }
.gv-count { display: none; }
/* Shown once (gallery.js maybeSwipeHint) while the photo nudges sideways. */
.gv-hint {
  position: absolute;
  z-index: 3;
  left: 50%;
  bottom: 52px;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 9px 14px;
  border-radius: 999px;
  background: rgba(8, 11, 19, 0.66);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  transform: translateX(-50%);
  pointer-events: none;
  animation: gv-hint 3.4s ease both;
}
.gv-hint svg { width: 16px; height: 16px; opacity: 0.8; }
@keyframes gv-open { from { opacity: 0; transform: scale(0.985); } }
@keyframes gv-hint { 0% { opacity: 0; } 10%, 85% { opacity: 1; } 100% { opacity: 0; } }
.gv-nav { display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, 0.08); color: #fff; }
.gv-nav:hover:not(:disabled) { background: rgba(255, 255, 255, 0.18); }
.gv-nav:disabled { opacity: 0.15; }
.gv-nav svg { width: 22px; height: 22px; }
.gv-faces { position: absolute; pointer-events: none; }
.gv-info { width: 320px; overflow-y: auto; padding: 22px 24px; border-left: 1px solid rgba(255, 255, 255, 0.07); }
.gv-info[hidden] { display: none; }
.gv-info h2 { margin: 0 0 6px; font-size: 13px; font-weight: 600; color: rgba(255, 255, 255, 0.5); }
.gv-block { margin: 0 0 26px; }
.gv-block p { margin: 0; font-size: 15px; line-height: 1.5; }
.gv-block button { padding: 0; border: 0; background: none; color: #fff; font-size: 15px; text-align: left; text-decoration: underline; text-decoration-color: rgba(255, 255, 255, 0.3); text-underline-offset: 4px; }
.gv-people { display: grid; margin: 0; padding: 0; list-style: none; }
.gv-people li { display: flex; align-items: baseline; gap: 10px; padding: 9px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.07); }
.gv-people li:last-child { border-bottom: 0; }
.gv-people button { flex: 1; padding: 0; border: 0; background: none; color: #fff; font-size: 15px; font-weight: 600; text-align: left; }
.gv-people button:hover { color: var(--optic); }
.gv-people a { font-size: 13px; color: rgba(255, 255, 255, 0.55); text-decoration: none; white-space: nowrap; }
.gv-people a:hover { color: #fff; text-decoration: underline; }
.gv-nobody { margin: 0; font-size: 14.5px; color: rgba(255, 255, 255, 0.55); }
.gv-report { display: inline-flex; align-items: center; gap: 8px; padding: 0; border: 0; background: none; color: rgba(255, 255, 255, 0.5); font-size: 13.5px; }
.gv-report:hover { color: #ffb3ac; }
.gv-report svg { width: 15px; height: 15px; }
.gv-admin { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 18px; border-top: 1px solid rgba(255, 255, 255, 0.07); }
.gv-admin h2 { flex-basis: 100%; }
.gv .gv-admin button { min-height: 36px; padding: 0 14px; border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 999px; font-size: 13.5px; text-decoration: none; }
.gv .gv-admin button:hover { border-color: rgba(255, 255, 255, 0.5); }
.gv .gv-admin .is-danger { color: #ffb3ac; border-color: rgba(255, 140, 130, 0.35); }
.gv-report + .gv-admin { margin-top: 22px; }
.gv-kind { display: grid; gap: 6px; flex-basis: 100%; margin-bottom: 10px; }
.gv-kind span { font-size: 13px; color: rgba(255, 255, 255, 0.5); }
.gv-kind select { height: 38px; padding: 0 10px; border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 10px; background: rgba(255, 255, 255, 0.06); color: #fff; font-size: 14.5px; }
.gv-kind select:disabled { opacity: 0.5; }
.gv-kind option { color: var(--ink); background: #fff; }
.gv-flag { flex-basis: 100%; margin: 0 0 10px; font-size: 13.5px; line-height: 1.45; color: rgba(255, 255, 255, 0.72); }
.gv .gv-admin .gv-flag button { min-height: 0; padding: 0; border: 0; border-radius: 0; font-size: 13.5px; text-decoration: underline; text-underline-offset: 3px; }
.gv-strip { display: flex; gap: 4px; padding: 10px 14px 14px; overflow-x: auto; scrollbar-width: none; }
.gv-strip::-webkit-scrollbar { display: none; }
.gv-strip button { flex: 0 0 auto; width: 60px; height: 44px; padding: 0; border: 0; border-radius: 6px; overflow: hidden; background: #1a2030; opacity: 0.45; box-shadow: inset 0 0 0 2px transparent; }
.gv-strip button:hover { opacity: 0.85; }
.gv-strip button[aria-current="true"] { opacity: 1; outline: 2px solid #fff; outline-offset: 1px; }
.gv-strip img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gv-names { display: none; }

/* ---------- Uploader ---------- */

.gu { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 24px; background: rgba(8, 11, 19, 0.55); }
.gu-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: min(920px, 100%);
  max-height: min(860px, calc(100vh - 48px));
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 30px 80px rgba(8, 11, 19, 0.35);
  overflow: hidden;
}
.gu-head { display: flex; align-items: flex-start; gap: 12px; padding: 22px 24px 12px; }
.gu-head h2 { margin: 0; font-size: 20px; font-weight: 700; }
.gu-head p { margin: 4px 0 0; font-size: 14px; color: var(--muted); font-weight: 400; }
.gu-body { overflow-y: auto; padding: 8px 24px 22px; display: grid; gap: 18px; align-content: start; }
.gu-foot { display: flex; align-items: center; gap: 14px; padding: 14px 24px 18px; border-top: 1px solid #eef1f6; }
.gu-foot-note { flex: 1; margin: 0; font-size: 13px; color: var(--muted); }
.gu-go { min-height: 48px; padding: 0 26px; border: 0; border-radius: 999px; background: var(--navy); color: #fff; font-size: 15.5px; font-weight: 700; }
.gu-go:hover:not(:disabled) { background: var(--navy-deep); }
.gu-go:disabled { opacity: 0.35; cursor: not-allowed; }
.gu-where { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }
.gu-field { display: grid; gap: 6px; }
.gu-field label, .gu-label { font-size: 13px; font-weight: 600; color: var(--ink); }
.gu-field input, .gu-field select { width: 100%; min-height: 46px; padding: 0 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; font-size: 16px; }
.gu-field input:focus, .gu-field select:focus { border-color: var(--navy); outline: none; box-shadow: 0 0 0 3px rgba(47, 95, 208, 0.15); }
.gu-seg { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--paper); }
.gu-seg button { height: 38px; padding: 0 16px; border: 0; border-radius: 999px; background: transparent; font-size: 14px; font-weight: 600; color: var(--muted); }
.gu-seg button[aria-pressed="true"] { background: #fff; color: var(--navy); box-shadow: 0 1px 3px rgba(7, 22, 52, 0.14); }
.gu-new { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 12px; }
.gu-new .gu-field-wide { grid-column: 1 / -1; }
.gu-hint-date { margin: 0; font-size: 13px; color: var(--up); }
.gu-drop {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 44px 20px;
  border: 1.5px dashed #c3ccda;
  border-radius: 16px;
  background: #fbfcfe;
  text-align: center;
  transition: border-color 150ms ease, background-color 150ms ease;
}
.gu-drop.is-over { border-color: var(--navy); background: #f1f5fc; }
.gu-drop-icon { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: #eef2f9; color: var(--navy); }
.gu-drop-icon svg { width: 26px; height: 26px; }
.gu-drop h3 { margin: 6px 0 0; font-size: 17px; font-weight: 700; }
.gu-drop p { margin: 0; font-size: 14px; color: var(--muted); }
.gu-pick { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 10px; }
.gu-pick label { position: relative; display: inline-flex; align-items: center; min-height: 44px; padding: 0 20px; border-radius: 999px; border: 1px solid var(--line); background: #fff; font-weight: 600; cursor: pointer; }
.gu-pick label:first-child { background: var(--navy); border-color: var(--navy); color: #fff; }
.gu-pick label:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }
.gu-pick input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.gu-sum { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.gu-sum-text { margin: 0; font-size: 15px; }
.gu-sum-text b { font-weight: 700; }
.gu-sum-actions { display: flex; gap: 6px; margin-left: auto; }
.gu-sum-actions label, .gu-sum-actions button { position: relative; display: inline-flex; align-items: center; min-height: 38px; padding: 0 14px; border: 0; border-radius: 999px; background: var(--paper); font-size: 13.5px; font-weight: 600; cursor: pointer; }
.gu-sum-actions label:hover, .gu-sum-actions button:hover { background: #e3e9f3; }
.gu-sum-actions input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.gu-meter { height: 6px; border-radius: 3px; background: #eef1f6; overflow: hidden; }
.gu-meter span { display: block; height: 100%; border-radius: 3px; background: var(--navy); transition: width 300ms ease; }
.gu-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 6px; }
.gu-thumb { position: relative; aspect-ratio: 1; overflow: hidden; border-radius: 10px; background: #eef1f6; }
.gu-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gu-thumb-x { position: absolute; top: 6px; right: 6px; display: grid; place-items: center; width: 26px; height: 26px; border: 0; border-radius: 50%; background: rgba(8, 11, 19, 0.6); color: #fff; font-size: 15px; line-height: 1; opacity: 0; transition: opacity 150ms ease; }
.gu-thumb:hover .gu-thumb-x, .gu-thumb-x:focus-visible { opacity: 1; }
@media (hover: none) { .gu-thumb-x { opacity: 1; } }
.gu-thumb-x:hover { background: var(--down); }
.gu-thumb-ph { position: absolute; inset: 0; display: grid; place-items: center; padding: 8px; font-size: 11px; color: var(--muted); text-align: center; word-break: break-all; }
.gu-thumb-state { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(255, 255, 255, 0.55); color: var(--ink); font-size: 12px; font-weight: 700; }
.gu-ring { width: 34px; height: 34px; border-radius: 50%; background: conic-gradient(var(--navy) calc(var(--p, 0) * 1%), rgba(11, 33, 82, 0.15) 0); -webkit-mask: radial-gradient(circle, transparent 12px, #000 13px); mask: radial-gradient(circle, transparent 12px, #000 13px); }
.gu-thumb.is-waiting .gu-thumb-state { background: rgba(255, 255, 255, 0.45); font-weight: 600; color: var(--muted); }
.gu-thumb.is-done .gu-thumb-state { background: transparent; place-items: end end; padding: 6px; }
.gu-badge { display: inline-grid; place-items: center; min-width: 24px; height: 24px; padding: 0 7px; border-radius: 12px; background: var(--up); color: #fff; font-size: 11.5px; font-weight: 700; }
.gu-badge svg { width: 14px; height: 14px; }
.gu-thumb.is-duplicate .gu-thumb-state { background: rgba(255, 255, 255, 0.55); }
.gu-thumb.is-duplicate .gu-badge { background: #8a95a8; }
.gu-thumb.is-error .gu-thumb-state { background: rgba(191, 58, 48, 0.75); color: #fff; }

.gu-tray { position: fixed; z-index: 35; right: 20px; bottom: max(20px, env(safe-area-inset-bottom)); width: min(340px, calc(100vw - 32px)); border-radius: 16px; background: #fff; box-shadow: 0 2px 6px rgba(7, 22, 52, 0.08), 0 20px 50px rgba(7, 22, 52, 0.22); overflow: hidden; }
.gu-tray-head { display: flex; align-items: center; gap: 8px; padding: 12px 10px 4px 16px; }
.gu-tray-head p { flex: 1; margin: 0; font-size: 14.5px; font-weight: 700; }
.gu-tray-head button { display: grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: 50%; background: transparent; color: var(--muted); }
.gu-tray-head button:hover { background: var(--paper); color: var(--ink); }
.gu-tray-head svg { width: 18px; height: 18px; }
.gu-tray-body { display: grid; gap: 10px; padding: 8px 16px 14px; }
.gu-tray-thumbs { display: flex; gap: 4px; }
.gu-tray-thumbs span { width: 40px; height: 40px; border-radius: 6px; overflow: hidden; background: #eef1f6; flex-shrink: 0; }
.gu-tray-thumbs img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gu-tray-body p { margin: 0; font-size: 13px; color: var(--muted); }
.gu-tray-body .gx-text-btn { justify-self: start; padding-left: 0; color: var(--navy); }

.gx-dropzone { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px; background: rgba(255, 255, 255, 0.86); pointer-events: none; backdrop-filter: blur(4px); }
.gx-dropzone-inner { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; width: 100%; height: 100%; border: 2px dashed var(--navy); border-radius: 24px; color: var(--navy); }
.gx-dropzone svg { width: 56px; height: 56px; }
.gx-dropzone p { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -0.01em; }

/* Sheets */
.gx-sheet h2 { margin: 0; font-size: 20px; }
.gx-sheet-section { display: grid; gap: 10px; padding: 18px 0; border-top: 1px solid #eef1f6; }
.gx-sheet .drawer-head + .gx-sheet-section { border-top: 0; padding-top: 4px; }
.gx-sheet-section h3 { margin: 0; font-size: 15px; font-weight: 700; }
.gx-sheet-foot { position: sticky; bottom: 0; display: flex; gap: 8px; padding: 12px 0 0; background: #fff; }
.gx-sheet-foot .btn { flex: 1; min-height: 48px; border-radius: 999px; }
.gx-sheet .gx-checks { max-height: 360px; overflow-y: auto; }
.gx-sheet .gx-views { margin-left: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.gx-sheet .gx-views button { width: auto; height: 64px; display: grid; gap: 4px; align-content: center; justify-items: center; background: var(--paper); color: var(--muted); font-size: 12.5px; font-weight: 600; }
.gx-sheet .gx-views button[aria-checked="true"] { background: #e9eef8; color: var(--navy); }
.gx-privacy-text p { margin: 0 0 10px; line-height: 1.6; }
.g-report-thumb { display: block; max-width: 100%; max-height: 180px; border-radius: 12px; }
.g-reasons { display: grid; gap: 8px; margin: 0; padding: 0; border: 0; }
.g-reasons legend { margin-bottom: 6px; padding: 0; font-size: 13px; font-weight: 500; color: var(--muted); }
.g-reason { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; }
.g-reason:has(input:checked) { border-color: var(--navy); background: #f1f5fc; }
.g-reason input { width: 18px; height: 18px; accent-color: var(--navy); }

/* ---------- Narrow screens ---------- */

@media (max-width: 900px) {
  .gx-filters { display: none; }
  .gx-filter-all { display: inline-flex; }
}
@media (max-width: 1020px) {
  /* The upload button lives in the page head here, so nothing else pushes the header buttons right. */
  .gx .admin-pill:not([hidden]) { margin-left: auto; }
  .gx .admin-pill[hidden] + .menu-toggle { margin-left: auto; }
}
@media (max-width: 720px) {
  .gx-people-tools { flex-direction: column; align-items: stretch; }
  .gx-people-tools .gx-search { flex-basis: auto; }
  .gx-head { gap: 20px; padding-top: 26px; padding-bottom: 20px; }
  .gx-head-top { align-items: stretch; }
  .gx-head-actions { flex-basis: 100%; }
  /* Faces and the "+N" circle share the width evenly. */
  .gx-crowd { --face: 48px; --face-gap: 8px; gap: 8px; justify-content: space-between; }
  .gx-crowd-faces { display: contents; }
  .gx-crowd-all { justify-content: center; width: var(--face); height: var(--face); padding: 0; border-radius: 50%; background: #e9eef8; color: var(--navy); font-size: 14px; font-weight: 700; }
  .gx-crowd-all-text, .gx-crowd-all svg { display: none; }
  .gx-crowd-more { display: inline; }
  .gx-crowd-all.is-arrow svg { display: block; width: 22px; height: 22px; }
  .gx-upload { flex: 1; justify-content: center; height: 50px; }
  .gx-me { height: 50px; padding: 0 16px; }
  .gx-me span { display: none; }
  .gx-me svg { width: 22px; height: 22px; }
  .gx-tabs { gap: 0; }
  .gx-tabs > button[data-tab] { flex: 1; text-align: center; }
  .gx-privacy span { display: none; }
  .gx-privacy { padding: 8px 4px 8px 12px; }
  .gx-bar { padding: 10px 0; gap: 6px; }
  .gx-search { flex: 1 1 auto; }
  .gx-views { margin-left: 0; }
  .gx-views button { width: 38px; }
  .gx-views button:not([aria-checked="true"]) { display: none; }
  .gx-body.has-rail { grid-template-columns: minmax(0, 1fr); }
  .gx-rail { display: none; }
  .gx-day + .gx-day { margin-top: 28px; }
  .gx-day-head { flex-wrap: wrap; gap: 2px 8px; }
  .gx-day-date { font-size: 15px; }
  .gx-day-album { flex-basis: 100%; order: 3; font-size: 13.5px; }
  .gx { --gap: 3px; --r: 4px; }
  .gx-square { grid-template-columns: repeat(3, 1fr); }
  .gx-li { grid-template-columns: 88px minmax(0, 1fr); gap: 2px 14px; }
  .gx-li-thumb { width: 88px; height: 66px; grid-row: 1 / 3; }
  .gx-li-people { grid-column: 2; font-size: 13.5px; }
  .gx-li-actions { display: none; }
  .gx-albums { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 12px; }
  .gx-album h3 { font-size: 14.5px; }
  .gx-people { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px 8px; }
  .gx-person-pic { width: 84px; height: 84px; }
  .gx-person b { font-size: 13.5px; }
  .gu { padding: 0; }
  .gu-panel { width: 100%; height: 100%; max-height: none; border-radius: 0; }
  .gu-where, .gu-new { grid-template-columns: minmax(0, 1fr); }
  .gu-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .gu-head, .gu-body, .gu-foot { padding-left: 16px; padding-right: 16px; }
  .gu-drop { padding: 30px 14px; }
  .gu-foot { flex-wrap: wrap; }
  .gu-foot-note { flex-basis: 100%; }
  .gu-go { flex: 1; }
  .gv-info { position: absolute; inset: auto 0 0 0; z-index: 3; width: auto; max-height: 70%; border-left: 0; border-radius: 20px 20px 0 0; background: #0c1220; }
  .gv-main { grid-template-columns: minmax(0, 1fr); position: relative; }
  .gv-stage { grid-template-columns: minmax(0, 1fr); padding: 0; }
  /* Phones: small arrows over the photo's edges, so it is clear there is more either side. */
  .gv-nav { position: absolute; z-index: 3; top: 50%; width: 38px; height: 38px; margin-top: -19px; background: rgba(8, 11, 19, 0.4); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
  .gv-nav.is-prev { left: 8px; }
  .gv-nav.is-next { right: 8px; }
  .gv-nav:disabled { opacity: 0; pointer-events: none; }
  .gv-nav svg { width: 20px; height: 20px; }
  .gv-count { display: block; position: absolute; z-index: 3; left: 50%; bottom: 12px; padding: 4px 10px; border-radius: 999px; background: rgba(8, 11, 19, 0.5); color: #fff; font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums; transform: translateX(-50%); pointer-events: none; }
  .gv-strip { display: none; }
  .gv-names { display: block; box-sizing: content-box; height: 42px; margin: 0; padding: 12px 16px max(16px, env(safe-area-inset-bottom)); overflow: hidden; font-size: 14px; line-height: 1.5; color: rgba(255, 255, 255, 0.85); }
  .gv-names.is-empty { visibility: hidden; }
  .gv-names button { padding: 0; border: 0; background: none; color: #fff; font-weight: 600; font-size: 14px; }
  .gx-dropzone p { font-size: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  .gx-tile img, .gx-album-cover img, .gx-person-pic, .gx-crowd-face { transition: none; }
  .gv-figure { animation: none; }
}

/* Admins: face boxes over the viewer photo, and the "who is this?" picker (also used by gallery-admin.js) */
.v-face {
  position: absolute;
  padding: 0;
  border: 2px solid rgba(255, 255, 255, 0.9);
  border-radius: 6px;
  background: transparent;
  pointer-events: auto;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35);
}
.v-face.is-auto { border-color: #4fd18b; }
.v-face.is-confirmed { border-color: var(--optic); }
.v-face.is-suggested { border-color: #f2b544; border-style: dashed; }
.v-face.is-unknown, .v-face.is-new { border-color: rgba(255, 255, 255, 0.6); border-style: dashed; }
.v-face.is-ignored, .v-face.is-optout { border-color: rgba(255, 255, 255, 0.25); }
.v-face-label {
  position: absolute;
  left: 50%; top: calc(100% + 4px);
  transform: translateX(-50%);
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(4, 9, 23, 0.82);
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}
.v-popover {
  position: fixed;
  z-index: 45;
  display: grid;
  gap: 8px;
  padding: 12px;
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
}
.v-popover input { width: 100%; height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); font-size: 16px; }
.v-pick-list { margin: 0; padding: 0; list-style: none; max-height: 340px; overflow-y: auto; overscroll-behavior: contain; }
.v-pick-list button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 6px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  text-align: left;
}
.v-pick-list button:hover, .v-pick-list button:focus-visible { background: var(--row-hover); }
/* The highlighted name (↑ / ↓, Enter takes it) and the typed letters, as in the board's search. */
.v-pick-list button.is-active { background: var(--row-hover); box-shadow: inset 3px 0 0 var(--navy); }
.v-pick-list mark, .gx-check-text mark, .gx-suggest mark { border-radius: 3px; background: #cef559; box-shadow: 0 0 0 1.5px #cef559; color: var(--navy-deep); }
.gv .v-pick-list mark { color: var(--navy-deep); }
.v-pick-list span { display: grid; line-height: 1.25; font-weight: 500; }
.v-pick-list small { font-weight: 400; font-size: 12px; color: var(--muted); }
.v-popover-row { display: flex; gap: 8px; }
.v-popover-row .btn { flex: 1; min-height: 40px; }
.form input[type="date"], .form input[type="url"] {
  width: 100%;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  font-size: 16px;
}

/* Profile: photos the player is tagged in */
.photos-count {
  display: inline-grid;
  place-items: center;
  min-width: 24px;
  height: 22px;
  margin-left: 8px;
  padding: 0 7px;
  border-radius: 11px;
  background: var(--paper);
  color: var(--muted);
  font-family: var(--font-score);
  font-size: 15px;
  font-weight: 600;
  vertical-align: 2px;
}
.profile-photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; border-radius: var(--radius-md); overflow: hidden; }
.profile-photo { position: relative; display: block; aspect-ratio: 1; background: #e4ebf4; overflow: hidden; }
.profile-photo img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform 300ms ease; }
.profile-photo:hover img { transform: scale(1.05); }
.profile-photo:focus-visible { outline-offset: -3px; }
.profile-photos.is-loading .profile-photo { animation: sk-pulse 1.2s ease-in-out infinite; }
.photos-more { margin-top: 10px; min-height: 44px; }
@keyframes sk-pulse { 50% { opacity: 0.55; } }

/* Admin: "Ảnh & khuôn mặt" (gallery-admin.js) */
.faces-admin { display: grid; gap: 20px; }
.fa-top { display: flex; flex-wrap: wrap; align-items: stretch; gap: 16px; }
.fa-stats {
  flex: 1 1 520px;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
}
.fa-stat { padding: 14px 16px; }
.fa-stat + .fa-stat { border-left: 1px solid var(--line); }
.fa-stat dt { font-size: 13px; color: var(--muted); }
.fa-stat dd { margin: 4px 0 0; font-family: var(--font-score); font-size: 32px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.fa-stat .fa-stat-note { margin-top: 6px; font-family: var(--font-body); font-size: 12px; font-weight: 500; color: var(--muted); }
.fa-top-side { flex: 0 1 260px; display: grid; align-content: center; gap: 10px; }
.fa-worker { margin: 0; font-size: 13px; color: var(--muted); }
.fa-worker::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 50%; background: var(--up); vertical-align: 1px; }
.fa-worker.is-stale::before { background: #e9a23b; }
.fa-worker.is-running::before { animation: fa-pulse 1.4s ease-in-out infinite; }
@keyframes fa-pulse { 50% { opacity: 0.25; } }
@media (prefers-reduced-motion: reduce) { .fa-worker.is-running::before { animation: none; } }
.fa-tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.fa-tabs::-webkit-scrollbar { display: none; }
.fa-tabs .chip { min-height: 44px; flex-shrink: 0; }
.fa-panel { display: grid; gap: 16px; }
.fa-panel[aria-busy="true"] { opacity: 0.7; }
.fa-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; }
.fa-bar .hint { flex: 1 1 280px; }
.fa-bar-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.fa-bar-actions .btn { min-height: 44px; }
.fa-lead { margin: 0; }
.fa-pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 16px; padding: 4px 0; }
.fa-pager .hint { margin: 0; }
.fa-pager .btn { min-height: 44px; }
.fa-loading { padding: 32px 0; text-align: center; }
.fa-empty { padding: 40px 16px; border: 1px dashed var(--line); border-radius: var(--radius-lg); text-align: center; color: var(--muted); }
.fa-empty p { margin: 0; }

.fa-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 12px; }
.fa-cards.is-compact { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.fa-card {
  position: relative;
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
}
.fa-card:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.fa-card.is-selected { border-color: var(--navy); box-shadow: 0 0 0 1px var(--navy); background: #f6f9fe; }
.fa-check { position: absolute; z-index: 1; top: 16px; right: 16px; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 6px; background: rgba(255, 255, 255, 0.92); box-shadow: 0 1px 3px rgba(7, 22, 52, 0.25); cursor: pointer; }
.fa-check input { width: 18px; height: 18px; margin: 0; accent-color: var(--navy); }
.fa-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.fa-photo-btn { display: block; width: 100%; padding: 0; border: 0; background: none; border-radius: var(--radius-md); cursor: zoom-in; }
.fa-crop { position: relative; display: block; width: 100%; aspect-ratio: 1; overflow: hidden; border-radius: var(--radius-md); background: #e4ebf4; }
.fa-crop img { position: absolute; max-width: none; height: auto; }
.fa-crop img.fa-tile { top: 0; }
.fa-ref .avatar { width: 100%; height: auto; aspect-ratio: 1; border-radius: var(--radius-md); font-size: 28px; }
.fa-card-body { display: grid; gap: 10px; min-width: 0; }
.fa-question { margin: 0; font-size: 14px; line-height: 1.4; }
.fa-question b { font-weight: 600; }
.fa-like { display: inline-block; margin-left: 4px; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; vertical-align: 1px; white-space: nowrap; }
.fa-like.is-high { background: var(--up-bg); color: var(--up); }
.fa-like.is-mid { background: #fff4df; color: #8a4f00; }
.fa-like.is-low { background: var(--paper); color: var(--muted); }
.fa-like.is-auto { background: #e8f0fd; color: var(--navy); }
.fa-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.fa-actions .btn { flex: 1 1 auto; min-height: 44px; padding: 0 10px; }

.fa-clusters { display: grid; gap: 14px; }
.fa-cluster, .fa-group { display: grid; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
.fa-cluster-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; }
.fa-cluster-head h3 { margin: 0; font-size: 16px; font-weight: 600; }
.fa-cluster-head .hint { margin: 0; flex-basis: 100%; }
.fa-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 6px; }
.fa-strip-face { position: relative; padding: 0; border: 0; border-radius: var(--radius-md); background: none; }
.fa-strip-face[aria-pressed="false"] .fa-crop { opacity: 0.3; filter: grayscale(1); }
.fa-strip-face[aria-pressed="false"]::after {
  content: "×";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--down);
  font-size: 28px;
  font-weight: 700;
}
.fa-cluster-name { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.fa-name-input { width: 100%; height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); font-size: 16px; }
.fa-name-list { grid-column: 1 / -1; margin: 0; padding: 0; list-style: none; max-height: 340px; overflow-y: auto; overscroll-behavior: contain; }
.fa-name-list:empty { display: none; }
.fa-name-list button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 6px 8px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  text-align: left;
}
.fa-name-list button:hover, .fa-name-list button:focus-visible { background: var(--row-hover); }
.fa-name-list button.is-active { background: var(--row-hover); box-shadow: inset 3px 0 0 var(--navy); }
.fa-name-list mark { border-radius: 3px; background: #cef559; box-shadow: 0 0 0 1.5px #cef559; color: var(--navy-deep); }
.fa-name-list span { display: grid; line-height: 1.25; font-weight: 500; }
.fa-name-list small { font-size: 12px; font-weight: 400; color: var(--muted); }
.fa-cluster-name .btn { min-height: 44px; }
.fa-section-title { margin: 8px 0 4px; font-size: 16px; font-weight: 600; }
.fa-loose { display: grid; gap: 10px; }
.fa-loose .fa-card { padding: 8px; }
/* Once faces are ticked, their buttons stay in reach while the admin scrolls on through the list. */
.fa-loose-bar.has-picked {
  position: sticky;
  top: 0;
  z-index: 5;
  padding: 8px 0;
  background: var(--paper);
  box-shadow: 0 6px 8px -8px rgba(8, 22, 55, 0.35);
}

.fa-tag { margin-left: 6px; padding: 2px 8px; border-radius: 999px; background: #fff4df; color: #8a4f00; font-size: 12px; font-weight: 600; vertical-align: 2px; }
.fa-thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 6px; }
.fa-thumb { position: relative; padding: 0; aspect-ratio: 1; border: 0; border-radius: var(--radius-sm); overflow: hidden; background: #e4ebf4; }
.fa-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fa-thumb[aria-pressed="false"] img { opacity: 0.3; filter: grayscale(1); }
.fa-thumb[aria-pressed="false"]::after { content: "×"; position: absolute; inset: 0; display: grid; place-items: center; color: var(--down); font-size: 28px; font-weight: 700; }

.fa-reports { display: grid; gap: 12px; }
.fa-report { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 14px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
.fa-report-img img { display: block; width: 100%; border-radius: var(--radius-md); }
.fa-report-body { display: grid; gap: 6px; align-content: start; }
.fa-report-body p { margin: 0; }
.fa-report-reason { font-weight: 600; }

.fa-privacy { display: grid; gap: 12px; max-width: 720px; }
.fa-modes { display: grid; gap: 8px; }
.fa-modes small { font-size: 13px; color: var(--muted); }
/* The radio sits on the title's line, keeps its size, and the title and its line follow each other (A6). */
.fa-modes .g-reason { align-items: flex-start; }
.fa-modes .g-reason input { flex: none; margin-top: 3px; }
.fa-modes .g-reason br { display: none; }
.fa-choice-form { position: relative; display: grid; gap: 6px; max-width: 420px; }
.fa-choice-pick { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px 0; }
.fa-choices { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.fa-choices li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); }
.fa-choice-name { flex: 1; min-width: 0; font-weight: 500; }
.fa-choices select { min-height: 40px; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 0 8px; background: #fff; }

.fa-lightbox { position: fixed; z-index: 50; inset: 0; display: grid; grid-template-rows: minmax(0, 1fr) auto; gap: 12px; padding: 16px; background: rgba(4, 9, 23, 0.92); }
.fa-lightbox figure { position: relative; justify-self: center; align-self: center; margin: 0; max-width: 100%; max-height: 100%; }
.fa-lightbox img { display: block; max-width: min(100%, 1280px); max-height: calc(100vh - 110px); }
.fa-lightbox-box { position: absolute; border: 3px solid var(--optic); border-radius: 6px; box-shadow: 0 0 0 9999px rgba(4, 9, 23, 0.35); }
.fa-lightbox-bar { display: flex; justify-content: center; gap: 8px; }
.fa-picker { z-index: 60; }

@media (max-width: 720px) {
  .fa-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .fa-stat:nth-child(4) { border-left: 0; }
  .fa-stat:nth-child(n + 4) { border-top: 1px solid var(--line); }
  .fa-stat dd { font-size: 26px; }
  .fa-top-side { flex-basis: 100%; }
  .fa-cards { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; }
  .fa-cards.is-compact { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fa-card { padding: 8px; }
  .fa-actions .btn { flex-basis: calc(50% - 3px); }
  .fa-actions .btn[data-act="other"] { flex-basis: 100%; }
  .fa-report { grid-template-columns: 96px minmax(0, 1fr); }
  .fa-cluster-name { grid-template-columns: minmax(0, 1fr); }
}
/* Unnamed faces keep only their box; the label shows on hover or focus, so crowds stay readable. */
.v-face:is(.is-unknown, .is-new, .is-ignored, .is-optout) .v-face-label { display: none; }
.v-face:is(:hover, :focus-visible) .v-face-label { display: block; z-index: 1; }

/* Phones: while a drawer is open the page behind is pinned (app.js lockPage) and the drawer covers
   exactly the visible area, which shrinks while the keyboard is up (app.js fitDrawerToScreen). */
@media (max-width: 720px) {
  body.is-pinned { position: fixed; left: 0; right: 0; width: 100%; overflow: hidden; }
  .drawer { top: var(--screen-top, 0px); bottom: auto; height: var(--screen-height, 100dvh); }
  .drawer.is-typing .profile-actions { position: static; box-shadow: none; }
}

/* Titles in the profile form: each title is a small card, place first (Vô địch / Hạng nhì / Hạng ba /
   Khác, in medal colours when picked), then the tournament or the free text. */
.title-list { gap: 10px; }
.title-row { display: grid; gap: 10px; padding: 10px; border: 1px solid var(--line); border-radius: var(--radius-md); }
.title-places { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); justify-self: stretch; }
.title-places .seg-option span { display: block; min-width: 0; padding: 0 4px; white-space: nowrap; }
.title-places .seg-option input[value="1"]:checked + span { background: var(--gold); color: var(--navy-deep); }
.title-places .seg-option input[value="2"]:checked + span { background: var(--silver); color: var(--navy-deep); }
.title-places .seg-option input[value="3"]:checked + span { background: var(--bronze); color: var(--navy-deep); }
.title-entry { display: flex; align-items: center; gap: 8px; }
.title-entry .title-input { flex: 1; min-width: 0; }

/* Titles on the profile: a gold, silver or bronze medal for a place, the trophy for anything else. */
.title-list-view .medal { width: 22px; height: 22px; flex-shrink: 0; }
.title-list-view .is-place-1 .medal { color: var(--gold); }
.title-list-view .is-place-2 .medal { color: var(--silver); }
.title-list-view .is-place-3 .medal { color: var(--bronze); }

/* iOS Safari gives a date box its own width, wider than the column, and ignores width: 100% unless the
   native look is turned off; the extra width let the whole edit view slide sideways under a finger. */
.form input[type="date"] {
  -webkit-appearance: none;
  appearance: none;
  display: block;
  min-width: 0;
  max-width: 100%;
  text-align: left;
}
.form input, .form select, .form textarea { min-width: 0; max-width: 100%; }
/* Nothing in a drawer may scroll it sideways. */
.drawer { overflow-x: hidden; overscroll-behavior-x: none; }
/* An empty date box shows nothing on iPhone; say what it is for (iOS Safari only). */
@supports (-webkit-touch-callout: none) {
  .form input[type="date"].is-empty::before { content: attr(data-placeholder); color: #8a95a8; }
}
/* Very narrow phones: the four title choices keep to one line. */
@media (max-width: 360px) {
  .title-places .seg-option span { font-size: 13px; padding: 0 2px; }
}
/* Form columns never grow to fit a wide control (a native date box, a select with a long option). */
.form { grid-template-columns: minmax(0, 1fr); }
.form-row { grid-template-columns: minmax(0, 1fr); min-width: 0; }
/* The two buttons of the save bar share the width; on narrow phones they shrink instead of pushing out. */
.profile-actions-row .btn { min-width: 0; padding-left: 12px; padding-right: 12px; }
@media (max-width: 360px) {
  .profile-actions-row .btn { padding-left: 8px; padding-right: 8px; font-size: 15px; }
}
/* The birth date box matches the tower select beside it (a later shared rule makes date boxes 44px). */
.form #e-birth { min-height: 0; height: 42px; padding: 9px 12px; background: #fbfcfe; font-size: 15px; }
@media (max-width: 720px) { .form #e-birth { font-size: 16px; } }

/* ---------- Player search: shared rows (phone sheet and the list under the toolbar's box) ---------- */

.toolbar-search-field { display: block; }
.ps-list { margin: 0; padding: 0; list-style: none; }
.ps-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  cursor: pointer;
}
.ps-row .avatar { width: 44px; height: 44px; font-size: 17px; }
.ps-row.is-active { background: var(--row-hover); box-shadow: inset 3px 0 0 var(--navy); }
@media (hover: hover) { .ps-row:hover { background: var(--row-hover); } }
/* Rows out of view skip layout and paint, so each keystroke stays quick on older phones. */
.ps-list .ps-row { content-visibility: auto; contain-intrinsic-size: auto 64px; }
.ps-main { display: grid; gap: 3px; min-width: 0; }
.ps-name { overflow: hidden; font-size: 16px; font-weight: 600; line-height: 1.3; white-space: nowrap; text-overflow: ellipsis; }
.ps-name mark {
  border-radius: 3px;
  background: #cef559;
  box-shadow: 0 0 0 1.5px #cef559;
  color: var(--navy-deep);
}
.ps-meta { display: flex; align-items: center; gap: 8px; min-width: 0; color: var(--muted); font-size: 13px; line-height: 1.4; }
.ps-meta .tag-veteran { padding: 0 7px; font-size: 11px; }
.ps-group { white-space: nowrap; }
.ps-nick { overflow: hidden; color: var(--navy); font-weight: 500; white-space: nowrap; text-overflow: ellipsis; }
.ps-score { display: grid; justify-items: end; gap: 5px; }
.ps-score b {
  font-family: var(--font-score);
  font-size: 25px;
  font-weight: 600;
  line-height: 1;
  color: var(--navy);
  text-box: trim-both cap alphabetic;
}
.ps-score.is-carried b { color: #8a95a8; }
.ps-score small { font-size: 12px; line-height: 1; color: var(--muted); white-space: nowrap; text-box: trim-both cap alphabetic; }
.ps-count, .ps-more { margin: 0; padding: 14px 16px 8px; color: var(--muted); font-size: 13px; font-weight: 500; }
.ps-more { padding-bottom: 0; }
.ps-empty { display: grid; gap: 6px; padding: 28px 16px; color: var(--muted); font-size: 14px; text-align: center; }
.ps-empty b { color: var(--ink); font-size: 16px; }
.ps-sec-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; }
.ps-sec-title { margin: 0 0 12px; color: var(--ink); font-size: 15px; font-weight: 700; }
.ps-sec-head .ps-sec-title { margin: 0; }
.ps-link { min-height: 32px; padding: 0 2px; border: 0; background: none; color: var(--muted); font-size: 14px; }
.ps-keys { display: flex; gap: 20px; padding: 10px 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.ps-keys span { display: inline-flex; align-items: center; gap: 4px; }
.ps-keys kbd {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: #fff;
  color: var(--ink);
  font: 600 12px var(--font-body);
}

/* Wider screens: the list drops down from the toolbar's box. */
.search-drop {
  position: absolute;
  z-index: 25;
  top: calc(100% + 8px);
  left: 0;
  width: max(100%, 520px);
  max-width: calc(100vw - 40px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: 0 24px 60px rgba(7, 22, 52, 0.22);
}
.search-drop .ps-list { max-height: min(450px, 55vh); overflow-y: auto; overscroll-behavior: contain; }
.search-drop .ps-row:last-child { border-bottom: 0; }
.search-drop .ps-sec-head { margin: 0; padding: 14px 16px 6px; }
.search-drop .ps-list + .ps-keys, .search-drop .ps-more + .ps-keys { border-top: 1px solid var(--line); }
.search-drop .ps-more { padding: 10px 16px; border-top: 1px solid var(--line); }

/* ---------- Phones: the dock, its menu and the search sheet ---------- */

.dock, .dock-sheet, .psearch { display: none; }

@media (max-width: 720px) {
  .has-dock { padding-bottom: calc(92px + env(safe-area-inset-bottom)); }
  /* The dock carries search, registration and the menu, so the header keeps only the club and, for
     admins, the admin pill. */
  .has-dock .menu-toggle, .has-dock .register-cta { display: none; }
  .has-dock .admin-pill { margin-left: auto; }
  /* The header has room again for the admin pill's words (they made way for the register button). */
  .has-dock .admin-pill [data-i18n="admin.pill"] { display: inline; }
  .has-dock .admin-dot { display: block; }
  .has-dock .toast { bottom: calc(96px + env(safe-area-inset-bottom)); }
  .has-dock .gu-tray { bottom: calc(88px + env(safe-area-inset-bottom)); }

  /* No pinned toolbar: its box gives way to the dock's search, and its filter button sits on the count line. */
  .has-dock .list-toolbar { position: static; margin: 0; padding: 0; border: 0; background: none; box-shadow: none; }
  .has-dock .toolbar-row { display: none; }
  .has-dock .result-bar { min-height: 40px; }
  .result-bar .toolbar-filter { height: 40px; margin-left: auto; border-radius: 999px; }
  .result-bar + .active-filters { margin: -2px 0 12px; }

  .dock {
    --dock-edge: 12px;
    position: fixed;
    z-index: 19;
    left: var(--dock-edge);
    right: var(--dock-edge);
    bottom: calc(12px + env(safe-area-inset-bottom));
    display: flex;
    align-items: center;
    gap: 2px;
    height: 64px;
    padding: 8px;
    border-radius: 22px;
    background: var(--navy-deep);
    box-shadow: 0 14px 34px rgba(7, 22, 52, 0.38), inset 0 0 0 1px rgba(255, 255, 255, 0.07);
    transition: transform 180ms ease-out, opacity 180ms ease-out,
      left 240ms cubic-bezier(0.3, 0.7, 0.2, 1), height 240ms ease-out, padding 240ms ease-out, border-radius 240ms ease-out;
  }
  .dock :focus-visible { outline-color: var(--optic); }
  /* Reading down: the dock folds into a round search button in the corner (dock.js). */
  .dock-folded .dock { left: calc(100% - 60px - var(--dock-edge)); height: 60px; padding: 0; border-radius: 30px; }
  .dock-folded .dock > :not(.dock-search) { display: none; }
  .dock-folded .dock-search { justify-content: center; height: 60px; padding: 0; border-radius: 30px; background: transparent; }
  .dock-folded .dock-search span { display: none; }
  .dock-folded .dock-search svg { width: 25px; height: 25px; }
  /* Out of the way while the keyboard is up (dock.js). */
  .is-keyboard .dock { transform: translateY(calc(100% + 24px)); opacity: 0; pointer-events: none; }

  .dock-search {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 5px;
    height: 48px;
    padding: 0 9px;
    border: 0;
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    text-align: left;
  }
  .dock-search svg { flex-shrink: 0; width: 21px; height: 21px; color: var(--optic); }
  .dock-search span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  /* "Tìm VĐV" when it fits, "Tìm" in a narrower box (the gallery's dock, 375 px phones): never cut off. */
  .dock-search { container-type: inline-size; }
  .dock-search-short { display: none; }
  @container (max-width: 102px) {
    .dock-search-long { display: none; }
    .dock-search-short { display: inline; }
  }
  /* Five places on a 375 px phone: the magnifier alone when even "Tìm" does not fit. */
  @container (max-width: 46px) {
    .dock-search-short { display: none; }
  }
  a.dock-search { text-decoration: none; }
  .dock-search[aria-expanded="true"] { background: rgba(255, 255, 255, 0.2); }
  .dock-item {
    position: relative;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-width: 50px;
    height: 48px;
    padding: 0 4px;
    border: 0;
    border-radius: 14px;
    background: none;
    color: rgba(255, 255, 255, 0.8);
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
  }
  .dock-item svg { width: 22px; height: 22px; }
  .dock-item span { white-space: nowrap; }
  .dock-item[aria-current="page"] { color: var(--optic); }
  .dock-item[aria-expanded="true"] { background: rgba(255, 255, 255, 0.12); color: #fff; }
  /* The season slot (562): ball-yellow while it reads "Đăng ký giải", like the others after; a red dot on match days. */
  .dock-season.is-register { padding: 0 7px; background: var(--optic); color: var(--navy-deep); }
  .dock-season.is-register span { font-weight: 600; }
  .dock-season.is-register[aria-current="page"] { color: var(--navy-deep); }
  .dock-dot {
    position: absolute;
    top: 3px;
    right: calc(50% - 19px);
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--heart);
    box-shadow: 0 0 0 2px var(--navy-deep);
  }
  .dock-season.is-register .dock-dot { top: -3px; right: -3px; width: 12px; height: 12px; }

  /* "Thêm": a sheet that slides up over the dock (dock.js builds it). Paper backdrop, white grouped cards,
     a line icon per row, labels at 500 and a muted line under each. */
  .dock-sheet:not([hidden]) { position: fixed; z-index: 22; inset: 0; display: block; touch-action: none; }
  .ds-scrim { position: absolute; inset: 0; background: rgba(7, 22, 52, 0.4); opacity: 0; transition: opacity 220ms ease-out; }
  .ds-panel {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    display: grid;
    gap: 10px;
    padding: 6px 12px calc(14px + env(safe-area-inset-bottom));
    border-radius: 24px 24px 0 0;
    background: var(--paper);
    box-shadow: 0 -10px 40px rgba(7, 22, 52, 0.18);
    transform: translateY(100%);
    transition: transform 280ms cubic-bezier(0.2, 0.8, 0.2, 1);
  }
  .dock-sheet.is-open .ds-scrim { opacity: 1; }
  .dock-sheet.is-open .ds-panel { transform: none; }
  .ds-grip { display: grid; place-items: center; height: 18px; }
  .ds-grip span { width: 36px; height: 5px; border-radius: 3px; background: #c9d2df; }
  .ds-card {
    margin: 0;
    padding: 0;
    overflow: hidden;
    list-style: none;
    border-radius: 16px;
    background: var(--surface);
    box-shadow: 0 0 0 1px rgba(7, 22, 52, 0.05);
  }
  .ds-card li { position: relative; }
  /* Hairline between rows, starting where the words start. */
  .ds-card li + li::before { content: ""; position: absolute; top: 0; left: 68px; right: 0; height: 1px; background: var(--line); }
  .ds-row {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr) 18px;
    align-items: center;
    gap: 14px;
    min-height: 62px;
    padding: 10px 14px;
    color: var(--ink);
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
  }
  .ds-row:active { background: var(--row-hover); }
  .ds-row:focus-visible { outline-offset: -3px; border-radius: 16px; }
  .ds-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: #eef2f8; color: var(--navy); }
  .ds-glyph { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
  .ds-text { display: grid; gap: 3px; min-width: 0; }
  .ds-label { font-size: 16px; font-weight: 500; line-height: 1.25; }
  .ds-sub { overflow: hidden; color: var(--muted); font-size: 13px; font-weight: 400; line-height: 1.3; white-space: nowrap; text-overflow: ellipsis; }
  .ds-end { width: 18px; height: 18px; fill: none; stroke: #9aa6ba; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
  /* The page you are on. */
  .ds-row[aria-current="page"] .ds-icon { background: var(--optic-soft); }
  .ds-row.is-zalo .ds-icon { background: none; }
  .ds-icon img { display: block; width: 40px; height: 40px; }
  .ds-row[aria-current="page"] .ds-end { opacity: 0; }

  /* The search sheet covers exactly what is visible (above the keyboard); app.js keeps it sized. */
  .psearch:not([hidden]) {
    position: fixed;
    z-index: 22;
    left: 0;
    right: 0;
    top: var(--screen-top, 0px);
    display: block;
    height: var(--screen-height, 100vh);
  }
  .psearch-scrim { position: absolute; inset: 0; background: rgba(7, 22, 52, 0.55); }
  .psearch-panel {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    max-height: calc(100% - 48px);
    overflow: hidden;
    border-radius: 22px 22px 0 0;
    background: var(--surface);
    box-shadow: 0 -12px 40px rgba(7, 22, 52, 0.3);
  }
  .psearch-grip {
    flex-shrink: 0;
    display: grid;
    place-items: center;
    width: 100%;
    height: 22px;
    padding: 0;
    border: 0;
    background: none;
  }
  .psearch-grip span { width: 40px; height: 5px; border-radius: 3px; background: #cfd7e3; }
  .psearch-scroll {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  /* Short content sits right above the box, where the thumb is. */
  .psearch-content { margin-top: auto; }
  /* Best match nearest the box: the list grows upward (the page order stays best first). */
  .psearch .ps-list { display: flex; flex-direction: column-reverse; }
  .psearch .ps-row { border-top: 1px solid var(--line); border-bottom: 0; }
  .psearch-bar {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px 12px;
    border-top: 1px solid var(--line);
    background: var(--surface);
  }
  .psearch-field {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    height: 50px;
    padding: 0 6px 0 14px;
    border-radius: 15px;
    background: var(--navy-deep);
    color: var(--optic);
  }
  .psearch-field > svg { flex-shrink: 0; width: 21px; height: 21px; }
  .psearch-field input {
    flex: 1;
    min-width: 0;
    height: 100%;
    padding: 0;
    border: 0;
    outline: none;
    background: none;
    color: #fff;
    caret-color: var(--optic);
    /* 17px: Safari zooms into any field under 16px. */
    font-size: 17px;
    -webkit-appearance: none;
    appearance: none;
  }
  .psearch-field input::placeholder { color: rgba(255, 255, 255, 0.6); }
  .psearch-field input::-webkit-search-cancel-button { display: none; }
  .psearch-field:focus-within { box-shadow: 0 0 0 2px var(--optic); }
  .psearch-clear {
    flex-shrink: 0;
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 0;
    background: none;
    color: rgba(255, 255, 255, 0.55);
  }
  .psearch-clear svg { width: 20px; height: 20px; }
  .psearch-cancel { min-height: 44px; padding: 0 2px; border: 0; background: none; color: var(--navy); font-size: 16px; font-weight: 600; }

  .ps-hint { margin: 0; padding: 16px 16px 2px; color: var(--muted); font-size: 14px; line-height: 1.55; }
  .ps-hint b { color: var(--ink); font-weight: 600; }
  .ps-sec { padding: 18px 16px 14px; }
  .ps-chiprow { padding: 12px 16px; }
  .ps-chips {
    display: flex;
    gap: 8px;
    margin: 0 -16px;
    padding: 0 16px;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .ps-chips::-webkit-scrollbar { display: none; }
  .ps-chip {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 40px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    color: var(--ink);
    font-size: 15px;
    font-weight: 500;
  }
  .ps-chip span { font-family: var(--font-score); font-size: 16px; font-weight: 600; color: var(--muted); }
  .ps-chip.is-veteran { border-color: transparent; background: var(--veteran-bg); color: var(--veteran-ink); }
  .ps-chip.is-veteran span { color: inherit; opacity: 0.75; }
  .ps-chip[aria-pressed="true"] { border-color: var(--navy); background: var(--navy); color: #fff; }
  .ps-chip[aria-pressed="true"] span { color: rgba(255, 255, 255, 0.75); opacity: 1; }
  .ps-recent { display: flex; gap: 8px; margin: 0 -16px; padding: 0 16px 2px; overflow-x: auto; scrollbar-width: none; }
  .ps-recent::-webkit-scrollbar { display: none; }
  .ps-person {
    flex: 0 0 76px;
    min-width: 0;
    display: grid;
    justify-items: center;
    gap: 6px;
    padding: 0;
    border: 0;
    background: none;
    color: var(--ink);
    font-size: 13px;
    font-weight: 500;
    line-height: 1.25;
  }
  .ps-person > span:last-child { max-width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  .ps-person .avatar { width: 56px; height: 56px; font-size: 21px; box-shadow: 0 0 0 2px #fff, 0 0 0 3.5px var(--line); }
}

/* Very narrow phones: with the menu and register buttons gone from the header, the club name fits again.
   The search button keeps its icon, its words give way. */
@media (max-width: 374px) {
  .has-dock .brand-text { position: static; width: auto; height: auto; overflow: visible; clip: auto; }
}
@media (max-width: 359px) {
  .dock { --dock-edge: 8px; }
  .dock-search { justify-content: center; padding: 0; }
  .dock-search span { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .dock, .ds-scrim, .ds-panel { transition: none; }
}

/* ---------- One menu (562): the dock's icons, the computer's search pill, the account photo ---------- */

.dock-ic, .dock-search-ic, .hd-search-ic, .hd-account-ic { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.dock-ic.is-more { fill: currentColor; stroke-width: 1.6; }
.dock-search-ic { stroke-width: 2.2; }

/* The header's right end: "Tải app" (iPhones) and the account photo. */
.hd-end { display: flex; flex: none; align-items: center; gap: 10px; }
.hd-end:empty { display: none; }
.hd-end .app-download { margin-left: 0; }
.hd-search {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 18px 0 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.85);
  font-size: 15px;
  font-weight: 400;
  text-decoration: none;
  white-space: nowrap;
}
.hd-search:hover { background: rgba(255, 255, 255, 0.16); color: #fff; }
.hd-search-ic { width: 20px; height: 20px; color: var(--optic); stroke-width: 2.2; }
/* 44 px to tap, a 36 px photo in a ball-yellow ring; the admin badge (web admin) at its corner. */
.hd-account { position: relative; display: grid; flex: none; place-items: center; width: 44px; height: 44px; border-radius: 50%; color: #fff; text-decoration: none; }
.hd-account.is-off:not(:has(.hd-account-badge)) { display: none; }
.hd-account-face { display: grid; place-items: center; width: 36px; height: 36px; overflow: hidden; border-radius: 50%; background: rgba(255, 255, 255, 0.12); box-shadow: 0 0 0 2px var(--optic); }
.hd-account-face .ac-av { box-shadow: none; }
.hd-account-ic { width: 22px; height: 22px; stroke-width: 1.8; }
.hd-account:hover .hd-account-face { box-shadow: 0 0 0 2px #fff; }
.hd-account-badge {
  position: absolute;
  top: -1px;
  right: -3px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 10px;
  background: var(--heart);
  color: #fff;
  font: 600 12px/20px var(--font-score);
  text-align: center;
  box-shadow: 0 0 0 2px var(--navy);
}
/* The social module (social-core.js, 580/592): 💬 and 🔔 beside the account photo, each with its red count. */
.hd-social { position: relative; display: grid; flex: none; place-items: center; width: 44px; height: 44px; border-radius: 50%; color: #fff; text-decoration: none; }
.hd-social::before { content: ""; position: absolute; inset: 4px; border-radius: 50%; background: rgba(255, 255, 255, 0.12); }
.hd-social:hover::before, .hd-social[aria-current="page"]::before { background: rgba(255, 255, 255, 0.22); }
.hd-social[aria-current="page"]::before { box-shadow: 0 0 0 2px var(--optic); }
.hd-social-ic { position: relative; width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
/* The solid marks (owner 23/11/2026, like Facebook's round header buttons): white on a light round, a pressed state. */
.hd-social-ic.is-solid { width: 22px; height: 22px; fill: currentColor; stroke: none; }
.hd-social::before { transition: transform 120ms ease, background-color 120ms ease; }
.hd-social:active::before { transform: scale(0.9); background: rgba(255, 255, 255, 0.26); }
.hd-social-n { top: 1px; right: -1px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; font-size: 11px; line-height: 18px; }
.hd-social { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.hd-social-n {
  position: absolute; top: -1px; right: -3px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px;
  background: var(--heart); color: #fff; font: 600 12px/20px var(--font-score); text-align: center; box-shadow: 0 0 0 2px var(--navy);
}
.hd-social-n[hidden] { display: none; }
@media (max-width: 720px) { .hd-end .hd-social { margin: 0 -4px; } }
/* A short note at the bottom (social-core.js toast()). */
.sc-toast {
  position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); z-index: 60; max-width: min(420px, calc(100% - 32px));
  padding: 12px 18px; border-radius: 18px; background: rgba(7, 22, 52, 0.94); color: #fff; font: 400 15px/1.35 var(--font-body);
  text-align: center; opacity: 0; pointer-events: none; transform: translate(-50%, 8px); transition: opacity 160ms, transform 160ms;
}
.sc-toast.is-on { opacity: 1; transform: translate(-50%, 0); }
/* "Mời qua Zalo" (584d) over a profile. */
.sc-invite { display: grid; justify-items: center; gap: 8px; padding: 8px 4px 4px; text-align: center; }
.sc-invite-av { display: grid; place-items: center; width: 84px; height: 84px; border-radius: 50%; background: var(--tp-soft, #e8edf5); color: var(--navy); font: 500 38px/1 var(--font-body); }
.sc-invite .k-btn img { width: 24px; height: 24px; border-radius: 6px; }

/* The board's "Đăng ký giải" in the computer's header only while registering; after that "Giải đấu" is in the menu. */
body:not([data-season="register"]) .register-cta { display: none; }
/* Signed-in admins: their photo and badge take the header, "Tải app" moves into Thêm (WEB-3). */
.ds-app-row { display: none; }
body:has(#dock-admin:not([hidden])) .ds-app-row, body:has(.hd-account-badge) .ds-app-row { display: block; }
body:has(#dock-admin:not([hidden])) .site-header .app-download, .site-header:has(.hd-account-badge) .app-download { display: none; }
/* The same with 💬 🔔 in the header (owner 23/11/2026, 602): on an iPhone "Tải app" pushed the account photo off the
   screen; it moves into Thêm. */
body:has(.site-header .hd-social) .ds-app-row { display: block; }
.site-header:has(.hd-social) .app-download { display: none; }
.ds-card-admin:not(:has(li:not([hidden]))) { display: none; }
.ds-row.is-app .ds-icon { background: var(--optic-soft); }

@media (min-width: 1021px) and (max-width: 1159px) {
  /* Narrow computers: the search pill keeps its icon. */
  .hd-search { width: 44px; padding: 0; justify-content: center; }
  .hd-search span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
}
@media (max-width: 1020px) {
  .hd-search { margin-left: auto; }
  .register-cta { margin-left: 0; }
}
@media (max-width: 720px) {
  .hd-search { display: none; }
  .hd-end { margin-left: auto; gap: 8px; }
  .has-dock .admin-pill:not([hidden]) ~ .hd-end { margin-left: 0; }
  .hd-account { margin-right: -4px; }
}

/* ---------- Poster maker (app.js "Poster maker", drawn by poster.js) ---------- */

/* Profile: three equal tiles in the dark band, in the owner's order (Tải ảnh hồ sơ, Tạo poster, Tìm partner),
   icon over label so they share one row even at 320 px. */
.profile-make { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 24px; }
.profile-make-btn {
  display: grid; justify-items: center; align-content: start; gap: 6px; min-width: 0; min-height: 78px; padding: 14px 6px 12px;
  border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 14px; background: rgba(255, 255, 255, 0.07); color: #fff;
  font: inherit; font-size: 14px; font-weight: 500; line-height: 1.25; text-align: center; cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.profile-make-btn:hover { border-color: rgba(255, 255, 255, 0.34); background: rgba(255, 255, 255, 0.13); }
.profile-make-btn:focus-visible { outline: 2px solid var(--optic); outline-offset: 2px; }
.profile-make-btn[aria-busy="true"] { opacity: 0.6; cursor: progress; }
.profile-make-btn svg {
  width: 22px; height: 22px; fill: none; stroke: var(--optic); stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round;
}
.profile-make-btn span { text-wrap: balance; }

.poster-view { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; min-width: 0; }
/* The poster itself, on the club's navy, sized to leave the controls in view; the framing controls under it. */
.pv-stage {
  --pv-frame-row: 56px; /* the framing controls (44 px) and the gap above them */
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
  row-gap: 12px;
  margin: 0 calc(-1 * var(--pad-x));
  padding: 18px var(--pad-x);
  background: radial-gradient(circle at 50% 40%, #0d2864, var(--navy-deep) 70%);
}
.pv-canvas {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: min(56dvh, 600px);
  border-radius: 10px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.38);
}
/* With a figure, the preview is the handle: drag to move it, two fingers or the wheel to zoom (app.js). */
.pv-canvas.is-adjustable {
  cursor: grab;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
.pv-canvas.is-dragging { cursor: grabbing; }
.pv-stage-note {
  position: absolute;
  bottom: calc(30px + var(--pv-frame-row));
  left: 50%;
  width: max-content;
  max-width: calc(100% - 2 * var(--pad-x) - 24px);
  margin: 0;
  padding: 8px 16px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: rgba(7, 22, 52, 0.88);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
}
/* While a cut-out is made: a bar along the note's foot, filled to the share of the estimate already spent. */
.pv-stage-note.is-busy { overflow: hidden; padding-bottom: 11px; }
.pv-stage-note.is-busy::after {
  content: "";
  position: absolute;
  right: 16px;
  bottom: 5px;
  left: 16px;
  height: 3px;
  border-radius: 2px;
  background: linear-gradient(var(--optic), var(--optic)) left / calc(var(--progress, 0) * 100%) 100% no-repeat, rgba(255, 255, 255, 0.22);
  transition: background-size 0.9s linear;
}
.pv-stage-note.is-busy::before {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--optic);
  vertical-align: 0;
}
@media (prefers-reduced-motion: no-preference) {
  .pv-stage-note.is-busy::before { animation: skeleton-pulse 0.8s ease-in-out infinite alternate; }
}
/* Framing controls: − and + in the middle; the first-time hint on their left, "Đặt lại" on their right, so the
   buttons never move when either comes or goes. */
.pv-frame {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  column-gap: 12px;
  width: 100%;
  max-width: 440px;
  min-height: 44px;
}
.pv-zooms { display: flex; grid-column: 2; gap: 10px; }
.pv-zoom {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  cursor: pointer;
  transition: background 0.15s ease, opacity 0.15s ease;
}
.pv-zoom svg { width: 20px; height: 20px; }
.pv-zoom:hover:not(:disabled) { background: rgba(255, 255, 255, 0.2); }
.pv-zoom:disabled { opacity: 0.35; cursor: default; }
.pv-frame-hint {
  display: flex;
  grid-column: 1;
  justify-self: end;
  align-items: center;
  gap: 6px;
  min-width: 0;
  margin: 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.3;
  text-align: right;
}
.pv-frame-hint svg { flex: none; width: 1.125rem; height: 1.125rem; color: var(--optic); }
.pv-reset {
  display: inline-flex;
  grid-column: 3;
  justify-self: start;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 999px;
  background: none;
  color: #fff;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
}
.pv-reset svg { flex: none; width: 1.125rem; height: 1.125rem; }
.pv-reset:hover { background: rgba(255, 255, 255, 0.12); }
.pv-zoom:focus-visible, .pv-reset:focus-visible { outline: 3px solid var(--optic); outline-offset: 2px; }
.pv-h { margin: 0 0 10px; font-size: 15px; font-weight: 700; }

/* Photos: one row that scrolls sideways, the upload tile first. */
.pv-photos {
  display: flex;
  gap: 10px;
  margin: 0 calc(-1 * var(--pad-x));
  padding: 3px var(--pad-x) 6px;
  overflow-x: auto;
  scroll-padding-inline: var(--pad-x);
  scroll-snap-type: x proximity;
  scrollbar-width: none;
}
.pv-photos::-webkit-scrollbar { display: none; }
.pv-photo {
  position: relative;
  flex: none;
  width: 84px;
  height: 112px;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 12px;
  background: var(--paper);
  box-shadow: inset 0 0 0 1px var(--line);
  cursor: pointer;
  scroll-snap-align: start;
}
.pv-photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
/* A photo already cut out: picking it gives the poster at once. */
.pv-ready {
  position: absolute;
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%);
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(7, 22, 52, 0.86);
  color: var(--optic);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
}
.pv-photo.is-picked { box-shadow: 0 0 0 3px var(--navy); }
.pv-photo.is-picked::after {
  content: "";
  position: absolute;
  top: 6px;
  right: 6px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--optic) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m6 12.5 4 4 8-9' fill='none' stroke='%230e2148' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 14px no-repeat;
  box-shadow: 0 0 0 2px var(--navy);
}
.pv-photo:focus-visible, .pv-upload:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }
.pv-photo.is-loading { cursor: default; }
@media (prefers-reduced-motion: no-preference) {
  .pv-photo.is-loading { animation: skeleton-pulse 0.9s ease-in-out infinite alternate; }
}
.pv-upload {
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 6px;
  padding: 6px;
  border: 1.5px dashed #b4c0d2;
  background: var(--surface);
  box-shadow: none;
  color: var(--navy);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
}
.pv-upload svg { width: 26px; height: 26px; }
.pv-upload.is-picked { padding: 0; border: 0; }
.pv-upload.is-picked span {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  padding: 4px;
  background: rgba(7, 22, 52, 0.78);
  color: #fff;
  font-size: 11px;
}

/* Choosing the photo (owner's choices 533, 534, 541; photo-pick.js): the marks on a tile, "Xem thêm", the upload tile's
   "Được lưu lại", Ban tổ chức's ☆ / Ẩn / Hiện lại under each tile, and the toast. Light type, few words. */
.pp-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.pp-head .pv-h { margin-bottom: 10px; }
.pp-legend { display: inline-flex; gap: 10px; color: var(--muted); font-size: 12px; font-weight: 400; white-space: nowrap; }
.pp-legend > span { display: inline-flex; align-items: center; gap: 3px; }
.pp-legend svg { width: 13px; height: 13px; }
.pp-legend .is-star svg { color: var(--gold); }
.pp-marks { position: absolute; top: 6px; left: 6px; display: flex; gap: 4px; pointer-events: none; }
.pp-mark {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  height: 22px;
  min-width: 22px;
  padding: 0 5px;
  border-radius: 999px;
  background: rgba(7, 22, 52, 0.82);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
}
.pp-mark svg { width: 13px; height: 13px; flex: none; }
.pp-mark.is-star { padding: 0; justify-content: center; background: #fff; color: var(--gold); box-shadow: 0 1px 3px rgba(7, 22, 52, 0.25); }
.pp-mark.is-used { color: var(--optic); }
.pp-mark.is-used b { font-weight: 600; }
.pp-flag {
  position: absolute;
  top: 6px;
  right: 6px;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #f0a020;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 0 0 2px #fff;
}
.pv-photo.is-picked .pp-flag { top: 30px; }
.pp-kept { display: block; color: var(--muted); font-size: 11px; font-weight: 400; }
.pv-upload.is-picked .pp-kept { display: none; }
.pp-more {
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 2px;
  padding: 8px;
  background: var(--paper);
  box-shadow: none;
  color: var(--navy);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.3;
  text-align: center;
}
.pp-more svg { width: 18px; height: 18px; }
.pp-more:hover { background: var(--row-hover); }
.pp-cell { display: grid; gap: 6px; flex: none; align-content: start; scroll-snap-align: start; }
.pp-admin { display: flex; justify-content: center; gap: 6px; }
.pp-act {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 36px;
  height: 36px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--navy);
  font: inherit;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}
.pp-act svg { width: 17px; height: 17px; flex: none; }
.pp-act.is-on { border-color: #f0d48a; background: #fff6dc; color: var(--gold); }
.pp-act:hover { background: var(--row-hover); }
.pp-act:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.pp-act:disabled { opacity: 0.5; cursor: default; }
.pp-act.is-show { white-space: nowrap; }
/* "Báo ảnh này" under a kept upload (549): quiet until needed. */
.pp-report .pp-act { border-color: transparent; background: none; color: var(--muted, #5b6884); }
.pp-report .pp-act:hover { color: #b4321f; background: #fdf0ed; }
.pp-sep { flex: none; align-self: stretch; width: 1px; margin: 0 2px; background: var(--line); }
.pv-photo.is-hidden img, .fm-photo.is-hidden img { filter: grayscale(1); opacity: 0.55; }
.pp-hidden-label {
  position: absolute;
  bottom: 6px;
  left: 50%;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  transform: translateX(-50%);
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
  font-size: 11px;
  white-space: nowrap;
}
.pp-hidden-label svg { width: 12px; height: 12px; }
.pp-toast {
  position: fixed;
  left: 50%;
  bottom: calc(88px + env(safe-area-inset-bottom, 0px));
  z-index: 300;
  display: flex;
  align-items: center;
  gap: 14px;
  width: max-content;
  max-width: calc(100vw - 32px);
  padding: 12px 18px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: var(--navy-deep);
  color: #fff;
  font-size: 14px;
  box-shadow: 0 10px 30px rgba(7, 22, 52, 0.3);
}
.pp-toast[hidden] { display: none; }
.pp-toast svg { width: 16px; height: 16px; vertical-align: -3px; margin-right: 6px; color: var(--gold); }
.pp-toast b { font-weight: 600; }
.pp-toast-action { border: 0; background: none; color: var(--optic); font: inherit; font-weight: 600; cursor: pointer; padding: 6px 0; }
.pv-retry { align-self: center; white-space: nowrap; }
.pv-status { min-height: 1.5em; margin: 8px 0 0; font-size: 14px; color: var(--muted); }
.pv-status.is-error { color: var(--down); }

/* Templates: small posters in a grid, the chosen one ringed in navy. */
.pv-templates { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 14px 10px; }
.pv-template {
  display: grid;
  align-content: start;
  gap: 6px;
  min-width: 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink);
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.3;
  text-align: center;
  cursor: pointer;
}
.pv-thumb {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 9 / 16;
  border-radius: 8px;
  background: var(--navy-deep);
  box-shadow: 0 0 0 1px var(--line);
}
.pv-thumb.is-portrait { aspect-ratio: 4 / 5; }
.pv-thumb.is-square { aspect-ratio: 1; }
.pv-template[aria-checked="true"] .pv-thumb { box-shadow: 0 0 0 3px var(--navy), 0 0 0 5px var(--optic); }
.pv-template[aria-checked="true"] span { color: var(--navy); font-weight: 700; }
.pv-template:focus-visible { outline: none; }
.pv-template:focus-visible .pv-thumb { box-shadow: 0 0 0 3px var(--focus); }

/* Sizes: three tiles, each with the shape it makes. */
.pv-formats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.pv-format {
  display: grid;
  justify-items: center;
  gap: 6px;
  min-height: 84px;
  padding: 10px 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}
.pv-format[aria-checked="true"] { border-color: var(--navy); background: #f0f4fa; box-shadow: inset 0 0 0 1px var(--navy); }
.pv-shape { display: block; border: 2px solid var(--navy); border-radius: 3px; }
.pv-shape.is-square { width: 22px; height: 22px; }
.pv-shape.is-portrait { width: 20px; height: 25px; }
.pv-shape.is-story { width: 15px; height: 27px; }
.pv-format-text { display: grid; line-height: 1.25; text-align: center; }
.pv-format-text b { font-size: 14px; }
.pv-format-text small { font-size: 11.5px; color: var(--muted); }
.pv-switch { display: flex; align-items: center; gap: 12px; margin-top: 16px; font-size: 15px; line-height: 1.35; cursor: pointer; }
.pv-switch input { flex: none; width: 22px; height: 22px; margin: 0; accent-color: var(--navy); }

/* The export button stays at the bottom of the drawer while the options scroll. */
.pv-bar {
  position: sticky;
  bottom: calc(-1 * var(--pad-bottom));
  z-index: 2;
  margin: 20px calc(-1 * var(--pad-x)) calc(-1 * var(--pad-bottom));
  padding: 12px var(--pad-x) calc(12px + env(safe-area-inset-bottom, 0px));
  background: var(--surface);
  box-shadow: 0 -1px 0 var(--line);
}
.pv-result {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: calc(100dvh - 270px);
  margin: 0 auto;
  border-radius: 14px;
  box-shadow: 0 12px 32px rgba(7, 22, 52, 0.28);
}

/* "Poster xác nhận đăng ký" (owner's choice 527, 2026-11-20; app.js "Poster xác nhận đăng ký", drawn by reg-poster.js):
   the poster maker's stage, a ring round the player being framed, the size as one segmented row, the players to pick,
   the chosen player's photos, then "Lưu ảnh" and "Chia sẻ" side by side. */
.rp-view { gap: 18px; }
/* A smaller poster than the maker's, so the players and their photos stay in view under it. */
.rp-view .pv-canvas { max-height: min(44dvh, 460px); }
@media (max-width: 720px) {
  .rp-view .pv-canvas { max-height: min(36dvh, 400px); }
}
.rp-wrap { max-width: 100%; }
.rp-wrap { position: relative; line-height: 0; }
.rp-ring {
  position: absolute;
  border: 2px dashed var(--optic);
  border-radius: 14px;
  box-shadow: 0 0 0 1px rgba(7, 22, 52, 0.35);
  pointer-events: none;
}
.rp-ring[hidden] { display: none; }
.rp-sizes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; padding: 3px; border-radius: 12px; background: var(--paper); }
.rp-size {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 44px;
  border: 0;
  border-radius: 9px;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}
.rp-size[aria-checked="true"] { background: var(--surface); color: var(--navy); font-weight: 600; box-shadow: 0 1px 3px rgba(7, 22, 52, 0.16); }
.rp-size .pv-shape { border-width: 1.6px; }
.rp-size .pv-shape.is-portrait { width: 13px; height: 16px; }
.rp-size .pv-shape.is-square { width: 15px; height: 15px; }
.rp-size .pv-shape.is-story { width: 10px; height: 18px; }
.rp-size:not([aria-checked="true"]) .pv-shape { border-color: var(--muted); }
.rp-size:focus-visible, .rp-person:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.rp-people { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.rp-people.is-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.rp-person {
  display: grid;
  justify-items: center;
  gap: 5px;
  min-width: 0;
  padding: 8px 4px 7px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}
.rp-person .avatar { width: 40px; height: 40px; }
.rp-person > span:last-child { max-width: 100%; font-size: 13px; font-weight: 500; line-height: 1.2; text-align: center; overflow-wrap: anywhere; }
.rp-person[aria-checked="true"] { border-color: var(--navy); background: #f0f4fa; box-shadow: inset 0 0 0 1px var(--navy); }
.rp-person[aria-checked="true"] > span:last-child { font-weight: 600; color: var(--navy); }
.rp-person[aria-checked="true"] .avatar { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--optic); }
.rp-view .pv-h { margin-bottom: 8px; }
.rp-bar { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 10px; }
.rp-bar .btn { min-height: 48px; }
/* The "Đã gửi đăng ký" screen: each event's poster under its row. */
.reg-done-list li:has(.reg-done-poster) { flex-wrap: wrap; }
.reg-done-poster { flex: 1 1 100%; min-height: 44px; background: var(--surface); color: var(--navy); font-weight: 600; }
.reg-done-poster .btn-icon { width: 18px; height: 18px; }

/* From the menu: who the poster is for. */
.pf-label { display: block; margin-bottom: 8px; font-weight: 600; }
.pf-input {
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  border: 1px solid #c3cddb;
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 16px; /* Safari zooms into smaller fields */
}
.pf-input:focus { border-color: var(--navy); outline: 3px solid rgba(47, 95, 208, 0.25); }
.pf-list { display: grid; gap: 2px; margin: 12px 0 0; padding: 0; list-style: none; }
.pf-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 60px;
  padding: 8px 10px;
  border: 0;
  border-radius: 12px;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.pf-row:hover, .pf-row:focus-visible { background: var(--row-hover); }
.pf-row .avatar { flex: none; width: 44px; height: 44px; font-size: 17px; }
.pf-name { display: grid; flex: 1; min-width: 0; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.pf-name small { font-size: 13px; font-weight: 500; color: var(--muted); }
.pf-score { font-family: var(--font-score); font-size: 22px; font-weight: 700; color: var(--navy); }
.pf-sub, .pf-empty { margin: 16px 0 0; font-size: 14px; color: var(--muted); }

/* ---------- Tìm partner (app.js "Tìm partner"; posters in poster.js pf-*) ---------- */

.pt-view { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; min-width: 0; }
.pt-num { font-family: var(--font-score); font-weight: 700; letter-spacing: 0.01em; }

/* "Bạn là ai": who the fit badges are worked out for. */
.pt-me {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px;
  border: 1.5px dashed #9fb2cc; border-radius: var(--radius-lg); background: var(--surface); font-size: 14px; line-height: 1.4;
}
.pt-me .avatar { flex: none; width: 40px; height: 40px; font-size: 16px; }
.pt-me > div { min-width: 0; flex: 1; }
.pt-me small { display: block; color: var(--muted); font-size: 13px; }
.pt-me .pt-num { font-size: 17px; }
.pt-me.is-empty { width: 100%; justify-content: center; padding: 14px; color: var(--navy); font: inherit; font-weight: 700; cursor: pointer; }
.pt-me.is-empty:hover { background: var(--row-hover); }
.pt-me.is-picking { display: block; border-style: solid; }

.pt-mine { display: grid; gap: 8px; }
.pt-mine .pv-h { margin: 0; }
.pt-mine-row {
  display: flex; justify-content: space-between; gap: 12px; padding: 12px 14px; border: 1.5px solid var(--navy);
  border-radius: var(--radius-md); background: var(--optic-soft); font: inherit; text-align: left; cursor: pointer;
}
.pt-mine-row span { color: var(--muted); font-size: 13px; white-space: nowrap; }

/* Event tabs: the cap in big digits, like the finals tabs. */
.pt-tabs { display: flex; gap: 6px; margin: 0 calc(-1 * var(--pad-x)); padding: 2px var(--pad-x) 4px; overflow-x: auto; scrollbar-width: none; }
.pt-tabs::-webkit-scrollbar { display: none; }
.pt-tab {
  flex: none; min-width: 78px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-md);
  background: var(--surface); font: inherit; text-align: center; cursor: pointer;
}
.pt-tab b { display: block; font-family: var(--font-score); font-size: 25px; line-height: 1; color: var(--navy); }
.pt-tab span { display: block; margin-top: 2px; font-size: 11.5px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.pt-tab i { display: block; margin-top: 2px; font-size: 11px; font-style: normal; font-weight: 700; color: var(--up); white-space: nowrap; }
.pt-tab[aria-selected="true"] { background: var(--navy-deep); border-color: var(--navy-deep); }
.pt-tab[aria-selected="true"] b, .pt-tab[aria-selected="true"] i { color: var(--optic); }
.pt-tab[aria-selected="true"] span { color: rgba(255, 255, 255, 0.8); }

.pt-list-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.pt-list-head h3 { margin: 0; font-size: 17px; font-weight: 800; }
.pt-list-head span { color: var(--muted); font-size: 13px; }
.pt-list { display: grid; gap: 10px; }
.pt-empty { margin: 0; padding: 18px; border-radius: var(--radius-lg); background: var(--surface); color: var(--muted); text-align: center; line-height: 1.5; }

.pt-row { padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
.pt-row.is-fit { border-color: #9fd3b6; box-shadow: inset 3px 0 0 var(--up); }
.pt-row.is-loading { height: 132px; background: linear-gradient(90deg, #eef2f7, #f6f8fb, #eef2f7); }
.pt-row-main { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; width: 100%; padding: 0; border: 0; background: none; font: inherit; text-align: left; color: inherit; cursor: pointer; }
.pt-row-main .avatar { width: 46px; height: 46px; font-size: 18px; }
.pt-who b { display: block; font-size: 15.5px; font-weight: 800; line-height: 1.25; }
.pt-who small { display: block; margin-top: 2px; color: var(--muted); font-size: 12.5px; }
.pt-score { text-align: right; }
.pt-score b { display: block; font-family: var(--font-score); font-size: 24px; line-height: 1; }
.pt-score small { color: var(--muted); font-size: 11.5px; }
.pt-needs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.pt-need { display: inline-flex; gap: 6px; padding: 5px 10px; border-radius: 8px; background: var(--optic-soft); font-size: 13.5px; font-weight: 600; }
.pt-need b:empty { display: none; }
.pt-need.is-social { background: #e6eefb; }
.pt-fit { display: inline-flex; align-items: center; gap: 4px; margin: 8px 0 0; padding: 3px 9px; border-radius: 999px; background: var(--down-bg); color: var(--down); font-size: 12.5px; font-weight: 800; }
.pt-fit.is-ok { background: var(--up-bg); color: var(--up); }
.pt-fit svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 3; }
.pt-note { margin: 8px 0 0; font-size: 14px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.pt-note.is-full { display: block; -webkit-line-clamp: none; white-space: pre-line; }
.pt-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.pt-call, .pt-zalo { min-height: 38px; padding: 7px 14px; border-radius: 999px; font-size: 14px; font-weight: 700; text-decoration: none; }
.pt-call { background: var(--up-bg); color: var(--up); }
.pt-zalo { background: #e8f1ff; color: #0b5bd3; }
.pt-call:hover { background: #d3ecdf; }
.pt-zalo:hover { background: #d8e7ff; }
.pt-call.btn-lg, .pt-zalo.btn-lg { flex: 1; min-height: 48px; font-size: 15.5px; }
.pt-call svg, .pt-zalo svg { width: 17px; height: 17px; }
.pt-zalo svg { fill: none; stroke: currentColor; stroke-width: 2.2; }

/* One request: the player and "you", the sum against the cap. */
.pt-vs { display: grid; grid-template-columns: 1fr 36px 1fr; align-items: center; padding: 16px 10px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); text-align: center; }
.pt-vs-side { display: grid; justify-items: center; gap: 4px; padding: 0; border: 0; background: none; font: inherit; color: inherit; cursor: pointer; }
div.pt-vs-side { cursor: default; }
.pt-vs-side b { font-size: 14.5px; font-weight: 800; }
.pt-vs-side .pt-num { font-size: 26px; color: var(--navy); line-height: 1; }
.pt-vs-side small { color: var(--navy); font-size: 12.5px; font-weight: 700; }
.pt-ghost { display: grid; place-items: center; width: 72px; height: 72px; border: 2.5px dashed #9fb2cc; border-radius: 50%; font-family: var(--font-score); font-size: 32px; font-weight: 700; color: #9fb2cc; }
.pt-plus { font-family: var(--font-score); font-size: 30px; color: var(--muted); }
.pt-event-pick { display: flex; flex-wrap: wrap; gap: 8px; }
.pt-event-pick .chip[aria-checked="true"] { background: var(--navy); border-color: var(--navy); color: #fff; }
.pt-need-line { margin: 0; padding: 10px 12px; border-radius: var(--radius-md); background: var(--optic-soft); font-size: 15.5px; font-weight: 800; }
.pt-meter { grid-column: 1 / -1; margin-top: 2px; }
.pt-bar { display: flex; height: 28px; overflow: hidden; border-radius: 8px; background: #e9eef5; }
.pt-bar span { display: flex; align-items: center; padding-left: 8px; overflow: hidden; font-size: 12.5px; font-weight: 800; white-space: nowrap; }
.pt-bar .is-them { background: var(--navy); color: #fff; }
.pt-bar .is-you { background: var(--optic); color: var(--navy-deep); }
.pt-bar .is-room { background: repeating-linear-gradient(135deg, var(--optic), var(--optic) 8px, #abdb20 8px, #abdb20 16px); }
.pt-bar-legend { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 6px; color: var(--muted); font-size: 12.5px; }
.pt-bar-legend .pt-fit { margin: 0; }
.pt-sec .pv-h { margin-bottom: 6px; }
.pt-contact { display: grid; gap: 4px; padding: 14px; border: 1.5px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
.pt-contact-label { color: var(--muted); font-size: 13px; }
.pt-phone { font-family: var(--font-score); font-size: 32px; font-weight: 700; letter-spacing: 0.02em; }
.pt-no-phone { margin: 0; font-size: 15px; font-weight: 600; }
.pt-more { display: flex; flex-wrap: wrap; gap: 8px; }
.pt-more .btn { flex: 1 1 140px; }
.pt-own { padding: 12px; border-radius: var(--radius-lg); background: var(--optic-soft); }
.pt-own p { margin: 0 0 10px; font-size: 13.5px; }
.pt-meta { margin: 0; color: var(--muted); font-size: 12.5px; text-align: center; }
.pt-meta .link-btn { color: var(--muted); font-size: 12.5px; }

/* Posting. */
.pt-form { display: grid; gap: 22px; }
.pt-step { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; font-size: 17px; font-weight: 800; }
.pt-step > span { display: grid; place-items: center; flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--navy-deep); color: #fff; font-size: 13px; }
.pt-step small { margin-left: auto; padding: 3px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--paper); font-size: 12.5px; font-weight: 700; }
.pt-picked { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1.5px solid var(--navy); border-radius: var(--radius-lg); background: var(--surface); }
.pt-picked .avatar { width: 44px; height: 44px; font-size: 17px; }
.pt-picked div { flex: 1; min-width: 0; }
.pt-picked b { display: block; font-weight: 800; }
.pt-picked small { color: var(--muted); font-size: 13px; }
.pt-opt {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 4px 12px; align-items: start;
  margin-bottom: 8px; padding: 12px; border: 1.5px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); cursor: pointer;
}
.pt-opt input { width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--navy); }
.pt-opt.is-on { border-color: var(--navy); box-shadow: inset 0 0 0 1px var(--navy); }
.pt-opt.is-off { opacity: 0.55; cursor: default; }
.pt-opt-text b { display: block; font-weight: 800; }
.pt-opt-text small { display: block; margin-top: 2px; color: var(--muted); font-size: 13px; }
.pt-tag { padding: 4px 9px; border-radius: 999px; background: var(--optic-soft); color: var(--navy); font-size: 12.5px; font-weight: 800; white-space: nowrap; }
.pt-textarea { width: 100%; min-height: 84px; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: var(--radius-md); font: inherit; font-size: 16px; line-height: 1.5; resize: vertical; }
.pt-textarea:focus, .pt-phone-input:focus { border-color: var(--navy); outline: 3px solid rgba(47, 95, 208, 0.25); }
.pt-counter { text-align: right; }
.pt-phone-input { font-family: var(--font-score); font-size: 22px; letter-spacing: 0.04em; }
.pt-warn { display: flex; gap: 10px; margin: 12px 0 0; padding: 10px 12px; border: 1px solid #f0d77a; border-radius: var(--radius-md); background: #fff7d6; color: #5c4a00; font-size: 13.5px; line-height: 1.45; }
.pt-warn svg { flex: none; width: 20px; height: 20px; color: #b88a00; }

/* Posted: the code to keep. */
.pt-done { justify-items: center; text-align: center; }
.pt-done p { margin: 0; color: var(--muted); line-height: 1.5; }
.pt-tick { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: var(--up-bg); color: var(--up); }
.pt-tick svg { width: 34px; height: 34px; fill: none; stroke: currentColor; stroke-width: 3; }
.pt-code { display: grid; gap: 4px; width: 100%; padding: 14px; border: 1.5px dashed var(--navy); border-radius: var(--radius-lg); background: var(--surface); }
.pt-code b { font-family: var(--font-score); font-size: 32px; letter-spacing: 0.14em; }
.pt-code span { color: var(--muted); font-size: 12.5px; }

/* Admin. */

/* ---------- Saving an image into a phone's photos (save-image.js) ---------- */

.save-hint { margin: 8px 0 0; text-align: center; }
.save-sheet {
  position: fixed; inset: 0; z-index: 1000; display: grid; grid-template-rows: minmax(0, 1fr) auto; place-items: center;
  padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom)); background: rgba(3, 8, 24, 0.94);
}
.save-sheet-img {
  max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 8px; box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  -webkit-touch-callout: default; user-select: auto;
}
.save-sheet-close {
  position: absolute; top: max(12px, env(safe-area-inset-top)); right: 12px; z-index: 1; width: 44px; height: 44px; border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, 0.14); color: #fff; font-size: 26px; line-height: 1; cursor: pointer;
}
.save-sheet-bar { display: grid; gap: 10px; justify-items: center; width: 100%; max-width: 420px; padding-top: 14px; }
.save-sheet-btn {
  width: 100%; min-height: 50px; border: 0; border-radius: 999px; background: var(--optic); color: var(--navy-deep);
  font: inherit; font-size: 16px; font-weight: 800; cursor: pointer;
}
.save-sheet-hint { margin: 0; color: rgba(255, 255, 255, 0.85); font-size: 14px; line-height: 1.45; text-align: center; }

/* ---------- Phones: text boxes never under 16px ---------- */

/* iPhone zooms into any text box under 16px and stays zoomed in, so the page then slides sideways ("bị tràn,
   không fix cứng"). Fields inherit the page's 15px unless a rule sizes them: this base catches those, and the
   boxes sized below 16px on purpose get 16px here. */
@media (max-width: 720px) {
  input, select, textarea { font-size: 16px; }
  .gx-search input,
  .gx-pop-search,
  .gv-kind select,
  .match-search,
  .form input[type="date"],
  .form input[type="url"],
  .form input[type="search"],
  .form input[type="email"],
  .form input[type="number"],
  .form input:not([type]) { font-size: 16px; }
  /* Backstop only: nothing should be wider than the screen, and if something ever is, it is cut off rather
     than letting the page slide sideways. */
  body { overflow-x: clip; }
}

/* ---------- Membership: application form, sent screen, admin queue ---------- */

.drawer-intro { margin: 4px 0 0; font-size: 14px; color: var(--muted); }
.member-gender { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); justify-self: stretch; }
.member-gender .seg-option span { display: block; min-width: 0; }
.member-privacy { display: flex; align-items: flex-start; gap: 8px; margin: 0; font-size: 13px; color: var(--muted); }
.member-privacy .lock-icon { margin-top: 1px; color: var(--muted); }
.member-note { margin: 0; }

.member-done { padding-top: 12px; }
.member-done-text { margin: 0; max-width: 34em; font-size: 15px; line-height: 1.5; }
.member-done .member-privacy { max-width: 34em; margin-top: 4px; text-align: left; }
.member-done-actions { display: grid; gap: 10px; width: 100%; margin-top: 14px; }

[data-member-add] svg { width: 18px; height: 18px; margin-right: 6px; vertical-align: -3px; }

/* A search that finds nobody may be someone not on the board yet. */
.empty .empty-join { margin: 14px 0 0; font-size: 14px; color: var(--muted); }
.empty-join a { color: var(--navy); font-weight: 600; }

/* ---------- Admin: activity log and account (2026-10-26 audit) ---------- */
/* More tabs than fit one desktop row: they wrap onto a second row (phones keep one row that scrolls sideways). */
@media (min-width: 721px) {

  .admin-tab { font-size: 14px; }
}

.form-help { font-size: 12px; color: var(--muted); }

.device { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-md); }
.device.is-current { border-color: #b9d9c6; background: #f5fbf7; }

#logout-others { min-height: 44px; }

@media (max-width: 720px) {
  /* The phone .wrap rule (padding: 0 16px) came later and took the admin page's top space away. */
  .admin-view { padding-top: 24px; }

  .device { grid-template-columns: auto minmax(0, 1fr); }
  .device .status-tag { grid-column: 2; justify-self: start; }
}

/* ---------- Admin: member list (/#admin/players) ---------- */

/* The bar's slot takes no box of its own, so the bar can stick to the bottom of the whole panel. */
#roster-bar-slot { display: contents; }

.roster-left { color: #8a4f00 !important; }

.roster-dialog { display: grid; gap: 14px; }
.roster-names { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.roster-names li { padding: 4px 10px; border-radius: 999px; background: var(--paper); font-size: 13px; font-weight: 600; }
.roster-names li.is-more { background: transparent; color: var(--muted); font-weight: 500; }
.roster-sub { margin: 4px 0 0; font-size: 14px; font-weight: 700; color: var(--navy); }
.roster-effects { display: grid; gap: 6px; margin: 0; padding: 0 0 0 20px; font-size: 14px; line-height: 1.45; }
.roster-effects.is-gone li::marker { color: var(--down); }
.profile-left { display: grid; gap: 8px; margin-top: 16px; }
.profile-left p { margin: 0; }
.profile-left .btn { justify-self: start; min-height: 40px; }
.profile-leave { margin: 20px 0 0; text-align: center; font-size: 14px; }

.merge-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.merge-card { position: relative; display: grid; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-md); cursor: pointer; }
.merge-card.is-kept { border-color: var(--navy); box-shadow: 0 0 0 1px var(--navy); background: #f7f9fd; }
.merge-card input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.merge-card:has(input:focus-visible) { outline: 3px solid var(--optic); outline-offset: 2px; }
.merge-card-head { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 8px; font-size: 14px; }
.merge-card-head b { overflow-wrap: anywhere; }
.merge-card-head .status-tag { grid-column: 1 / -1; justify-self: start; }
.merge-card dl { display: grid; gap: 4px; margin: 0; font-size: 13px; }
.merge-card dl div { display: flex; justify-content: space-between; gap: 8px; }
.merge-card dt { color: var(--muted); }
.merge-card dd { margin: 0; font-weight: 600; text-align: right; }

.group-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.group-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-md); }
.group-row > span { display: grid; min-width: 0; }
.group-row small { font-size: 12px; color: var(--muted); }
.group-row .btn { min-height: 40px; }
.group-row.is-editing { display: block; border-color: var(--navy); }
.group-form label { font-size: 13px; font-weight: 600; color: var(--muted); }

@media (max-width: 400px) {
  .merge-cards { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Gallery admin: several photos at once, album manager, hidden photos (2026-10-26 audit) ---------- */
.gx-pick-toggle::after { display: none; }
.gx-pick-toggle svg { width: 18px; height: 18px; }
.gx-pick-toggle[aria-pressed="true"] { border-color: var(--navy); background: var(--navy); color: #fff; }
.gx-picking .gx-tile::before {
  content: ""; position: absolute; z-index: 2; top: 8px; left: 8px; width: 24px; height: 24px;
  border: 2px solid #fff; border-radius: 50%; background: rgba(7, 22, 52, 0.25); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}
.gx-picking .gx-tile.is-picked::before {
  background: var(--navy) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 12.5l4 4L18 8' fill='none' stroke='%23fff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 16px no-repeat;
}
.gx-picking .gx-tile.is-picked img { transform: scale(0.92); border-radius: 6px; }
.gx-picking .gx-tile.is-picked { outline: 3px solid var(--navy); outline-offset: -3px; }
.gx-picking .gx-li-thumb.is-picked { outline: 3px solid var(--navy); }
.gx-pickbar {
  position: fixed; z-index: 21; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  display: grid; gap: 8px; width: min(1080px, calc(100% - 32px)); padding: 10px 12px;
  border-radius: var(--radius-lg); background: var(--navy); color: #fff; box-shadow: 0 14px 34px rgba(7, 22, 52, 0.35);
}
.gx-pickbar-top { display: flex; align-items: center; gap: 10px; }
.gx-pickbar-top b { flex: 1; min-width: 0; }
.gx-pickbar .gx-text-btn { position: relative; color: rgba(255, 255, 255, 0.85); }
.gx-pickbar .gx-text-btn::after { content: ""; position: absolute; inset: -8px -4px; } /* "Chọn hết": 44 px to tap (A10) */
.gx-pickbar .btn { min-height: 40px; }
.gx-pickbar .btn-primary { background: var(--optic); border-color: var(--optic); color: var(--navy); }
.gx-pickbar-acts { display: flex; flex-wrap: wrap; gap: 8px; }
.gx-pickbar-acts .btn { flex: 0 0 auto; gap: 6px; background: rgba(255, 255, 255, 0.1); border-color: rgba(255, 255, 255, 0.25); color: #fff; white-space: nowrap; }
.gx-pickbar-acts .btn svg { width: 18px; height: 18px; }
.gx-pickbar-acts .btn.is-danger { background: #fff; border-color: #fff; color: var(--down); }
.gx-pickbar-acts .btn:disabled { opacity: 0.45; }
.gx-album-desc { margin: 6px 0 0; font-size: 14px; color: var(--ink); white-space: pre-line; }
.gx-albums-admin { margin: 0 0 12px; text-align: right; }
.gv-admin-row { display: inline-flex; gap: 6px; }
.gv .gv-admin button svg { width: 16px; height: 16px; margin-right: 6px; vertical-align: -3px; }
.gx-delete-choice { display: grid; gap: 8px; margin: 0; padding: 0; border: 0; }
.g-reason > span { display: grid; gap: 6px; min-width: 0; }
.g-reason small { color: var(--muted); }
.g-reason select { width: 100%; height: 40px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fbfcfe; padding: 0 10px; font: inherit; font-size: 15px; }

.am-list { display: grid; gap: 8px; margin: 14px 0 0; padding: 0; list-style: none; }
.am-row { border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); }
.am-row.is-hidden .am-cover, .am-row.is-hidden .am-main b { opacity: 0.55; }
.am-row.is-editing { border-color: var(--navy); }
.am-row.is-dragging { position: relative; z-index: 3; border-color: var(--navy); box-shadow: 0 14px 30px rgba(7, 22, 52, 0.22); background: #f7f9fd; }
.am-line { display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 8px 12px 8px 4px; }
.am-handle { display: grid; place-items: center; width: 44px; height: 44px; border: 0; background: none; color: var(--muted); cursor: grab; touch-action: none; }
.am-handle svg { width: 22px; height: 22px; }
.am-row.is-dragging .am-handle { cursor: grabbing; color: var(--navy); }
.am-cover { width: 64px; height: 48px; border-radius: 8px; background: var(--paper); overflow: hidden; }
.am-cover img { display: block; width: 100%; height: 100%; object-fit: cover; }
.am-main { display: grid; min-width: 0; }
.am-main b { font-size: 15px; overflow-wrap: anywhere; }
.am-main .fa-tag { justify-self: start; margin: 2px 0; }
.am-main small { font-size: 12.5px; color: var(--muted); }
.fa-tag.is-hidden { background: var(--paper); color: var(--muted); }
.am-acts { display: flex; gap: 6px; }
.am-acts .btn { min-height: 40px; }
.am-move { min-width: 40px; padding: 0; font-size: 17px; }
.am-form { padding: 4px 14px 14px; border-top: 1px solid var(--line); }
.am-form-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 12px; }
.am-form textarea { min-height: 72px; }
.am-form-acts { display: flex; flex-wrap: wrap; gap: 8px; }
.am-form-acts .btn { min-height: 42px; }
.am-delete { margin-left: auto; }
.am-sub { margin: 10px 0 0; font-size: 15px; color: var(--navy); }
.am-covers { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 6px; max-height: 236px; overflow-y: auto; }
.am-cover-pick { aspect-ratio: 4 / 3; padding: 0; border: 2px solid transparent; border-radius: 8px; overflow: hidden; background: var(--paper); }
.am-cover-pick img { display: block; width: 100%; height: 100%; object-fit: cover; }
.am-cover-pick[aria-checked="true"] { border-color: var(--navy); box-shadow: 0 0 0 2px var(--optic); }
.am-hidden { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-top: 14px; }
.am-hidden-item { position: relative; display: grid; gap: 4px; padding: 6px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); cursor: pointer; }
.am-hidden-item.is-picked { border-color: var(--navy); box-shadow: 0 0 0 1px var(--navy); }
.am-hidden-item.is-locked { cursor: default; opacity: 0.7; }
.am-hidden-item input { position: absolute; top: 12px; left: 12px; width: 22px; height: 22px; accent-color: var(--navy); }
.am-hidden-item img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 6px; }
.am-reason { font-size: 12.5px; font-weight: 600; }
.am-hidden-item small { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }

@media (max-width: 720px) {
  /* While ticking photos the bar takes the dock's place. */
  .gx-picking .dock { display: none; }
  .gx-pickbar { width: calc(100% - 24px); bottom: calc(12px + env(safe-area-inset-bottom)); }
  .gx-pickbar-acts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gx-pickbar-acts .btn { justify-content: center; min-height: 40px; padding: 0 8px; font-size: 14px; }
  .gx-pickbar-acts .btn.is-danger { grid-column: 2; }
  .gx-pick-toggle { width: 42px; padding: 0; justify-content: center; }
  .gx-pick-toggle span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .am-line { grid-template-columns: auto auto minmax(0, 1fr); padding-right: 10px; }
  .am-acts { grid-column: 1 / -1; justify-content: flex-end; padding: 0 0 2px; }
  .am-cover { width: 52px; height: 40px; }
  .am-form-grid { grid-template-columns: minmax(0, 1fr); }
  .am-form input, .am-form textarea, .am-form select, .g-reason select { font-size: 16px; }
  .am-delete { margin-left: 0; }
  .am-hidden { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.am-form .switch { justify-self: start; }
/* An album with a description gives its text the full width on phones; the buttons go underneath. */
@media (max-width: 720px) {
  .gx-album-head:has(.gx-album-desc) { flex-wrap: wrap; row-gap: 4px; }
  .gx-album-head:has(.gx-album-desc) > div { flex-basis: 100%; }
}

/* ---------- Admin: proposals in part, handled lists, partner edit (2026-10-26 audit) ---------- */
.diff-row.is-choosable dt { display: flex; align-items: center; gap: 6px; }
.diff-pick { display: inline-grid; place-items: center; width: 28px; height: 28px; margin-left: -4px; cursor: pointer; }
.diff-pick input { width: 18px; height: 18px; margin: 0; accent-color: var(--navy); }
.diff-row.is-choosable:has(.diff-pick input:not(:checked)) dd { opacity: 0.4; text-decoration: line-through; }
.diff-edit { margin-left: 8px; padding: 2px 8px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--navy); font-size: 12px; font-weight: 600; }
.diff-input { width: 100%; max-width: 220px; height: 34px; padding: 0 10px; border: 1px solid var(--navy); border-radius: var(--radius-sm); font: inherit; font-size: 15px; }
.diff-input.is-score { max-width: 90px; font-family: var(--font-score); font-size: 18px; font-weight: 600; }
.request-pick-hint { margin: 4px 0 0; font-size: 12.5px; }
/* At least 44 px to tap on a phone with the look unchanged (layout audit A10): an invisible margin around the small
   controls of a proposal card. */
.diff-pick, .diff-edit, .request-player { position: relative; }
.diff-pick::after { content: ""; position: absolute; inset: -8px; }
.diff-edit::after { content: ""; position: absolute; inset: -11px -4px; }
.request-player::after { content: ""; position: absolute; inset: -11px -4px; }

@media (max-width: 720px) {
  .diff-input { font-size: 16px; }
}
.diff-row.is-choosable { grid-template-columns: 108px 1fr; }

/* ---------- Admin: settings sections, other admins, seasons, scores in bulk (2026-10-26 audit) ---------- */

.sc-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.sc-table th { padding: 6px 8px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 12.5px; font-weight: 600; text-align: left; }
.sc-table td { padding: 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.sc-table .sc-num { font-family: var(--font-score); font-size: 17px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sc-table .sc-who small { display: block; color: #8a4f00; font-size: 12px; }
.sc-table .sc-who select { width: 100%; max-width: 260px; height: 36px; border: 1px solid #e9a23b; border-radius: var(--radius-sm); background: #fffaf0; font: inherit; font-size: 14px; }
.sc-table tr.is-error td { color: var(--down); }
.sc-table .sc-delta { white-space: nowrap; text-align: right; }
#sc-preview { max-height: 46vh; overflow: auto; }
@media (max-width: 720px) {

  .sc-table .sc-who select, #sc-paste, #sc-note, #sc-delta, #admin-add-form input { font-size: 16px; }
  .sc-table th, .sc-table td { padding: 6px 4px; }
}

/* Registrations, admin: "Đăng ký hộ", correcting or deleting a whole registration, pairing people waiting for the
   organisers (2026-10-27 audit, items 15–18). */
.status-tag.is-btc { background: var(--optic-soft); color: var(--navy-deep); }
.link-btn.is-danger { color: var(--down); }
.link-btn.is-danger[data-armed="true"] { font-weight: 700; }
.reg-admin-note { margin: 14px 0 0; padding: 10px 12px; border-radius: var(--radius-sm); background: rgba(255, 255, 255, 0.1); font-size: 14px; line-height: 1.45; color: #fff; }
.pair-me { display: grid; gap: 8px; padding: 12px; border-radius: var(--radius-md); background: var(--paper); }
.pair-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.pair-option { border: 1px solid var(--line); border-radius: var(--radius-md); }
.pair-option label { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 10px 12px; cursor: pointer; }
.pair-option input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.pair-option:has(input:focus-visible) { outline: 3px solid var(--optic); outline-offset: 2px; }
.pair-option.is-picked { border-color: var(--navy); box-shadow: 0 0 0 1px var(--navy); background: #f7f9fd; }
.pair-option.is-off label { cursor: not-allowed; opacity: 0.55; }
.pair-text { display: grid; min-width: 0; }
.pair-text b { font-size: 14px; overflow-wrap: anywhere; }
.pair-text small { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.pair-sum { font-family: var(--font-score); font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pair-sum.is-over { color: var(--down); }
.pair-why { display: block; padding: 0 12px 10px; font-size: 12px; color: var(--down); }

/* Settings → Giải đấu: deadline, dates, Lão tướng age and the events, changed on the site (2026-10-27 audit, item 27). */

.appset-row { display: grid; gap: 4px; }
.appset-row .form-help { margin-left: 15px; }

.tset-kind { font-size: 13px; font-weight: 600; color: var(--muted); }
.tset-kind b { color: var(--up); }

/* ---------- The home page: the board first, with shortcuts to the club and its sponsors above the table. ---------- */
.site-nav > a, .header-more summary { white-space: nowrap; }
@media (min-width: 1021px) {
  .site-header .header-inner { gap: 20px; }
  .site-nav { gap: 30px; font-size: 15px; }
}
@media (min-width: 1021px) and (max-width: 1159px) {
  .site-header .header-inner { gap: 14px; }
  .site-nav { gap: 18px; font-size: 14px; }
}
.hm-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 14px 0; }
.hm-tile { display: grid; gap: 2px; align-content: center; padding: 12px 16px; border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--navy-deep); text-decoration: none; transition: border-color .15s, background .15s; }
.hm-tile:hover { border-color: var(--navy-deep); }
.hm-tile b { font-family: var(--font-score); font-size: clamp(20px, 2vw, 26px); font-weight: 700; line-height: 1.05; text-transform: uppercase; }
.hm-tile span { font-size: 14px; color: var(--muted); }
.hm-tile img { display: none; }

/* The phone's menu sheet: every row inside the screen on any phone. Short screens drop the second line of each row;
   the smallest, and phones held sideways, scroll inside the sheet (dock.js sets is-scroll). */
.ds-title { margin: 0 0 4px 6px; font-size: 13px; font-weight: 700; color: var(--muted); }
@media (max-width: 760px), (max-height: 500px) {
  .ds-panel { max-height: calc(100vh - 8px); max-height: calc(100dvh - max(8px, env(safe-area-inset-top))); overflow-y: auto; overscroll-behavior: contain; }
  .ds-panel.is-scroll { touch-action: pan-y; }
  .ds-grip { touch-action: none; }
  .ds-card { margin-bottom: 8px; }
  .ds-row { min-height: 0; padding-top: 7px; padding-bottom: 7px; }
  .ds-icon, .ds-icon img { width: 36px; height: 36px; }
}
@media (max-width: 760px) and (max-height: 799px) {
  .ds-panel { gap: 4px; }
  .ds-sub { display: none; }
  .ds-row { padding-top: 5px; padding-bottom: 5px; }
  .ds-icon, .ds-icon img { width: 32px; height: 32px; }
  .ds-glyph { width: 20px; height: 20px; }
  .ds-label { font-size: 15px; }
}

@media (max-width: 760px) {
  /* Phones: two tiles on photos. */
  .hm-tiles { gap: 8px; margin: 12px 0; }
  .hm-tile { position: relative; align-content: end; min-height: 104px; padding: 12px; overflow: hidden; border: 0; background: var(--navy-deep); color: #fff; isolation: isolate; }
  .hm-tile img { position: absolute; inset: 0; z-index: -2; display: block; width: 100%; height: 100%; object-fit: cover; }
  .hm-tile::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(to top, rgba(7, 22, 52, .94) 8%, rgba(7, 22, 52, .35) 72%, rgba(7, 22, 52, .15)); }
  .hm-tile b { font-size: 21px; }
  .hm-tile span { color: rgba(255, 255, 255, .9); font-size: 13px; }
}

/* Livestreamed matches on a profile: a row to swipe through, running to the edges of the panel so the next card
   shows. Each card is the wide video itself with the players over its lower part, so all cards are one size. */
.live-rail { display: flex; gap: 10px; margin: 0 calc(var(--pad-x, 0px) * -1); padding: 0 var(--pad-x, 0px) 4px; overflow-x: auto; list-style: none; scroll-snap-type: x proximity; scroll-padding-inline: var(--pad-x, 0px); scrollbar-width: none; }
.live-rail::-webkit-scrollbar { display: none; }
.live-rail > li { display: flex; flex: 0 0 min(88%, 360px); min-width: 0; scroll-snap-align: start; }
.live-rail > li:only-child { flex-basis: 100%; }
.live-card { position: relative; display: block; width: 100%; aspect-ratio: 16 / 9; overflow: hidden; color: #fff; text-decoration: none; background: var(--navy-deep); border-radius: var(--radius-md); }
.live-card::after { content: ""; position: absolute; inset: 15% 0 0; background: linear-gradient(to top, rgba(7, 22, 52, 0.97) 45%, rgba(7, 22, 52, 0)); }
.live-thumb { position: absolute; inset: 0; display: block; }
.live-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.live-play { position: absolute; left: 50%; top: 38%; display: flex; width: 38px; height: 38px; align-items: center; justify-content: center; background: rgba(7, 22, 52, 0.7); border-radius: 50%; transform: translate(-50%, -50%); }
.live-play svg { width: 20px; height: 20px; fill: currentColor; }
/* A score-only match (21/11/2026, 544): court lines and the final games in the video's place, no play button. */
.live-thumb.is-score { background: radial-gradient(120% 90% at 50% 20%, #0d2864 0%, #041841 70%); }
.live-court { position: absolute; inset: 0; width: 100%; height: 100%; fill: none; stroke: #fff; stroke-width: 1.2; opacity: 0.1; }
.live-final { position: absolute; left: 50%; top: 36%; z-index: 1; display: flex; align-items: center; gap: 12px; font: 500 40px/1 var(--font-score); font-variant-numeric: tabular-nums; color: rgba(255, 255, 255, 0.55); transform: translate(-50%, -50%); }
.live-final b { font-weight: 500; }
.live-final b.is-won { color: var(--optic); }
.live-final.is-even { color: #fff; }
.live-final i { width: 12px; height: 2px; background: rgba(255, 255, 255, 0.4); border-radius: 2px; }
.live-score-only { position: absolute; right: 8px; top: 36%; z-index: 1; display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px 2px 6px; font-size: 12px; white-space: nowrap; background: rgba(7, 22, 52, 0.8); border: 1px solid rgba(255, 255, 255, 0.16); border-radius: 999px; transform: translateY(-50%); }
.live-score-only svg { width: 13px; height: 13px; fill: none; stroke: var(--optic); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.live-top { position: absolute; left: 8px; right: 8px; top: 8px; z-index: 1; display: flex; align-items: center; gap: 6px; font-size: 12px; }
.live-score { flex: none; padding: 2px 8px; font: 500 16px/1.25 var(--font-score); font-variant-numeric: tabular-nums; white-space: nowrap; background: var(--navy-deep); border-radius: var(--radius-sm); }
.live-score.is-won { background: var(--up); }
.live-score.is-lost { background: var(--down); }
.live-stake { min-width: 0; margin-left: auto; padding: 2px 8px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: var(--navy); background: var(--optic-soft); border-radius: 999px; }
.live-top time { flex: none; margin-left: auto; padding: 1px 6px; background: rgba(7, 22, 52, 0.76); border-radius: var(--radius-sm); }
.live-stake + time { margin-left: 0; }
.live-info { position: absolute; left: 10px; right: 10px; bottom: 8px; z-index: 1; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.live-people { display: grid; grid-template-columns: 34px minmax(0, 1fr); align-items: start; font-size: 13px; }
.live-label { font-size: 12px; line-height: 22px; color: rgba(255, 255, 255, 0.78); }
.live-names { display: flex; flex-flow: row wrap; gap: 3px 10px; min-width: 0; }
.live-who { display: flex; align-items: center; gap: 5px; min-width: 0; max-width: 100%; min-height: 22px; }
.live-who-name { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.live-solo { grid-column: 1 / -1; font-size: 12px; color: rgba(255, 255, 255, 0.78); }
.live-face { flex: none; display: flex; width: 22px; height: 22px; align-items: center; justify-content: center; object-fit: cover; font-size: 11px; color: var(--navy); background: var(--line); border-radius: 50%; }
.live-rail > li.live-all { flex-basis: 92px; }
.live-all a { display: flex; flex-direction: column; width: 100%; align-items: center; justify-content: center; gap: 8px; font-size: 13px; text-align: center; color: var(--navy); text-decoration: none; }
.live-all-icon { display: flex; width: 38px; height: 38px; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 50%; background: var(--surface); }
.live-all-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
/* Friendlies in the same row (547 idea 2): the friendly's link card drawn in the picture's place (friendly.js), its badge
   "▶ 38:12" (the replay) or "Poster" under the score, clear of the names, and two chips under the title: this year's
   matches and the opponent met most. */
button.live-card { padding: 0; border: 0; font: inherit; text-align: left; cursor: pointer; }
.live-card.is-friendly { background: #1d3b2a; }
.live-card.is-friendly::after { content: none; }
.live-thumb.is-friendly canvas { display: block; width: 100%; height: 100%; }
.casual-badge { position: absolute; left: 50%; top: 68%; z-index: 1; transform: translate(-50%, -50%); display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px 3px 7px; font: 500 14px/1.2 var(--font-score); color: #fff; background: rgba(7, 22, 52, 0.82); border-radius: 999px; }
.casual-badge svg { width: 13px; height: 13px; fill: currentColor; }
.casual-badge svg:has(rect) { fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.casual-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 10px; }
.casual-chip { display: inline-flex; align-items: center; min-height: 30px; padding: 0 12px; font-size: 13.5px; color: var(--navy); background: var(--surface-muted, #eef2f7); border-radius: 999px; }
.casual-lightbox { position: fixed; inset: 0; z-index: 1000; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 56px 16px 24px; background: rgba(2, 9, 28, 0.92); }
.casual-lightbox-poster { display: block; max-width: 100%; max-height: calc(100vh - 160px); width: auto; height: auto; border-radius: 10px; background: #071634; }
.casual-lightbox-close { position: absolute; top: 10px; right: 12px; width: 44px; height: 44px; font-size: 30px; line-height: 1; color: #fff; background: none; border: 0; cursor: pointer; }
.casual-lightbox-save { min-width: 180px; min-height: 48px; padding: 0 22px; font: inherit; font-size: 16px; font-weight: 600; color: var(--navy); background: var(--optic); border: 0; border-radius: 24px; cursor: pointer; }
.casual-lightbox-save:disabled { opacity: 0.5; cursor: default; }
/* A mouse cannot swipe, so it gets arrows beside "all". */
.live-arrows { display: none; }
@media (hover: hover) and (pointer: fine) {
  .live-arrows { display: flex; gap: 4px; margin-left: auto; margin-right: 10px; }
  .live-arrows button { display: flex; width: 28px; height: 28px; padding: 0; align-items: center; justify-content: center; color: var(--navy); cursor: pointer; background: var(--surface); border: 1px solid var(--line); border-radius: 50%; }
  .live-arrows svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
  .live-arrows + .matches-source { margin-left: 0; }
}

/* ---------- Accounts (approved previews 513–516; account.js): "Đăng nhập" with Apple, Google or Zalo, the account sheet,
   and the menu's first row. A bottom sheet on phones, a centred card on wider screens. Light weights (owner). ---------- */
.ac-sheet[hidden] { display: none; }
.ac-sheet { position: fixed; z-index: 60; inset: 0; }
.ac-scrim { position: absolute; inset: 0; background: rgba(7, 22, 52, 0.4); opacity: 0; transition: opacity 220ms ease-out; }
.ac-panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 24px);
  max-height: calc(100dvh - max(24px, env(safe-area-inset-top)));
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 6px 20px calc(24px + env(safe-area-inset-bottom));
  border-radius: 24px 24px 0 0;
  background: var(--paper);
  box-shadow: 0 -10px 40px rgba(7, 22, 52, 0.18);
  color: var(--ink);
  font-family: var(--font-body);
  transform: translateY(100%);
  transition: transform 280ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
.ac-sheet.is-open .ac-scrim { opacity: 1; }
.ac-sheet.is-open .ac-panel { transform: none; }
@media (min-width: 761px) {
  .ac-panel { left: 50%; right: auto; bottom: auto; top: 50%; width: 420px; max-height: calc(100vh - 48px); padding-bottom: 28px; border-radius: 24px; transform: translate(-50%, -46%); opacity: 0; transition: transform 220ms ease-out, opacity 220ms ease-out; }
  .ac-sheet.is-open .ac-panel { transform: translate(-50%, -50%); opacity: 1; }
  .ac-grip { visibility: hidden; }
}
@media (prefers-reduced-motion: reduce) { .ac-scrim, .ac-panel { transition: none; } }
.ac-grip { display: grid; place-items: center; height: 18px; flex: none; }
.ac-grip span { width: 36px; height: 5px; border-radius: 3px; background: #c9d2df; }
.ac-x { position: absolute; top: 14px; right: 14px; display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 50%; background: #e8edf5; color: var(--navy); cursor: pointer; }
.ac-back { display: inline-flex; align-self: flex-start; align-items: center; gap: 4px; min-height: 40px; margin: 6px 0 2px -6px; padding: 0 8px 0 4px; border: 0; background: none; color: var(--navy); font: 400 16px/1 var(--font-body); cursor: pointer; }
.ac-crest { display: block; width: 64px; height: 64px; margin: 12px auto 12px; }
.ac-title { margin: 0 0 20px; text-align: center; font-size: 24px; font-weight: 500; line-height: 1.2; letter-spacing: -0.01em; outline: none; }
.ac-title.is-left { margin: 6px 0 14px; text-align: left; font-size: 22px; }
.ac-title.is-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.ac-btns { display: grid; gap: 12px; }
.ac-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 54px;
  padding: 0 20px;
  border: 0;
  border-radius: 27px;
  font: 500 17px/1.15 var(--font-body);
  letter-spacing: -0.005em;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.ac-btn .ac-logo { flex: none; width: 22px; height: 22px; }
.ac-btn.is-apple { background: #000; color: #fff; }
.ac-btn.is-apple .ac-logo { width: 21px; height: 21px; margin-top: -3px; }
.ac-btn.is-google { background: #fff; color: #1f1f1f; box-shadow: inset 0 0 0 1px #747775; }
.ac-btn.is-google.is-away { font-size: 15px; font-weight: 400; color: var(--muted); }
.ac-btn.is-zalo { background: var(--zalo); color: #fff; }
.ac-btn.is-zalo .ac-logo { width: 26px; height: 26px; border-radius: 50%; box-shadow: 0 0 0 2px #fff; }
.ac-btn:focus-visible, .ac-go:focus-visible, .ac-add:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.ac-quiet { margin: 14px 0 0; text-align: center; font-size: 15px; font-weight: 400; line-height: 1.35; color: var(--muted); }
.ac-note { margin: 10px 0 0; text-align: center; font-size: 14px; line-height: 1.4; color: var(--muted); }
.ac-privacy { align-self: center; margin-top: 10px; padding: 6px 8px; font-size: 13px; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.ac-error { margin: 0 0 14px; padding: 10px 14px; border-radius: 12px; background: var(--down-bg); color: var(--down); font-size: 15px; line-height: 1.4; text-align: center; }
.ac-error:empty { display: none; }
.ac-update { margin: 4px 0 0; padding: 14px 16px; border-radius: 16px; background: var(--optic-soft); color: var(--ink); font-size: 16px; line-height: 1.4; text-align: center; }
.ac-av { position: relative; display: inline-grid; flex: none; place-items: center; overflow: hidden; border-radius: 50%; background: #dfe6f0; color: var(--navy); font-weight: 500; line-height: 1; }
.ac-av img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ac-me { display: flex; flex-direction: column; align-items: center; gap: 10px; margin: 8px 0 18px; }
.ac-me .ac-av { box-shadow: 0 0 0 3px #fff, 0 6px 18px rgba(7, 22, 52, 0.14); }
.ac-name { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 4px 8px; border: 0; background: none; color: var(--ink); font: 400 21px/1.25 var(--font-body); cursor: pointer; }
.ac-name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ac-name .ac-ic { flex: none; color: var(--muted); }
.ac-k { margin: 0 0 6px 4px; font-size: 13px; color: var(--muted); }
.ac-card { margin: 0 0 12px; padding: 0; overflow: hidden; list-style: none; border-radius: 16px; background: var(--surface); box-shadow: 0 0 0 1px rgba(7, 22, 52, 0.05); }
.ac-card li { position: relative; }
.ac-card li + li::before { content: ""; position: absolute; top: 0; left: 56px; right: 0; height: 1px; background: var(--line); }
.ac-prov { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; align-items: center; gap: 12px; min-height: 54px; padding: 6px 12px 6px 14px; }
.ac-prov b { font-size: 16px; font-weight: 400; }
.ac-plogo { display: grid; place-items: center; width: 32px; height: 32px; overflow: hidden; border-radius: 50%; }
.ac-plogo.is-apple { background: #000; color: #fff; }
.ac-plogo.is-apple .ac-logo { width: 17px; height: 17px; margin-top: -3px; }
.ac-plogo.is-google { background: #fff; box-shadow: inset 0 0 0 1px #dadce0; }
.ac-plogo.is-google .ac-logo { width: 17px; height: 17px; }
.ac-plogo.is-zalo .ac-logo { width: 32px; height: 32px; }
.ac-ok { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--up); color: #fff; }
.ac-add { display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; border-radius: 18px; background: #eef2f8; color: var(--navy); font-size: 15px; text-decoration: none; }
.ac-go { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto 16px; align-items: center; gap: 12px; width: 100%; min-height: 54px; padding: 6px 14px; border: 0; background: none; color: var(--ink); font: 400 16px/1.25 var(--font-body); text-align: left; text-decoration: none; cursor: pointer; }
.ac-go b { font-weight: 400; }
.ac-go .ac-ic { color: var(--navy); }
.ac-go .ac-n { color: var(--muted); font-family: var(--font-score); font-size: 18px; }
.ac-go:active, .ac-tour:active { background: var(--row-hover); }
.ac-delete-link { align-self: center; margin-top: 6px; padding: 10px 14px; border: 0; background: none; color: var(--down); font: 400 15px/1 var(--font-body); cursor: pointer; }
.ac-bin { display: grid; place-items: center; width: 64px; height: 64px; margin: 14px auto 14px; border-radius: 50%; background: var(--down-bg); color: var(--down); }
.ac-line { margin: -10px 8px 22px; text-align: center; font-size: 16px; line-height: 1.45; color: var(--muted); }
.ac-red, .ac-plain, .ac-main, .ac-wide { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 54px; border: 0; border-radius: 27px; font: 500 17px/1 var(--font-body); text-decoration: none; cursor: pointer; }
.ac-red { background: var(--down); color: #fff; }
.ac-plain { margin-top: 10px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); color: var(--ink); }
.ac-main { background: var(--optic); color: var(--navy-deep); }
.ac-wide { margin-top: 4px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); color: var(--navy); font-weight: 400; }
.ac-form { display: grid; gap: 12px; }
.ac-input { width: 100%; min-height: 52px; padding: 0 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--ink); font: 400 18px/1.2 var(--font-body); }
.ac-input:focus { outline: 3px solid var(--focus); outline-offset: 1px; }
.ac-form .ac-error { margin: 0; }
.ac-tour { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; padding: 8px 14px; color: var(--ink); text-decoration: none; }
.ac-tour span:first-child { display: grid; gap: 2px; min-width: 0; }
.ac-tour b { overflow: hidden; font-size: 16px; font-weight: 400; text-overflow: ellipsis; white-space: nowrap; }
.ac-tour small { font-size: 13px; color: var(--muted); }
.ac-card.is-tours li + li::before { left: 14px; }
.ac-role { display: inline-flex; flex: none; align-items: center; height: 26px; padding: 0 10px; border-radius: 13px; background: #e8edf5; color: var(--ink); font-size: 13px; font-weight: 500; white-space: nowrap; }
.ac-role.is-head { background: var(--navy); color: #fff; }
.ac-role.is-deputy { background: var(--optic-soft); }
.ac-role.is-referee, .ac-role.is-refereeWaiting { background: #fdf1d6; color: #8a5a00; }
.ac-trio { display: inline-flex; align-items: center; gap: 6px; }
.ac-trio > i { display: grid; place-items: center; width: 24px; height: 24px; overflow: hidden; border-radius: 50%; font-style: normal; }
.ac-trio > i.is-apple { background: #000; color: #fff; }
.ac-trio > i.is-apple .ac-logo { width: 13px; height: 13px; margin-top: -2px; }
.ac-trio > i.is-google { background: #fff; box-shadow: inset 0 0 0 1px #dadce0; }
.ac-trio > i.is-google .ac-logo { width: 13px; height: 13px; }
.ac-trio > i.is-zalo .ac-logo { width: 24px; height: 24px; }
.ac-trio.is-sm > i, .ac-trio.is-sm > i.is-zalo .ac-logo { width: 20px; height: 20px; }
.ac-trio.is-sm > i.is-apple .ac-logo, .ac-trio.is-sm > i.is-google .ac-logo { width: 11px; height: 11px; }
/* The menu's first row (513a): "Đăng nhập" on navy, or the account's photo and name; the providers under it. */
.ac-dock { margin-bottom: 4px; }
.ac-dock .ac-dock-ic { background: var(--navy); color: #fff; }
.ac-dock .ds-text { gap: 6px; }
.ac-dock .ds-label { font-size: 17px; }
.ac-dock .ac-av { width: 40px !important; height: 40px !important; }

/* Quản trị → Tài khoản (approved preview 516; app.js): the accounts, one account, "Khoá tài khoản". */
.acc-search { position: relative; margin-top: 4px; }
.acc-search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.acc-search input { width: 100%; min-height: 46px; padding: 0 14px 0 44px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); font: inherit; font-size: 16px; color: var(--ink); }

/* Thùng rác (owner, 22/11/2026, 551): one row per deleted thing, its picture when it has one, "Khôi phục". */

/* ---------- Identity (owner 22/11/2026, C12): "Đăng nhập nhanh" (/admin/, Cài đặt), "Đây là tôi" on a profile, the
   account sheet's player, the admins' queue and "Gắn với VĐV". Light weights, little text (owner). ---------- */

/* /admin/: the provider buttons above the password. */
.login-quick { margin: 26px 0 2px; }
.login-quick .ac-btn { min-height: 54px; border-radius: 27px; font-size: 16px; }
.login-note { margin: 12px 0 0; padding: 10px 14px; border-radius: 12px; background: var(--optic-soft); color: var(--ink); font-size: 15px; line-height: 1.4; text-align: center; }
.login-password[hidden] { display: none; }
.login-use-password { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 44px; margin-top: 14px; border: 0; background: none; color: var(--muted); font: 400 15px/1 var(--font-body); cursor: pointer; }
.login-use-password[hidden] { display: none; }
.login-use-password svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* Cài đặt → Đăng nhập nhanh (board 570): a navy card with the providers or the account, one lime button. */

.qk-via .ac-ic { width: 14px; height: 14px; }

/* "Đây là tôi": a light pill under the profile's facts (the hero is navy). */
.me-slot:empty { display: none; }
.me-slot { margin-top: 12px; }
.me-pill { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 14px 0 10px; border: 1px solid rgba(255, 255, 255, 0.45); border-radius: 17px; background: rgba(255, 255, 255, 0.06); color: #fff; font: 400 14px/1 var(--font-body); cursor: pointer; }
.me-pill svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.me-pill.is-wait { border-color: transparent; background: rgba(255, 255, 255, 0.14); color: rgba(255, 255, 255, 0.88); }
.me-pill.is-yes { border-color: transparent; background: var(--optic); color: var(--navy-deep); cursor: default; }
.me-pill:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

/* The sheet: the account's photo → the player's. */
.me-pair { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 18px 0 16px; }
.me-pair .ac-av, .me-pair .avatar { width: 68px; height: 68px; font-size: 26px; box-shadow: 0 0 0 3px #fff, 0 6px 18px rgba(7, 22, 52, 0.14); }
.me-link { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--optic-soft); color: var(--navy); }
.me-link.is-wait { background: #fdf1d6; color: #8a5a00; }
.me-link svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.me-ask .ac-line b { color: var(--ink); font-weight: 500; }
.me-withdraw { color: var(--down); }

/* The account sheet: its board player. */
.ac-go.ac-player { grid-template-columns: 32px minmax(0, 1fr) auto 16px; }
.ac-player b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ac-pstat { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 12px; background: #fdf1d6; color: #8a5a00; font-size: 13px; white-space: nowrap; }
.ac-pstat.is-rejected { background: #eef2f8; color: var(--muted); }

/* The admins' queue ("Xác nhận VĐV", top of the Tài khoản tab). */

/* An account's page: its board player, "Gắn với VĐV", the admin it signs in as. */

.acc-admin { display: flex; align-items: center; gap: 8px; margin: 0 0 14px; color: var(--navy); font-size: 15px; }

/* ---------- "Của tôi" (559, D5; account.js): the account sheet as tiles, its pages. Light weights (owner). ---------- */
.mn-head { display: flex; align-items: center; gap: 14px; margin: 8px 0 16px; }
.mn-head > .ac-av { box-shadow: 0 0 0 3px #fff, 0 6px 18px rgba(7, 22, 52, 0.14); }
.mn-who { display: grid; justify-items: start; gap: 6px; min-width: 0; }
.mn-name { padding: 0; font-size: 20px; }
.mn-chip { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; min-height: 30px; padding: 3px 10px 3px 3px; border-radius: 15px; background: var(--optic-soft); color: var(--ink); font-size: 14px; text-decoration: none; }
.mn-chip > span:not(.ac-av) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mn-chip-ok { display: grid; flex: none; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--up); color: #fff; }
.mn-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mn-tile { position: relative; display: grid; grid-template-columns: auto 1fr; align-content: start; gap: 10px 8px; min-height: 104px; padding: 14px; border: 0; border-radius: 18px;
  background: var(--surface); box-shadow: 0 0 0 1px rgba(7, 22, 52, 0.06); color: var(--ink); font: inherit; text-align: left; text-decoration: none; cursor: pointer; }
.mn-tile:active { background: var(--row-hover); }
.mn-tile:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.mn-ic { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: #eef2f8; color: var(--navy); }
.mn-n { justify-self: end; font-family: var(--font-score); font-size: 30px; font-weight: 500; line-height: 1; color: var(--navy-deep); }
.mn-label { grid-column: 1 / -1; font-size: 16px; font-weight: 400; }
.mn-sub { grid-column: 1 / -1; display: inline-flex; align-items: center; gap: 6px; margin-top: -6px; font-size: 13px; color: var(--muted); }
.mn-sub.is-amber::before, .mn-sub.is-green::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #e0a000; }
.mn-sub.is-green::before { background: var(--up); }
.ac-role.is-playing { background: var(--optic); color: var(--navy-deep); }
.mn-reg { margin: 0 0 12px; padding: 14px; border-radius: 18px; background: var(--surface); box-shadow: 0 0 0 1px rgba(7, 22, 52, 0.06); }
.mn-reg-t { margin: 0 0 2px; font-size: 13px; color: var(--muted); }
.mn-reg h3 { margin: 0; font-size: 17px; font-weight: 500; }
.mn-reg-who { margin: 2px 0 0; font-size: 14px; color: var(--muted); }
.mn-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 12px 0 0; padding: 0; list-style: none; font-size: 12px; text-align: center; color: var(--muted); }
.mn-steps li { padding-top: 8px; border-top: 4px solid #e3e8f0; }
.mn-steps li.is-done { border-color: var(--up); color: var(--up); }
.mn-steps li.is-wait, .mn-steps li.is-now { border-color: #e0a000; color: #8a5a00; }
.mn-steps li.is-off { border-color: #e3e8f0; color: var(--down); }
.mn-pay { display: flex; align-items: center; gap: 14px; margin-top: 14px; padding: 12px; border-radius: 14px; background: var(--paper); }
.mn-qr { flex: none; width: 132px; height: 132px; border-radius: 8px; background: #fff; }
.mn-pay-text { display: grid; gap: 4px; min-width: 0; }
.mn-amount { font-family: var(--font-score); font-size: 26px; font-weight: 500; color: var(--navy-deep); }
.mn-pay-text small { font-size: 13px; line-height: 1.35; color: var(--muted); overflow-wrap: anywhere; }
.mn-save { justify-self: start; margin-top: 6px; min-height: 38px; padding: 0 16px; border: 0; border-radius: 19px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); color: var(--navy); font: 400 14px/1 var(--font-body); cursor: pointer; }
.mn-ask { margin-top: 4px; }
.mn-claim { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; padding: 10px 10px 10px 14px; border-radius: 16px; background: var(--optic-soft); color: var(--ink); font-size: 15px; }
.mn-claim > span { flex: 1; }
.mn-claim-btn { flex: none; min-height: 40px; padding: 0 14px; border: 0; border-radius: 20px; background: var(--navy-deep); color: #fff; font: 500 14px/1 var(--font-body); cursor: pointer; }
.mn-list li + li::before { left: 14px; }
.mn-row { display: flex; align-items: center; gap: 12px; min-height: 58px; padding: 8px 14px; color: var(--ink); text-decoration: none; }
.mn-row-text { display: grid; flex: 1; gap: 2px; min-width: 0; }
.mn-row-text b { overflow: hidden; font-size: 15px; font-weight: 400; text-overflow: ellipsis; white-space: nowrap; }
.mn-row-text small { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--muted); }
.mn-score { flex: none; font-family: var(--font-score); font-size: 22px; color: var(--navy-deep); }

/* ---------- Results from Baseline (576): the join form's field, the toast's "Hoàn tác", the application's link ---------- */

.ox-join-row { display: flex; align-items: center; gap: 8px; }
.ox-join-row input { flex: 1; min-width: 0; }
.ox-join-row .ox-chip { flex: none; min-height: 44px; padding: 0 12px; border-radius: var(--radius-md); }
.ox-join-found { display: flex; flex: 1; align-items: center; gap: 8px; min-height: 44px; padding: 0 4px 0 12px; border-radius: var(--radius-md); background: #e8f6ee; }
.ox-join-found[hidden] { display: none; }
.ox-join-found b { font-weight: 500; }
.ox-join-found small { color: var(--muted); }
.ox-ok { display: grid; flex: none; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: #1f9d55; color: #fff; }
.ox-ok svg { width: 14px; height: 14px; }
.ox-clear { display: grid; place-items: center; width: 44px; height: 44px; margin-left: auto; padding: 0; border: 0; background: none; color: var(--muted); cursor: pointer; }
.ox-clear svg { width: 16px; height: 16px; }
.ox-join-state.is-error { color: var(--down); }
.ox-join .ox-where { align-self: flex-start; min-height: 44px; }
.member-card-link { display: flex; align-items: center; gap: 8px; margin: 6px 0 0; font-size: 14px; overflow-wrap: anywhere; }
.toast.has-action { display: flex; align-items: center; gap: 14px; width: max-content; padding: 4px 6px 4px 18px; white-space: nowrap; pointer-events: auto; }
.toast-act { min-height: 44px; padding: 0 12px; border: 0; background: none; color: var(--optic); font: 500 14px/1 inherit; cursor: pointer; }

/* ---------- Pickleball: DUPR board ---------- */

/* A club's first season has no previous one (app.js hasPreviousSeason): no season switch, no comparison columns. */
body.no-previous-season .season-switch,
body.no-previous-season .board .c-prev,
body.no-previous-season .board .c-delta { display: none; }
/* The club tier (A+, A, B) next to the group, as Lão tướng's tag: navy on lime for A+, quieter for A and B. */
.tag-tier {
  display: inline-flex;
  align-items: center;
  margin-left: 6px;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--optic-soft);
  color: var(--navy);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.6;
  white-space: nowrap;
}
.tag-tier[data-tier="A+"] { background: var(--optic); color: var(--navy-deep); }
.tag-tier[data-tier="B"] { background: var(--row-hover); color: var(--muted); }
.player-meta .tag-tier { margin-left: 0; }
