/* =========================================================================
   Free Man — styles
   -------------------------------------------------------------------------
   Design intent: this should read as a football product with real
   character, not a generic SaaS dashboard reskinned green. Deep pitch
   green + crisp white cards + a warm amber accent for calls to action
   and highlights. Shapes (not just colour) distinguish teammates from
   opponents throughout, and touch targets stay generous (44px+) even
   though the visible markers are smaller — the tappable area is bigger
   than what you see, which matters a lot on a crowded mobile pitch.
   ========================================================================= */

:root {
  /* Brand palette */
  --pitch-dark: #0b3d2e;
  --pitch-mid: #0f4d3a;
  --pitch-light: #14603f;
  --ink: #10241c;
  --paper: #fbfbf5;
  --paper-dim: #f0f1e8;
  --line: #d9dccb;

  --accent: #f2a71b;       /* amber — calls to action, highlights */
  --accent-ink: #3a2600;

  --teammate: #2f6fed;     /* blue circles */
  --opponent: #d94f4f;     /* red triangles */
  --correct: #1f9d55;
  --incorrect: #d94f4f;

  /* Darker than the marker colours on purpose: these are used behind
     WHITE badge text (difficulty labels), which needs a 4.5:1 contrast
     ratio to meet WCAG AA for normal-weight small text. Checked with
     a contrast calculator: #167a42 vs white = 5.4:1, #c23f3f vs white
     = 5.2:1. --medium keeps dark ink text instead, since amber is too
     light for white text at any reasonable saturation. */
  --easy: #167a42;
  --medium: #f2a71b;
  --hard: #c23f3f;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;

  --touch-target: 44px;

  color-scheme: light;
}

* {
  box-sizing: border-box;
}

/* Make the `hidden` attribute actually hide things.
   -------------------------------------------------------------------
   The browser's default stylesheet has `[hidden] { display: none }`
   with NO !important, so ANY author rule that sets `display` on the
   same element silently wins and the element stays visible even though
   `el.hidden = true` reports true in JavaScript.
   This bit us for real: `.duel-flash { display: flex }` meant the
   between-puzzle score flash never went away, so the "+117" and its
   dark tint sat on top of the NEXT puzzle's board. The JS was correct;
   the CSS was quietly overriding it.
   This one rule makes `hidden` mean hidden everywhere, permanently,
   including for any element added later. */
[hidden] {
  display: none !important;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* -------------------------------------------------------------------
   Skip link — visually hidden until keyboard-focused
   ------------------------------------------------------------------- */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 0.75rem 1rem;
  z-index: 100;
  border-radius: 0 0 var(--radius-sm) 0;
  font-weight: 600;
}
.skip-link:focus {
  left: 0;
}

/* -------------------------------------------------------------------
   Header
   ------------------------------------------------------------------- */
.site-header {
  background: var(--pitch-dark);
  color: var(--paper);
  padding: 0.9rem 1.1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
}

.site-header__brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
}

.site-header__crest {
  font-size: 1.3rem;
}

.mode-tabs {
  display: flex;
  gap: 0.25rem;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 0.25rem;
}

.mode-tabs__btn {
  appearance: none;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.75);
  font: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  /* Padding tightens on narrow screens (see the media query below) so
     three tabs plus the wordmark still fit on a 360px phone without
     the touch target ever dropping below 44px. */
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  min-height: var(--touch-target);
  white-space: nowrap;
}

.mode-tabs__btn.is-active {
  background: var(--paper);
  color: var(--pitch-dark);
}

/* -------------------------------------------------------------------
   Layout
   ------------------------------------------------------------------- */
main {
  max-width: 640px;
  margin: 0 auto;
  padding: 1.25rem 1rem 3rem;
}

.panel {
  background: var(--paper);
}

.panel__eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--pitch-light);
  margin: 0 0 0.4rem;
}

.panel__title {
  font-size: 1.7rem;
  margin: 0 0 0.5rem;
  letter-spacing: -0.02em;
}

.panel__subtitle {
  color: #4a5147;
  margin: 0 0 1.5rem;
  font-size: 1.02rem;
}

/* -------------------------------------------------------------------
   Buttons
   ------------------------------------------------------------------- */
