/* ═══════════════════════════════════════════════════════════════════════
   quest.css — Street Poker Quest (mobile-first gamified trainer)

   Theme: dark navy (#06060b → #0f172a) with electric-blue accent (#3b82f6).
   Spade ♠ is the primary motif. Designed for portrait phone widths first;
   gracefully widens to tablet via a max-width column.
   ═══════════════════════════════════════════════════════════════════════ */

:root {
  --bg:        #06060b;
  --panel:     #0f172a;
  --panel-2:   #111c33;
  --panel-3:   #1a2542;
  --line:      #1e293b;
  --line-soft: #243049;

  --text:    #e2e8f0;
  --muted:   #94a3b8;
  --dim:     #64748b;

  --accent:        #3b82f6;
  --accent-strong: #1d4ed8;
  --accent-soft:   #1e3a8a;
  --accent-glow:   rgba(59,130,246,.45);

  --good:    #22c55e;
  --bad:     #ef4444;
  --warn:    #f59e0b;
  --gold:    #eab308;

  --raise:   #3b82f6;     /* what the lesson asks them to learn */
  --fold:    #1f2937;     /* the "do nothing" colour */

  --r-1:  6px;
  --r-2:  10px;
  --r-3:  14px;
  --r-4:  20px;
  --r-5:  28px;

  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;
  --sp-7: 48px;

  --safe-top:    env(safe-area-inset-top);
  --safe-bottom: env(safe-area-inset-bottom);
  --safe-left:   env(safe-area-inset-left);
  --safe-right:  env(safe-area-inset-right);

  --bar-h: 64px;
  --tap:   44px;

  --ease: cubic-bezier(.22,.9,.32,1);

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI",
          system-ui, "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}

body {
  min-height: 100dvh;
  min-height: -webkit-fill-available;
}

button {
  font-family: inherit;
  color: inherit;
  border: 0;
  background: transparent;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

a { color: var(--accent); }

/* ─────────────────────────────────────────────────────────────────────
   Shell
   ───────────────────────────────────────────────────────────────────── */
.quest-app {
  position: relative;
  min-height: 100dvh;
  max-width: 480px;
  margin: 0 auto;
  background:
    radial-gradient(1200px 600px at 50% -10%, #0a1628 0%, transparent 60%),
    radial-gradient(700px 500px at 100% 100%, #0a1838 0%, transparent 70%),
    var(--bg);
  background-attachment: fixed;
  padding-left:  var(--safe-left);
  padding-right: var(--safe-right);
}

.screen {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  padding-top: var(--safe-top);
  padding-bottom: calc(var(--safe-bottom) + 16px);
}

[hidden] { display: none !important; }

/* ─────────────────────────────────────────────────────────────────────
   Top bars
   ───────────────────────────────────────────────────────────────────── */
.topbar,
.home-topbar,
.drill-topbar {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  height: var(--bar-h);
  padding: 0 var(--sp-4);
  flex-shrink: 0;
}

.topbar-title {
  flex: 1;
  margin: 0;
  text-align: center;
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
}

.iconbtn {
  width: var(--tap);
  height: var(--tap);
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  color: var(--text);
  background: rgba(255,255,255,.04);
  border: 1px solid var(--line-soft);
  transition: transform .15s var(--ease), background .15s var(--ease);
}
.iconbtn:active { transform: scale(.94); background: rgba(255,255,255,.08); }
.iconbtn-spacer { width: var(--tap); height: var(--tap); display: inline-block; }

/* ─────────────────────────────────────────────────────────────────────
   Buttons
   ───────────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 56px;
  padding: 0 var(--sp-5);
  border-radius: var(--r-3);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: .01em;
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--line-soft);
  transition: transform .12s var(--ease), background .15s var(--ease), opacity .15s var(--ease);
  width: 100%;
}
.btn:active:not(:disabled) { transform: translateY(2px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.btn-primary {
  background: linear-gradient(180deg, var(--accent) 0%, var(--accent-strong) 100%);
  color: #fff;
  border-color: transparent;
  box-shadow:
    0 1px 0 rgba(255,255,255,.18) inset,
    0 -2px 0 rgba(0,0,0,.25) inset,
    0 8px 24px -10px var(--accent-glow);
}
.btn-primary:active:not(:disabled) {
  box-shadow:
    0 1px 0 rgba(255,255,255,.10) inset,
    0 -1px 0 rgba(0,0,0,.25) inset,
    0 4px 16px -10px var(--accent-glow);
}

.btn-good {
  background: linear-gradient(180deg, #34d399 0%, #15803d 100%);
  color: #fff;
  border-color: transparent;
  box-shadow:
    0 1px 0 rgba(255,255,255,.18) inset,
    0 -2px 0 rgba(0,0,0,.25) inset;
}
.btn-bad {
  background: linear-gradient(180deg, #f87171 0%, #b91c1c 100%);
  color: #fff;
  border-color: transparent;
  box-shadow:
    0 1px 0 rgba(255,255,255,.18) inset,
    0 -2px 0 rgba(0,0,0,.25) inset;
}

.cta-bar {
  position: sticky;
  bottom: 0;
  margin-top: auto;
  padding: var(--sp-4);
  padding-bottom: calc(var(--safe-bottom) + var(--sp-4));
  background: linear-gradient(180deg, transparent 0%, var(--bg) 60%);
}
.cta-bar-stack {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}
.btn-ghost {
  background: transparent;
  border: 1px solid var(--line-soft);
  color: var(--muted);
  height: 48px;
  font-size: 15px;
  font-weight: 600;
}
.btn-ghost:active:not(:disabled) {
  background: var(--panel-2);
  color: var(--text);
}

/* ─────────────────────────────────────────────────────────────────────
   Splash
   ───────────────────────────────────────────────────────────────────── */
.screen-splash {
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: var(--sp-3);
}
.splash-mark {
  filter: drop-shadow(0 8px 24px var(--accent-glow));
  animation: splashPulse 2s ease-in-out infinite;
}
@keyframes splashPulse {
  0%, 100% { transform: translateY(0) scale(1); }
  50%      { transform: translateY(-4px) scale(1.04); }
}
.splash-title {
  margin: 0;
  font-size: 28px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text);
}
.splash-tag {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

/* ─────────────────────────────────────────────────────────────────────
   Hero
   ───────────────────────────────────────────────────────────────────── */
.screen-hero { position: relative; overflow: hidden; }
.hero-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(420px 320px at 80% 20%, rgba(59,130,246,.25) 0%, transparent 70%),
    radial-gradient(520px 380px at 10% 90%, rgba(29,78,216,.30) 0%, transparent 70%);
  opacity: .85;
  z-index: 0;
}
.hero-bg::before {
  content: "♠ ♥ ♦ ♣ ♠ ♥ ♦ ♣ ♠ ♥ ♦ ♣ ♠ ♥ ♦ ♣ ♠ ♥ ♦ ♣ ♠ ♥ ♦ ♣";
  position: absolute;
  inset: -10%;
  font-size: 64px;
  line-height: 1.4;
  letter-spacing: 16px;
  color: rgba(59,130,246,.06);
  font-weight: 900;
  word-spacing: 12px;
  transform: rotate(-8deg);
  pointer-events: none;
}
.hero-body {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: var(--sp-5) var(--sp-5);
  gap: var(--sp-4);
}
.hero-headline {
  margin: 0;
  font-size: 34px;
  line-height: 1.12;
  font-weight: 800;
  letter-spacing: -.01em;
}
.hero-sub {
  margin: 0;
  font-size: 18px;
  line-height: 1.4;
  color: var(--text);
}
.hero-sub.muted { color: var(--muted); font-size: 16px; }
.quest-legal-note {
  margin-top: var(--sp-2);
  padding: 12px 14px;
  border-radius: var(--r-2);
  background: rgba(15,23,42,.72);
  border: 1px solid rgba(148,163,184,.18);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}
.quest-legal-note strong {
  display: block;
  color: var(--text);
  margin-bottom: 4px;
}
.quest-legal-note span {
  display: flex;
  gap: 12px;
  margin-top: 8px;
  font-weight: 700;
}
.quest-legal-note a {
  color: var(--accent);
  text-decoration: none;
}
.quest-legal-note-home {
  margin: var(--sp-4) 0 var(--sp-5);
}
.accent { color: var(--accent); }
@media (min-width: 380px) {
  .hero-headline { font-size: 38px; }
}

/* ─────────────────────────────────────────────────────────────────────
   Onboarding
   ───────────────────────────────────────────────────────────────────── */
.onboarding-body {
  flex: 1;
  padding: var(--sp-3) var(--sp-5) var(--sp-6);
  display: flex;
  flex-direction: column;
  gap: var(--sp-5);
}
.screen-title {
  margin: 0;
  font-size: 28px;
  font-weight: 800;
  line-height: 1.18;
  letter-spacing: -.01em;
}
.screen-sub {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
}

.level-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}
.level-card {
  text-align: left;
  background: linear-gradient(180deg, var(--panel) 0%, var(--panel-2) 100%);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-3);
  padding: var(--sp-4) var(--sp-5);
  display: grid;
  gap: 6px;
  transition: border-color .15s var(--ease), background .15s var(--ease), transform .12s var(--ease);
  position: relative;
}
.level-card:active { transform: scale(.99); }
.level-card[aria-checked="true"] {
  border-color: var(--accent);
  background: linear-gradient(180deg, rgba(59,130,246,.10) 0%, var(--panel-2) 100%);
  box-shadow: 0 0 0 1px var(--accent-glow), 0 8px 28px -16px var(--accent-glow);
}
.level-suits {
  display: flex;
  gap: 6px;
  font-size: 18px;
  color: var(--accent);
}
.level-name {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
}
.level-desc {
  font-size: 14px;
  color: var(--muted);
}
.fineprint {
  margin: 0;
  font-size: 12px;
  color: var(--dim);
  text-align: center;
}

/* Daily-goal selection (onboarding) */
.goal-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-3);
}
.goal-card {
  text-align: center;
  background: linear-gradient(180deg, var(--panel) 0%, var(--panel-2) 100%);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-3);
  padding: var(--sp-4) var(--sp-3);
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: border-color .15s var(--ease), background .15s var(--ease), transform .12s var(--ease);
}
.goal-card:active { transform: scale(.98); }
.goal-card[aria-checked="true"] {
  border-color: var(--accent);
  background: linear-gradient(180deg, rgba(59,130,246,.10) 0%, var(--panel-2) 100%);
  box-shadow: 0 0 0 1px var(--accent-glow);
}
.goal-num {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -.02em;
  color: var(--text);
  line-height: 1;
}
.goal-num span {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: .04em;
  margin-left: 4px;
  text-transform: uppercase;
}
.goal-label {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.3;
}

