/* ELFA games - shared look. "Back Page" (Bold restyle, 2026-10-04): the back page of a
   sports paper. Black and white, one type family (Archivo) at three widths, square corners,
   thick black rules. Club colour is the only colour, and only where a club is the subject.
   Win and loss are black fill vs outline, never green vs red.
   → docs/features/game-38-0-feel.md, "Bold restyle". */
@import url('https://fonts.googleapis.com/css2?family=Archivo:wdth,wght@62..125,100..900&display=swap');

/* ── THE TOKENS. Every colour on the game pages is one of these. Change the look here. ──
   Light is the default. Dark is opt-in: the page sets html[data-theme="dark"] when
   localStorage 'elfa-theme' is 'dark' (the same key the main app's header toggle writes). */
:root {
  --paper: #F3F2ED;        /* ground */
  --sheet: #FFFFFF;        /* cards, inputs, tables */
  --ink: #0D0D0D;          /* text, rules, filled blocks */
  --ink-2: #2E2E2C;        /* hover on a black block */
  --mute: #64635E;         /* captions (5.4:1 on paper) */
  --hair: #D8D6CE;         /* hairline rules */
  --hair-2: #E8E6DF;       /* inner rules, empty cells */
  --hover: #ECEAE3;        /* row and button hover on paper */
  --on-ink: #FFFFFF;       /* text on a black block */
  --on-ink-mute: #B9B8B2;  /* secondary text on a black block */
  --lose: #C4C2BA;         /* the weaker of two */
  --club: var(--ink);      /* the spin card; a club colour when one is known */
  --on-club: var(--on-ink);
  --scrim: rgba(13, 13, 13, .96);
  --shadow: rgba(13, 13, 13, .30);  /* a lifted card's shadow, the reel window's recess */

  --font: 'Archivo', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --ease: cubic-bezier(0.23, 1, 0.32, 1);
  --t-fast: 150ms; --t-med: 200ms; --t-slow: 250ms;

  /* Older names, kept so anything still written against them (the share-link page in
     api/play_routes.py) lands on the new look. They point at the tokens above. */
  --low: var(--paper); --surface: var(--sheet); --container: var(--hair-2); --raised: var(--sheet);
  --primary: var(--ink); --primary-dim: var(--hover);
  --main: var(--ink); --subtle: var(--ink-2); --muted: var(--mute); --border: var(--hair);
  --coral: var(--ink); --amber: var(--ink);
  --mono: var(--font); --display: var(--font); --sans: var(--font);
  color-scheme: light;
}
html[data-theme="dark"] {
  --paper: #0D0D0D;
  --sheet: #181817;
  --ink: #F3F2ED;
  --ink-2: #D8D6CE;
  --mute: #A3A19A;
  --hair: #3A3935;
  --hair-2: #262624;
  --hover: #222220;
  --on-ink: #0D0D0D;
  --on-ink-mute: #4A4944;
  --lose: #4A4944;
  --scrim: rgba(24, 24, 23, .97);
  --shadow: rgba(0, 0, 0, .70);
  color-scheme: dark;
}

/* ── ARENA EDITION (2026-10-13). The game's own look: a night game under the lights. The 38-0
   page sets html[data-theme="dark"] by default (index.html), and these deepen the dark tokens
   to an arena floor. Card tiers (Practice and live, where ratings show) and the floor are the
   game's only extra colours; club colour stays the colour of a club.
   → docs/features/game-38-0-feel.md, "Arena edition". */
html[data-theme="dark"] {
  --paper: #0B0C10;
  --sheet: #15171D;
  --hair: #2B2E37;
  --hair-2: #1E2027;
  --hover: #1E2027;
  --mute: #9A9DA8;
  --floor: #12141A;           /* the court */
  --floor-line: rgba(243, 242, 237, .16);
  --scrim: rgba(11, 12, 16, .97);
}
:root {
  /* Card tiers by rating: bronze < 78 · silver 78 · gold 85 · elite 92 · icon 99 (the cap). */
  --t-bronze: #8A5A3B; --t-bronze-on: #FBEFE6; --t-bronze-edge: #B67B55;
  --t-silver: #C3C8CF; --t-silver-on: #121418; --t-silver-edge: #E6E9ED;
  --t-gold: #E4B43C;   --t-gold-on: #1A1406;   --t-gold-edge: #FFD978;
  --t-elite: #0E0F13;  --t-elite-on: #F6E3A8;  --t-elite-edge: #E4B43C;
  --t-icon: #F4F1E8;   --t-icon-on: #0D0D0D;   --t-icon-edge: #B79CFF;
  --card-neutral: #1E2027;
  /* The scoreboard and the title band are black in both themes. */
  --arena-black: #000000; --arena-panel: #050608; --arena-panel-2: #15171C; --arena-rule: #23252C;
  --arena-text: #F3F2ED; --arena-mute: #8A8D98;
  /* A card's back (the pack, face down, while the reels spin). */
  --back: #101218; --back-edge: #2B2E37; --back-inner: #23262E; --back-mark: #3A3E49;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--font);
             font-size: 15px; line-height: 1.4; -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }

