/* ============================================================
   Beyond the Desk
   Editorial register, not dashboard: one deliberate accent color
   (deep green) instead of a scattered palette, oversized confident
   Syne headlines, tiny tracked-out uppercase labels for nav/meta
   (the Khoi/Kai reference language), minimal chrome, generous
   whitespace. Data widgets (leaderboard, stats) still have to be
   legible and functional - they borrow the same restraint rather
   than reverting to boxed dashboard cards.
   ============================================================ */

:root {
  --g900: #001810;
  --g800: #002d1c;
  --g700: #005031;
  --g600: #006640;
  --g500: #008050;
  --g400: #00a362;
  --g100: #d4f0e3;
  --g50:  #edf9f3;

  --bg:     #f7f6f3;
  --surface:#ffffff;
  --ink:    #17190f;
  --ink-lt: #52564a;
  --muted:  #8a8d82;
  --border: #e2e2df;

  --red: #a8402f;
  --silver: #5b6b95;
  --bronze: #b6693a;

  --fd: 'Syne', system-ui, sans-serif;
  --fb: 'DM Sans', system-ui, sans-serif;
  --fm: 'DM Mono', monospace;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --tracked: 0.14em;
}

* , *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-font-smoothing: antialiased; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--fb);
  font-size: 15px;
  line-height: 1.55;
}
button, select, input { font: inherit; color: inherit; }
img.emoji { height: 1em; width: 1em; vertical-align: -0.1em; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.wrap { max-width: 840px; margin: 0 auto; padding: 0 24px 110px; }

/* ── ANNOUNCEMENT STRIP ── */
.strip {
  background: var(--g700); color: rgba(255,255,255,0.92);
  text-align: center; padding: 9px 16px;
  font-family: var(--fb); font-size: 10.5px; font-weight: 600;
  text-transform: uppercase; letter-spacing: var(--tracked);
}
.strip a { color: #fff; text-decoration: underline; text-underline-offset: 2px; }
.strip a:hover { opacity: .85; }

/* ── NAV ── */
.nav { background: var(--surface); border-bottom: 1px solid var(--border); }
.nav-inner {
  max-width: 840px; margin: 0 auto; padding: 20px 24px;
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; row-gap: 10px;
}
.nav-mark { font-family: var(--fd); font-weight: 700; font-size: 16px; letter-spacing: 0.02em; color: var(--ink); text-decoration: none; }
.nav-mark .dot { color: var(--g500); }
.nav-right { display: flex; align-items: center; gap: 22px; }

.year-toggle { display: flex; gap: 16px; }
.year-link {
  background: none; border: none; cursor: pointer; padding: 2px 0;
  color: var(--muted); font-family: var(--fb); font-weight: 600; font-size: 11px;
  text-transform: uppercase; letter-spacing: var(--tracked);
  border-bottom: 1.5px solid transparent; transition: color .15s, border-color .15s;
}
.year-link.active { color: var(--ink); border-bottom-color: var(--g600); }

.profile-btn {
  background: none; border: none; cursor: pointer; color: var(--ink-lt);
  font-family: var(--fb); font-weight: 600; font-size: 11px;
  text-transform: uppercase; letter-spacing: var(--tracked); text-decoration: none;
  padding: 2px 0; border-bottom: 1.5px solid transparent; transition: color .15s, border-color .15s;
}
.profile-btn:hover { color: var(--ink); }
.profile-btn.signed-in { color: var(--g600); border-bottom-color: var(--g600); }

/* ── HERO ── */
.hero { padding: 56px 0 30px; text-align: center; }
.hero-title {
  font-family: var(--fd); font-weight: 800; font-size: clamp(22px, 7.5vw, 64px);
  line-height: 1.04; letter-spacing: -0.01em; color: var(--ink);
  overflow-wrap: break-word;
}
.hero-sub {
  color: var(--muted); font-size: 11px; margin-top: 16px;
  text-transform: uppercase; letter-spacing: var(--tracked); font-weight: 600;
}

/* ── BOTTOM TAB BAR ──
   Thin-line text tabs (Khoi/Kai nav language), not a filled pill
   bottom-app bar. */
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
  background: var(--surface); border-top: 1px solid var(--border);
  display: flex; justify-content: space-around;
  padding: 16px 4px calc(16px + env(safe-area-inset-bottom, 0px));
}
.tab-btn {
  background: none; border: none; cursor: pointer; color: var(--muted);
  font-family: var(--fb); font-weight: 600; font-size: 10.5px;
  text-transform: uppercase; letter-spacing: var(--tracked); text-decoration: none;
  padding: 4px 10px; border-bottom: 1.5px solid transparent; transition: color .15s, border-color .15s;
}
.tab-btn.active { color: var(--g700); border-bottom-color: var(--g700); }

/* ── STAT STRIP ──
   A masthead stat line, not boxed KPI cards: big numerals, tiny
   tracked caption, thin hairline dividers between them. */
.stat-row {
  display: grid; grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
  padding: 26px 0; margin: 8px 0 6px;
}
.stat-chip {
  text-align: center; cursor: pointer; border-left: 1px solid var(--border);
}
.stat-chip:first-child { border-left: none; }
.stat-num { font-family: var(--fd); font-weight: 800; font-size: 30px; letter-spacing: -0.02em; color: var(--ink); }
.stat-lbl {
  font-family: var(--fb); font-size: 10px; font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: var(--tracked); margin-top: 6px;
}
.stat-sub { font-size: 11px; color: var(--ink-lt); margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 6px; }
.stat-detail {
  grid-column: 1 / -1; background: var(--surface); border: 1px solid var(--border);
  padding: 12px 16px; font-size: 12.5px; color: var(--ink-lt); display: none; line-height: 1.8;
  margin-top: 18px; text-align: left;
}
.stat-detail.show { display: block; }

/* ── SECTION ── */
.section { padding: 44px 0 6px; }
.section:first-of-type { padding-top: 30px; }
.section-hd { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; margin-bottom: 22px; flex-wrap: wrap; }
.section-title {
  font-family: var(--fd); font-weight: 800; font-size: 13px; color: var(--ink);
  text-transform: uppercase; letter-spacing: var(--tracked);
}
.section-note { font-family: var(--fb); font-size: 10.5px; font-weight: 600; color: var(--muted); margin-top: 4px; text-transform: uppercase; letter-spacing: 0.08em; }
#boardStatus { color: var(--g600); }

.pill-select {
  background: none; border: none; border-bottom: 1.5px solid var(--border);
  padding: 2px 14px 4px 0; font-family: var(--fb); font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--ink-lt); cursor: pointer; outline: none;
}
.pill-select:focus { border-color: var(--g500); }