/* ─────────────────────────────────────────────────────────────────────
   Home / lesson path
   ───────────────────────────────────────────────────────────────────── */
.home-topbar {
  justify-content: flex-start;
  gap: var(--sp-2);
}
.streak-pill, .xp-pill, .chips-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--panel-2);
  border: 1px solid var(--line-soft);
  font-weight: 700;
  font-size: 14px;
}
.streak-flame { font-size: 16px; }
.xp-icon { color: var(--accent); }
.chip-mini { color: #f87171; font-size: 16px; line-height: 1; }
.chips-pill[data-empty="true"] {
  background: rgba(239,68,68,.12);
  border-color: rgba(239,68,68,.4);
  color: #fca5a5;
}
.home-topbar .iconbtn-profile { margin-left: auto; }

/* ─────────────────────────────────────────────────────────────────────
   Daily goal card (home)
   ───────────────────────────────────────────────────────────────────── */
.daily-goal-card {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  background: linear-gradient(135deg, var(--panel) 0%, var(--panel-2) 100%);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-3);
  margin: 0 0 var(--sp-3);
  position: relative;
}
.daily-goal-card[data-met="true"] {
  border-color: var(--good);
  background: linear-gradient(135deg, rgba(34,197,94,.08) 0%, var(--panel-2) 100%);
}
.daily-ring {
  position: relative;
  width: 56px; height: 56px;
  flex-shrink: 0;
}
.daily-ring svg { display: block; }
.daily-ring-pct {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
.daily-goal-card[data-met="true"] .daily-ring-pct::before {
  content: "✓";
  font-size: 20px;
  color: var(--good);
}
.daily-goal-card[data-met="true"] .daily-ring-pct { font-size: 0; }
.daily-goal-text { flex: 1; min-width: 0; }
.daily-goal-title { font-size: 14px; font-weight: 700; }
.daily-goal-sub   { font-size: 12px; color: var(--muted); margin-top: 2px; font-variant-numeric: tabular-nums; }
.daily-goal-edit {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: grid; place-items: center;
  color: var(--muted);
  background: rgba(255,255,255,.04);
  border: 1px solid var(--line-soft);
}
.daily-goal-edit:active { background: rgba(255,255,255,.08); }

.home-body {
  flex: 1;
  padding: var(--sp-3) var(--sp-4) calc(var(--safe-bottom) + var(--sp-6));
  overflow-y: auto;
}

.units {
  display: flex;
  flex-direction: column;
  gap: var(--sp-6);
}
.unit-section {
  display: flex;
  flex-direction: column;
}

/* Weekly recap card */
.recap-card {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  width: 100%;
  text-align: left;
  padding: var(--sp-3) var(--sp-4);
  margin: 0 0 var(--sp-3);
  border-radius: var(--r-3);
  background: linear-gradient(135deg, rgba(168,85,247,.10), var(--panel-2));
  border: 1px solid rgba(168,85,247,.3);
  color: var(--text);
  transition: transform .12s var(--ease);
}
.recap-card:active { transform: scale(.99); }
.recap-icon {
  width: 40px; height: 40px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 22px;
  background: linear-gradient(180deg, #a855f7 0%, #6b21a8 100%);
  flex-shrink: 0;
  box-shadow: 0 4px 14px -8px rgba(168,85,247,.6);
}
.recap-text { flex: 1; min-width: 0; }
.recap-eyebrow {
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
}
.recap-title {
  font-size: 15px;
  font-weight: 700;
  margin-top: 2px;
}
.recap-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}
.recap-arrow {
  color: var(--muted);
  font-size: 20px;
  font-weight: 600;
}

/* Promo cards row (Hand of the Day / Practice your leaks) */
.promo-row {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  margin: 0 0 var(--sp-5);
}
.promo-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-4);
  text-align: left;
  border-radius: var(--r-3);
  border: 1px solid var(--line-soft);
  background: var(--panel-2);
  overflow: hidden;
  transition: transform .12s var(--ease);
}
.promo-card:active { transform: scale(.99); }
.promo-card[data-state="done"] {
  opacity: .65;
}
.promo-card[data-state="done"]::after {
  content: "✓ Done";
  position: absolute;
  top: 8px; right: 10px;
  font-size: 11px;
  font-weight: 700;
  color: var(--good);
  letter-spacing: .06em;
}
.promo-card-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(140px 60px at 0% 50%, rgba(245,158,11,.20), transparent 70%),
              radial-gradient(180px 80px at 100% 50%, rgba(59,130,246,.18), transparent 70%);
  pointer-events: none;
}
.promo-card-hod {
  background: linear-gradient(135deg, rgba(245,158,11,.10) 0%, var(--panel-2) 100%);
  border-color: rgba(245,158,11,.4);
}
.promo-card-leaks {
  background: linear-gradient(135deg, rgba(239,68,68,.08) 0%, var(--panel-2) 100%);
  border-color: rgba(239,68,68,.35);
}
.promo-card-icon {
  flex-shrink: 0;
  width: 44px; height: 44px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 22px;
  background: linear-gradient(180deg, #fbbf24 0%, #b45309 100%);
  color: #1f1306;
  box-shadow: 0 4px 14px -8px rgba(245,158,11,.6);
}
.promo-card-icon-leaks {
  background: linear-gradient(180deg, #f87171 0%, #991b1b 100%);
  color: #fff;
  box-shadow: 0 4px 14px -8px rgba(239,68,68,.6);
}
.promo-card-text { flex: 1; min-width: 0; position: relative; }
.promo-card-eyebrow {
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 2px;
}
.promo-card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.promo-card-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}
.unit-banner {
  position: relative;
  margin: var(--sp-2) 0 var(--sp-5);
  padding: var(--sp-5);
  border-radius: var(--r-4);
  background:
    linear-gradient(135deg, rgba(59,130,246,.18) 0%, rgba(29,78,216,.08) 100%),
    var(--panel);
  border: 1px solid var(--line-soft);
  overflow: hidden;
}
.unit-banner::after {
  content: "♠";
  position: absolute;
  right: -16px; top: -22px;
  font-size: 140px;
  color: rgba(59,130,246,.10);
  line-height: 1;
  pointer-events: none;
}
.unit-eyebrow {
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}
.unit-title {
  font-size: 24px;
  font-weight: 800;
}

.lesson-path {
  list-style: none;
  margin: 0;
  padding: 0 var(--sp-3);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-5);
  position: relative;
}
.lesson-path::before {
  content: "";
  position: absolute;
  top: 24px; bottom: 24px;
  left: 50%;
  width: 2px;
  background: repeating-linear-gradient(
    to bottom,
    var(--line-soft) 0,
    var(--line-soft) 8px,
    transparent 8px,
    transparent 14px
  );
  transform: translateX(-1px);
  z-index: 0;
}

.lesson-node {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  --offset: 0px;
  transform: translateX(var(--offset));
}
.lesson-node:nth-child(odd)  { --offset: -64px; }
.lesson-node:nth-child(even) { --offset:  64px; }

