/* ============================================================================
   FOCUS DRILLS — Design System Stylesheet
   Source: Aesthetic Starter Kit — Template 8 "Playful Gamified"
   Manifest: /design/DesignSystem.md  (Do not invent values outside these tokens)
   ----------------------------------------------------------------------------
   0. Design Tokens
   1. Reset & Base
   2. Typography
   3. Layout & Containers
   4. Components  (Button / GameCard / DifficultyPicker / HudBar / Board / Cell /
                   ResultPanel / StatTile / TopBar / Toast / Modal /
                   HowToPlayList / ProgressRing / Sparkline / Doodles)
   5. Views       (Home / Play / Progress / About)
   6. Responsive
   7. Reduced Motion
   ========================================================================== */

/* ==========================================================================
   0. DESIGN TOKENS
   ========================================================================== */
:root {
  /* --- Brand surfaces --- */
  --cream:        #FFF8E7;
  --surface:      #FFFFFF;
  --surface-sunk: #FFF1D6;

  /* --- Text (all verified >= 4.5:1 on --cream) --- */
  --ink:      #2D1B69;  /* 13.46:1 */
  --ink-soft: #6B5B95;  /*  5.58:1 */
  --ink-mute: #74669F;  /*  4.79:1 */

  /* --- Accent: pink (block use only) --- */
  --accent:       #FF6B9D;
  --accent-shade: #D94E80;
  --accent-ink:   #BE1F5C;  /*  5.60:1 on cream, 4.97:1 on accent-wash — the ONLY pink allowed on text */
  --accent-wash:  #FFE4EE;

  /* --- Secondary: teal (block use only) --- */
  --teal:       #4ECDC4;
  --teal-shade: #33B3AA;
  --teal-ink:   #0A7A70;  /*  4.92:1 */
  --teal-wash:  #D9F5F2;

  /* --- Accent: sun (block use only) --- */
  --sun:       #FFD93D;
  --sun-shade: #E8BC1A;
  --sun-ink:   #7A5C00;  /*  5.91:1 */
  --sun-wash:  #FFF0C2;

  /* --- Semantic --- */
  --leaf:       #0A7A70;
  --leaf-wash:  #D9F5F2;
  --amber-ink:  #7A5C00;
  --amber-wash: #FFF0C2;
  --berry:      #C0303F;  /*  5.31:1 */
  --berry-wash: #FFE0E3;

  /* --- Lines --- */
  --border:        rgba(45, 27, 105, .12);
  --border-strong: rgba(45, 27, 105, .22);
  --divider:       rgba(45, 27, 105, .10);

  /* --- Spacing scale (8px base) --- */
  --s-xs:  4px;
  --s-sm:  8px;
  --s-md:  16px;
  --s-lg:  24px;
  --s-xl:  32px;
  --s-2xl: 48px;
  --s-3xl: 64px;

  /* --- Radius --- */
  --r-sm:   8px;
  --r-md:   12px;
  --r-lg:   16px;
  --r-xl:   24px;
  --r-pill: 9999px;

  /* --- Shadow (solid offset — the template's signature) --- */
  --sh-raise: 0 4px 0 rgba(45, 27, 105, .14);
  --sh-soft:  0 10px 30px -12px rgba(45, 27, 105, .28);
  --sh-focus: 0 0 0 3px var(--cream), 0 0 0 6px var(--accent-ink);

  /* --- Motion --- */
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-out:    cubic-bezier(0.22, 1, 0.36, 1);
  --dur-fast: 120ms;
  --dur-base: 300ms;
  --dur-slow: 480ms;

  /* --- Type --- */
  --font-display: 'Fredoka', 'Nunito', 'Trebuchet MS', sans-serif;
  --font-body:    'Nunito', 'Trebuchet MS', -apple-system, sans-serif;

  /* --- Per-game theme (overridden by [data-theme]) --- */
  --theme:       var(--accent);
  --theme-shade: var(--accent-shade);
  --theme-ink:   var(--accent-ink);
  --theme-wash:  var(--accent-wash);
}

/* Game theme bindings — components read --theme*, never --accent* directly */
[data-theme="accent"] { --theme: var(--accent); --theme-shade: var(--accent-shade); --theme-ink: var(--accent-ink); --theme-wash: var(--accent-wash); }
[data-theme="teal"]   { --theme: var(--teal);   --theme-shade: var(--teal-shade);   --theme-ink: var(--teal-ink);   --theme-wash: var(--teal-wash); }
[data-theme="sun"]    { --theme: var(--sun);    --theme-shade: var(--sun-shade);    --theme-ink: var(--sun-ink);    --theme-wash: var(--sun-wash); }
[data-theme="ink"]    { --theme: #7E6BC4;       --theme-shade: #63509F;             --theme-ink: #4A3A85;           --theme-wash: #EDE8FA; }

/* ==========================================================================
   1. RESET & BASE
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }

* { margin: 0; padding: 0; }

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

body {
  min-height: 100dvh;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Subtle paper grain — keeps the cream from reading as flat default */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: .5;
  background-image:
    radial-gradient(circle at 12% 8%,  rgba(255, 107, 157, .10) 0, transparent 38%),
    radial-gradient(circle at 88% 12%, rgba(78, 205, 196, .10) 0, transparent 34%),
    radial-gradient(circle at 72% 92%, rgba(255, 217, 61, .13) 0, transparent 40%);
}

button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
a { color: var(--accent-ink); text-decoration-thickness: 2px; text-underline-offset: 3px; }
ul, ol { list-style: none; }
svg { display: block; }

:focus-visible {
  outline: none;
  box-shadow: var(--sh-focus);
  border-radius: var(--r-sm);
}

/* Skip link — first tab stop */
.skip-link {
  position: absolute;
  left: var(--s-md);
  top: -100px;
  z-index: 999;
  padding: var(--s-sm) var(--s-lg);
  background: var(--ink);
  color: var(--cream);
  border-radius: var(--r-pill);
  transition: top var(--dur-base) var(--ease-out);
}
.skip-link:focus { top: var(--s-md); }

.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;
}

/* ==========================================================================
   2. TYPOGRAPHY
   ========================================================================== */