/* The wordmark. One class, so the brand can be changed in one place. Just the letters: the
   thin bar that stood before them read as an "I" (owner, 2026-10-06). */
.elfa-wordmark { font-family: var(--font); font-weight: 500; font-stretch: 62%; text-transform: uppercase;
                 letter-spacing: .01em; line-height: 1; display: inline-flex; align-items: center;
                 text-decoration: none; color: inherit; }

/* Display type: 900 at width 62, caps. Labels: 700 at width 80, 11px, tracked. */
.d { font-weight: 900; font-stretch: 62%; text-transform: uppercase; line-height: .86; letter-spacing: -.005em; }

.wrap { max-width: 980px; margin: 0 auto; padding: 20px 16px 64px; }
/* The masthead: a black bar. */
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 52px;
       padding: 0 16px; background: var(--ink); color: var(--on-ink); }
.top .lbl { color: var(--on-ink-mute); text-decoration: none; transition: color var(--t-fast) var(--ease); }
.top .lbl:hover { color: var(--on-ink); }
.brand { display: flex; align-items: center; gap: 12px; font-weight: 900; font-stretch: 62%; font-size: 30px;
         text-transform: uppercase; line-height: 1; }
.brand .tag, .brand small { font-size: 11px; font-weight: 700; font-stretch: 80%; letter-spacing: .09em;
                            text-transform: uppercase; color: var(--on-ink-mute); }
.brand .tag { color: var(--on-ink); border: 1.5px solid currentColor; padding: 3px 6px; }

.lbl { font-size: 11px; font-weight: 700; font-stretch: 80%; letter-spacing: .09em; text-transform: uppercase;
       line-height: 1.2; color: var(--mute); }
.num { font-variant-numeric: tabular-nums lining-nums; }
/* A section: a 6px rule and a condensed headline, like a newspaper section head. */
.panel { background: transparent; }
.hd { display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
      border-top: 6px solid var(--ink); padding: 10px 0 10px; }
.hd h2 { margin: 0; font-size: 30px; font-weight: 900; font-stretch: 62%; text-transform: uppercase;
         line-height: .95; color: var(--ink); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Buttons are square. Primary = a black block; the rest = an outline on a white sheet.
   Hover lifts 2px, press scales to .97. Transform and colour only. */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px;
       padding: 0 20px; border: 2px solid var(--ink); border-radius: 0; background: var(--sheet); color: var(--ink);
       font-family: var(--font); font-weight: 800; font-stretch: 75%; font-size: 14px; letter-spacing: .05em;
       text-transform: uppercase; text-decoration: none; white-space: nowrap;
       transition: transform var(--t-med) var(--ease), background-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease); }
.btn.primary { background: var(--ink); color: var(--on-ink); }
@media (hover: hover) and (pointer: fine) {
  .btn:hover:not(:disabled) { background: var(--ink); color: var(--on-ink); transform: translateY(-2px); }
  .btn.primary:hover:not(:disabled) { background: var(--ink-2); }
}
.btn:active:not(:disabled) { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: default; }

.pill { display: inline-block; border: 1.5px solid var(--ink); padding: 2px 7px; font-size: 10px; font-weight: 700;
        font-stretch: 80%; letter-spacing: .09em; text-transform: uppercase; color: var(--ink); }
.muted { color: var(--mute); }
.subtle { color: var(--ink-2); }
.accent { color: var(--ink); }
.bad { color: var(--mute); }

/* A rating chip: the number is the information. The top tier is a black block. */
.rt { display: inline-flex; align-items: center; justify-content: center; min-width: 34px; height: 24px; padding: 0 6px;
      font-weight: 900; font-stretch: 62%; font-size: 18px; font-variant-numeric: tabular-nums;
      border: 1.5px solid var(--ink); background: var(--sheet); color: var(--ink); }
.rt.elite { background: var(--ink); color: var(--on-ink); }
.rt.good { color: var(--ink); }

.fade-in { animation: fade var(--t-slow) var(--ease) both; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.flip { animation: flip .45s var(--ease) both; }
@keyframes flip { from { opacity: 0; transform: rotateX(70deg); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  .btn { transition: none; }
  .btn:hover:not(:disabled), .btn:active:not(:disabled) { transform: none; }
}
@media (max-width: 640px) { .hide-sm { display: none !important; } }

/* The hero's black band bleeds sideways (`.hero::before`, inset -100vmax) to reach the screen
   edges. Without clipping, that bleed made the page 1218px wide on a 390px phone and the whole
   game slid sideways. `clip`, not `hidden`: hidden makes body a scroll box and breaks sticky. */
html, body { overflow-x: clip; }

/* THE TOP BAR STAYS BLACK IN BOTH THEMES, like the app's. Dark mode swaps --ink to paper, which
   turned the bar light on a dark page; inside the bar the ink tokens are pinned back. */
html[data-theme="dark"] .top { --ink: #000000; --ink-2: #2E2E2C; --on-ink: #F3F2ED; --on-ink-mute: #B9B8B2; }