.lesson-orb {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 30px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(180deg, var(--panel-2) 0%, var(--panel) 100%);
  border: 2px solid var(--line-soft);
  box-shadow:
    0 1px 0 rgba(255,255,255,.05) inset,
    0 -3px 0 rgba(0,0,0,.40) inset,
    0 10px 20px -10px rgba(0,0,0,.50);
  transition: transform .15s var(--ease);
  position: relative;
}
.lesson-orb:active { transform: translateY(2px); }

.lesson-node[data-state="locked"]   .lesson-orb { color: var(--dim); }
.lesson-node[data-state="locked"]   .lesson-orb::after {
  content: "🔒";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 22px;
}
.lesson-node[data-state="locked"]   .lesson-orb > * { opacity: 0; }

.lesson-node[data-state="current"]  .lesson-orb {
  background: linear-gradient(180deg, var(--accent) 0%, var(--accent-strong) 100%);
  border-color: var(--accent);
  box-shadow:
    0 1px 0 rgba(255,255,255,.20) inset,
    0 -3px 0 rgba(0,0,0,.30) inset,
    0 10px 26px -8px var(--accent-glow);
  animation: bob 2.4s ease-in-out infinite;
}
@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-4px); }
}

.lesson-node[data-state="done"] .lesson-orb {
  background: linear-gradient(180deg, #fbbf24 0%, #b45309 100%);
  border-color: #fbbf24;
  color: #1f1306;
  box-shadow:
    0 1px 0 rgba(255,255,255,.30) inset,
    0 -3px 0 rgba(0,0,0,.30) inset,
    0 10px 22px -10px rgba(245,158,11,.5);
}

.lesson-stars {
  display: flex;
  gap: 3px;
  margin-top: 2px;
  height: 12px;
  align-items: center;
}
.lesson-stars span {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: rgba(255,255,255,.08);
  border: 1px solid var(--line-soft);
}
.lesson-stars span[data-on="true"] {
  background: linear-gradient(180deg, #fbbf24 0%, #b45309 100%);
  border-color: #fbbf24;
  box-shadow: 0 2px 4px -2px rgba(245,158,11,.6);
}
.lesson-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  text-align: center;
  max-width: 160px;
  line-height: 1.25;
}
.lesson-sub {
  font-size: 11px;
  color: var(--muted);
}

/* ─────────────────────────────────────────────────────────────────────
   Lesson breakdown
   ───────────────────────────────────────────────────────────────────── */
.breakdown-body {
  flex: 1;
  padding: var(--sp-3) var(--sp-4) var(--sp-6);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}

.breakdown-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}
.meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--panel-2);
  border: 1px solid var(--line-soft);
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}
.meta-chip strong { color: var(--accent); }

.breakdown-legend {
  display: flex;
  gap: var(--sp-4);
  align-items: center;
  font-size: 13px;
  color: var(--muted);
}
.legend-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.legend-chip i {
  width: 14px; height: 14px;
  border-radius: 4px;
  display: inline-block;
}
.legend-raise i { background: var(--raise); }
.legend-fold  i { background: var(--fold); border: 1px solid var(--line-soft); }

.range-grid {
  display: grid;
  grid-template-columns: repeat(13, 1fr);
  gap: 2px;
  background: var(--panel);
  padding: 6px;
  border-radius: var(--r-2);
  border: 1px solid var(--line-soft);
}
.range-cell {
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  font-size: 9px;
  font-weight: 700;
  font-family: var(--mono);
  color: rgba(255,255,255,.85);
  background: var(--fold);
  border-radius: 3px;
  user-select: none;
}
.range-cell.is-raise {
  background: var(--raise);
  color: #fff;
  box-shadow: 0 0 0 1px rgba(96,165,250,.4) inset;
}
.range-cell.is-pair { font-weight: 800; }

/* PLO variant — list of category labels instead of the 13x13 grid */
.range-grid.range-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  background: transparent;
  padding: 0;
  border: 0;
  grid-template-columns: none;
}
.range-listrow {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 10px 12px;
  background: var(--panel-2);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-2);
  font-size: 13px;
  color: var(--text);
}
.range-listdot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--raise);
  flex-shrink: 0;
}

.breakdown-tip {
  background: linear-gradient(135deg, rgba(59,130,246,.10), rgba(59,130,246,.02));
  border: 1px solid var(--accent-soft);
  border-radius: var(--r-3);
  padding: var(--sp-4);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
}
.breakdown-tip strong { color: var(--accent); }

/* ─────────────────────────────────────────────────────────────────────
   Drill — poker table + multiple-choice cards
   ───────────────────────────────────────────────────────────────────── */
.drill-topbar { gap: var(--sp-3); }
.progress {
  flex: 1;
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}
.progress-bar {
  flex: 1;
  height: 10px;
  border-radius: 999px;
  background: var(--panel-2);
  overflow: hidden;
  border: 1px solid var(--line-soft);
}
.progress-bar > span {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent) 0%, #60a5fa 100%);
  border-radius: 999px;
  transition: width .35s var(--ease);
}
.progress-text {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  min-width: 30px;
  text-align: right;
}
.drill-streak {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 700;
  font-size: 14px;
  color: var(--gold);
}
.drill-chips {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.drill-chip {
  width: 14px; height: 14px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 35%, #f87171 0 35%, #b91c1c 36% 100%);
  border: 1.5px dashed #fecaca;
  box-sizing: border-box;
  transition: transform .25s var(--ease), background .25s var(--ease), opacity .25s var(--ease);
}
.drill-chip[data-spent="true"] {
  background: var(--panel-2);
  border-color: var(--line-soft);
  border-style: solid;
  opacity: .55;
  transform: scale(.85);
}
.drill-chip.is-burning {
  animation: chipBurn .55s var(--ease);
}
@keyframes chipBurn {
  0%   { transform: scale(1); }
  30%  { transform: scale(1.4); filter: brightness(1.5); }
  60%  { transform: scale(.7); filter: brightness(.5); }
  100% { transform: scale(.85); filter: brightness(1); }
}

.drill-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  padding: var(--sp-3) var(--sp-3) var(--sp-5);
}

/* Time-attack countdown bar */
.attack-bar {
  height: 6px;
  border-radius: 999px;
  background: rgba(255,255,255,.06);
  overflow: hidden;
  margin: -8px var(--sp-3) 0;
  border: 1px solid var(--line-soft);
}
.attack-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #ef4444 0%, #f59e0b 50%, #22c55e 100%);
  border-radius: 999px;
}

/* ─────────────────────────────────────────────────────────────────────
   Poker simulator — brown felt with cream inner border, person-silhouette
   seat pucks, FOLD pills, dealer button, green chip pucks for blinds/pot.
   Inspired by mainstream gamified-trainer references; tuned for our dark
   navy app shell.
   ───────────────────────────────────────────────────────────────────── */