.btn {
  appearance: none;
  border: none;
  font: inherit;
  font-weight: 700;
  border-radius: var(--radius-md);
  padding: 0.85rem 1.4rem;
  min-height: var(--touch-target);
  cursor: pointer;
  font-size: 1rem;
  transition: transform 0.06s ease, box-shadow 0.15s ease;
}
.btn:active {
  transform: translateY(1px) scale(0.99);
}
.btn:focus-visible {
  outline: 3px solid var(--pitch-light);
  outline-offset: 2px;
}

.btn--primary {
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 3px 0 #b57e0e;
}
.btn--primary:hover {
  filter: brightness(1.04);
}

.btn--secondary {
  background: var(--paper-dim);
  color: var(--ink);
  border: 1px solid var(--line);
}

/* -------------------------------------------------------------------
   Difficulty picker
   ------------------------------------------------------------------- */
.difficulty-picker {
  margin-bottom: 1.5rem;
}

.difficulty-picker__label {
  font-weight: 700;
  margin: 0 0 0.6rem;
  font-size: 0.9rem;
}

.difficulty-picker__options {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.difficulty-btn {
  appearance: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--paper);
  border: 2px solid var(--line);
  border-radius: var(--radius-md);
  padding: 0.6rem 1rem;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  min-height: var(--touch-target);
}

.difficulty-btn.is-selected {
  border-color: var(--ink);
  background: var(--paper-dim);
}

.difficulty-btn__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}
.difficulty-btn__dot--easy { background: var(--easy); }
.difficulty-btn__dot--medium { background: var(--medium); }
.difficulty-btn__dot--hard { background: var(--hard); }

.already-played-note {
  background: var(--paper-dim);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 1rem;
  color: #4a5147;
}

/* -------------------------------------------------------------------
   Puzzle meta / badges
   ------------------------------------------------------------------- */
.puzzle-meta {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  margin-bottom: 0.9rem;
  flex-wrap: wrap;
}

.badge {
  display: inline-block;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #fff;
  flex-shrink: 0;
}
.badge--easy { background: var(--easy); }
.badge--medium { background: var(--medium); color: var(--accent-ink); }
.badge--hard { background: var(--hard); }

.puzzle-context {
  margin: 0;
  font-weight: 600;
  font-size: 1.02rem;
}

/* The context line and result headline receive PROGRAMMATIC focus
   (tabindex="-1") purely so screen readers announce them and keyboard
   users land somewhere sensible — they're not interactive, so the
   default focus ring would read as "this is a button" and mislead.
   Interactive elements keep their visible focus styles untouched. */
.puzzle-context:focus,
.result-headline:focus {
  outline: none;
}

/* -------------------------------------------------------------------
   The pitch
   ------------------------------------------------------------------- */
.pitch-wrap {
  margin-bottom: 1rem;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(11, 61, 46, 0.25);
}

.pitch-container {
  position: relative;
  width: 100%;
  /* Real pitch ratio, 105:68 */
  aspect-ratio: 105 / 68;
}

.pitch-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.pitch-svg__turf {
  fill: var(--pitch-mid);
}
.pitch-svg__stripe {
  fill: var(--pitch-light);
  opacity: 0.35;
}
.pitch-svg__line {
  stroke: rgba(255, 255, 255, 0.75);
  stroke-width: 0.35;
}
.pitch-svg__spot {
  fill: rgba(255, 255, 255, 0.75);
}
.pitch-svg__goal {
  fill: rgba(255, 255, 255, 0.9);
}

/* -------------------------------------------------------------------
   Player markers
   -------------------------------------------------------------------
   Each marker is centred on its (left, top) percentage via
   transform: translate(-50%, -50%). The button's box is the full
   touch target (44px+); the visible dot/triangle is drawn smaller
   inside it via ::before so the pitch doesn't look cluttered with
   giant circles while tap accuracy stays forgiving.
   ------------------------------------------------------------------- */
.marker {
  position: absolute;
  transform: translate(-50%, -50%);
  width: var(--touch-target);
  height: var(--touch-target);
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  padding: 0;
}

.marker--teammate,
.marker--opponent,
.marker--actor,
.marker--ball {
  pointer-events: none; /* re-enabled below for the interactive kind */
}

.marker--teammate {
  pointer-events: auto;
  cursor: pointer;
}

.marker::before {
  content: "";
  display: block;
}

/* Teammates: blue circle */
.marker--teammate::before {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--teammate);
  border: 2.5px solid #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
  transition: transform 0.1s ease;
}
.marker--teammate:hover::before,
.marker--teammate:focus-visible::before {
  transform: scale(1.15);
}
.marker--teammate:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 2px;
  border-radius: 50%;
}