.display { font-family: var(--font-display); font-weight: 600; font-size: clamp(38px, 6vw, 56px); line-height: 1.05; letter-spacing: -.02em; }
h1, .h1   { font-family: var(--font-display); font-weight: 600; font-size: clamp(30px, 4.4vw, 40px); line-height: 1.15; letter-spacing: -.015em; }
h2, .h2   { font-family: var(--font-display); font-weight: 600; font-size: 30px; line-height: 1.2; letter-spacing: -.01em; }
h3, .h3   { font-family: var(--font-display); font-weight: 500; font-size: 24px; line-height: 1.3; }
h4, .h4   { font-family: var(--font-display); font-weight: 500; font-size: 19px; line-height: 1.35; }

.lede    { font-size: 18px; font-weight: 600; line-height: 1.55; color: var(--ink-soft); }
.body    { font-size: 16px; line-height: 1.6; }
.small   { font-size: 14px; font-weight: 600; line-height: 1.5; }
.caption {
  font-size: 12px; font-weight: 700; line-height: 1.4;
  text-transform: uppercase; letter-spacing: .08em; color: var(--ink-mute);
}
.numeral {
  font-family: var(--font-display);
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum' 1;
  letter-spacing: -.01em;
}
.muted { color: var(--ink-soft); }

/* ==========================================================================
   3. LAYOUT
   ========================================================================== */
.app {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.wrap {
  width: 100%;
  max-width: 1120px;
  margin-inline: auto;
  padding-inline: var(--s-lg);
}

.view { display: none; }
.view.is-active { display: block; animation: viewIn var(--dur-slow) var(--ease-out) both; }
@keyframes viewIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

.section { margin-top: var(--s-2xl); }
.section--tight { margin-top: var(--s-xl); }

.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: var(--s-md); margin-bottom: var(--s-md); flex-wrap: wrap;
}

.stack   { display: flex; flex-direction: column; gap: var(--s-md); }
.stack-6 { display: flex; flex-direction: column; gap: var(--s-xl); }
.row     { display: flex; align-items: center; gap: var(--s-sm); flex-wrap: wrap; }

/* ==========================================================================
   4. COMPONENTS
   ========================================================================== */

/* ---- 4.1 Button ---------------------------------------------------------- */
.btn {
  --btn-bg: var(--surface);
  --btn-fg: var(--ink);
  --btn-shade: rgba(45, 27, 105, .18);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-sm);
  padding: var(--s-md) var(--s-xl);
  min-height: 48px;
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  text-align: center;
  border: 2px solid transparent;
  border-radius: var(--r-pill);
  box-shadow: 0 4px 0 var(--btn-shade);
  transition: transform var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-fast) var(--ease-out),
              filter var(--dur-fast) var(--ease-out),
              background-color var(--dur-base) var(--ease-out);
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover  { filter: brightness(1.05); transform: translateY(-1px); box-shadow: 0 5px 0 var(--btn-shade); }
.btn:active { transform: translateY(4px); box-shadow: 0 0 0 var(--btn-shade); }
.btn:focus-visible { box-shadow: var(--sh-focus), 0 4px 0 var(--btn-shade); }
.btn[disabled], .btn[aria-disabled="true"] {
  opacity: .45; cursor: not-allowed; transform: none !important;
  box-shadow: 0 4px 0 var(--btn-shade) !important; filter: none !important;
}

.btn--primary   { --btn-bg: var(--accent); --btn-shade: var(--accent-shade); }
.btn--secondary { --btn-bg: var(--teal);   --btn-shade: var(--teal-shade); }
.btn--sun       { --btn-bg: var(--sun);    --btn-shade: var(--sun-shade); }
.btn--themed    { --btn-bg: var(--theme);  --btn-shade: var(--theme-shade); }
.btn--ghost {
  --btn-bg: transparent; --btn-fg: var(--ink-soft); --btn-shade: transparent;
  border-color: var(--border-strong); box-shadow: none;
}
.btn--ghost:hover { background: rgba(45, 27, 105, .05); filter: none; transform: none; }
.btn--ghost:active { transform: translateY(2px); box-shadow: none; }
.btn--ghost:focus-visible { box-shadow: var(--sh-focus); }

.btn--sm { min-height: 36px; height: 36px; padding: 0 var(--s-md); font-size: 14px; box-shadow: 0 3px 0 var(--btn-shade); }
.btn--lg { min-height: 60px; padding: var(--s-lg) var(--s-2xl); font-size: 18px; }
.btn--block { display: flex; width: 100%; }

.btn__icon { width: 20px; height: 20px; flex: none; }

/* loading state — three-dot pulse, no spinner (less anxiety-inducing) */
.btn.is-loading { pointer-events: none; color: transparent; }
.btn.is-loading::after {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(circle 3px at 42% 50%, currentColor 99%, transparent) ,
    radial-gradient(circle 3px at 50% 50%, currentColor 99%, transparent),
    radial-gradient(circle 3px at 58% 50%, currentColor 99%, transparent);
  color: var(--ink);
  border-radius: inherit;
  animation: dotPulse 900ms var(--ease-out) infinite;
}
@keyframes dotPulse { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }

/* ---- 4.2 Icon button ---------------------------------------------------- */
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; min-width: 44px;
  border: 2px solid var(--border); border-radius: var(--r-pill);
  background: var(--surface); color: var(--ink-soft);
  box-shadow: 0 3px 0 var(--border);
  transition: transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out), background-color var(--dur-base) var(--ease-out), color var(--dur-base) var(--ease-out);
}
.icon-btn:hover { background: var(--accent-wash); color: var(--accent-ink); border-color: var(--accent); transform: translateY(-1px); }
.icon-btn:active { transform: translateY(3px); box-shadow: 0 0 0 var(--border); }
.icon-btn:focus-visible { box-shadow: var(--sh-focus); }
.icon-btn[aria-pressed="true"] { background: var(--teal-wash); border-color: var(--teal); color: var(--teal-ink); }
.icon-btn svg { width: 20px; height: 20px; }