.poker-table {
  position: relative;
  margin: 0 auto;
  width: 100%;
  max-width: 380px;
  aspect-ratio: 5 / 7;
  /* Outer dark frame */
  padding: 0;
  background: transparent;
  border: 0;
}
.poker-table::before {
  /* The felt itself — warm brown radial */
  content: "";
  position: absolute;
  inset: 8% 6%;
  border-radius: 50% / 32%;
  background:
    radial-gradient(120% 110% at 50% 30%,
      #7d5232 0%,
      #5a361b 55%,
      #2d1a0c 100%);
  box-shadow:
    0 1px 0 rgba(255,255,255,.08) inset,
    0 -10px 40px -10px rgba(0,0,0,.6) inset,
    0 14px 30px -10px rgba(0,0,0,.6);
}
.poker-table::after {
  /* Cream inner racetrack outline */
  content: "";
  position: absolute;
  inset: 14% 12%;
  border-radius: 50% / 36%;
  border: 1.5px solid rgba(231,206,165,.55);
  pointer-events: none;
}

/* Seat pucks (the silhouetted player avatars) */
.seat {
  position: absolute;
  width: 70px;
  text-align: center;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 2;
}
.seat-puck {
  width: 52px; height: 52px;
  border-radius: 50%;
  margin: 0 auto;
  background:
    radial-gradient(circle at 50% 35%, #6b3f23 0%, #3a2110 70%, #1f120a 100%);
  border: 1px solid rgba(0,0,0,.5);
  display: grid;
  place-items: center;
  color: rgba(255,255,255,.18);
  box-shadow:
    0 1px 0 rgba(255,255,255,.08) inset,
    0 -3px 6px rgba(0,0,0,.35) inset,
    0 4px 10px rgba(0,0,0,.45);
  position: relative;
}
.seat-puck svg { display: block; }

/* Pill below the puck containing the position label and stack */
.seat-bubble {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  margin-top: -8px;
  padding: 4px 10px 5px;
  background: linear-gradient(180deg, #2c1a0e 0%, #1a0f08 100%);
  border: 1px solid rgba(0,0,0,.6);
  border-radius: 8px;
  min-width: 44px;
  box-shadow:
    0 1px 0 rgba(255,255,255,.05) inset,
    0 4px 8px rgba(0,0,0,.35);
  position: relative;
}
.seat-name {
  font-size: 11px;
  font-weight: 800;
  color: #f3e3c8;
  letter-spacing: .03em;
  line-height: 1.1;
}
.seat-stack {
  font-size: 10px;
  color: #c8b693;
  margin-top: 1px;
  font-variant-numeric: tabular-nums;
}
.seat-stack.is-fold {
  color: #f87171;
  font-weight: 700;
  letter-spacing: .04em;
}

/* Hero highlight — a faint gold ring on the puck and gold tint on the bubble */
.seat[data-hero="true"] .seat-puck {
  box-shadow:
    0 0 0 2px rgba(251,191,36,.6),
    0 0 18px rgba(251,191,36,.25),
    0 1px 0 rgba(255,255,255,.10) inset,
    0 -3px 6px rgba(0,0,0,.35) inset;
}
.seat[data-hero="true"] .seat-bubble {
  border-color: rgba(251,191,36,.6);
}

/* Face-down cards behind seats still in the hand */
.seat-cards {
  position: absolute;
  display: flex;
  gap: 3px;
  transform: translate(-50%, -50%);
  z-index: 1;
}
.mini-card {
  width: 28px;
  height: 40px;
  border-radius: 4px;
  background:
    /* diamond/criss-cross pattern over a light base */
    linear-gradient(135deg, transparent 46%, rgba(0,0,0,.18) 46% 54%, transparent 54%) 0 0/8px 8px,
    linear-gradient(45deg,  transparent 46%, rgba(0,0,0,.18) 46% 54%, transparent 54%) 0 0/8px 8px,
    linear-gradient(180deg, #d4c0a3 0%, #a08566 100%);
  border: 1.5px solid #1a0f08;
  box-shadow: 0 3px 6px rgba(0,0,0,.55), 0 1px 0 rgba(255,255,255,.15) inset;
  position: relative;
}
.mini-card::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 6px;
  background: #e07b3a;
  border-bottom-left-radius: 3px;
  border-bottom-right-radius: 3px;
}
/* Hero shows their cards larger (and the stack changes from 2 → 4 → 5 cards
   for NLH / PLO4 / PLO5 via .seat-cards[data-cards]). */
.seat-cards[data-cards="4"] .mini-card,
.seat-cards[data-cards="5"] .mini-card { width: 22px; height: 32px; }
.seat[data-hero="true"] ~ .seat-cards--hero .mini-card,
.seat-cards--hero .mini-card { width: 38px; height: 54px; }
.seat-cards--hero[data-cards="4"] .mini-card { width: 28px; height: 42px; }
.seat-cards--hero[data-cards="5"] .mini-card { width: 24px; height: 38px; }

/* Dealer button: small cream disc */
.dealer-btn {
  position: absolute;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: linear-gradient(180deg, #fff7e0 0%, #d6b87a 100%);
  color: #5a3a14;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 800;
  font-family: var(--mono);
  box-shadow:
    0 1px 0 rgba(255,255,255,.5) inset,
    0 -2px 4px rgba(0,0,0,.3) inset,
    0 4px 8px rgba(0,0,0,.45);
  transform: translate(-50%, -50%);
  z-index: 3;
}

/* Pot / blinds — green poker chip with dashed white edge plus a value pill */
.blind-chip {
  position: absolute;
  display: inline-flex;
  align-items: center;
  gap: 0;
  transform: translate(-50%, -50%);
  z-index: 2;
}
.blind-chip::before {
  content: "";
  width: 22px; height: 22px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 35%, #34d399 0 30%, #10b981 31% 60%, #047857 61% 100%);
  border: 2px dashed #ecfdf5;
  box-shadow: 0 4px 8px rgba(0,0,0,.45);
  box-sizing: border-box;
  flex-shrink: 0;
}
.blind-chip-val {
  margin-left: -6px;
  padding: 3px 8px 3px 12px;
  background: linear-gradient(180deg, #2c1a0e 0%, #1a0f08 100%);
  border: 1px solid rgba(0,0,0,.5);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  color: #f3e3c8;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 4px 8px rgba(0,0,0,.4);
}

/* Drill prompt */
.drill-prompt {
  text-align: center;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.35;
  padding: 0 var(--sp-3);
}
.drill-prompt .verb { color: var(--accent); }

/* Drill options (4 hand combos) */
.drill-options {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-2);
  padding: 0 var(--sp-2);
}
.combo-btn {
  position: relative;
  aspect-ratio: 5 / 7;
  border-radius: 10px;
  background: #fff;
  border: 2px solid #fff;
  box-shadow: 0 4px 12px rgba(0,0,0,.45);
  display: flex;
  overflow: hidden;
  transition: transform .12s var(--ease), box-shadow .15s var(--ease);
}
.combo-btn:active { transform: scale(.96); }
.combo-half {
  flex: 1;
  display: grid;
  grid-template-rows: auto 1fr;
  align-items: start;
  padding: 4px 4px 6px;
  background: #fff;
  position: relative;
}
.combo-half + .combo-half { border-left: 1px solid #e5e7eb; }
.combo-rank {
  font-size: 22px;
  font-weight: 800;
  font-family: Georgia, serif;
  line-height: 1;
}
.combo-suit {
  font-size: 22px;
  line-height: 1;
  align-self: end;
  justify-self: center;
  margin-bottom: 4px;
}
/* PLO compaction — fit 4 or 5 cards in the same combo button */
.combo-btn[data-cards="4"] .combo-rank,
.combo-btn[data-cards="4"] .combo-suit { font-size: 14px; }
.combo-btn[data-cards="4"] .combo-half { padding: 3px 1px 4px; }
.combo-btn[data-cards="5"] .combo-rank,
.combo-btn[data-cards="5"] .combo-suit { font-size: 12px; }
.combo-btn[data-cards="5"] .combo-half { padding: 3px 0 3px; }
.combo-half[data-color="r"] { color: #dc2626; }
.combo-half[data-color="b"] { color: #111827; }

.combo-btn[data-state="correct"] {
  border-color: var(--good);
  box-shadow: 0 0 0 4px rgba(34,197,94,.20), 0 6px 18px rgba(0,0,0,.5);
  animation: pop .35s var(--ease);
}
.combo-btn[data-state="wrong"] {
  border-color: var(--bad);
  box-shadow: 0 0 0 4px rgba(239,68,68,.20), 0 6px 18px rgba(0,0,0,.5);
  animation: shake .35s var(--ease);
}
.combo-btn[data-state="dim"] { opacity: .35; }

@keyframes pop {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.06); }
  100% { transform: scale(1); }
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%      { transform: translateX(-6px); }
  40%      { transform: translateX(6px); }
  60%      { transform: translateX(-3px); }
  80%      { transform: translateX(3px); }
}

/* Feedback bar */
.feedback-bar {
  position: sticky;
  bottom: 0;
  margin-top: auto;
  padding: var(--sp-4);
  padding-bottom: calc(var(--safe-bottom) + var(--sp-4));
  background: var(--panel);
  border-top: 1px solid var(--line-soft);
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  animation: slideUp .25s var(--ease);
}
@keyframes slideUp {
  from { transform: translateY(20%); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}
.feedback-bar[data-tone="good"] { background: linear-gradient(180deg, rgba(34,197,94,.10), var(--panel)); border-top-color: var(--good); }
.feedback-bar[data-tone="bad"]  { background: linear-gradient(180deg, rgba(239,68,68,.10), var(--panel)); border-top-color: var(--bad); }
.feedback-headline {
  font-size: 22px;
  font-weight: 800;
}
.feedback-bar[data-tone="good"] .feedback-headline { color: var(--good); }
.feedback-bar[data-tone="bad"]  .feedback-headline { color: var(--bad); }
.feedback-body {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
}
.feedback-body code {
  font-family: var(--mono);
  background: rgba(255,255,255,.05);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--accent);
}

/* ─────────────────────────────────────────────────────────────────────
   Lesson complete
   ───────────────────────────────────────────────────────────────────── */
.complete-body {
  flex: 1;
  padding: var(--sp-6) var(--sp-5);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--sp-4);
}
.complete-trophy {
  margin-top: var(--sp-5);
  filter: drop-shadow(0 16px 36px var(--accent-glow));
  animation: trophyIn .55s var(--ease);
}
@keyframes trophyIn {
  from { transform: scale(.6) rotate(-12deg); opacity: 0; }
  to   { transform: scale(1) rotate(0); opacity: 1; }
}

/* Big stars on lesson complete */
.complete-stars {
  display: flex;
  gap: var(--sp-2);
  margin-top: var(--sp-2);
  align-items: center;
}
.big-star {
  font-size: 36px;
  line-height: 1;
  color: rgba(255,255,255,.10);
  text-shadow: 0 0 0 currentColor;
  transform: scale(.6);
  opacity: 0;
  transition: transform .25s var(--ease), color .2s var(--ease), text-shadow .2s var(--ease), opacity .2s var(--ease);
}
.complete-stars[data-revealed="0"] .big-star { opacity: .4; transform: scale(.85); }
.complete-stars[data-revealed="0"] .big-star { color: rgba(255,255,255,.10); }
.big-star[data-on="true"] {
  color: #fbbf24;
  text-shadow: 0 0 12px rgba(245,158,11,.6);
  opacity: 1;
  transform: scale(1.1);
  animation: starPop .55s var(--ease);
}
.big-star[data-on="true"][data-pos="2"] { animation-delay: .15s; }
.big-star[data-on="true"][data-pos="3"] { animation-delay: .30s; }
.big-star[data-on="false"] {
  opacity: .35;
  color: rgba(255,255,255,.18);
}
@keyframes starPop {
  0%   { transform: scale(.4) rotate(-30deg); opacity: 0; }
  60%  { transform: scale(1.3) rotate(8deg); opacity: 1; }
  100% { transform: scale(1.1) rotate(0); opacity: 1; }
}
.complete-title {
  margin: 0;
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -.01em;
}
.complete-sub {
  margin: 0;
  font-size: 16px;
  color: var(--muted);
}
.complete-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-2);
  width: 100%;
  margin-top: var(--sp-4);
}
.stat-card {
  background: var(--panel-2);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-3);
  padding: var(--sp-3);
  text-align: center;
}
.stat-num {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
}
.stat-label {
  margin-top: 2px;
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ─────────────────────────────────────────────────────────────────────
   Profile
   ───────────────────────────────────────────────────────────────────── */
.profile-body {
  flex: 1;
  padding: var(--sp-3) var(--sp-4) var(--sp-7);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}
.profile-card {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  background: var(--panel-2);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-4);
  padding: var(--sp-4);
}
.profile-avatar {
  width: 64px; height: 64px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 32px;
  background: linear-gradient(180deg, var(--accent) 0%, var(--accent-strong) 100%);
  color: #fff;
  box-shadow: 0 8px 22px -10px var(--accent-glow);
}
.profile-name { font-size: 18px; font-weight: 800; }
.profile-level { font-size: 13px; color: var(--muted); margin-top: 2px; }

.profile-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-2);
}