/* ── AVATAR ──
   Champion (rank 1) gets the brand fill; everyone else is a thin
   outline in ink - color is reserved for the win. */
.avatar {
  width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--fm); font-weight: 500; font-size: 10px;
  color: var(--ink-lt); background: none; border: 1.5px solid var(--border);
}

/* ── PODIUM ──
   Champion still carries the one brand color and the biggest scale -
   but 2nd/3rd now get their own warm tint instead of flat grey, and a
   medal floats above each avatar (repositioned via absolute + the
   column as its positioning parent, since the emoji lives later in
   the DOM inside .podium-block - CSS-only, app.js untouched). Columns
   pop in on load with a little overshoot instead of just appearing. */
.podium { display: flex; align-items: flex-start; justify-content: center; gap: 16px; padding: 6px 0 30px; text-align: center; }
.podium-col {
  display: flex; flex-direction: column; align-items: center; flex: 1; min-width: 0; max-width: 150px;
  position: relative; padding-top: 40px;
  animation: podiumPop .5s var(--ease) backwards;
}
.podium-col:nth-child(1) { animation-delay: .05s; }
.podium-col:nth-child(2) { animation-delay: .18s; }
.podium-col:nth-child(3) { animation-delay: .12s; }
@keyframes podiumPop {
  from { transform: scale(.7) translateY(10px); opacity: 0; }
  to   { transform: scale(1) translateY(0); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) { .podium-col { animation: none; } }

.podium-col .avatar {
  width: 34px; height: 34px; font-size: 11px;
  animation: avatarDance 1.8s ease-in-out .7s infinite;
}
/* Each winner dances on their own beat - different duration/delay per
   column so they move independently, not in robotic lockstep. */
.podium-col:nth-child(1) .avatar { animation-duration: 1.6s; animation-delay: .85s; }
.podium-col:nth-child(2) .avatar { animation-duration: 1.9s; animation-delay: .7s; }
.podium-col:nth-child(3) .avatar { animation-duration: 1.7s; animation-delay: 1s; }
@keyframes avatarDance {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  25%      { transform: translateY(-5px) rotate(-8deg); }
  50%      { transform: translateY(0) rotate(0deg); }
  75%      { transform: translateY(-5px) rotate(8deg); }
}
@media (prefers-reduced-motion: reduce) { .podium-col .avatar { animation: none; } }
.podium-col.p1 { order: -1; }
.podium-col.p1 .avatar { width: 44px; height: 44px; font-size: 13px; background: var(--g600); border-color: var(--g600); color: #fff; }
.podium-col.p2 .avatar { border-color: var(--silver); color: var(--silver); }
.podium-col.p3 .avatar { border-color: var(--bronze); color: var(--bronze); }

.podium-rankicon {
  position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  font-size: 26px; line-height: 1;
}
.podium-col.p1 .podium-rankicon { font-size: 34px; }

.podium-name {
  font-family: var(--fb); font-weight: 700; font-size: 12px; text-align: center; max-width: 100%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 10px; color: var(--ink);
  text-transform: uppercase; letter-spacing: 0.04em;
}
.podium-col.p1 .podium-name { font-size: 13.5px; white-space: normal; overflow: visible; text-overflow: unset; line-height: 1.25; }
.podium-score { font-family: var(--fd); font-weight: 800; font-size: 17px; color: var(--ink-lt); margin-top: 4px; white-space: nowrap; }
.podium-col.p1 .podium-score { font-size: 28px; color: var(--g600); }
.podium-col.p2 .podium-score { color: var(--silver); }
.podium-col.p3 .podium-score { color: var(--bronze); }
.podium-block { width: 30px; height: 3px; margin-top: 12px; border-radius: 2px; background: var(--border); }
.podium-col.p1 .podium-block { width: 40px; height: 4px; background: var(--g600); }
.podium-col.p2 .podium-block { background: var(--silver); }
.podium-col.p3 .podium-block { background: var(--bronze); }
.podium-empty {
  text-align: center; color: var(--muted); font-size: 12px; text-transform: uppercase;
  letter-spacing: 0.08em; padding: 30px 14px; width: 100%;
}

/* ── LEADERBOARD ROWS ──
   A horizontal bar chart: each row's fill is that department's one
   color (validated set, see DEPT_COLORS in app.js), sized to its share
   of the row's max value. */
.board { display: flex; flex-direction: column; }
.board-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0; border-bottom: 1px dotted var(--border);
}
.board-row:last-child { border-bottom: none; }
.board-rank {
  width: 20px; flex-shrink: 0;
  font-family: var(--fm); font-size: 11px; color: var(--muted);
}
.board-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; overflow: hidden; }
/* Each department keeps one color (set inline as --dept-color, see
   avatarHtml() in app.js) everywhere it shows up in a list - the
   podium avatars are untouched, since rank there is a deliberate
   green/silver/bronze signal, not identity. */