/* ---- 4.3 TopBar --------------------------------------------------------- */
.topbar {
  position: sticky; top: 0; z-index: 60;
  background: rgba(255, 248, 231, .88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 2px solid var(--divider);
  transition: box-shadow var(--dur-base) var(--ease-out);
}
.topbar.is-scrolled { box-shadow: var(--sh-soft); }
.topbar__inner {
  display: flex; align-items: center; gap: var(--s-lg);
  min-height: 64px; padding-block: var(--s-sm);
}

.brand {
  display: inline-flex; align-items: center; gap: var(--s-sm);
  font-family: var(--font-display); font-weight: 600; font-size: 21px;
  color: var(--ink); text-decoration: none; letter-spacing: -.01em;
  flex: none;
}
.brand:hover .brand__mark { transform: rotate(-8deg) scale(1.06); }
.brand__mark {
  width: 34px; height: 34px; flex: none;
  transition: transform var(--dur-base) var(--ease-bounce);
}

.nav { display: flex; align-items: center; gap: var(--s-xs); margin-left: auto; }
.nav__link {
  padding: var(--s-sm) var(--s-md);
  border-radius: var(--r-pill);
  font-size: 15px; font-weight: 700; color: var(--ink-soft);
  text-decoration: none;
  transition: background-color var(--dur-base) var(--ease-out), color var(--dur-base) var(--ease-out);
}
.nav__link:hover { background: rgba(45, 27, 105, .06); color: var(--ink); }
.nav__link[aria-current="page"] { background: var(--ink); color: var(--cream); }

.topbar__tools { display: flex; align-items: center; gap: var(--s-sm); flex: none; }

/* today counter pill */
.today-pill {
  display: inline-flex; align-items: center; gap: var(--s-sm);
  padding: var(--s-sm) var(--s-md);
  border-radius: var(--r-pill);
  background: var(--sun-wash);
  border: 2px solid var(--sun);
  font-size: 14px; font-weight: 800; color: var(--sun-ink);
  white-space: nowrap;
}
.today-pill__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--sun-shade); }
.today-pill.is-complete { background: var(--leaf-wash); border-color: var(--teal); color: var(--leaf); }
.today-pill.is-complete .today-pill__dot { background: var(--leaf); }

/* mobile menu toggle */
.nav-toggle { display: none; }

/* ---- 4.4 Hero / Training stand ------------------------------------------ */
.hero {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: var(--s-2xl);
  align-items: center;
  padding-block: var(--s-2xl) var(--s-xl);
}
.hero__copy { max-width: 540px; }
.hero__title { margin-bottom: var(--s-md); }
.hero__title em {
  font-style: normal;
  background: var(--accent-wash);
  box-shadow: inset 0 -.34em 0 var(--accent);
  padding-inline: .08em;
  border-radius: 4px;
}
.hero__lede { color: var(--ink-soft); font-weight: 600; font-size: 18px; line-height: 1.55; margin-bottom: var(--s-lg); max-width: 460px; }
.hero__actions { display: flex; flex-direction: column; gap: var(--s-md); align-items: flex-start; }
.hero__quick { display: flex; gap: var(--s-sm); flex-wrap: wrap; }

/* the live stand — this IS the first-screen CTA */
.stand {
  position: relative;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--r-xl);
  padding: var(--s-lg);
  box-shadow: var(--sh-raise);
}
.stand__head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-sm); margin-bottom: var(--s-md); }
.stand__label { display: inline-flex; align-items: center; gap: var(--s-sm); }
.stand__live {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--accent); flex: none;
  animation: livePulse 2s var(--ease-out) infinite;
}
@keyframes livePulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .45; transform: scale(.82); } }

.stand__board {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--s-sm);
  aspect-ratio: 1;
  max-width: 340px;
  margin-inline: auto;
  padding: var(--s-md);
  background: var(--surface-sunk);
  border-radius: var(--r-lg);
}
.stand__cell {
  display: flex; align-items: center; justify-content: center;
  background: var(--surface);
  border-radius: var(--r-md);
  font-family: var(--font-display); font-weight: 500;
  font-size: clamp(13px, 2.4vw, 17px);
  color: var(--ink);
  transition: background-color var(--dur-base) var(--ease-out),
              color var(--dur-base) var(--ease-out),
              transform var(--dur-base) var(--ease-bounce);
}
.stand__cell.is-hit {
  background: var(--accent-wash);
  color: var(--accent-ink);
  transform: scale(.94);
}
.stand__foot { display: flex; align-items: center; justify-content: space-between; gap: var(--s-md); margin-top: var(--s-md); }

/* ---- 4.5 Progress strip ------------------------------------------------- */
.strip {
  display: flex; align-items: center; gap: var(--s-lg);
  padding: var(--s-md) var(--s-lg);
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-raise);
}
.strip__meta { min-width: 0; }
.strip__title { font-weight: 800; font-size: 16px; }
.strip__sub { font-size: 14px; color: var(--ink-soft); font-weight: 600; }
.strip__bar {
  flex: 1; min-width: 80px; height: 12px;
  background: var(--surface-sunk);
  border-radius: var(--r-pill);
  overflow: hidden;
}
.strip__fill {
  height: 100%; width: 0;
  background: var(--accent);
  border-radius: var(--r-pill);
  transition: width var(--dur-slow) var(--ease-out);
}

/* ---- 4.6 GameCard ------------------------------------------------------- */
.bento {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: minmax(212px, auto);
  gap: var(--s-lg);
}
.gcard {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: var(--s-lg);
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-raise);
  text-align: left;
  overflow: hidden;
  transition: transform var(--dur-base) var(--ease-bounce),
              box-shadow var(--dur-base) var(--ease-out),
              border-color var(--dur-base) var(--ease-out);
}
.gcard:hover {
  transform: translateY(-4px);
  border-color: var(--theme);
  box-shadow: 0 8px 0 var(--theme-shade);
}
.gcard:active { transform: translateY(-1px); box-shadow: 0 3px 0 var(--theme-shade); }
.gcard:focus-visible { box-shadow: var(--sh-focus), var(--sh-raise); }

.gcard__art {
  position: relative;
  display: grid;
  place-items: center;
  background: var(--theme-wash);
  border-radius: var(--r-lg);
  margin-bottom: var(--s-md);
  flex: none;
  overflow: hidden;
}
.gcard--standard .gcard__art { height: 64px; }
.gcard__art svg { width: 100%; height: 100%; }