.profile-section {
  margin: var(--sp-4) 0 0;
  font-size: 13px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}
.profile-hint {
  margin: -4px 0 0;
  font-size: 12px;
  color: var(--dim);
  line-height: 1.45;
}

/* Streak freeze inventory */
.freeze-inventory {
  display: flex;
  gap: var(--sp-2);
  align-items: center;
}
.freeze-slot {
  width: 52px; height: 52px;
  border-radius: var(--r-2);
  display: grid;
  place-items: center;
  background: var(--panel-2);
  border: 1px solid var(--line-soft);
  color: var(--dim);
  font-size: 22px;
}
.freeze-slot[data-on="true"] {
  color: #93c5fd;
  background: linear-gradient(180deg, rgba(96,165,250,.18), var(--panel));
  border-color: #60a5fa;
  box-shadow: 0 0 0 1px rgba(96,165,250,.3), 0 8px 22px -14px rgba(96,165,250,.6);
}

/* Mistakes log */
.mistakes-log {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
}
.mistakes-empty {
  font-size: 13px;
  color: var(--dim);
  padding: var(--sp-3) 0;
  font-style: italic;
}
.mistake-row {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: 10px var(--sp-3);
  background: var(--panel-2);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-2);
}
.mistake-hand {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 14px;
  color: var(--text);
  min-width: 44px;
  text-align: center;
  padding: 4px 8px;
  background: var(--bg);
  border-radius: 6px;
  border: 1px solid var(--line-soft);
}
.mistake-meta {
  flex: 1;
  min-width: 0;
}
.mistake-source {
  font-size: 13px;
  color: var(--text);
  font-weight: 600;
}
.mistake-when {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}

/* Settings row hint (small description under label) */
.row-hint {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
  font-weight: 400;
}

/* ─────────────────────────────────────────────────────────────────────
   Range Explorer
   ───────────────────────────────────────────────────────────────────── */
.promo-card-ranges {
  background: linear-gradient(135deg, rgba(96,165,250,.10) 0%, var(--panel-2) 100%);
  border-color: rgba(96,165,250,.35);
}
.promo-card-icon-ranges {
  background: linear-gradient(180deg, #60a5fa 0%, #1d4ed8 100%);
  color: #fff;
  font-family: var(--mono);
  box-shadow: 0 4px 14px -8px var(--accent-glow);
}
.promo-card-weak {
  background: linear-gradient(135deg, rgba(168,85,247,.10) 0%, var(--panel-2) 100%);
  border-color: rgba(168,85,247,.35);
}
.promo-card-icon-weak {
  background: linear-gradient(180deg, #c084fc 0%, #6b21a8 100%);
  color: #fff;
}

/* Per-spot accuracy list (in profile) */
.spot-stats {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.spot-stats-empty {
  font-size: 13px;
  color: var(--dim);
  font-style: italic;
  padding: 8px 0;
}
.spot-row {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: 10px var(--sp-3);
  background: var(--panel-2);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-2);
}
.spot-row-label {
  flex: 1;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  min-width: 0;
}
.spot-row-meta {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}
.spot-row-pct {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  min-width: 48px;
  text-align: right;
}
.spot-row-pct[data-tone="hot"]  { color: var(--good); }
.spot-row-pct[data-tone="warm"] { color: var(--warn); }
.spot-row-pct[data-tone="cold"] { color: var(--bad); }

.ranges-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  padding: var(--sp-2) var(--sp-3) calc(var(--safe-bottom) + var(--sp-5));
  overflow-y: auto;
}

.filter-row {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  padding: 2px 0;
}
.filter-row::-webkit-scrollbar { display: none; }
.filter-chip {
  flex-shrink: 0;
  height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--panel-2);
  border: 1px solid var(--line-soft);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .02em;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background .15s var(--ease), color .15s var(--ease), border-color .15s var(--ease);
}
.filter-chip:active { transform: scale(.97); }
.filter-chip[data-active="true"] {
  background: linear-gradient(180deg, var(--accent) 0%, var(--accent-strong) 100%);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 0 0 1px var(--accent-glow), 0 4px 14px -10px var(--accent-glow);
}
.filter-chip-eyebrow {
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--dim);
  margin-right: 4px;
  flex-shrink: 0;
  align-self: center;
  padding-left: 2px;
}

.ranges-summary-row {
  display: flex;
  gap: var(--sp-2);
  align-items: stretch;
}
.ranges-summary {
  flex: 1;
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-2);
  padding: 10px var(--sp-3);
  font-size: 13px;
  color: var(--text);
  line-height: 1.4;
}
.ranges-summary strong { color: var(--accent); }

.iconbtn-star, .iconbtn-compare {
  width: 40px;
  height: auto;
  border-radius: var(--r-2);
  color: var(--muted);
  flex-shrink: 0;
}
.iconbtn-star[data-pinned="true"] {
  color: #fbbf24;
}
.iconbtn-star[data-pinned="true"] svg path {
  fill: #fbbf24;
  stroke: #fbbf24;
}
.iconbtn-compare[data-active="true"] {
  color: #34d399;
  background: rgba(34,197,94,.08);
  border-color: rgba(34,197,94,.5);
}

/* Compare block — secondary filter row and eyebrow */
.compare-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: var(--sp-3);
  background: linear-gradient(135deg, rgba(34,197,94,.06), var(--panel-2));
  border: 1px solid rgba(34,197,94,.35);
  border-radius: var(--r-2);
  animation: slideUp .25s var(--ease);
}
.compare-eyebrow {
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #34d399;
  font-weight: 700;
}

/* Diff overlay decorations on grid cells */
.big-cell[data-diff="add"]::after {
  content: "+";
  position: absolute;
  top: 1px; right: 2px;
  font-size: 10px;
  line-height: 1;
  font-weight: 800;
  color: #86efac;
  text-shadow: 0 0 2px rgba(0,0,0,.6);
  z-index: 3;
}
.big-cell[data-diff="rem"]::after {
  content: "−";
  position: absolute;
  top: 1px; right: 2px;
  font-size: 12px;
  line-height: 1;
  font-weight: 800;
  color: #fca5a5;
  text-shadow: 0 0 2px rgba(0,0,0,.6);
  z-index: 3;
}
.big-cell[data-diff="add"] {
  outline: 1.5px solid rgba(34,197,94,.6);
  outline-offset: -1px;
}
.big-cell[data-diff="rem"] {
  outline: 1.5px solid rgba(239,68,68,.6);
  outline-offset: -1px;
}
.big-cell[data-diff="mix"] {
  outline: 1.5px solid rgba(234,179,8,.55);
  outline-offset: -1px;
}

/* Favorites quick row (chips for pinned spots) */
.favorites-row {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  padding: 2px 0;
}
.favorites-row::-webkit-scrollbar { display: none; }
.fav-chip {
  flex-shrink: 0;
  height: 32px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(251,191,36,.10), var(--panel-2));
  border: 1px solid rgba(251,191,36,.4);
  color: #fbbf24;
  font-size: 12px;
  font-weight: 700;
}
.fav-chip-x {
  width: 16px; height: 16px;
  border-radius: 50%;
  background: rgba(0,0,0,.35);
  color: var(--muted);
  display: grid; place-items: center;
  font-size: 10px;
}