/* Opponents: red triangle — shape difference matters for colour-blind
   accessibility, not just the red/blue hue difference.
   Built as two stacked clip-path triangles (a slightly larger white
   one behind, a smaller red one in front) rather than a flat red
   shape, because a flat red triangle only hits ~2.4:1 contrast
   against the pitch green — below the 3:1 WCAG non-text minimum. The
   white outline (same idea as the teammate circle's white border)
   fixes that and matches the visual language used everywhere else on
   the pitch. */
.marker--opponent {
  position: absolute;
}
.marker--opponent::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 26px;
  height: 23px;
  clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
  background: #fff;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.35));
}
.marker--opponent::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -42%);
  width: 19px;
  height: 16px;
  clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
  background: var(--opponent);
}

/* The actor (player on the ball): a hollow ring so it reads as
   "the origin of the pass", distinct from both teammates and
   opponents. */
.marker--actor::before {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: transparent;
  border: 3px solid #fff;
  box-shadow: 0 0 0 3px var(--accent), 0 2px 6px rgba(0, 0, 0, 0.35);
}

/* Ball: small white dot */
.marker--ball::before {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

/* Once the board is locked (answer given), dim everything that isn't
   part of the feedback so the ✓/✕ markers carry the story. Opacity
   stays fairly high — the explanation text refers to these players,
   so they must remain readable, just visually secondary. */
.pitch-container.is-locked .marker--teammate:not(.marker--correct):not(.marker--incorrect),
.pitch-container.is-locked .marker--opponent {
  opacity: 0.55;
}
.pitch-container.is-locked .marker--teammate {
  cursor: default;
}

/* Answer feedback states */
.marker--teammate.marker--correct::before {
  background: var(--correct);
  box-shadow: 0 0 0 4px rgba(31, 157, 85, 0.35), 0 2px 6px rgba(0, 0, 0, 0.35);
}
.marker--teammate.marker--incorrect::before {
  background: var(--incorrect);
  box-shadow: 0 0 0 4px rgba(217, 79, 79, 0.35), 0 2px 6px rgba(0, 0, 0, 0.35);
}
/* Text glyphs on top of the feedback markers so the result never
   depends on colour alone. */
.marker--correct::after,
.marker--incorrect::after {
  content: "✓";
  position: absolute;
  color: #fff;
  font-weight: 900;
  font-size: 13px;
  pointer-events: none;
}
.marker--incorrect::after {
  content: "✕";
}

.puzzle-instructions {
  color: #4a5147;
  font-size: 0.92rem;
  margin: 0;
}

/* -------------------------------------------------------------------
   Result panel
   ------------------------------------------------------------------- */
.result-headline {
  font-size: 1.35rem;
  font-weight: 800;
  margin: 0 0 0.6rem;
}
.result-headline.is-correct { color: var(--correct); }
.result-headline.is-incorrect { color: var(--incorrect); }

.result-explanation {
  font-size: 1.02rem;
  margin: 0 0 1.4rem;
  color: var(--ink);
  background: var(--paper-dim);
  border-left: 4px solid var(--accent);
  padding: 0.9rem 1rem;
  border-radius: var(--radius-sm);
}

.result-actions {
  display: flex;
  gap: 0.7rem;
  flex-wrap: wrap;
  margin-bottom: 0.8rem;
}

.share-confirm {
  color: var(--correct);
  font-weight: 600;
  font-size: 0.9rem;
  margin: 0 0 1.2rem;
}

/* Copy-to-clipboard failed: the share text is shown inline for manual
   copying, so it needs to look like content, not a success message. */
.share-confirm--failed {
  color: var(--ink);
  font-weight: 400;
  background: var(--paper-dim);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.7rem 0.9rem;
  white-space: pre-wrap;
  user-select: all; /* one tap selects the whole text on most browsers */
}

/* Space between the still-visible pitch panel and the result panel
   that now appears beneath it. */
#puzzle-panel:not([hidden]) + #result-panel:not([hidden]) {
  margin-top: 1.5rem;
  border-top: 1px solid var(--line);
  padding-top: 1.25rem;
}

.stats-summary {
  border-top: 1px solid var(--line);
  padding-top: 1rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin: 0;
}
.stats-grid__item {
  text-align: center;
  background: var(--paper-dim);
  border-radius: var(--radius-sm);
  padding: 0.7rem 0.4rem;
}
.stats-grid__item dt {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6b7264;
  margin: 0 0 0.2rem;
}
.stats-grid__item dd {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
}