.gcard__body { display: flex; flex-direction: column; gap: var(--s-xs); flex: 1; min-width: 0; }
.gcard__skill {
  font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em;
  color: var(--theme-ink);
}
.gcard__name { font-family: var(--font-display); font-weight: 500; font-size: 21px; line-height: 1.2; }
.gcard__desc { font-size: 14px; color: var(--ink-soft); font-weight: 600; line-height: 1.45; }

.gcard__foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--s-sm); margin-top: var(--s-md); padding-top: var(--s-md);
  border-top: 2px dashed var(--divider);
}
.gcard__best { font-size: 14px; font-weight: 700; color: var(--ink-soft); }
.gcard__best b { font-family: var(--font-display); font-size: 17px; color: var(--ink); }
.gcard__go {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 14px; font-weight: 800; color: var(--theme-ink);
}
.gcard__go svg { width: 16px; height: 16px; transition: transform var(--dur-base) var(--ease-bounce); }
.gcard:hover .gcard__go svg { transform: translateX(3px); }

/* featured card — spans 2x2: a full-width demo panel above, copy below */
.gcard--featured {
  grid-column: span 2;
  grid-row: span 2;
  flex-direction: column;
  align-items: stretch;
  gap: var(--s-lg);
  padding: var(--s-xl);
}
.gcard--featured .gcard__art {
  width: 100%;
  flex: 1;
  min-height: 170px;
  aspect-ratio: auto;
  margin-bottom: 0;
}
.gcard--featured .gcard__inner {
  display: flex;
  flex-direction: column;
  flex: none;
  min-width: 0;
}
.gcard--featured .gcard__name { font-size: 30px; }
.gcard--featured .gcard__desc { font-size: 15px; }

/* mini demo board inside the featured art panel */
.mini {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px;
  width: min(74%, 300px); aspect-ratio: 1;
}
.mini span {
  display: grid; place-items: center;
  background: var(--surface); border-radius: 8px;
  font-family: var(--font-display);
  font-size: clamp(14px, 2.2vw, 22px);
  font-weight: 500;
  color: var(--ink);
  transition: background-color var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-bounce);
}
.mini span.is-on { background: var(--accent); color: var(--ink); transform: scale(1.06); }

/* ---- 4.7 DifficultyPicker ---------------------------------------------- */
.diffs { display: flex; gap: var(--s-sm); flex-wrap: wrap; }
.diff {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-width: 100px; min-height: 68px;
  padding: var(--s-sm) var(--s-md);
  background: var(--surface);
  border: 2px solid var(--border-strong);
  border-radius: var(--r-lg);
  box-shadow: 0 3px 0 var(--border);
  transition: transform var(--dur-base) var(--ease-bounce),
              box-shadow var(--dur-base) var(--ease-out),
              border-color var(--dur-base) var(--ease-out),
              background-color var(--dur-base) var(--ease-out);
}
.diff:hover { border-color: var(--theme); transform: translateY(-2px); box-shadow: 0 5px 0 var(--border); }
.diff:active { transform: translateY(1px); box-shadow: 0 1px 0 var(--border); }
.diff:focus-visible { box-shadow: var(--sh-focus); }
.diff__label { font-family: var(--font-display); font-weight: 500; font-size: 18px; }
.diff__meta { font-size: 12px; font-weight: 700; color: var(--ink-mute); }
.diff__sessions {
  font-size: 10.5px; font-weight: 800; color: var(--ink-mute);
  letter-spacing: .04em; opacity: .82;
  margin-top: 1px;
}
.diff[aria-pressed="true"] {
  background: var(--theme);
  border-color: var(--theme-shade);
  box-shadow: 0 3px 0 var(--theme-shade);
}
.diff[aria-pressed="true"] .diff__meta { color: var(--ink); opacity: .75; }

/* ---- 4.8 HudBar --------------------------------------------------------- */
.hud {
  display: flex; align-items: center; gap: var(--s-md);
  padding: var(--s-sm) var(--s-md);
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--r-pill);
  box-shadow: var(--sh-raise);
}
.hud__group { display: flex; align-items: center; gap: var(--s-md); }
.hud__stat { display: flex; align-items: baseline; gap: 6px; }
.hud__stat dt, .hud__label { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-mute); }
.hud__value { font-family: var(--font-display); font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; }
.hud__value.is-success { color: var(--leaf); }
.hud__value.is-warn { color: var(--berry); }
.hud__spacer { flex: 1; }
.hud.is-paused .hud__value { opacity: .4; }
.hud__pause-flag {
  display: none; padding: 2px var(--s-sm);
  background: var(--amber-wash); color: var(--amber-ink);
  border-radius: var(--r-pill); font-size: 11px; font-weight: 800;
  text-transform: uppercase; letter-spacing: .08em;
}
.hud.is-paused .hud__pause-flag { display: inline-block; }

/* ---- 4.9 Board ---------------------------------------------------------- */
.board {
  position: relative;
  width: 100%;
  max-width: min(560px, 92vw);
  margin-inline: auto;
  padding: var(--s-md);
  background: var(--surface-sunk);
  border: 2px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: inset 0 3px 0 rgba(45, 27, 105, .05);
  transition: border-color var(--dur-base) var(--ease-out);
}
.board--grid  { aspect-ratio: 1; }
.board--stage { aspect-ratio: 4 / 3; }
/* Drills render into .board__stage; the pause veil lives beside it, so a drill
   clearing its own container can never wipe the overlay away. */
.board__stage { height: 100%; }
.board.is-complete { border-color: var(--theme); }

/* pause overlay on the board */
.board__veil {
  position: absolute; inset: 0; z-index: 5;
  display: none; place-items: center; gap: var(--s-md);
  flex-direction: column;
  background: rgba(255, 248, 231, .93);
  border-radius: var(--r-lg);
  text-align: center;
  padding: var(--s-lg);
}
.board.is-paused .board__veil { display: grid; }