/* Action buttons row at the bottom of the explorer */
.ranges-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px;
}

/* Sizing block in the bottom sheet */
.sheet-sizing {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 var(--sp-2);
}
.size-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--panel-2);
  border: 1px solid var(--line-soft);
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}
.size-tag-eyebrow {
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
}
.size-tag[data-action="raise"] { border-color: rgba(59,130,246,.4); }
.size-tag[data-action="raise"] .size-tag-eyebrow { color: var(--accent); }
.size-tag[data-action="call"]  { border-color: rgba(34,197,94,.35); }
.size-tag[data-action="call"]  .size-tag-eyebrow { color: #34d399; }

.ranges-legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
  font-size: 12px;
  color: var(--muted);
  padding: 0 4px;
}
.ranges-legend .legend-chip i {
  width: 14px; height: 14px;
  border-radius: 4px;
  display: inline-block;
}
.legend-call i  { background: #22c55e; }
.legend-fold-explorer i { background: #1f2937; border: 1px solid var(--line-soft); }

/* Big mobile grid — fills the screen width with comfortable cells */
.big-range-grid {
  display: grid;
  grid-template-columns: repeat(13, 1fr);
  gap: 2px;
  background: var(--panel);
  padding: 4px;
  border-radius: var(--r-2);
  border: 1px solid var(--line-soft);
}
.big-cell {
  position: relative;
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  font-size: 9.5px;
  font-weight: 700;
  font-family: var(--mono);
  color: rgba(255,255,255,.92);
  background: var(--panel-2);
  border-radius: 3px;
  transition: transform .12s var(--ease);
  overflow: hidden;
  cursor: pointer;
  user-select: none;
}
.big-cell:active { transform: scale(.92); }
.big-cell .big-cell-label { position: relative; z-index: 2; mix-blend-mode: normal; pointer-events: none; }
/* The mix is drawn as left-anchored color bands behind the label */
.big-cell .mix-band {
  position: absolute;
  inset: 0;
  display: flex;
  pointer-events: none;
}
.big-cell .mix-band > i {
  display: block;
  height: 100%;
}
.big-cell .mix-band > i.raise { background: var(--raise); }
.big-cell .mix-band > i.call  { background: #16a34a; }
.big-cell .mix-band > i.fold  { background: #1f2937; }

/* Selected cell ring */
.big-cell[data-sel="true"] {
  box-shadow: 0 0 0 2px #fbbf24, 0 0 8px rgba(251,191,36,.5);
  z-index: 2;
}

/* PLO category list (replaces the 13x13 grid for PLO formats) */
.plo-cat-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.plo-cat-group-eyebrow {
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: var(--sp-2);
}
.plo-cat-row {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: 10px var(--sp-3);
  background: var(--panel-2);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-2);
  text-align: left;
  width: 100%;
  transition: transform .12s var(--ease);
}
.plo-cat-row:active { transform: scale(.99); }
.plo-cat-row[data-action="raise"] {
  background: linear-gradient(135deg, rgba(59,130,246,.10), var(--panel-2));
  border-color: rgba(59,130,246,.4);
}
.plo-cat-row[data-action="call"] {
  background: linear-gradient(135deg, rgba(34,197,94,.08), var(--panel-2));
  border-color: rgba(34,197,94,.35);
}
.plo-cat-row[data-action="fold"] { opacity: .55; }
.plo-cat-glyph {
  width: 36px; height: 36px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 18px;
  font-weight: 800;
  flex-shrink: 0;
  background: var(--panel);
  border: 1px solid var(--line-soft);
  color: var(--text);
}
.plo-cat-row[data-action="raise"] .plo-cat-glyph {
  background: linear-gradient(180deg, var(--accent) 0%, var(--accent-strong) 100%);
  color: #fff;
  border-color: transparent;
}
.plo-cat-row[data-action="call"] .plo-cat-glyph {
  background: linear-gradient(180deg, #34d399 0%, #15803d 100%);
  color: #fff;
  border-color: transparent;
}
.plo-cat-text { flex: 1; min-width: 0; }
.plo-cat-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}
.plo-cat-sample {
  display: flex;
  gap: 3px;
  flex-shrink: 0;
}
.plo-mini-card {
  width: 18px;
  height: 26px;
  border-radius: 3px;
  background: #fff;
  display: grid;
  place-items: center;
  font-family: Georgia, serif;
  font-size: 10px;
  font-weight: 800;
  border: 1px solid #e5e7eb;
}
.plo-mini-card[data-color="r"] { color: #dc2626; }
.plo-mini-card[data-color="b"] { color: #111827; }

/* Category bottom-sheet specific bits */
.sheet-cat-row {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding-bottom: var(--sp-3);
  border-bottom: 1px solid var(--line-soft);
}
.sheet-cat-glyph {
  width: 56px; height: 56px;
  border-radius: var(--r-2);
  display: grid;
  place-items: center;
  font-size: 28px;
  font-weight: 800;
  background: linear-gradient(180deg, var(--accent) 0%, var(--accent-strong) 100%);
  color: #fff;
  flex-shrink: 0;
}
.sheet-cat-label {
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
}
.sheet-cat-action {
  margin-top: 2px;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: .04em;
  text-transform: uppercase;
}
.sheet-cat-desc {
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
  color: var(--muted);
}
.sheet-cat-eyebrow {
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 4px;
}
.sheet-cat-combos {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: var(--sp-2);
}
.sheet-cat-combo {
  display: flex;
  gap: 2px;
  padding: 6px;
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  justify-content: center;
}

.ranges-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
.ranges-stat {
  background: var(--panel-2);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-2);
  padding: 8px;
  text-align: center;
}
.ranges-stat-num {
  font-size: 16px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.ranges-stat-num[data-tone="raise"] { color: var(--raise); }
.ranges-stat-num[data-tone="call"]  { color: #34d399; }
.ranges-stat-num[data-tone="fold"]  { color: var(--muted); }
.ranges-stat-label {
  font-size: 10px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 2px;
}

/* Bottom sheet for hand detail */
.sheet-overlay {
  align-items: end;
  padding: 0;
  background: rgba(2,6,23,.55);
}
.sheet-card {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  border-radius: var(--r-4) var(--r-4) 0 0;
  padding: var(--sp-3) var(--sp-4) calc(var(--safe-bottom) + var(--sp-4));
  animation: sheetIn .25s var(--ease);
}
@keyframes sheetIn {
  from { transform: translateY(40%); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}
.sheet-grabber {
  width: 36px;
  height: 4px;
  border-radius: 2px;
  background: var(--line-soft);
  margin: -4px auto var(--sp-3);
}
.sheet-hand-row {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding-bottom: var(--sp-3);
  border-bottom: 1px solid var(--line-soft);
}
.sheet-hand-label {
  font-family: var(--mono);
  font-size: 28px;
  font-weight: 800;
  color: var(--text);
  min-width: 64px;
}
.sheet-hand-cards {
  display: flex;
  gap: 4px;
}
.sheet-card-mini {
  width: 36px;
  height: 50px;
  border-radius: 5px;
  background: #fff;
  border: 1.5px solid #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,.35);
  display: grid;
  grid-template-rows: auto 1fr;
  padding: 4px 5px;
  font-family: Georgia, serif;
}
.sheet-card-mini[data-color="r"] { color: #dc2626; }
.sheet-card-mini[data-color="b"] { color: #111827; }
.sheet-card-mini-rank { font-size: 13px; font-weight: 800; line-height: 1; }
.sheet-card-mini-suit { font-size: 14px; align-self: end; justify-self: center; line-height: 1; }

.sheet-mix {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: var(--sp-3) 0;
}
.sheet-mix-row {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}
.sheet-mix-label {
  font-size: 13px;
  font-weight: 700;
  width: 56px;
  color: var(--text);
}
.sheet-mix-bar {
  flex: 1;
  height: 18px;
  border-radius: 999px;
  background: rgba(255,255,255,.05);
  overflow: hidden;
  border: 1px solid var(--line-soft);
}
.sheet-mix-bar > i {
  display: block;
  height: 100%;
  border-radius: 999px;
  transition: width .25s var(--ease);
}
.sheet-mix-pct {
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--text);
  width: 42px;
  text-align: right;
}
.sheet-mix-row[data-action="raise"] .sheet-mix-bar > i,
.sheet-mix-row[data-action="raise"] .sheet-mix-label { color: var(--raise); }
.sheet-mix-row[data-action="raise"] .sheet-mix-bar > i { background: var(--raise); }
.sheet-mix-row[data-action="call"]  .sheet-mix-bar > i { background: #16a34a; }
.sheet-mix-row[data-action="call"]  .sheet-mix-label  { color: #34d399; }
.sheet-mix-row[data-action="fold"]  .sheet-mix-bar > i { background: #475569; }
.sheet-mix-row[data-action="fold"]  .sheet-mix-label  { color: var(--muted); }
.sheet-tip {
  margin: 0 0 var(--sp-2);
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
}

.badge-list {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-3);
}
.badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
}
.badge-art {
  width: 56px; height: 56px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 26px;
  background: var(--panel-2);
  border: 1px solid var(--line-soft);
  color: var(--dim);
}
.badge.is-unlocked .badge-art {
  background: linear-gradient(180deg, #fbbf24 0%, #b45309 100%);
  color: #1f1306;
  border-color: #fbbf24;
  box-shadow: 0 6px 18px -10px rgba(245,158,11,.5);
}
.badge-label {
  font-size: 10px;
  color: var(--muted);
  line-height: 1.2;
}

.profile-settings {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--line-soft);
  border-radius: var(--r-3);
  overflow: hidden;
  border: 1px solid var(--line-soft);
}
.row-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 14px var(--sp-4);
  background: var(--panel-2);
  font-size: 15px;
  color: var(--text);
}
.row-btn:active { background: var(--panel-3); }
.row-value { color: var(--muted); font-size: 14px; }
.row-btn-danger { color: var(--bad); }

/* ─────────────────────────────────────────────────────────────────────
   Settings rows — toggle pill
   ───────────────────────────────────────────────────────────────────── */
.row-toggle {
  position: relative;
  width: 38px;
  height: 22px;
  border-radius: 999px;
  background: var(--line-soft);
  transition: background .2s var(--ease);
  flex-shrink: 0;
}
.row-toggle::after {
  content: "";
  position: absolute;
  top: 3px; left: 3px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #cbd5e1;
  transition: transform .2s var(--ease), background .2s var(--ease);
}
.row-toggle[data-on="true"] {
  background: var(--accent);
}
.row-toggle[data-on="true"]::after {
  transform: translateX(16px);
  background: #fff;
}

/* ─────────────────────────────────────────────────────────────────────
   Modal overlay (out-of-chips / general)
   ───────────────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2,6,23,.78);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: grid;
  place-items: center;
  padding: var(--sp-5);
  z-index: 100;
  animation: fadeIn .2s var(--ease);
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal-card {
  width: 100%;
  max-width: 360px;
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-4);
  padding: var(--sp-5);
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  animation: modalIn .25s var(--ease);
}
@keyframes modalIn {
  from { transform: translateY(20px) scale(.96); opacity: 0; }
  to   { transform: translateY(0) scale(1); opacity: 1; }
}
.modal-art { display: grid; place-items: center; }
.modal-title {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
}
.modal-body {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--muted);
}
.modal-body strong { color: var(--text); }
.modal-actions {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  margin-top: var(--sp-2);
}

/* Achievement unlock celebration */
.achievement-overlay { z-index: 110; }
.achievement-card {
  text-align: center;
  position: relative;
  overflow: hidden;
}
.achievement-card::before {
  content: "";
  position: absolute;
  inset: -50%;
  background:
    conic-gradient(from 0deg,
      rgba(251,191,36,0) 0deg,
      rgba(251,191,36,.18) 30deg,
      rgba(251,191,36,0) 60deg,
      rgba(251,191,36,0) 180deg,
      rgba(251,191,36,.18) 210deg,
      rgba(251,191,36,0) 240deg,
      rgba(251,191,36,0) 360deg);
  animation: spin 6s linear infinite;
  pointer-events: none;
}
@keyframes spin { to { transform: rotate(360deg); } }
.achievement-eyebrow {
  position: relative;
  font-size: 11px;
  letter-spacing: .18em;
  font-weight: 700;
  text-transform: uppercase;
  color: #fbbf24;
}
.achievement-art {
  position: relative;
  font-size: 64px;
  line-height: 1;
  margin: var(--sp-2) auto;
  animation: badgeIn .6s var(--ease);
  filter: drop-shadow(0 8px 20px rgba(245,158,11,.55));
}
@keyframes badgeIn {
  0%   { transform: scale(.4) rotate(-30deg); opacity: 0; }
  60%  { transform: scale(1.2) rotate(8deg); opacity: 1; }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}
.achievement-title {
  position: relative;
  margin: 0;
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
}
.achievement-body {
  position: relative;
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--muted);
}

/* Lesson detail modal */
.detail-card { text-align: center; }
.detail-icon {
  font-size: 56px;
  line-height: 1;
  color: var(--accent);
  margin-bottom: 4px;
  filter: drop-shadow(0 6px 14px rgba(59,130,246,.4));
}
.detail-title {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
}
.detail-sub {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}
.detail-stars {
  display: flex;
  gap: var(--sp-2);
  justify-content: center;
  margin: var(--sp-2) 0;
}
.detail-stars .big-star {
  font-size: 28px;
  /* Skip the entrance animation when used in a modal */
  animation: none;
  opacity: 1;
  transform: scale(1);
}
.detail-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-2);
  margin: var(--sp-2) 0;
}

/* Recap modal art */
.recap-modal-art {
  font-size: 56px;
  line-height: 1;
  margin: 0 auto;
  filter: drop-shadow(0 8px 18px rgba(168,85,247,.5));
}
.recap-modal-card { text-align: center; }

/* ─────────────────────────────────────────────────────────────────────
   Coach overlay (first-drill tutorial)
   ───────────────────────────────────────────────────────────────────── */
.coach-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2,6,23,.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: grid;
  place-items: end center;
  padding: 0 var(--sp-4) calc(var(--safe-bottom) + 24px);
  z-index: 90;
  animation: fadeIn .25s var(--ease);
}
.coach-card {
  width: 100%;
  max-width: 360px;
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-4);
  padding: var(--sp-5);
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  animation: modalIn .3s var(--ease);
}
.coach-step {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent);
}
.coach-title {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
}
.coach-body {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--muted);
}
.coach-body strong { color: var(--text); }
.coach-actions {
  display: flex;
  gap: var(--sp-2);
  margin-top: var(--sp-3);
}
.coach-actions .btn { height: 48px; font-size: 15px; flex: 1; }

/* Highlight the focus target with a soft ring drawn over the dim overlay */
.coach-spotlight {
  position: relative;
  z-index: 91;
  box-shadow:
    0 0 0 9999px rgba(0,0,0,0),
    0 0 0 4px rgba(59,130,246,.55),
    0 0 24px 8px rgba(59,130,246,.35);
  border-radius: 16px;
  animation: spotlightPulse 1.6s ease-in-out infinite;
}
@keyframes spotlightPulse {
  0%, 100% { box-shadow: 0 0 0 9999px rgba(0,0,0,0), 0 0 0 4px rgba(59,130,246,.55), 0 0 24px 8px rgba(59,130,246,.35); }
  50%      { box-shadow: 0 0 0 9999px rgba(0,0,0,0), 0 0 0 6px rgba(59,130,246,.75), 0 0 30px 14px rgba(59,130,246,.45); }
}

/* ─────────────────────────────────────────────────────────────────────
   Screen transitions (forward slides; back slides reverse)
   ───────────────────────────────────────────────────────────────────── */
.screen[data-anim="enter-fwd"] { animation: slideInFwd .28s var(--ease); }
.screen[data-anim="enter-back"] { animation: slideInBack .28s var(--ease); }
@keyframes slideInFwd {
  from { transform: translateX(20%); opacity: 0; }
  to   { transform: translateX(0);   opacity: 1; }
}
@keyframes slideInBack {
  from { transform: translateX(-20%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

/* ─────────────────────────────────────────────────────────────────────
   Confetti
   ───────────────────────────────────────────────────────────────────── */
.confetti {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 80;
}
.confetti:empty { display: none; }
.confetti-piece {
  position: absolute;
  top: -16px;
  width: 8px;
  height: 14px;
  border-radius: 2px;
  opacity: 0;
  animation: confettiFall var(--dur, 2.4s) cubic-bezier(.22,.7,.32,1) forwards;
}
@keyframes confettiFall {
  0%   { opacity: 0; transform: translate3d(0, -20px, 0) rotate(0deg); }
  10%  { opacity: 1; }
  100% { opacity: 0; transform: translate3d(var(--dx, 0px), 110vh, 0) rotate(var(--rot, 720deg)); }
}

/* ─────────────────────────────────────────────────────────────────────
   Toast
   ───────────────────────────────────────────────────────────────────── */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--safe-bottom) + 90px);
  transform: translate(-50%, 20px);
  background: var(--panel-3);
  border: 1px solid var(--line-soft);
  color: var(--text);
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(0,0,0,.4);
  opacity: 0;
  transition: opacity .2s var(--ease), transform .2s var(--ease);
  z-index: 50;
  pointer-events: none;
}
.toast[data-show="true"] {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ─────────────────────────────────────────────────────────────────────
   Reduced motion
   ───────────────────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* ─────────────────────────────────────────────────────────────────────
   Tablet polish
   ───────────────────────────────────────────────────────────────────── */
@media (min-width: 600px) {
  .quest-app {
    margin-top: 16px;
    margin-bottom: 16px;
    border-radius: var(--r-5);
    overflow: hidden;
    box-shadow: 0 24px 60px -20px rgba(0,0,0,.6);
    min-height: calc(100dvh - 32px);
  }
}

/* ─────────────────────────────────────────────────────────────────────
   Desktop — wider container + key 2-column layouts
   ───────────────────────────────────────────────────────────────────── */
@media (min-width: 720px) {
  /* Expand the shell to use more of the available panel */
  .quest-app {
    max-width: 780px;
    margin-top: 0;
    margin-bottom: 0;
    border-radius: 0;
    min-height: 100dvh;
    box-shadow: none;
  }

  /* ── Home screen ── */
  .home-body {
    padding: var(--sp-4) var(--sp-7) calc(var(--safe-bottom) + var(--sp-6));
  }

  /* 2-column promo cards */
  .promo-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--sp-3);
  }

  /* Wider lesson path: flatten the zigzag so nodes run straighter */
  .lesson-node:nth-child(odd)  { --offset: -36px; }
  .lesson-node:nth-child(even) { --offset:  36px; }

  /* ── Onboarding: skill level as 2-column grid ── */
  .level-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--sp-3);
  }

  /* ── Drill screen: table on left, prompt + options on right ── */
  .screen-drill .drill-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 36px;
    row-gap: var(--sp-3);
    align-items: center;
    padding: var(--sp-5) var(--sp-7) var(--sp-6);
  }
  /* attack bar spans both columns when visible */
  .screen-drill .attack-bar {
    grid-column: 1 / -1;
    margin: 0;
  }
  /* table spans both rows of the right slot */
  .screen-drill .poker-table {
    grid-row: span 2;
    max-width: none;
    width: 100%;
    align-self: center;
  }
  .screen-drill .drill-prompt {
    padding: 0;
    text-align: left;
    align-self: end;
    font-size: 19px;
  }
  .screen-drill .drill-options {
    padding: 0;
    align-self: start;
  }

  /* ── Breakdown: wider padding, bigger range cells ── */
  .breakdown-body {
    padding: var(--sp-5) var(--sp-7) var(--sp-7);
  }
  .range-cell {
    font-size: 11px;
  }

  /* ── Range explorer: wider padding, bigger grid cells ── */
  .ranges-body {
    padding: var(--sp-4) var(--sp-7) var(--sp-7);
  }
  .big-range-grid {
    gap: 3px;
  }
  .big-cell {
    font-size: 11.5px;
    border-radius: 4px;
  }

  /* ── Complete screen: center in the wider layout ── */
  .complete-body {
    padding: var(--sp-7) var(--sp-7);
    max-width: 480px;
    margin: 0 auto;
  }

  /* ── Profile body: wider padding ── */
  .profile-body {
    padding: var(--sp-4) var(--sp-7) var(--sp-7);
  }
  .badge-list {
    grid-template-columns: repeat(6, 1fr);
  }
}