/* =========================================================================
   DUEL MODE
   -------------------------------------------------------------------------
   The only timed part of the product. Visually it runs hotter than the
   daily puzzle on purpose — the daily is meant to feel calm and
   contemplative, a duel is meant to feel like a contest.
   ========================================================================= */

.duel-challenge-banner {
  background: var(--pitch-dark);
  color: var(--paper);
  padding: 0.9rem 1.1rem;
  border-radius: var(--radius-md);
  font-weight: 700;
  margin: 0 0 1rem;
}

.duel-link-error {
  background: #fdecec;
  border: 1px solid #f0c2c2;
  color: #7a2020;
  padding: 0.9rem 1rem;
  border-radius: var(--radius-md);
  margin: 0 0 1rem;
  font-size: 0.95rem;
}

.duel-name {
  display: block;
  margin-bottom: 1.25rem;
}

.duel-name__label {
  display: block;
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 0.4rem;
}

.duel-name__input {
  width: 100%;
  font: inherit;
  padding: 0.75rem 0.9rem;
  min-height: var(--touch-target);
  border: 2px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--paper);
  color: var(--ink);
}
.duel-name__input:focus-visible {
  outline: 3px solid var(--pitch-light);
  outline-offset: 1px;
  border-color: var(--pitch-light);
}

.duel-record {
  margin: 1.25rem 0 0;
  font-weight: 700;
  color: var(--pitch-light);
}

/* --- HUD (progress, score, clock) ---------------------------------- */
.duel-hud {
  margin-bottom: 0.9rem;
}

.duel-hud__row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.duel-hud__progress {
  font-weight: 700;
  font-size: 0.95rem;
}

.duel-hud__score {
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--pitch-light);
  font-variant-numeric: tabular-nums;
}

.duel-timer {
  height: 10px;
  background: var(--paper-dim);
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
}

.duel-timer__bar {
  height: 100%;
  width: 100%;
  background: var(--pitch-light);
  /* No CSS transition on width: the bar is repainted every frame from
     the real elapsed time, so a transition would make it lag behind
     the actual clock and misrepresent how long is left. */
}

.duel-timer__bar.is-urgent {
  background: var(--hard);
}

.duel-timer__text {
  margin: 0.35rem 0 0;
  text-align: right;
  font-weight: 700;
  font-size: 0.85rem;
  color: #6b7264;
  font-variant-numeric: tabular-nums;
}

/* --- Between-puzzle score flash ------------------------------------ */
.pitch-wrap--duel {
  position: relative;
}

.duel-flash {
  position: absolute;
  inset: 0;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(2rem, 12vw, 3.5rem);
  font-weight: 900;
  letter-spacing: -0.02em;
  color: #fff;
  text-shadow: 0 3px 12px rgba(0, 0, 0, 0.55);
  pointer-events: none;
  /* Deliberately translucent rather than opaque: the board underneath
     stays readable, so the ✓ on the correct player is visible at the
     same moment as the score. That glimpse is the only teaching a
     player gets mid-duel. */
  background: rgba(11, 61, 46, 0.35);
}