/* ---- 4.10 Cell ---------------------------------------------------------- */
.grid-cells {
  display: grid;
  grid-template-columns: repeat(var(--n, 5), 1fr);
  gap: var(--s-sm);
  height: 100%;
}
.cell {
  display: grid; place-items: center;
  min-width: 44px; min-height: 44px;
  background: var(--surface);
  border: 2px solid transparent;
  border-radius: var(--r-md);
  font-family: var(--font-display);
  font-size: var(--cell-fs, 20px);
  font-weight: 500;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  transition: background-color var(--dur-fast) var(--ease-out),
              transform var(--dur-fast) var(--ease-out),
              border-color var(--dur-base) var(--ease-out);
  -webkit-tap-highlight-color: transparent;
}
.cell:hover { background: var(--theme-wash); transform: scale(1.03); }
.cell:focus-visible { box-shadow: var(--sh-focus); }
.cell.is-hit {
  background: var(--theme);
  color: var(--ink);
  pointer-events: none;
  transform: scale(.96);
}
.cell.is-hint { border-color: var(--sun); box-shadow: 0 0 0 3px var(--sun-wash); }
.cell.is-miss {
  background: var(--berry-wash);
  color: var(--berry);
  animation: cellShake 220ms var(--ease-out);
}
@keyframes cellShake {
  0%, 100% { transform: translateX(0); }
  25%      { transform: translateX(-4px); }
  75%      { transform: translateX(4px); }
}

/* ---- 4.11 Stage (reflex / stroop / vigilance) --------------------------- */
.stage {
  position: relative;
  display: grid;
  place-items: center;
  height: 100%;
  min-height: 180px;
  gap: var(--s-lg);
  text-align: center;
}
.stage__prompt { font-family: var(--font-display); font-size: clamp(20px, 3.6vw, 28px); font-weight: 500; }

/* stroop word */
.stroop-word {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(52px, 12vw, 96px);
  line-height: 1;
  letter-spacing: .02em;
  text-transform: uppercase;
  user-select: none;
}
.stroop-options { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s-md); width: min(420px, 88%); }
.stroop-opt {
  display: grid; place-items: center;
  min-height: 64px;
  border-radius: var(--r-lg);
  border: 3px solid var(--border-strong);
  background: var(--surface);
  font-weight: 800; font-size: 16px; color: var(--ink);
  transition: transform var(--dur-fast) var(--ease-out), border-color var(--dur-base) var(--ease-out);
}
.stroop-opt:hover { transform: translateY(-2px); border-color: var(--ink); }
.stroop-opt:active { transform: translateY(2px); }
.stroop-opt.is-right { border-color: var(--leaf); background: var(--leaf-wash); }
.stroop-opt.is-wrong { border-color: var(--berry); background: var(--berry-wash); }
.stroop-sw {
  width: 100%; height: 100%;
  border-radius: var(--r-md);
  box-shadow: 0 4px 0 rgba(45, 27, 105, .18);
}

/* reflex target */
.reflex-field { position: relative; width: 100%; height: 100%; min-height: 300px; }
.reflex-target {
  position: absolute;
  display: grid; place-items: center;
  width: 84px; height: 84px;
  border-radius: 50%;
  background: var(--theme);
  color: var(--ink);
  font-family: var(--font-display); font-weight: 600; font-size: 28px;
  border: none;
  box-shadow: 0 5px 0 var(--theme-shade);
  transform: translate(-50%, -50%);
  animation: popIn 220ms var(--ease-bounce) both;
}
.reflex-target:hover { filter: brightness(1.06); }
.reflex-target:active { transform: translate(-50%, -50%) scale(.94); }
.reflex-target.is-decoy { background: var(--ink-mute); box-shadow: 0 5px 0 #4F4373; color: var(--cream); }
@keyframes popIn { from { opacity: 0; transform: translate(-50%, -50%) scale(.5); } to { opacity: 1; transform: translate(-50%, -50%) scale(1); } }

.reflex-count {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-family: var(--font-display); font-size: 17px; color: var(--ink-soft); font-weight: 500;
}

/* memory pads */
.pads { display: grid; grid-template-columns: repeat(var(--n, 3), 1fr); gap: var(--s-md); width: min(420px, 86%); aspect-ratio: 1; }
.pad {
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 2px solid var(--border);
  transition: background-color 160ms var(--ease-out), transform 160ms var(--ease-bounce), border-color 160ms var(--ease-out);
  min-height: 44px;
}
.pad:hover { border-color: var(--theme); }
.pad.is-flash { background: var(--theme); border-color: var(--theme-shade); transform: scale(.96); }
.pad.is-input { background: var(--teal-wash); border-color: var(--teal); }
.pad.is-wrong { background: var(--berry-wash); border-color: var(--berry); }
.pad:disabled { cursor: default; }

/* vigilance stream */
.vig {
  display: grid; place-items: center; gap: var(--s-md);
}
.vig__glyph {
  display: grid; place-items: center;
  width: clamp(150px, 34vw, 210px); aspect-ratio: 1;
  border-radius: var(--r-xl);
  background: var(--surface);
  border: 3px solid var(--border);
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(64px, 15vw, 96px);
  color: var(--ink);
  transition: border-color var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}
.vig__glyph.is-pulse { border-color: var(--theme); transform: scale(1.02); }
.vig__controls { display: flex; gap: var(--s-md); }

/* ---- 4.12 ResultPanel --------------------------------------------------- */
.result {
  position: relative;
  width: min(520px, 94vw);
  margin-inline: auto;
  padding: var(--s-xl);
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-raise);
  text-align: center;
}
.result.is-entering { animation: resultIn var(--dur-slow) var(--ease-bounce) both; }
@keyframes resultIn { from { opacity: 0; transform: scale(.94) translateY(10px); } to { opacity: 1; transform: none; } }
.result__badge {
  display: inline-flex; align-items: center; gap: var(--s-sm);
  padding: var(--s-xs) var(--s-md);
  border-radius: var(--r-pill);
  background: var(--theme-wash); color: var(--theme-ink);
  font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em;
  margin-bottom: var(--s-md);
}
.result__badge svg { width: 16px; height: 16px; flex: none; }
.result__badge--pb { background: var(--sun-wash); color: var(--sun-ink); }
.result__headline { font-family: var(--font-display); font-size: 28px; font-weight: 600; line-height: 1.2; margin-bottom: var(--s-sm); }
.result__sub { color: var(--ink-soft); font-weight: 600; font-size: 15px; margin-bottom: var(--s-sm); }
.result__trail { color: var(--ink-mute); font-weight: 600; font-size: 13px; margin-bottom: var(--s-lg); font-style: italic; opacity: .85; }
.result__grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s-md); margin-bottom: var(--s-lg); text-align: left; }
.result__note {
  display: flex; gap: var(--s-sm); align-items: flex-start; text-align: left;
  padding: var(--s-md); border-radius: var(--r-lg);
  background: var(--surface-sunk); color: var(--ink-soft);
  font-size: 14px; font-weight: 600; line-height: 1.5;
  margin-bottom: var(--s-lg);
}
.result__note svg { width: 18px; height: 18px; flex: none; margin-top: 2px; }
.result__actions { display: flex; gap: var(--s-md); justify-content: center; flex-wrap: wrap; }