.board-row .avatar { background: var(--dept-color, var(--g600)); border: none; color: #fff; }
.board-name-wrap { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; overflow: hidden; }
.board-name {
  font-weight: 600; font-size: 13px; white-space: nowrap; color: var(--ink);
  width: 92px; overflow: hidden; text-overflow: ellipsis; flex-shrink: 0;
}
/* Real bar chart, not a leader-line: each department's own color (the
   validated 10-hue set, assigned by id - see DEPT_COLORS in app.js)
   fills a track sized to its share of the row's max value. Thin mark,
   rounded data-end, no border drawn around it (the surface-color gap
   between rows is what separates them, not a stroke). */
.board-track {
  flex: 1; min-width: 32px; height: 10px; background: var(--border);
  border-radius: 5px; overflow: hidden;
}
/* Zero-score rows fade back so the rows that actually have activity
   are what the eye lands on - a wall of identical empty grey bars and
   "0"s reads as bland/broken, not as "nothing happened here yet." */
.board-row.zero .avatar { background: none; border: 1.5px solid var(--border); color: var(--muted); }
.board-row.zero .board-name { color: var(--muted); font-weight: 500; }
.board-row.zero .board-track { background: transparent; }
.board-row.zero .board-score { color: var(--border); }
.board-fill {
  display: block; height: 100%; border-radius: 5px;
  background: var(--dept-color, var(--g600));
  transition: width .7s var(--ease);
}
.board-score {
  font-family: var(--fm); font-weight: 500; font-size: 13px; flex-shrink: 0; color: var(--ink);
  min-width: 24px; text-align: right;
}
.board-empty {
  text-align: center; color: var(--muted); font-size: 12px; text-transform: uppercase;
  letter-spacing: 0.06em; padding: 24px 14px;
}

/* ── BUTTONS ── */
.btn3d {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1.5px solid var(--g700); border-radius: 4px; cursor: pointer; text-decoration: none;
  font-family: var(--fb); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: var(--tracked);
  padding: 13px 26px; color: #fff;
  background: var(--g700); transition: background .18s, color .18s, border-color .18s;
}
.btn3d:hover { background: var(--g500); border-color: var(--g500); }
.btn3d.ghost { background: none; color: var(--ink); border-color: var(--ink); }
.btn3d.ghost:hover { background: var(--ink); color: #fff; }
.btn3d.danger { background: none; color: var(--red); border-color: var(--red); }
.btn3d.danger:hover { background: var(--red); color: #fff; }
.btn3d:disabled { opacity: .45; cursor: not-allowed; }

/* ── SCORE ENTRY ── */
.entry-card { padding: 0; }
.entry-form { display: none; gap: 18px; flex-wrap: wrap; align-items: flex-end; margin-top: 24px; }
.entry-form.show { display: flex; }
.efield { display: flex; flex-direction: column; gap: 7px; flex: 1; min-width: 110px; }
.efield label { font-family: var(--fb); font-size: 10px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
.efield select, .efield input {
  background: none; border: none; border-bottom: 1.5px solid var(--border);
  padding: 6px 0 8px; font-size: 14px; outline: none; transition: border-color .18s;
}
.efield select:focus, .efield input:focus { border-color: var(--g600); }
.efield input[type="number"] { width: 100%; }
.entry-status { font-size: 12px; margin-top: 14px; }
.entry-status.ok { color: var(--g600); }
.entry-status.err { color: var(--red); }
.entry-hint { font-family: var(--fb); font-size: 11px; color: var(--muted); margin-top: 14px; }

/* ── FOOTER ──
   One deliberate pop of a different color (indigo, not the house green)
   for this one celebratory moment - a glow effect, not a plain caption,
   per the reference (the old app's "HAVE FUN" treatment). Everywhere
   else on the site stays disciplined; this is the one wink. */
.foot {
  text-align: center; padding: 50px 0 0;
  font-family: var(--fd); font-weight: 800; font-size: clamp(20px, 5vw, 28px);
  color: #5b4fc4; text-transform: uppercase; letter-spacing: 0.06em;
  display: flex; align-items: center; justify-content: center; gap: 12px;
  animation: footGlow 2.2s ease-in-out infinite;
}
@keyframes footGlow {
  0%, 100% { text-shadow: 0 0 14px rgba(91, 79, 196, 0.45), 0 0 28px rgba(91, 79, 196, 0.25); transform: scale(1); }
  50%      { text-shadow: 0 0 26px rgba(91, 79, 196, 0.8),  0 0 46px rgba(91, 79, 196, 0.5); transform: scale(1.06); }
}
.foot img.emoji {
  height: 0.85em; width: 0.85em; filter: drop-shadow(0 0 6px rgba(91, 79, 196, 0.5));
  animation: footBounce 1.6s ease-in-out infinite;
}
.foot img.emoji:last-of-type { animation-delay: .3s; }
@keyframes footBounce {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50%      { transform: translateY(-4px) rotate(-8deg); }
}
@media (prefers-reduced-motion: reduce) {
  .foot, .foot img.emoji { animation: none; }
}
.foot-links { display: flex; justify-content: center; gap: 18px; margin-top: 12px; }
.foot-links a {
  color: var(--ink-lt); font-family: var(--fb); font-weight: 600; font-size: 10px;
  text-transform: uppercase; letter-spacing: 0.1em; text-decoration: none;
  border-bottom: 1px solid transparent; padding-bottom: 2px; transition: color .15s, border-color .15s;
}
.foot-links a:hover { color: var(--ink); border-bottom-color: var(--ink); }

/* ── COMING SOON (gallery placeholder) ── */
.photo-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 20px 0 40px; }
.photo-cell { aspect-ratio: 1; border-radius: 10px; overflow: hidden; box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
.photo-cell img { width: 100%; height: 100%; object-fit: cover; display: block; }

.soon-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin: 40px 0; }
.soon-slot {
  aspect-ratio: 1; border: 1.5px dashed var(--border); border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  color: var(--border); font-size: 22px;
}
.soon-note {
  text-align: center; color: var(--ink-lt); font-size: 13px; line-height: 1.7;
  max-width: 380px; margin: 0 auto;
}

/* ── PHOTO MARQUEE (Home) ──
   Full-bleed, continuous, seamless loop: the track holds the card set
   twice back-to-back and scrolls exactly half its own width, so the
   join is invisible. Placeholder cards until real event photos exist -
   same shape/shadow a real <img> would use, so swapping them in later
   is a content change, not a redesign. Pauses on hover so it's
   readable, not just a blur going past. */
.marquee-wrap { overflow: hidden; padding: 10px 0; margin: 6px 0 40px; }
.marquee-track {
  display: flex; gap: 14px; width: max-content;
  animation: marqueeScroll 7s linear infinite;
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
  transform: translateZ(0);
}
@media (hover: hover) {
  .marquee-wrap:hover .marquee-track { animation-play-state: paused; }
}
.marquee-card {
  width: 140px; height: 96px; flex-shrink: 0;
  animation: marqueeShake 0.5s ease-in-out infinite;
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
}
.marquee-card:nth-child(2n) { animation-delay: -0.15s; }
.marquee-card:nth-child(3n) { animation-delay: -0.3s; }
.marquee-card-inner {
  width: 100%; height: 100%; border-radius: 10px; overflow: hidden;
  box-shadow: 0 6px 16px rgba(0,0,0,0.12);
}
.marquee-card img { width: 100%; height: 100%; object-fit: cover; display: block; }
@keyframes marqueeScroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
@keyframes marqueeShake {
  0%, 100% { transform: rotate(0deg) translateY(0); }
  25% { transform: rotate(-4deg) translateY(-2px); }
  75% { transform: rotate(4deg) translateY(2px); }
}
@media (prefers-reduced-motion: reduce) { .marquee-card { animation: none; } }
@media (prefers-reduced-motion: reduce) { .marquee-track { animation: none; } }

/* ── ACTIVITY ROW (Home) ──
   The trip is the headline now, not any one activity - Games and
   Photos get equal-weight cards here rather than one of them being
   the page's hero title. */
.activity-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 28px 0; }
.activity-card {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 20px 12px; border: 1px solid var(--border); border-radius: 8px;
  text-decoration: none; color: var(--ink); transition: border-color .18s, transform .18s;
}
.activity-card:hover { border-color: var(--g500); transform: translateY(-2px); }
.activity-icon { font-size: 28px; }
.activity-label { font-family: var(--fd); font-weight: 700; font-size: 12.5px; text-align: center; }

/* ── ITINERARY (Home) ── */
.itinerary { margin-bottom: 34px; }
.itin-row {
  display: flex; gap: 14px; padding: 10px 0; border-bottom: 1px dotted var(--border);
  align-items: baseline;
}
.itin-row:last-child { border-bottom: none; }
.itin-time { font-family: var(--fm); font-size: 11.5px; color: var(--muted); width: 74px; flex-shrink: 0; }
.itin-activity { font-size: 13px; color: var(--ink); font-weight: 600; }

/* ── PAIRINGS (Leaderboard) ── */
.teams-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px; margin-bottom: 28px;
}
.team-card { border: 1.5px solid var(--border); border-radius: 10px; padding: 14px; }
.team-card-name {
  font-family: var(--fb); font-weight: 800; font-size: 11px; color: var(--g600);
  text-transform: uppercase; letter-spacing: var(--tracked); margin-bottom: 6px;
}
.team-card-deps { font-size: 12.5px; color: var(--ink); font-weight: 600; line-height: 1.5; }

.pairing-round-label {
  font-family: var(--fb); font-weight: 800; font-size: 11px; color: var(--muted);
  text-transform: uppercase; letter-spacing: var(--tracked); margin: 0 0 10px;
}
.pairing-table { margin-bottom: 24px; display: flex; flex-direction: column; gap: 10px; }
.pairing-row {
  display: grid; grid-template-columns: 56px 1fr auto 1fr;
  align-items: stretch; border: 1.5px solid var(--border); border-radius: 8px; overflow: hidden;
}
.pairing-game {
  display: flex; align-items: center; justify-content: center; text-align: center;
  font-family: var(--fb); font-weight: 800; font-size: 10.5px; color: var(--ink); padding: 6px;
}
.pairing-team {
  display: flex; align-items: center; justify-content: center; text-align: center;
  background: var(--g100); color: var(--g600); font-weight: 800; font-size: 12px;
  padding: 12px 10px; line-height: 1.3;
}
.pairing-vs {
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 11.5px; color: var(--ink); padding: 0 12px;
}

.leading-tag {
  display: inline-block; font-family: var(--fb); font-weight: 700; font-size: 10px;
  color: var(--g600); text-transform: uppercase; letter-spacing: var(--tracked);
  background: var(--g50); border: 1px solid var(--g100); border-radius: 20px;
  padding: 3px 10px; margin-bottom: 10px;
}

/* ── RECAP CARD (Home page's "last year" teaser) ── */
.recap-card {
  border: 1px solid var(--border); border-radius: 4px; padding: 30px 20px; text-align: center; margin: 34px 0;
  animation: recapIn .6s var(--ease) backwards;
}
@keyframes recapIn {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
#liveCard { animation-delay: .12s; }
@media (prefers-reduced-motion: reduce) { .recap-card { animation: none; } }
.recap-year { font-family: var(--fd); font-weight: 800; font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: var(--tracked); margin-bottom: 6px; }
.recap-sub { font-size: 12.5px; color: var(--ink-lt); margin-bottom: 20px; }
.recap-champ {
  font-family: var(--fd); font-weight: 800; font-size: 26px;
  color: var(--g600); letter-spacing: -0.01em; padding-top: 58px;
  animation: champImpact .5s ease-out 1.15s backwards;
}
/* The crown anchors to .champ-first (just the name's first letter, set
   in index.html) rather than a guessed offset, so it sits on the
   actual letter regardless of what the name is. */
.champ-first { position: relative; display: inline-block; }
/* Left edge of the letter, not centered over it - sitting on the
   vertical stroke, tilted back over the letter (the "before the M"
   look), not floating symmetrically above the whole glyph. */
.crown {
  position: absolute; top: -38px; left: -14px; font-size: 56px; line-height: 1;
  animation:
    crownDrop .85s cubic-bezier(.32, .1, .4, 1.6) .45s backwards,
    crownBounce 1.6s ease-in-out 1.3s infinite;
}
@keyframes crownDrop {
  0%   { transform: translateY(-150px) rotate(-70deg) scale(.6); opacity: 0; }
  55%  { transform: translateY(4px) rotate(-8deg) scale(1); opacity: 1; }
  70%  { transform: translateY(-10px) rotate(-22deg) scale(1.12); }
  85%  { transform: translateY(2px) rotate(-14deg) scale(.97); }
  100% { transform: translateY(0) rotate(-18deg) scale(1); }
}
@keyframes crownBounce {
  0%, 100% { transform: translateY(0) rotate(-18deg); }
  50%      { transform: translateY(-6px) rotate(-10deg); }
}
@keyframes champImpact {
  0%   { transform: scale(1); }
  30%  { transform: scale(1.08); }
  60%  { transform: scale(0.97); }
  100% { transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) { .crown, .recap-champ { animation: none; } }
.recap-score { font-family: var(--fm); font-size: 13px; color: var(--ink-lt); margin-top: 6px; }
.live-dot {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: var(--g500); margin-right: 6px; animation: livePulse 1.4s ease-in-out infinite;
}
@keyframes livePulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .live-dot { animation: none; } }

/* ── SETUP FORM (standalone page, mirrors .mfield) ── */
.setup-card { max-width: 380px; margin: 30px auto 0; }
.setup-status { font-size: 12px; color: var(--muted); margin-top: 4px; margin-bottom: 26px; text-align: center; }
.setup-status.signed-in { color: var(--g600); }

/* ── MODAL ── */
.veil { position: fixed; inset: 0; background: rgba(15,20,12,0.5); display: flex; align-items: center; justify-content: center; padding: 18px; z-index: 100; }
.veil[hidden] { display: none; }
.modal {
  background: var(--surface); border-radius: 2px; padding: 34px;
  width: 100%; max-width: 380px; max-height: 90vh; overflow: auto;
}
.modal h3 { font-family: var(--fd); font-weight: 800; font-size: 16px; margin-bottom: 8px; color: var(--ink); text-transform: uppercase; letter-spacing: 0.04em; }
.modal-sub { font-size: 12.5px; color: var(--ink-lt); margin-bottom: 26px; line-height: 1.6; }
.mfield { margin-bottom: 20px; }
.mfield label { display: block; font-family: var(--fb); font-size: 10px; font-weight: 600; color: var(--muted); margin-bottom: 7px; text-transform: uppercase; letter-spacing: 0.08em; }
.mfield input {
  width: 100%; background: none; border: none; border-bottom: 1.5px solid var(--border);
  padding: 6px 0 8px; font-size: 14px; outline: none; transition: border-color .18s;
}
.mfield input:focus { border-color: var(--g600); }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; flex-wrap: wrap; }

/* ── TOAST ── */
#toast {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: #fff; padding: 12px 22px; border-radius: 2px;
  font-family: var(--fb); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em;
  opacity: 0; pointer-events: none; transition: all .35s var(--ease); z-index: 999;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 480px) {
  .entry-form { flex-direction: column; align-items: stretch; }
  .podium { gap: 14px; }
}

@media (max-width: 400px) {
  .nav-mark { font-size: 14px; }
  .nav-right { gap: 16px; }
  .hero { padding: 44px 0 24px; }
  .stat-row { padding: 20px 0; }
  .stat-num { font-size: 24px; }
  .podium-col.p1 .podium-score { font-size: 25px; }
}