.duel-flash.is-correct { color: #b6f2ce; }
.duel-flash.is-incorrect { color: #ffd4d4; }

.duel-result-score {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 0 1.2rem;
  color: var(--pitch-light);
}

/* --- Head-to-head table -------------------------------------------- */
.h2h {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.4rem;
  font-variant-numeric: tabular-nums;
}

.h2h caption {
  text-align: left;
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
  color: #4a5147;
}

.h2h th,
.h2h td {
  padding: 0.5rem 0.4rem;
  text-align: center;
  border-bottom: 1px solid var(--line);
}

.h2h thead th {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6b7264;
}

.h2h tbody th {
  color: #6b7264;
  font-weight: 700;
}

.h2h tfoot th,
.h2h tfoot td {
  font-weight: 800;
  border-bottom: none;
  border-top: 2px solid var(--ink);
  padding-top: 0.6rem;
}

/* Won/lost rows carry a tint AND an arrow glyph (rendered in the
   markup) so the outcome never depends on colour alone. */
.h2h__row--won { background: rgba(31, 157, 85, 0.09); }
.h2h__row--lost { background: rgba(194, 63, 63, 0.09); }

/* --- End-of-duel explanation review -------------------------------- */
.duel-review__heading {
  font-size: 1.05rem;
  margin: 1.5rem 0 0.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
}

.duel-review__list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.9rem;
}

.duel-review__item {
  background: var(--paper-dim);
  border-radius: var(--radius-md);
  padding: 0.9rem 1rem;
}

.duel-review__verdict {
  margin: 0 0 0.35rem;
  font-weight: 800;
  font-size: 0.9rem;
}
.duel-review__verdict.is-correct { color: var(--easy); }
.duel-review__verdict.is-incorrect { color: var(--hard); }

.duel-review__context {
  margin: 0 0 0.35rem;
  font-weight: 700;
  font-size: 0.95rem;
}

.duel-review__explanation {
  margin: 0;
  font-size: 0.95rem;
  color: #3f463d;
}

/* Screen-reader-only text (used for the win/loss column, which is an
   arrow glyph visually). */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* -------------------------------------------------------------------
   Footer
   ------------------------------------------------------------------- */
.site-footer {
  text-align: center;
  padding: 1.5rem 1rem 2.5rem;
  color: #6b7264;
  font-size: 0.82rem;
}
.site-footer a {
  color: var(--pitch-light);
}

/* -------------------------------------------------------------------
   Larger screens
   ------------------------------------------------------------------- */
@media (min-width: 640px) {
  .panel__title {
    font-size: 2rem;
  }
  main {
    padding-top: 2rem;
  }
  .mode-tabs__btn {
    padding: 0.5rem 0.95rem;
  }
}

/* -------------------------------------------------------------------
   Narrow phones — three tabs plus the wordmark is the tightest thing
   in the layout, so shed non-essential width here rather than let the
   tabs wrap or shrink their tap targets.
   ------------------------------------------------------------------- */
@media (max-width: 420px) {
  .site-header {
    padding: 0.75rem 0.7rem;
    gap: 0.5rem;
  }
  .site-header__name {
    /* The crest still identifies the product; the wordmark is the
       first thing that can go when space is genuinely short. */
    display: none;
  }
  .mode-tabs__btn {
    padding: 0.5rem 0.65rem;
    font-size: 0.85rem;
  }
}

/* -------------------------------------------------------------------
   Reduced motion
   ------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}

/* =========================================================================
   DAILY LEADERBOARD
   ========================================================================= */

.daily-rank {
  font-size: 1.05rem;
  margin: 0 0 1.2rem;
  color: var(--ink);
}
.daily-rank strong {
  font-size: 1.3rem;
  color: var(--pitch-light);
}

.board-wrap { margin-top: 1.5rem; }

.board__heading {
  font-size: 1.05rem;
  margin: 1.5rem 0 0.6rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
}
.board-wrap > .board__heading:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.board {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}
.board th,
.board td {
  padding: 0.5rem 0.4rem;
  text-align: right;
  border-bottom: 1px solid var(--line);
  font-size: 0.95rem;
}
.board th:first-child,
.board td:first-child,
.board__name {
  text-align: left;
}
.board thead th {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6b7264;
}
/* Names come from a public database, so cap the width and clip rather
   than letting a long entry wreck the table on mobile. */
.board__name {
  max-width: 11rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.board-loading {
  color: #6b7264;
  font-style: italic;
  margin: 0;
}

/* Explains WHY a board is empty, instead of showing a blank table. */
.board-note {
  background: var(--paper-dim);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 1rem 1.1rem;
  margin-bottom: 1rem;
}
.board-note--warn {
  background: #fdf4e6;
  border-color: #f0dcb8;
}
.board-note__title {
  font-weight: 800;
  margin: 0 0 0.35rem;
}
.board-note p:last-child { margin: 0; font-size: 0.95rem; color: #4a5147; }

/* First-time explainer on the daily intro. Replaces the name field that
   used to sit here — asking for a name before someone has seen the game
   made the front door read as a signup form. */
.how-it-works {
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem;
  display: grid;
  gap: 0.6rem;
}
.how-it-works li {
  position: relative;
  padding-left: 1.6rem;
  color: #4a5147;
  font-size: 0.98rem;
}
.how-it-works li::before {
  content: "\25B8";
  position: absolute;
  left: 0.35rem;
  color: var(--accent);
  font-weight: 900;
}

/* Name prompt on the RESULT screen, where the player already has a
   score worth putting on a board. */
.name-prompt {
  background: var(--paper-dim);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 1rem 1.1rem;
  margin-bottom: 1.2rem;
}
.name-prompt .duel-name { margin-bottom: 0.8rem; }

/* =========================================================================
   OFFSIDE
   -------------------------------------------------------------------------
   The offside line is drawn during play, not just on the reveal. A real
   player can see where the last defender is, so hiding it would turn an
   offside decoy into an unfair gotcha instead of a readable decision.
   ========================================================================= */
.offside-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 0;
  border-left: 2px dashed rgba(255, 255, 255, 0.55);
  pointer-events: none;
  z-index: 1;
}

/* Offside players are dimmed and get a slash through them, so the status
   is readable without colour — and their aria-label says "(offside)"
   outright for screen-reader users. They stay clickable on purpose:
   picking one and learning why it was wrong IS the lesson. */
.marker--offside::before {
  opacity: 0.45;
}
.marker--offside::after {
  content: "";
  position: absolute;
  width: 26px;
  height: 2px;
  background: #fff;
  transform: rotate(-45deg);
  box-shadow: 0 0 3px rgba(0, 0, 0, 0.6);
  pointer-events: none;
}
/* Once the board is locked the feedback glyphs take over, so drop the
   slash to avoid two marks fighting on the same circle. */
.pitch-container.is-locked .marker--offside.marker--correct::after,
.pitch-container.is-locked .marker--offside.marker--incorrect::after {
  width: auto;
  height: auto;
  background: none;
  transform: none;
  box-shadow: none;
}

/* =========================================================================
   ACCOUNTS
   -------------------------------------------------------------------------
   The sign-in and username panel only ever appears on the RESULT screen,
   never before play. Kept visually quiet on purpose: it's an offer, not a
   gate, and the score above it is the thing that earned attention.
   ========================================================================= */
.name-prompt__lead {
  margin: 0 0 0.7rem;
  font-weight: 600;
}

.name-prompt__note {
  margin: 0.6rem 0 0;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--text-muted, #4a5a52);
}

.name-prompt__note a {
  color: inherit;
}

/* Status messages carry meaning, so they never rely on colour alone —
   each is a full sentence, and the error state adds a border as well as
   a hue. */
.account-message {
  margin: 0.8rem 0 0;
  padding: 0.6rem 0.75rem;
  border-radius: 8px;
  font-size: 0.9rem;
  line-height: 1.5;
  border-left: 4px solid transparent;
}

.account-message.is-ok {
  background: #eef5f1;
  border-left-color: #167a42;
  color: #14432c;
}

.account-message.is-error {
  background: #fdeeee;
  border-left-color: #c23f3f;
  color: #6d1f1f;
}

/* A button that has to look like a link, because "sign out" belongs in
   the footer next to Privacy rather than as a competing call to action. */
.link-btn {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: inherit;
  text-decoration: underline;
  cursor: pointer;
}

/* =========================================================================
   ARCHIVE
   -------------------------------------------------------------------------
   A list of past dailies. Deliberately dense: someone scanning for the day
   they missed wants to see a lot of rows at once, not a card each.
   ========================================================================= */
.archive-list__items {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
}

.archive-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0.2rem;
  border-bottom: 1px solid rgba(11, 61, 46, 0.12);
}

.archive-row:last-child {
  border-bottom: none;
}

.archive-row__label {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.archive-row__day {
  font-weight: 700;
}

.archive-row__date,
.archive-row__detail {
  font-size: 0.82rem;
  color: var(--text-muted, #4a5a52);
}

/* Pushed right, and the score sits above the detail so the eye can run
   down the column of scores without reading the rest. */
.archive-row__result {
  margin-left: auto;
  text-align: right;
  display: flex;
  flex-direction: column;
}

.archive-row__score {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.archive-row__btn {
  flex: 0 0 auto;
  padding: 0.45rem 0.8rem;
  font-size: 0.85rem;
}

/* =========================================================================
   PRO
   -------------------------------------------------------------------------
   Locked archive rows stay fully visible — day number, date, everything —
   so the size of what Pro unlocks is seen, not described. Only the play
   action is replaced. Dimming carries the state for colour-blind users
   alongside the lock glyph, and the row is never colour-only.
   ========================================================================= */
.archive-row--locked .archive-row__label,
.archive-row--locked .archive-row__result {
  opacity: 0.55;
}

.pro-price {
  font-size: 1.3rem;
  font-weight: 700;
  margin: 0.4rem 0 0.8rem;
}