/* ---- 4.13 StatTile ------------------------------------------------------ */
.tile {
  display: flex; flex-direction: column; gap: var(--s-xs);
  padding: var(--s-md);
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-raise);
  min-width: 0;
}
.tile__label { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-mute); }
.tile__value { font-family: var(--font-display); font-size: clamp(24px, 3.4vw, 30px); font-weight: 600; line-height: 1.1; font-variant-numeric: tabular-nums; }
.tile__sub { font-size: 13px; font-weight: 700; color: var(--ink-soft); }
.tile--accent { background: var(--accent-wash); border-color: var(--accent); }
.tile--accent .tile__label { color: var(--accent-ink); }
.tile--teal { background: var(--teal-wash); border-color: var(--teal); }
.tile--teal .tile__label { color: var(--teal-ink); }
.tile--sun { background: var(--sun-wash); border-color: var(--sun); }
.tile--sun .tile__label { color: var(--sun-ink); }
.tile--ink { background: var(--ink); border-color: var(--ink); }
.tile--ink .tile__label { color: rgba(255, 248, 231, .72); }
.tile--ink .tile__value, .tile--ink .tile__sub { color: var(--cream); }

.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s-md); }
.tiles--3 { grid-template-columns: repeat(3, 1fr); }

/* ---- 4.14 HowToPlayList ------------------------------------------------- */
.howto { display: flex; flex-direction: column; gap: var(--s-md); }
.howto li { display: flex; gap: var(--s-md); align-items: flex-start; }
.howto__num {
  display: grid; place-items: center;
  width: 32px; height: 32px; flex: none;
  border-radius: 50%;
  background: var(--theme-wash); color: var(--theme-ink);
  font-family: var(--font-display); font-weight: 600; font-size: 15px;
}
.howto__text { font-size: 15px; font-weight: 600; color: var(--ink-soft); line-height: 1.5; padding-top: 4px; }

/* ---- 4.15 ProgressRing -------------------------------------------------- */
.ring { display: inline-grid; place-items: center; position: relative; flex: none; }
.ring svg { transform: rotate(-90deg); }
.ring__track { stroke: rgba(45, 27, 105, .10); fill: none; stroke-linecap: round; }
.ring__value {
  stroke: var(--accent); fill: none; stroke-linecap: round;
  transition: stroke-dashoffset var(--dur-slow) var(--ease-out), stroke var(--dur-base) var(--ease-out);
}
.ring.is-complete .ring__value { stroke: var(--leaf); }
.ring__label {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 600; font-size: 15px;
}

/* ---- 4.16 Sparkline ----------------------------------------------------- */
.spark { position: relative; width: 100%; height: 56px; }
.spark svg { width: 100%; height: 100%; overflow: visible; }
.spark__line { fill: none; stroke: var(--theme); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.spark__area { fill: var(--theme-wash); opacity: .7; }
.spark__dot { fill: var(--theme-shade); }
.spark--empty {
  display: grid; place-items: center;
  border: 2px dashed var(--border-strong);
  border-radius: var(--r-md);
  font-size: 13px; font-weight: 700; color: var(--ink-mute);
  text-align: center; padding: var(--s-sm);
}

/* ---- 4.17 Toast --------------------------------------------------------- */
.toasts {
  position: fixed; left: 50%; bottom: var(--s-lg);
  transform: translateX(-50%);
  z-index: 200;
  display: flex; flex-direction: column; gap: var(--s-sm); align-items: center;
  pointer-events: none;
  width: max-content; max-width: 92vw;
}
.toast {
  display: flex; align-items: center; gap: var(--s-sm);
  padding: var(--s-sm) var(--s-lg);
  background: var(--ink); color: var(--cream);
  border-radius: var(--r-pill);
  box-shadow: var(--sh-soft);
  font-size: 14px; font-weight: 700;
  animation: toastIn var(--dur-base) var(--ease-bounce) both;
}
.toast svg { width: 18px; height: 18px; flex: none; }
.toast.is-leaving { animation: toastOut 200ms var(--ease-out) both; }
@keyframes toastIn  { from { opacity: 0; transform: translateY(16px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(10px); } }

/* ---- 4.18 Modal --------------------------------------------------------- */
.modal {
  position: fixed; inset: 0; z-index: 300;
  display: grid; place-items: center;
  padding: var(--s-lg);
  background: rgba(45, 27, 105, .40);
  animation: fadeIn 200ms var(--ease-out) both;
}
.modal[hidden] { display: none; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal__panel {
  width: min(520px, 94vw);
  max-height: 88dvh; overflow-y: auto;
  padding: var(--s-xl);
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-soft);
  animation: resultIn var(--dur-base) var(--ease-bounce) both;
}
.modal__title { font-family: var(--font-display); font-size: 24px; font-weight: 600; margin-bottom: var(--s-sm); }
.modal__body { color: var(--ink-soft); font-weight: 600; font-size: 15px; line-height: 1.6; }
.modal__actions { display: flex; gap: var(--s-md); justify-content: flex-end; margin-top: var(--s-lg); flex-wrap: wrap; }

/* ---- 4.19 Doodles (hand-drawn SVG decorations) -------------------------- */
.doodle { position: absolute; pointer-events: none; color: var(--accent); }
.doodle--teal { color: var(--teal); }
.doodle--sun  { color: var(--sun-shade); }
.doodle--ink  { color: var(--ink-mute); }
.doodle--float { animation: doodleFloat 4s var(--ease-out) infinite; }
@keyframes doodleFloat { 0%, 100% { transform: translateY(0) rotate(0deg); } 50% { transform: translateY(-7px) rotate(3deg); } }

/* ---- 4.20 Panel / Card shell -------------------------------------------- */
.panel {
  padding: var(--s-xl);
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-raise);
}
.panel--flat { box-shadow: none; background: transparent; border-style: dashed; }

/* ---- 4.21 Play header --------------------------------------------------- */
.play-head { display: flex; align-items: center; gap: var(--s-md); margin-bottom: var(--s-lg); flex-wrap: wrap; }
.play-head__title { font-family: var(--font-display); font-size: clamp(22px, 3.4vw, 30px); font-weight: 600; }
.play-head__tags { display: flex; gap: var(--s-sm); align-items: center; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: var(--s-xs) var(--s-md);
  border-radius: var(--r-pill);
  background: var(--surface-sunk);
  font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em;
  color: var(--ink-mute);
  box-shadow: 0 2px 0 var(--border);
  transition: transform var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out);
}
.chip:hover { transform: translateY(-1px); box-shadow: 0 3px 0 var(--border); }
.chip:active { transform: translateY(1px); box-shadow: 0 1px 0 var(--border); }
.chip--theme { background: var(--theme-wash); color: var(--theme-ink); }