/* ─────────────────────────────────────────────────────────────────────
   Wide desktop — full dashboard layout (used when Quest is embedded
   in the desktop SPA's Course > Quest iframe sub-pane)
   ───────────────────────────────────────────────────────────────────── */
@media (min-width: 1024px) {
  .quest-app {
    max-width: 1100px;
    padding-left: 0;
    padding-right: 0;
  }

  /* Top bar gets more breathing room and centers the streak/XP/chip pills */
  .home-topbar {
    padding: 0 var(--sp-7);
    height: 72px;
  }
  .streak-pill, .xp-pill, .chips-pill {
    font-size: 14px;
  }

  /* Home: 2-column layout — daily goal + recap on the left, promo cards on the right */
  .home-body {
    display: grid;
    grid-template-columns: 1fr 1.1fr;
    column-gap: var(--sp-6);
    row-gap: var(--sp-5);
    padding: var(--sp-5) var(--sp-7) calc(var(--safe-bottom) + var(--sp-7));
    align-items: start;
  }
  .daily-goal-card { grid-column: 1; }
  .recap-card      { grid-column: 1; }
  .promo-row {
    grid-column: 2;
    grid-row: 1 / span 3;
    grid-template-columns: 1fr 1fr;
    align-content: start;
  }
  .units { grid-column: 1 / -1; }

  /* Daily goal card: bigger ring, more presence */
  .daily-goal-card {
    padding: var(--sp-5) var(--sp-6);
    border-radius: var(--r-4);
  }
  .daily-ring svg { width: 80px; height: 80px; }
  .daily-goal-title { font-size: 18px; }
  .daily-goal-sub   { font-size: 14px; }

  /* Promo cards: taller for desktop legibility */
  .promo-card {
    padding: var(--sp-5);
    min-height: 96px;
  }
  .promo-card-title { font-size: 16px; }
  .promo-card-sub   { font-size: 13px; }

  /* Onboarding screens center vertically in the desktop frame */
  .screen-onboarding .onboarding-body,
  .screen-goal       .onboarding-body,
  .screen-hero       .hero-body {
    max-width: 720px;
    margin: 0 auto;
    padding-left: var(--sp-7);
    padding-right: var(--sp-7);
  }
  .level-list {
    grid-template-columns: 1fr 1fr;
    gap: var(--sp-3);
    max-width: 640px;
  }
  .goal-list {
    grid-template-columns: 1fr 1fr;
    gap: var(--sp-3);
    max-width: 640px;
  }

  /* Range explorer: 3-column grid of filters at the top */
  .ranges-body .filter-row {
    margin-bottom: var(--sp-3);
  }

  /* Big range grid: more visible cells */
  .big-range-grid {
    max-width: 720px;
    margin: 0 auto;
  }
  .big-cell {
    font-size: 13px;
  }

  /* Drill screen: keep the 2-column drill layout but allow more space */
  .screen-drill .drill-body {
    max-width: 980px;
    margin: 0 auto;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   Postflop Tree — hand-class panel + V/B/M legend + texture strip
   Used by HUD/tree-screen.js. Scoped to .screen-tree to avoid leakage.
   ═══════════════════════════════════════════════════════════════════════════ */

/* V/B/M legend under the colored strip on each tree node */
.screen-tree .sp-vbm-legend {
  display: flex;
  gap: 10px;
  margin-top: 4px;
  font-size: 10px;
  color: #94a3b8;
  font-family: inherit;
}
.screen-tree .sp-vbm-legend-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 2px;
  margin-right: 4px;
  vertical-align: middle;
}
.screen-tree .sp-vbm-legend-dot-v { background: #34d399; }
.screen-tree .sp-vbm-legend-dot-b { background: #f87171; }
.screen-tree .sp-vbm-legend-dot-m { background: #a78bfa; }

/* Toggle row for the hand-class panel */
.screen-tree .sp-tree-class-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 6px;
  padding: 4px 0;
  background: none;
  border: none;
  color: #93c5fd;
  font-size: 11px;
  font-family: inherit;
  cursor: pointer;
}
.screen-tree .sp-tree-class-toggle:hover { color: #bfdbfe; }

/* Panel body (expanded state) */
.screen-tree .sp-tree-class-panel {
  margin-top: 8px;
  padding: 10px 12px;
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(51, 65, 85, 0.5);
  border-radius: 8px;
}

/* One class row inside the panel */
.screen-tree .sp-tree-class-row {
  display: grid;
  grid-template-columns: 1fr 80px 36px 40px;
  gap: 8px;
  align-items: center;
  padding: 3px 0;
  font-size: 11px;
}
.screen-tree .sp-tree-class-label { color: #cbd5e1; }
.screen-tree .sp-tree-class-barwrap {
  height: 6px;
  background: rgba(51, 65, 85, 0.5);
  border-radius: 3px;
  overflow: hidden;
}
.screen-tree .sp-tree-class-bar {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #60a5fa);
  border-radius: 3px;
}
.screen-tree .sp-tree-class-pct {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: #e2e8f0;
  text-align: right;
}
.screen-tree .sp-tree-class-n {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: #64748b;
  text-align: right;
}
.screen-tree .sp-tree-class-rare {
  margin-top: 6px;
  font-size: 10px;
  color: #64748b;
}
.screen-tree .sp-tree-class-empty {
  font-size: 11px;
  color: #64748b;
  text-align: center;
  padding: 6px 0;
}

/* Texture chip strip below the tree-screen header */
.screen-tree .sp-tex-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(15, 23, 42, 0.35);
  border-bottom: 1px solid rgba(51, 65, 85, 0.35);
}
.screen-tree .sp-tex-strip-label {
  flex-shrink: 0;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #64748b;
  font-weight: 600;
}
.screen-tree .sp-tex-strip-pills {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  flex-wrap: nowrap;
  -webkit-overflow-scrolling: touch;
}
.screen-tree .sp-tex-strip-pills::-webkit-scrollbar { display: none; }
.screen-tree .sp-tex-strip-pills .sp-pill {
  flex-shrink: 0;
  white-space: nowrap;
}