.play-layout { display: grid; grid-template-columns: 300px 1fr; gap: var(--s-xl); align-items: start; }
.play-main { display: flex; flex-direction: column; gap: var(--s-lg); min-width: 0; }
.play-side { display: flex; flex-direction: column; gap: var(--s-lg); }

.hint-line {
  display: flex; align-items: center; justify-content: center; gap: var(--s-sm);
  font-size: 14px; font-weight: 700; color: var(--ink-mute);
  text-align: center;
}
.hint-line svg { width: 16px; height: 16px; flex: none; }

/* ---- 4.22 Progress view ------------------------------------------------- */
.progress-row {
  display: grid;
  grid-template-columns: 1.4fr .8fr .8fr 1.4fr;
  gap: var(--s-md);
  align-items: center;
  padding: var(--s-md) 0;
  border-bottom: 2px dashed var(--divider);
}
.progress-row:last-child { border-bottom: 0; }
.progress-row__name { display: flex; align-items: center; gap: var(--s-md); min-width: 0; }
.progress-row__swatch { width: 40px; height: 40px; border-radius: var(--r-md); flex: none; display: grid; place-items: center; }
.progress-row__swatch svg { width: 26px; height: 26px; }
.progress-row__title { font-family: var(--font-display); font-weight: 500; font-size: 17px; }
.progress-row__skill { font-size: 12px; font-weight: 700; color: var(--ink-mute); text-transform: uppercase; letter-spacing: .06em; }
.progress-row__metric { font-family: var(--font-display); font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; }
.progress-row__metric small { display: block; font-family: var(--font-body); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-mute); }

.tabs { display: inline-flex; gap: var(--s-xs); padding: var(--s-xs); background: var(--surface-sunk); border-radius: var(--r-pill); }
.tab {
  padding: var(--s-sm) var(--s-lg);
  border-radius: var(--r-pill);
  font-size: 14px; font-weight: 800; color: var(--ink-soft);
  transition: background-color var(--dur-base) var(--ease-out), color var(--dur-base) var(--ease-out);
}
.tab:hover { color: var(--ink); transform: translateY(-1px); }
.tab[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 2px 0 var(--border); }

/* ---- 4.23 Footer -------------------------------------------------------- */
.footer {
  margin-top: auto;
  padding-block: var(--s-2xl) var(--s-xl);
  border-top: 2px solid var(--divider);
  color: var(--ink-mute);
  font-size: 13px;
  font-weight: 600;
}
.footer__inner { display: flex; justify-content: space-between; gap: var(--s-md); flex-wrap: wrap; align-items: center; }
.footer__note { display: flex; align-items: center; gap: var(--s-sm); max-width: 62ch; line-height: 1.5; }
.footer__note svg { width: 16px; height: 16px; flex: none; }
.footer__links { display: flex; gap: var(--s-md); }

/* ---- 4.24 App shell ----------------------------------------------------- */
#main {
  flex: 1;
  padding-block: var(--s-2xl) var(--s-3xl);
}
/* Focus is moved to #main on every route change so screen readers land in the
   right place. That must never paint a focus ring around the whole page. */
#main:focus,
#main:focus-visible {
  outline: none;
  box-shadow: none;
  border-radius: 0;
}

.brand__mark { color: var(--accent); }

.nav__close { display: none; }

@keyframes fadeOut { to { opacity: 0; } }

/* ---- 4.25 Setup layout -------------------------------------------------- */
.setup-grid {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: var(--s-lg);
  align-items: start;
}

/* ---- 4.26 HUD progress bar --------------------------------------------- */
.hud-bar {
  height: 12px;
  background: var(--surface-sunk);
  border: 2px solid var(--border);
  border-radius: var(--r-pill);
  overflow: hidden;
}
.hud-bar__fill {
  height: 100%;
  width: 0;
  background: var(--theme);
  border-radius: var(--r-pill);
  transition: width var(--dur-base) var(--ease-out);
}

/* ---- 4.27 Result grade -------------------------------------------------- */
.result__grade {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-md);
  margin-bottom: var(--s-lg);
}
.result__grade .stack { text-align: left; gap: 0; }
.grade {
  display: grid;
  place-items: center;
  width: 68px; height: 68px;
  flex: none;
  border-radius: 50%;
  background: var(--theme);
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 600;
  line-height: 1;
  box-shadow: 0 4px 0 var(--theme-shade);
}
/* B/C stay neutral — a grade is information, not a verdict */
.grade[data-grade="B"],
.grade[data-grade="C"] {
  background: var(--surface-sunk);
  color: var(--ink-soft);
  box-shadow: 0 4px 0 var(--border);
}
.score {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

/* ---- 4.28 Week chart ---------------------------------------------------- */
.week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: var(--s-sm);
  height: 140px;
}
.week__col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s-xs);
  height: 100%;
}
.week__bar-wrap {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: flex-end;
}
.week__bar {
  width: 100%;
  min-height: 6px;
  background: var(--accent);
  border-radius: var(--r-sm);
  transition: height var(--dur-slow) var(--ease-out);
}
.week__bar.is-empty { background: rgba(45, 27, 105, .10); }
.week__label {
  font-size: 11px; font-weight: 800; text-transform: uppercase;
  letter-spacing: .06em; color: var(--ink-mute);
}
.week__count { font-family: var(--font-display); font-size: 14px; font-weight: 600; }

/* ---- 4.29 About grid ---------------------------------------------------- */
.about-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s-md);
}
.about-card h2 { margin-bottom: var(--s-xs); }
.about-card__icon {
  display: grid;
  place-items: center;
  width: 46px; height: 46px;
  margin-bottom: var(--s-md);
  border-radius: var(--r-md);
  background: var(--theme-wash);
  color: var(--theme-ink);
}
.about-card__icon svg { width: 25px; height: 25px; }
.about-card__icon--ink { background: var(--surface-sunk); color: var(--ink-soft); }

/* ---- 4.30 Session list -------------------------------------------------- */
.session-list { display: flex; flex-direction: column; }
.session-row {
  display: grid;
  grid-template-columns: 14px 1.4fr .5fr .9fr .8fr;
  gap: var(--s-md);
  align-items: center;
  padding: var(--s-sm) 0;
  border-bottom: 2px dashed var(--divider);
  font-size: 14px;
}
.session-row:last-child { border-bottom: 0; }
.session-row__dot { width: 10px; height: 10px; border-radius: 50%; background: var(--theme); }
.session-row__name { font-weight: 700; }
.session-row__meta { color: var(--ink-mute); font-weight: 700; }
.session-row__score { font-family: var(--font-display); font-weight: 500; font-variant-numeric: tabular-nums; }
.session-row__when { color: var(--ink-mute); font-weight: 600; text-align: right; }

/* ==========================================================================
   5. VIEW HELPERS
   ========================================================================== */
.d-none { display: none !important; }

/* ==========================================================================
   6. RESPONSIVE
   ========================================================================== */
@media (max-width: 1024px) {
  .bento { grid-template-columns: repeat(2, 1fr); }
  .gcard--featured { grid-column: span 2; grid-row: auto; }
  .gcard--featured .gcard__art { flex: none; height: 200px; }
  .play-layout { grid-template-columns: 1fr; }
  .play-side { order: 2; }
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .setup-grid { grid-template-columns: 1fr; }
  .about-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; gap: var(--s-xl); padding-block: var(--s-xl) var(--s-lg); text-align: left; }
  .hero__copy { max-width: none; }
}

@media (max-width: 768px) {
  :root { --s-2xl: 40px; --s-3xl: 48px; }

  .wrap { padding-inline: var(--s-md); }

  .nav-toggle { display: inline-flex; }
  .nav__close { display: inline-flex; }
  .nav {
    position: fixed; inset: 0 0 0 auto; width: min(300px, 86vw); z-index: 80;
    flex-direction: column; align-items: stretch; gap: var(--s-xs);
    padding: var(--s-2xl) var(--s-lg) var(--s-lg);
    background: var(--surface);
    border-left: 2px solid var(--border);
    box-shadow: var(--sh-soft);
    transform: translateX(100%);
    transition: transform var(--dur-base) var(--ease-out);
    margin-left: 0;
  }
  .nav.is-open { transform: none; }
  .nav__link { padding: var(--s-md); font-size: 17px; }
  .nav__close { align-self: flex-end; }

  .topbar__inner { gap: var(--s-sm); }
  .brand { font-size: 18px; }
  .brand__mark { width: 28px; height: 28px; }
  .today-pill { padding: var(--s-xs) var(--s-sm); font-size: 12px; }

  .bento { grid-template-columns: 1fr; gap: var(--s-md); }
  .gcard--featured { grid-column: span 1; padding: var(--s-lg); }
  .gcard--featured .gcard__name { font-size: 24px; }

  .strip { flex-direction: column; align-items: stretch; gap: var(--s-sm); }
  .strip__bar { width: 100%; }

  .hud { border-radius: var(--r-lg); flex-wrap: wrap; gap: var(--s-sm); }
  .hud__group { gap: var(--s-md); }
  .hud__value { font-size: 18px; }

  .board { max-width: 100%; padding: var(--s-sm); }
  .grid-cells { gap: 6px; }
  .cell { min-width: 40px; min-height: 40px; border-radius: var(--r-sm); }

  .result { padding: var(--s-lg); }
  .result__grid { grid-template-columns: 1fr; }

  .tiles, .tiles--3 { grid-template-columns: 1fr; }
  .tiles--compact { grid-template-columns: repeat(2, 1fr); }

  .progress-row { grid-template-columns: 1fr 1fr; gap: var(--s-sm); row-gap: var(--s-md); }
  .progress-row__name { grid-column: span 2; }
  .progress-row .spark { grid-column: span 2; }

  .stroop-options { width: 100%; }
  .reflex-target { width: 72px; height: 72px; }
  .tabs { width: 100%; justify-content: space-between; }
  .tab { padding: var(--s-sm) var(--s-md); flex: 1; text-align: center; }

  .about-grid { grid-template-columns: 1fr; }
  .week { height: 112px; }
  .week__count { font-size: 12px; }

  .session-row { grid-template-columns: 14px 1fr auto; gap: var(--s-sm); }
  .session-row__meta, .session-row__score { display: none; }

  .result__grade { gap: var(--s-md); }
  .grade { width: 56px; height: 56px; font-size: 26px; }
  .score { font-size: 22px; }

  .play-head { gap: var(--s-sm); }
  .play-head__tags { width: 100%; }
}

@media (max-width: 420px) {
  .hero__actions .btn--lg { width: 100%; }
  .hero__quick { width: 100%; }
  .hero__quick .btn { flex: 1; }
}

/* ==========================================================================
   7. REDUCED MOTION
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  .doodle--float, .stand__live { animation: none !important; }
  .gcard:hover, .btn:hover, .diff:hover { transform: none; }
}
.diff[aria-pressed="true"] .diff__sessions { color: var(--ink); opacity: .7; }
