/* ThinkerLoop — premium dark mode styles */

:root {
  --bg: #06080F;
  --bg-2: #0A0D17;
  --panel: rgba(14, 17, 28, 0.72);
  --panel-2: rgba(20, 24, 36, 0.88);
  --panel-border: rgba(255, 255, 255, 0.06);
  --panel-edge: rgba(255, 255, 255, 0.12);
  --text-hi: #F5F7FB;
  --text-md: #C4CADA;
  --text-lo: #6B7491;
  --text-vlo: #3E4663;
  --accent: #A78BFA;
  --accent-2: #67E8F9;
  --accent-3: #F472B6;
  --glow-soft: 0 0 0 1px rgba(255,255,255,0.04), 0 24px 60px -28px rgba(167, 139, 250, 0.32), 0 8px 24px -16px rgba(0,0,0,0.6);
  --shadow-card: 0 1px 0 rgba(255,255,255,0.06) inset, 0 -1px 0 rgba(0,0,0,0.4) inset, 0 30px 60px -30px rgba(0,0,0,0.8), 0 8px 24px -12px rgba(0,0,0,0.5);
}

html, body { background: var(--bg); color: var(--text-hi); -webkit-font-smoothing: antialiased; }
body {
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(167, 139, 250, 0.10), transparent 60%),
    radial-gradient(900px 500px at 0% 100%, rgba(103, 232, 249, 0.07), transparent 55%),
    radial-gradient(800px 400px at 100% 100%, rgba(244, 114, 182, 0.05), transparent 60%),
    linear-gradient(180deg, var(--bg), var(--bg-2));
  min-height: 100vh;
}
/* Dot grid texture */
body::before {
  content: '';
  position: fixed; inset: 0;
  background-image: radial-gradient(circle at 1px 1px, rgba(255,255,255,0.025) 1px, transparent 0);
  background-size: 32px 32px;
  pointer-events: none;
  z-index: 0;
}

/* Soft ambient gradient blobs */
.ambient-orbs { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.orb {
  position: absolute; border-radius: 50%; filter: blur(140px); opacity: .15;
  animation: float 22s ease-in-out infinite;
}
.orb-1 { width: 620px; height: 620px; background: #A78BFA; top: -260px; left: -180px; }
.orb-2 { width: 520px; height: 520px; background: #67E8F9; bottom: -240px; right: -160px; animation-delay: -8s; }
.orb-3 { width: 420px; height: 420px; background: #F472B6; top: 50%; left: 60%; animation-delay: -14s; opacity: .08; }

@keyframes float {
  0%,100% { transform: translate(0,0) scale(1); }
  50% { transform: translate(60px,-40px) scale(1.08); }
}

main, header, footer, .ad-slot { position: relative; z-index: 1; }

/* Header */
header.sticky {
  background: rgba(6, 8, 15, 0.55) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04) !important;
}

/* Brand */
.brand-link { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }
.logo-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px;
  position: relative;
}
.logo-mark::after {
  content: ''; position: absolute; inset: -6px;
  background: radial-gradient(circle at 30% 30%, rgba(167,139,250,.25), transparent 70%);
  border-radius: 50%;
  filter: blur(8px);
  z-index: -1;
}
.brand-wordmark {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-weight: 600; font-size: 19px; letter-spacing: -0.02em;
  color: var(--text-hi);
}
.brand-thinker { color: var(--text-hi); }
.brand-loop {
  background: linear-gradient(135deg, #C4B5FD 0%, #7DD3FC 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* Sidebar */
.sidebar-panel { position: sticky; top: 88px; align-self: start; max-height: calc(100vh - 110px); }
.sidebar-inner {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 18px;
  padding: 20px 14px;
  backdrop-filter: blur(24px) saturate(140%);
  -webkit-backdrop-filter: blur(24px) saturate(140%);
  max-height: calc(100vh - 110px);
  overflow-y: auto;
  box-shadow: var(--shadow-card);
  position: relative;
}
.sidebar-inner::before {
  content: ''; position: absolute; inset: 0;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255,255,255,.04) 0%, transparent 30%);
  pointer-events: none;
}
.sidebar-inner::-webkit-scrollbar { width: 6px; }
.sidebar-inner::-webkit-scrollbar-thumb { background: rgba(255,255,255,.08); border-radius: 6px; }

.zone-group .zone-title {
  font-size: 10px; font-weight: 600; letter-spacing: .22em; text-transform: uppercase;
  color: var(--text-lo);
  margin-bottom: 8px; padding-left: 12px;
  display: flex; align-items: center; gap: 8px;
}
.zone-group .zone-title .zone-svg {
  width: 12px; height: 12px; color: var(--zone-color, var(--text-lo));
  filter: drop-shadow(0 0 6px var(--zone-color, transparent));
}

.cat-btn {
  width: 100%; text-align: left; padding: 9px 12px; border-radius: 10px;
  font-size: 13.5px; color: var(--text-md);
  display: flex; align-items: center; gap: 10px;
  border: 1px solid transparent;
  transition: background 160ms ease, color 160ms ease, transform 160ms cubic-bezier(.16,1,.3,1);
  position: relative;
}
.cat-btn:hover { background: rgba(255,255,255,.035); color: var(--text-hi); transform: translateX(2px); }
.cat-btn[data-active="true"] {
  background: linear-gradient(90deg, color-mix(in oklab, var(--zone-color) 14%, transparent), transparent);
  color: var(--text-hi);
}
.cat-btn[data-active="true"]::before {
  content: ''; position: absolute; left: 0; top: 8px; bottom: 8px; width: 2px;
  background: var(--zone-color); border-radius: 2px;
  box-shadow: 0 0 12px var(--zone-color);
}
.cat-btn .cat-icon { font-size: 15px; opacity: .85; width: 18px; text-align: center; }
.cat-btn .cat-count {
  margin-left: auto; font-size: 10.5px; color: var(--text-lo);
  font-family: 'JetBrains Mono', ui-monospace, monospace; font-weight: 500;
  background: rgba(255,255,255,.04); padding: 2px 7px; border-radius: 999px;
  border: 1px solid rgba(255,255,255,.05);
}

/* Stage panel */
.stage-panel {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 22px;
  padding: 36px;
  backdrop-filter: blur(24px) saturate(140%);
  -webkit-backdrop-filter: blur(24px) saturate(140%);
  box-shadow: var(--shadow-card);
  min-height: 540px;
  position: relative;
  overflow: hidden;
}
.stage-panel::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.18), transparent);
  pointer-events: none;
}
.stage-panel::after {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(800px 400px at 20% 0%, rgba(167,139,250,.04), transparent 50%);
  pointer-events: none;
}
.stage-panel > * { position: relative; z-index: 1; }

@media (max-width: 640px) {
  .stage-panel { padding: 20px; border-radius: 18px; }
}

/* Puzzle card */
.puzzle-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.zone-pill {
  font-size: 11px; padding: 4px 10px; border-radius: 999px; font-weight: 600; letter-spacing: .04em;
  background: color-mix(in oklab, var(--zone-color) 18%, transparent);
  color: var(--zone-color);
  border: 1px solid color-mix(in oklab, var(--zone-color) 35%, transparent);
}
.archetype-name { color: #94a3b8; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }
.puzzle-difficulty { display: inline-flex; gap: 2px; }
.puzzle-difficulty span { width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,.15); }
.puzzle-difficulty span.on { background: var(--zone-color); box-shadow: 0 0 8px var(--zone-color); }

.puzzle-title {
  font-family: 'Space Grotesk', sans-serif; font-weight: 500; font-size: 36px;
  line-height: 1.08; letter-spacing: -.028em;
  margin-bottom: 16px;
  color: var(--text-hi);
}
@media (max-width: 640px) { .puzzle-title { font-size: 26px; } }

.puzzle-prompt {
  font-size: 16px; line-height: 1.65; color: var(--text-md);
  padding: 20px 22px; border-radius: 14px;
  background: rgba(255,255,255,.025);
  border: 1px solid rgba(255,255,255,.05);
  margin-bottom: 24px;
  white-space: pre-wrap;
  font-weight: 300;
}

.puzzle-visual {
  display: flex; justify-content: center; padding: 22px 0; margin-bottom: 16px;
  border-radius: 16px; background: rgba(0,0,0,0.25); border: 1px solid rgba(255,255,255,.04);
  min-height: 120px; align-items: center;
}

.answer-input {
  width: 100%; padding: 14px 16px; border-radius: 12px;
  background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.1);
  color: #fff; font-size: 16px; font-family: inherit;
  transition: border-color 180ms, box-shadow 180ms;
}
.answer-input:focus { outline: none; border-color: var(--zone-color); box-shadow: 0 0 0 4px color-mix(in oklab, var(--zone-color) 18%, transparent); }
.answer-input::placeholder { color: #64748b; }

.choice-grid { display: grid; gap: 10px; grid-template-columns: 1fr; }
@media (min-width: 520px) { .choice-grid { grid-template-columns: 1fr 1fr; } }

.choice {
  text-align: left; padding: 14px 16px; border-radius: 12px;
  background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.08);
  color: #e2e8f0; font-size: 15px; cursor: pointer;
  transition: all 160ms cubic-bezier(.16,1,.3,1);
  display: flex; align-items: center; gap: 12px;
}
.choice:hover { background: rgba(255,255,255,.07); border-color: var(--zone-color); transform: translateY(-1px); }
.choice .choice-key {
  width: 26px; height: 26px; border-radius: 8px; background: rgba(255,255,255,.05);
  display: inline-flex; align-items: center; justify-content: center; font-family: ui-monospace, monospace; font-size: 12px;
  color: #94a3b8;
}
.choice.correct { background: rgba(16, 185, 129, 0.14); border-color: #10b981; }
.choice.wrong { background: rgba(239, 68, 68, 0.12); border-color: #ef4444; }

.btn {
  padding: 12px 22px; border-radius: 999px; font-weight: 500; font-size: 14px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: transform 180ms cubic-bezier(.16,1,.3,1), background 180ms ease, border-color 180ms ease, box-shadow 240ms ease;
  cursor: pointer; border: 1px solid transparent;
  font-family: inherit; letter-spacing: -0.005em;
}
.btn-primary {
  background:
    linear-gradient(180deg, rgba(255,255,255,.10), transparent 60%),
    linear-gradient(135deg, var(--zone-color, #A78BFA), color-mix(in oklab, var(--zone-color, #A78BFA) 50%, #67E8F9));
  color: #0F0A1E;
  box-shadow:
    0 1px 0 rgba(255,255,255,.3) inset,
    0 -1px 0 rgba(0,0,0,.2) inset,
    0 12px 32px -10px color-mix(in oklab, var(--zone-color, #A78BFA) 60%, transparent),
    0 4px 12px -4px rgba(0,0,0,.4);
  font-weight: 600;
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 1px 0 rgba(255,255,255,.3) inset, 0 -1px 0 rgba(0,0,0,.2) inset, 0 16px 40px -10px color-mix(in oklab, var(--zone-color, #A78BFA) 70%, transparent), 0 6px 14px -4px rgba(0,0,0,.5); }
.btn-primary:active { transform: scale(.98); }
.btn-ghost {
  background: rgba(255,255,255,.035);
  border-color: rgba(255,255,255,.08);
  color: var(--text-hi);
  box-shadow: 0 1px 0 rgba(255,255,255,.04) inset;
}
.btn-ghost:hover { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.14); transform: translateY(-1px); }

.action-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }

/* Clue panel */
.clue-panel {
  margin-top: 18px; padding: 16px 18px; border-radius: 14px;
  background: rgba(124, 58, 237, 0.08);
  border: 1px solid rgba(124, 58, 237, 0.25);
  font-size: 14px; color: #e9d5ff;
}
.clue-loading {
  display: flex; align-items: center; gap: 12px; font-family: ui-monospace, monospace;
  color: #c4b5fd;
}
.countdown {
  font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums;
  color: #fff; min-width: 28px; text-align: center;
}

/* Intellect Core (slide up after solve) */
.intellect-core {
  margin-top: 24px;
  border-radius: 20px;
  padding: 24px;
  background: linear-gradient(180deg, rgba(16,185,129,.08), rgba(15,23,42,.4));
  border: 1px solid rgba(16, 185, 129, 0.3);
  animation: fadeUp 480ms cubic-bezier(.16,1,.3,1);
}
.intellect-core h3 {
  font-family: 'Space Grotesk'; font-weight: 600; font-size: 18px; margin-bottom: 6px;
  color: #6ee7b7;
}
.intellect-core .answer-line { font-size: 15px; color: #e2e8f0; margin-bottom: 12px; }
.intellect-core .answer-line b { color: #fff; }
.intellect-core .breakdown { font-size: 14.5px; line-height: 1.65; color: #cbd5e1; }

/* Revealed state — different color palette so users know no stars earned */
.intellect-core.intellect-revealed {
  background: linear-gradient(180deg, rgba(167,139,250,.10), rgba(15,23,42,.4));
  border-color: rgba(167,139,250,0.35);
}
.intellect-core.intellect-revealed h3 { color: #C4B5FD; }
.answer-revealed { color: #C4B5FD !important; }
.answer-revealed b { color: #fff !important; }

/* Reveal button subtle color hint */
.btn-reveal { color: #C4B5FD !important; }
.btn-reveal:hover { background: rgba(167,139,250,.08) !important; border-color: rgba(167,139,250,.24) !important; }

/* Sudoku revealed cells */
.sudoku-cell.sudoku-revealed { color: #C4B5FD; background: rgba(167,139,250,.08); animation: revealPop 320ms cubic-bezier(.16,1,.3,1); }
@keyframes revealPop { 0% { transform: scale(0.6); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }

/* Inline ad slot */
.ad-slot {
  border: 1px dashed rgba(255,255,255,.12);
  border-radius: 14px;
  padding: 14px 18px;
  background: linear-gradient(135deg, rgba(255,255,255,.02), rgba(255,255,255,.04));
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
}
.ad-label {
  font-size: 10px; letter-spacing: .18em; font-weight: 700;
  color: #64748b; background: rgba(255,255,255,.04); padding: 4px 8px; border-radius: 6px;
  white-space: nowrap;
}
.ad-body { font-size: 13px; color: #94a3b8; }
.ad-slot-banner { margin-bottom: 0; }
.intellect-core .ad-slot { margin-top: 18px; }

/* Shake animation hook */
.shake { animation: shake 420ms cubic-bezier(.36,.07,.19,.97); }
@keyframes shake {
  10%,90% { transform: translateX(-2px); }
  20%,80% { transform: translateX(3px); }
  30%,50%,70% { transform: translateX(-6px); }
  40%,60% { transform: translateX(6px); }
}

/* Welcome screen — editorial */
.welcome-hero { padding: 8px 0 32px; }
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 11px; font-weight: 600; letter-spacing: .22em; text-transform: uppercase;
  color: var(--text-lo);
  padding: 6px 12px; border-radius: 999px;
  background: rgba(255,255,255,.03); border: 1px solid rgba(255,255,255,.06);
  margin-bottom: 28px;
}
.hero-eyebrow .dot {
  width: 6px; height: 6px; border-radius: 50%; background: #34D399;
  box-shadow: 0 0 12px #34D399; animation: pulseDot 2s ease-in-out infinite;
}
@keyframes pulseDot { 0%,100% { opacity: 1; } 50% { opacity: .4; } }

.welcome-hero h1 {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-weight: 600; font-size: 64px; letter-spacing: -.035em; line-height: 1.02;
  color: var(--text-hi);
  margin-bottom: 20px;
  max-width: 720px;
}
.welcome-hero h1 em {
  font-family: 'Instrument Serif', Georgia, serif;
  font-style: italic; font-weight: 400;
  background: linear-gradient(135deg, #C4B5FD 20%, #7DD3FC 70%, #6EE7B7);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  padding: 0 4px;
}
@media (max-width: 640px) {
  .welcome-hero h1 { font-size: 40px; }
  .stage-panel { padding: 22px !important; border-radius: 18px; }
}
.welcome-hero .hero-sub {
  font-size: 18px; color: var(--text-md); max-width: 560px; line-height: 1.55;
  margin-bottom: 36px; font-weight: 300;
}
.welcome-hero .hero-stats {
  display: flex; gap: 32px; padding: 20px 24px;
  border-radius: 16px;
  background: rgba(255,255,255,.02);
  border: 1px solid rgba(255,255,255,.05);
  margin-bottom: 32px;
  flex-wrap: wrap;
}
.welcome-hero .hero-stats .stat { display: flex; flex-direction: column; gap: 2px; }
.welcome-hero .hero-stats .stat-v {
  font-family: 'Space Grotesk'; font-weight: 600; font-size: 28px; color: var(--text-hi); letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
}
.welcome-hero .hero-stats .stat-l {
  font-size: 11px; color: var(--text-lo); letter-spacing: .14em; text-transform: uppercase; font-weight: 500;
}
.welcome-hero .hero-stats .stat-divider {
  width: 1px; background: linear-gradient(180deg, transparent, rgba(255,255,255,.08), transparent);
  align-self: stretch;
}

.hero-ctas { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 56px; }

/* Featured Daily card */
.daily-featured {
  display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: center;
  padding: 24px 28px; border-radius: 18px; margin-bottom: 48px;
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.06), rgba(167, 139, 250, 0.04));
  border: 1px solid rgba(251, 191, 36, 0.18);
  position: relative; overflow: hidden;
  cursor: pointer;
  transition: transform 240ms cubic-bezier(.16,1,.3,1), border-color 240ms ease;
}
.daily-featured:hover { transform: translateY(-2px); border-color: rgba(251, 191, 36, .35); }
.daily-featured::after {
  content: ''; position: absolute; top: -40px; right: -40px; width: 180px; height: 180px;
  background: radial-gradient(circle, rgba(251,191,36,.18), transparent 70%);
  pointer-events: none;
}
.daily-featured .df-eyebrow {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 10px; font-weight: 700; letter-spacing: .22em; text-transform: uppercase;
  color: #FBBF24; margin-bottom: 10px;
}
.daily-featured .df-eyebrow svg { width: 12px; height: 12px; }
.daily-featured .df-title {
  font-family: 'Space Grotesk'; font-weight: 600; font-size: 22px; letter-spacing: -.015em;
  color: var(--text-hi); margin-bottom: 6px;
}
.daily-featured .df-sub { font-size: 13.5px; color: var(--text-md); line-height: 1.5; max-width: 460px; }
.daily-featured .df-cta {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px; border-radius: 999px;
  background: linear-gradient(135deg, #FBBF24, #F59E0B);
  color: #0F0A02; font-weight: 600; font-size: 13.5px;
  box-shadow: 0 8px 24px -8px rgba(251, 191, 36, .5);
  white-space: nowrap;
  z-index: 1;
}

/* Today · Daily grid */
.today-progress {
  font-size: 11px; color: var(--text-lo); letter-spacing: .06em;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
}
.today-progress b { color: var(--text-hi); font-weight: 500; }
.today-date { color: var(--text-md); font-weight: 400; font-family: 'Space Grotesk'; text-transform: none; letter-spacing: -0.005em; }

.daily-grid {
  display: grid; gap: 14px; margin-bottom: 44px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.daily-card {
  display: grid; grid-template-columns: 56px 1fr auto; gap: 16px;
  align-items: center; text-align: left;
  padding: 20px 22px; border-radius: 18px;
  background: rgba(255,255,255,.025);
  border: 1px solid color-mix(in oklab, var(--zone-color) 20%, rgba(255,255,255,.06));
  cursor: pointer; overflow: hidden; position: relative;
  transition: transform 280ms cubic-bezier(.16,1,.3,1), border-color 280ms ease, background 280ms ease;
}
.daily-card::before {
  content: ''; position: absolute; inset: 0; opacity: .5; pointer-events: none;
  background: radial-gradient(400px 200px at 80% -20%, color-mix(in oklab, var(--zone-color) 12%, transparent), transparent 65%);
}
.daily-card:hover { transform: translateY(-3px); border-color: color-mix(in oklab, var(--zone-color) 55%, transparent); background: rgba(255,255,255,.04); }
.daily-card.done {
  background: linear-gradient(135deg, color-mix(in oklab, var(--zone-color) 10%, transparent), rgba(16,185,129,.05));
  border-color: color-mix(in oklab, var(--zone-color) 40%, transparent);
}
.daily-card-icon {
  width: 56px; height: 56px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; color: var(--zone-color);
  background: color-mix(in oklab, var(--zone-color) 12%, rgba(255,255,255,.02));
  border: 1px solid color-mix(in oklab, var(--zone-color) 30%, transparent);
  box-shadow: 0 0 28px -8px var(--zone-color);
}
.daily-card-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.daily-card-eyebrow {
  font-size: 10.5px; letter-spacing: .22em; text-transform: uppercase; font-weight: 600;
  color: var(--zone-color);
}
.daily-card.done .daily-card-eyebrow { color: #6ee7b7; }
.daily-card-name { font-family: 'Space Grotesk'; font-weight: 600; font-size: 20px; letter-spacing: -.015em; color: var(--text-hi); }
.daily-card-desc { font-size: 12.5px; color: var(--text-lo); line-height: 1.5; }
.daily-card-cta {
  font-size: 13px; font-weight: 600; color: var(--text-hi);
  padding: 8px 14px; border-radius: 999px;
  background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.08);
  white-space: nowrap;
  transition: background 180ms;
}
.daily-card:hover .daily-card-cta { background: var(--zone-color); color: #0f0a02; }

/* Extra stat-icon hint next to numeric */
.stat-hint { font-size: 15px; margin-left: 5px; }

/* Section heading */
.section-h {
  display: flex; align-items: baseline; gap: 12px;
  margin-bottom: 20px; margin-top: 8px;
}
.section-h h2 {
  font-family: 'Space Grotesk'; font-weight: 500; font-size: 13px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--text-lo);
}
.section-h .section-line {
  flex: 1; height: 1px;
  background: linear-gradient(90deg, rgba(255,255,255,.08), transparent);
}

/* Refined zone tiles */
.zone-tiles {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.zone-tile {
  padding: 22px; border-radius: 18px; text-align: left;
  background: rgba(255,255,255,.02);
  border: 1px solid rgba(255,255,255,.06);
  transition: transform 280ms cubic-bezier(.16,1,.3,1), border-color 280ms ease, background 280ms ease;
  cursor: pointer;
  position: relative; overflow: hidden;
}
.zone-tile::before {
  content: ''; position: absolute; inset: 0; opacity: 0; transition: opacity 360ms ease;
  background: radial-gradient(400px 200px at 80% -10%, color-mix(in oklab, var(--zone-color) 10%, transparent), transparent 60%);
  pointer-events: none;
}
.zone-tile:hover {
  transform: translateY(-3px); border-color: color-mix(in oklab, var(--zone-color) 40%, transparent);
  background: rgba(255,255,255,.035);
}
.zone-tile:hover::before { opacity: 1; }
.zone-tile .tile-icon {
  width: 38px; height: 38px; border-radius: 11px;
  display: inline-flex; align-items: center; justify-content: center;
  background: color-mix(in oklab, var(--zone-color) 12%, rgba(255,255,255,.02));
  border: 1px solid color-mix(in oklab, var(--zone-color) 25%, transparent);
  color: var(--zone-color);
  margin-bottom: 18px;
  box-shadow: 0 0 24px -8px var(--zone-color);
}
.zone-tile .tile-icon svg { width: 18px; height: 18px; }
.zone-tile .tile-name { font-family: 'Space Grotesk'; font-weight: 600; font-size: 16px; color: var(--text-hi); margin-bottom: 6px; letter-spacing: -.01em; }
.zone-tile .tile-desc { font-size: 13px; color: var(--text-lo); line-height: 1.5; }
.zone-tile .tile-count {
  font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 11px; color: var(--text-vlo);
  margin-top: 14px; padding-top: 12px; border-top: 1px solid rgba(255,255,255,.04);
  display: flex; justify-content: space-between;
}

/* Mobile sidebar overlay */
@media (max-width: 1023px) {
  .sidebar-panel { position: fixed; top: 64px; left: 0; right: 0; bottom: 0; z-index: 30; padding: 16px; }
  .sidebar-panel:not(.hidden) { display: block; background: rgba(2,6,23,.85); backdrop-filter: blur(20px); }
}

/* Visual puzzle helpers */
.matrix-grid { display: grid; gap: 8px; }
.matrix-cell {
  aspect-ratio: 1; border-radius: 10px; background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
  display: flex; align-items: center; justify-content: center;
  font-size: 28px;
}
.matrix-cell.unknown { background: rgba(124,58,237,.1); border-color: rgba(124,58,237,.4); }

.memory-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; max-width: 320px; }
.memory-cell { aspect-ratio: 1; border-radius: 10px; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.08); cursor: pointer; transition: all 160ms; }
.memory-cell.lit { background: var(--zone-color); box-shadow: 0 0 20px var(--zone-color); }
.memory-cell.selected { border-color: var(--zone-color); background: color-mix(in oklab, var(--zone-color) 30%, transparent); }

/* ========== Interactive Engine ========== */
.interactive-host { flex-direction: column; gap: 14px; padding: 22px; }

/* 1) Simon */
.simon-wrap { width:100%; max-width: 380px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.simon-status { color:#cbd5e1; font-size:14px; min-height: 20px; font-family: ui-monospace, monospace; }
.simon-grid { display:grid; gap: 10px; width: 100%; }
.simon-cell { aspect-ratio: 1; border-radius: 14px; background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08); cursor: pointer; transition: all 120ms ease; }
.simon-cell:hover:not(:disabled) { background: rgba(255,255,255,0.07); }
.simon-cell.lit { background: var(--zone-color); box-shadow: 0 0 30px var(--zone-color), inset 0 0 18px rgba(255,255,255,.25); transform: scale(0.97); }
.simon-progress { width: 100%; height: 4px; background: rgba(255,255,255,.06); border-radius: 2px; overflow: hidden; }
.simon-progress span { display: block; height: 100%; background: var(--zone-color); width: 0; transition: width 160ms ease; }

/* 2) Cup shuffle */
.cups-wrap { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.cups-status { color:#cbd5e1; font-size: 14px; min-height: 20px; }
.cups-track { position: relative; width: 100%; max-width: 460px; height: 140px; }
.cup {
  position: absolute; left: 0; top: 20px; width: 120px; height: 100px;
  transition: transform 380ms cubic-bezier(.6,.05,.32,1);
}
.cup .cup-body {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, color-mix(in oklab, var(--zone-color) 70%, #0f172a), #0f172a);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 10px 10px 40% 40% / 10px 10px 24% 24%;
  box-shadow: 0 12px 28px -10px var(--zone-color);
  transition: transform 280ms cubic-bezier(.16,1,.3,1);
}
.cup .ball {
  position: absolute; bottom: -6px; left: 50%; transform: translateX(-50%);
  width: 22px; height: 22px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff, #fbbf24 65%);
  box-shadow: 0 0 18px rgba(251,191,36,.7);
  opacity: 0; transition: opacity 200ms;
}
.cup.lifted .cup-body { transform: translateY(-44px); }
.cup.lifted .ball { opacity: 1; }
.cup.selectable { cursor: pointer; }
.cup.selectable:hover .cup-body { transform: translateY(-6px); }
.cup.cup-correct .cup-body { border-color: #10b981; box-shadow: 0 0 30px #10b981; }
.cups-hint { color:#64748b; font-size: 12px; }

/* 3) Mental rotation */
.rotation-wrap { display: flex; flex-direction: column; align-items: center; gap: 16px; width:100%; }
.rotation-status { color:#cbd5e1; font-size: 14px; }
.rotation-base { padding: 18px 26px; border-radius: 16px; background: rgba(255,255,255,.03); border: 1px solid rgba(255,255,255,.08); }
.rotation-options { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; width: 100%; max-width: 480px; }
.rotation-card {
  position: relative; padding: 12px; border-radius: 14px;
  background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.08);
  cursor: pointer; transition: all 160ms ease;
  display: flex; align-items: center; justify-content: center;
}
.rotation-card:hover { background: rgba(255,255,255,.07); border-color: var(--zone-color); transform: translateY(-2px); }
.rotation-card.correct { border-color: #10b981; background: rgba(16,185,129,.1); }
.rotation-card.wrong { border-color: #ef4444; background: rgba(239,68,68,.1); }
.rotation-label { position:absolute; top:6px; left:8px; font-family: ui-monospace, monospace; font-size: 10px; color:#64748b; }

/* 4) Trolley vote */
.vote-wrap { display:flex; flex-direction:column; gap: 14px; width:100%; max-width: 540px; }
.vote-stage { border-radius: 14px; background: rgba(0,0,0,.25); overflow: hidden; }
.vote-choices { display:grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.vote-btn { padding: 14px; border-radius: 12px; background: rgba(255,255,255,.04); border:1px solid rgba(255,255,255,.1); color:#e2e8f0; cursor:pointer; font-size:14px; font-weight:500; transition: all 160ms; }
.vote-btn:hover:not(:disabled) { background: rgba(255,255,255,.08); border-color: var(--zone-color); }
.vote-btn:disabled { opacity: .85; cursor: default; }
.vote-btn.chosen { background: color-mix(in oklab, var(--zone-color) 25%, transparent); border-color: var(--zone-color); color:#fff; box-shadow: 0 0 18px -4px var(--zone-color); }
.vote-bar { position: relative; height: 36px; border-radius: 10px; overflow: hidden; background: rgba(255,255,255,.04); display: flex; }
.vote-fill { height: 100%; display: flex; align-items: center; padding: 0 12px; font-size: 12px; font-family: ui-monospace, monospace; transition: width 600ms cubic-bezier(.16,1,.3,1); white-space: nowrap; overflow: hidden; }
.vote-fill span { opacity: .9; }
.vote-a { background: linear-gradient(90deg, color-mix(in oklab, var(--zone-color) 55%, #0f172a), color-mix(in oklab, var(--zone-color) 30%, #0f172a)); }
.vote-b { background: linear-gradient(90deg, rgba(255,255,255,.06), rgba(255,255,255,.10)); justify-content: flex-end; text-align: right; }
.vote-meta { font-size: 11px; color:#64748b; font-family: ui-monospace, monospace; }

/* 5) Müller-Lyer */
.illusion-wrap { display:flex; flex-direction:column; gap: 14px; width:100%; max-width: 540px; }
.illusion-status { color:#cbd5e1; font-size:14px; }
.illusion-svg { background: rgba(0,0,0,.25); border-radius: 14px; }
.illusion-slider-wrap { display:flex; align-items:center; gap: 12px; font-size: 12px; color:#94a3b8; }
.illusion-slider { flex: 1; appearance: none; height: 6px; border-radius: 4px; background: rgba(255,255,255,.08); }
.illusion-slider::-webkit-slider-thumb { appearance: none; width: 18px; height: 18px; border-radius: 50%; background: var(--zone-color); box-shadow: 0 0 12px var(--zone-color); cursor: pointer; }
.illusion-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* 6) Reaction */
.react-wrap { width: 100%; max-width: 460px; display: flex; flex-direction: column; gap: 14px; align-items: center; }
.react-pad {
  width: 100%; aspect-ratio: 2.4;
  border-radius: 18px; border: 1px solid rgba(255,255,255,.08);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  cursor: pointer; font-size: 28px; font-weight: 700;
  transition: background-color 80ms, border-color 80ms, box-shadow 200ms;
  font-family: 'Space Grotesk';
}
.react-state { font-size: 28px; }
.react-hint { font-size: 12px; font-weight: 400; color: rgba(255,255,255,.7); }
.react-idle { background: rgba(239,68,68,.12); border-color: rgba(239,68,68,.4); color: #fecaca; }
.react-arming { background: rgba(251,191,36,.16); border-color: rgba(251,191,36,.5); color: #fde68a; }
.react-ready { background: rgba(16,185,129,.2); border-color: #10b981; color:#fff; box-shadow: 0 0 40px rgba(16,185,129,.5); }
.react-fail { background: rgba(239,68,68,.25); border-color: #ef4444; color: #fff; }
.react-stats { font-size: 13px; color: #94a3b8; font-family: ui-monospace, monospace; }

/* 7) Maze */
.maze-wrap { display:flex; flex-direction:column; align-items:center; gap: 12px; width:100%; }
.maze-status { color:#cbd5e1; font-size: 13px; }
.maze-grid { display: grid; gap: 4px; padding: 8px; background: rgba(0,0,0,.25); border-radius: 12px; }
.maze-cell { width: 38px; height: 38px; border-radius: 6px; background: rgba(255,255,255,.04); position: relative; }
.maze-cell.wall { background: linear-gradient(135deg, rgba(255,255,255,.12), rgba(255,255,255,.04)); border: 1px solid rgba(255,255,255,.1); }
.maze-cell.goal::after { content:'★'; position:absolute; inset:0; display:flex; align-items:center; justify-content:center; color: var(--zone-color); font-size: 20px; }
.maze-cell.player::before { content:''; position: absolute; inset: 6px; border-radius: 50%; background: radial-gradient(circle at 30% 30%, #fff, var(--zone-color) 70%); box-shadow: 0 0 16px var(--zone-color); }
.maze-meta { font-size: 12px; color:#94a3b8; font-family: ui-monospace, monospace; }
.maze-pad { display: flex; flex-direction: column; align-items: center; gap: 4px; margin-top: 4px; }
.maze-pad-row { display: flex; gap: 4px; }
.maze-pad button { width: 44px; height: 44px; border-radius: 10px; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.1); color: #e2e8f0; font-size: 18px; cursor: pointer; }
.maze-pad button:active { background: var(--zone-color); }

/* 8) Logic gate */
.gate-wrap { display:flex; flex-direction:column; align-items:center; gap: 16px; }
.gate-status { color:#cbd5e1; font-size:14px; text-align:center; }
.gate-circuit { display:flex; align-items: center; gap: 14px; padding: 20px; border-radius: 16px; background: rgba(0,0,0,.25); }
.gate-input, .gate-out { padding: 12px 16px; border-radius: 12px; background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.1); color:#cbd5e1; font-family: ui-monospace, monospace; font-size: 13px; cursor: pointer; transition: all 160ms; }
.gate-input.on { background: var(--zone-color); color:#fff; border-color: var(--zone-color); box-shadow: 0 0 18px var(--zone-color); }
.gate-out { cursor: default; }
.gate-out.on { background: rgba(16,185,129,.2); border-color: #10b981; color: #6ee7b7; box-shadow: 0 0 18px rgba(16,185,129,.4); }
.gate-body { padding: 16px 22px; border-radius: 12px; background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.12); font-family: 'Space Grotesk'; font-weight: 700; color:#fff; letter-spacing: 0.06em; }

/* 9) Sudoku */
.sudoku-wrap { display:flex; flex-direction:column; align-items:center; gap: 14px; width: 100%; }
.sudoku-status { font-size: 13px; color:#cbd5e1; text-align: center; max-width: 360px; }
.sudoku-grid { display:grid; grid-template-columns: repeat(4, 64px); grid-template-rows: repeat(4, 64px); gap: 2px; padding: 4px; background: rgba(255,255,255,.06); border-radius: 12px; }
.sudoku-cell {
  background: rgba(15,23,42,.7); border: none; color:#fff; font-size: 22px; font-family: 'Space Grotesk'; font-weight: 600;
  display:flex; align-items:center; justify-content:center; cursor:pointer; border-radius: 4px;
  transition: background 140ms, transform 100ms;
}
.sudoku-cell:hover:not(.locked) { background: rgba(255,255,255,.06); }
.sudoku-cell.locked { color: var(--zone-color); background: rgba(15,23,42,.95); cursor: default; }
.sudoku-cell.selected { background: color-mix(in oklab, var(--zone-color) 25%, transparent); box-shadow: inset 0 0 0 2px var(--zone-color); }
.sudoku-cell.conflict { color: #fca5a5; background: rgba(239,68,68,.18); }
.sudoku-cell.border-right-thick { box-shadow: inset -2px 0 0 rgba(255,255,255,.18); }
.sudoku-cell.border-bottom-thick { box-shadow: inset 0 -2px 0 rgba(255,255,255,.18); }
.sudoku-cell.border-right-thick.border-bottom-thick { box-shadow: inset -2px 0 0 rgba(255,255,255,.18), inset 0 -2px 0 rgba(255,255,255,.18); }
.sudoku-pad { display: flex; gap: 6px; }
.sudoku-key {
  width: 44px; height: 44px; border-radius: 10px; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.1);
  color: #e2e8f0; font-size: 17px; font-family: 'Space Grotesk'; font-weight: 600; cursor: pointer; transition: all 140ms;
}
.sudoku-key:hover { background: var(--zone-color); border-color: var(--zone-color); color: #fff; }
.sudoku-key-erase { color: #fca5a5; }
.sudoku-actions { display: flex; gap: 10px; }

/* 10) Slide tile */
.slide-wrap { display:flex; flex-direction:column; align-items:center; gap: 14px; }
.slide-status { font-size: 13px; color:#cbd5e1; text-align: center; max-width: 360px; }
.slide-grid { display: grid; gap: 6px; padding: 8px; background: rgba(255,255,255,.04); border-radius: 14px; }
.slide-tile {
  border-radius: 10px; border: 1px solid rgba(255,255,255,.1);
  background: linear-gradient(135deg, color-mix(in oklab, var(--zone-color) 40%, #0f172a), #0f172a);
  color: #fff; font-size: 22px; font-family: 'Space Grotesk'; font-weight: 700;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  transition: transform 160ms cubic-bezier(.16,1,.3,1), box-shadow 200ms;
  box-shadow: 0 4px 14px -6px var(--zone-color);
}
.slide-tile:hover { transform: scale(1.04); }
.slide-empty { background: transparent; box-shadow: none; border-style: dashed; opacity: .4; cursor: default; }
.slide-empty:hover { transform: none; }
.slide-tile.done { background: linear-gradient(135deg, #10b981, #059669); box-shadow: 0 4px 14px -6px #10b981; }
.slide-meta { font-size: 12px; color:#94a3b8; font-family: ui-monospace, monospace; }

/* 11) Nonogram */
.nono-wrap { display:flex; flex-direction:column; align-items:center; gap: 14px; }
.nono-status { font-size: 13px; color:#cbd5e1; text-align: center; max-width: 380px; }
.nono-board {
  display: grid;
  grid-template-columns: 80px repeat(5, 40px);
  grid-template-rows: 80px repeat(5, 40px);
  gap: 3px;
  background: rgba(255,255,255,.04);
  padding: 8px; border-radius: 12px;
}
.nono-corner { grid-column: 1; grid-row: 1; }
.nono-col-clues { grid-column: 2 / 7; grid-row: 1; display: grid; grid-template-columns: repeat(5, 40px); gap: 3px; }
.nono-row-clues { grid-column: 1; grid-row: 2 / 7; display: grid; grid-template-rows: repeat(5, 40px); gap: 3px; }
.nono-clue {
  display: flex; align-items: flex-end; justify-content: center; gap: 3px;
  font-family: ui-monospace, monospace; font-size: 12px; color: #cbd5e1;
}
.nono-clue-row { flex-direction: row; align-items: center; justify-content: flex-end; padding-right: 6px; }
.nono-clue-col { flex-direction: column; align-items: center; padding-bottom: 4px; }
.nono-clue span { background: rgba(255,255,255,.05); padding: 2px 5px; border-radius: 4px; min-width: 16px; text-align: center; }
.nono-grid { grid-column: 2 / 7; grid-row: 2 / 7; display: grid; grid-template-columns: repeat(5, 40px); grid-template-rows: repeat(5, 40px); gap: 3px; }
.nono-cell {
  background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.08);
  border-radius: 6px; cursor: pointer; transition: all 120ms;
}
.nono-cell:hover { background: rgba(255,255,255,.08); }
.nono-cell.fill { background: var(--zone-color); border-color: var(--zone-color); box-shadow: inset 0 0 8px rgba(0,0,0,.3); }
.nono-cell.fill.done { animation: pulseGlow 1.6s ease-in-out infinite; }
.nono-cell.marked { background: rgba(239,68,68,.05); }
.nono-cell.marked::after { content: '✕'; display:flex; align-items:center; justify-content:center; height:100%; color: rgba(239,68,68,.6); font-size: 16px; }

/* Difficulty tabs */
.diff-tabs {
  display: inline-flex; gap: 4px; padding: 4px;
  background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.08);
  border-radius: 12px; margin-bottom: 14px;
}
.diff-tabs button {
  padding: 7px 16px; font-size: 12px; font-weight: 600; letter-spacing: .04em;
  border-radius: 8px; color: #94a3b8; background: transparent; border: 0; cursor: pointer;
  transition: all 160ms;
}
.diff-tabs button:hover { color: #e2e8f0; }
.diff-tabs button[data-active="true"] {
  background: linear-gradient(135deg, var(--zone-color), color-mix(in oklab, var(--zone-color) 60%, #fff));
  color: #0f172a; box-shadow: 0 4px 14px -4px var(--zone-color);
}

/* 12) Queens */
.queens-wrap { display:flex; flex-direction:column; align-items:center; gap: 14px; }
.queens-status { font-size: 13px; color:#cbd5e1; text-align: center; max-width: 380px; }
.queens-grid { display: grid; gap: 0; padding: 6px; background: rgba(0,0,0,.3); border-radius: 12px; }
.queens-cell {
  border: none; cursor: pointer; display: flex; align-items: center; justify-content: center;
  font-size: 22px; transition: transform 80ms;
}
.queens-cell:hover { transform: scale(0.96); }
.queens-cell .qq { color: #fff; text-shadow: 0 0 8px rgba(255,255,255,.5); filter: drop-shadow(0 2px 4px rgba(0,0,0,.4)); }
.queens-cell .qx { color: rgba(255,255,255,.4); font-size: 14px; }
.queens-cell.conflict { background-color: rgba(239,68,68,.4) !important; box-shadow: inset 0 0 0 2px #ef4444 !important; }
.queens-actions { display: flex; gap: 10px; }

/* 13) Zip — LinkedIn-style drag-to-draw with filled color regions + white ribbon */
.zip-wrap { display:flex; flex-direction:column; align-items:center; gap: 14px; }
.zip-status { font-size: 13px; color: var(--text-md); text-align: center; max-width: 420px; min-height: 18px; line-height: 1.5; }
.zip-board {
  position: relative;
  background: rgba(255,255,255,.02);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 20px;
  padding: 0;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05), 0 20px 40px -20px rgba(0,0,0,.6);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.zip-cells { position: absolute; inset: 0; }
.zip-cell {
  position: absolute;
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  pointer-events: none;
  transition: filter 200ms ease;
  background: linear-gradient(135deg,
    color-mix(in oklab, var(--region-color, #3B82F6) 55%, #0F172A),
    color-mix(in oklab, var(--region-color, #3B82F6) 32%, #0F172A));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08);
}
.zip-region-0 { --region-color: #8B5CF6; }
.zip-region-1 { --region-color: #3B82F6; }
.zip-cell .zip-cp {
  width: 30px; height: 30px; border-radius: 50%;
  background: #0F0F14;
  color: #fff;
  font-weight: 700; font-size: 15px;
  font-family: 'Space Grotesk';
  display: flex; align-items: center; justify-content: center;
  box-shadow:
    0 1px 0 rgba(255,255,255,.14) inset,
    0 -1px 0 rgba(0,0,0,.4) inset,
    0 2px 6px rgba(0,0,0,.5);
  position: relative; z-index: 3;
}
.zip-cell.in-path { filter: brightness(1.05); }
.zip-cell.head { filter: brightness(1.15); }
.zip-path-svg {
  position: absolute; inset: 0;
  pointer-events: none;
  overflow: visible;
  z-index: 2;
}
.zip-trail-glow {
  fill: none;
  stroke: rgba(255,255,255,.28);
  stroke-width: 34;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: blur(6px);
}
.zip-trail {
  fill: none;
  stroke: #ffffff;
  stroke-width: 26;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,.4));
}
.zip-head-dot {
  fill: #fff;
  stroke: rgba(0,0,0,.3);
  stroke-width: 2;
  filter: drop-shadow(0 0 6px rgba(255,255,255,.6));
}
.zip-meta { font-size: 12px; color: var(--text-lo); font-family: 'JetBrains Mono', ui-monospace, monospace; }
.zip-actions { display: flex; gap: 10px; }

/* 14) Pinpoint */
.pin-wrap { display:flex; flex-direction:column; gap: 14px; width:100%; max-width: 540px; }
.pin-status { font-size: 14px; color:#cbd5e1; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.pin-attempts { font-size: 11px; color:#64748b; font-family: ui-monospace, monospace; }
.pin-clues { display: flex; flex-direction: column; gap: 8px; }
.pin-clue {
  padding: 12px 16px; border-radius: 12px;
  background: rgba(255,255,255,.03); border: 1px solid rgba(255,255,255,.06);
  font-size: 16px; color: #475569; font-family: 'Space Grotesk';
  transition: all 240ms cubic-bezier(.16,1,.3,1);
}
.pin-clue.shown {
  background: color-mix(in oklab, var(--zone-color) 12%, rgba(255,255,255,.03));
  border-color: color-mix(in oklab, var(--zone-color) 50%, transparent);
  color: #fff;
  animation: fadeUp 360ms cubic-bezier(.16,1,.3,1);
}
.pin-input-row { display: flex; gap: 8px; }
.pin-input {
  flex: 1; padding: 12px 14px; border-radius: 10px;
  background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.1);
  color: #fff; font-size: 15px; font-family: inherit;
}
.pin-input:focus { outline: none; border-color: var(--zone-color); box-shadow: 0 0 0 3px color-mix(in oklab, var(--zone-color) 22%, transparent); }
.pin-input:disabled { opacity: .5; }
.pin-submit:disabled, .pin-reveal-next:disabled { opacity: .45; cursor: default; }

/* Header auth + leaderboard */
.header-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 14px; border-radius: 999px;
  background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.08);
  color: var(--text-hi); font-size: 13px; font-weight: 500;
  cursor: pointer; transition: background 160ms ease, transform 160ms cubic-bezier(.16,1,.3,1), border-color 160ms ease;
}
.header-pill:hover { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.14); transform: translateY(-1px); }
.header-pill.hidden { display: none; }
.header-pill svg { flex-shrink: 0; }
.auth-signin { background: #fff; color: #1f2937; border-color: rgba(0,0,0,.08); font-weight: 600; }
.auth-signin:hover { background: #f3f4f6; }

.auth-profile {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 4px 10px 4px 4px; border-radius: 999px;
  background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.08);
  font-size: 13px;
}
.auth-profile.hidden { display: none; }
.auth-profile img {
  width: 26px; height: 26px; border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(255,255,255,.1);
}
.auth-profile #auth-name { color: var(--text-hi); font-weight: 500; }
.auth-signout {
  background: transparent; border: 0; color: var(--text-lo);
  cursor: pointer; font-size: 13px; padding: 2px 6px; border-radius: 6px;
  transition: color 160ms, background 160ms;
}
.auth-signout:hover { color: #fca5a5; background: rgba(239,68,68,.08); }

/* Leaderboard view */
.leaderboard { padding: 8px 0; }
.lb-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 32px; flex-wrap: wrap; }
.lb-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 11px; font-weight: 600; letter-spacing: .22em; text-transform: uppercase;
  color: var(--text-lo);
  padding: 5px 10px; border-radius: 999px;
  background: rgba(255,255,255,.03); border: 1px solid rgba(255,255,255,.06);
  margin-bottom: 14px;
}
.lb-title {
  font-family: 'Space Grotesk'; font-weight: 600; font-size: 38px; letter-spacing: -.025em; line-height: 1.05;
  color: var(--text-hi); margin-bottom: 8px; max-width: 580px;
}
.lb-sub { font-size: 15px; color: var(--text-md); max-width: 480px; line-height: 1.5; font-weight: 300; }
.lb-list { display: flex; flex-direction: column; gap: 6px; }
.lb-loading, .lb-empty {
  padding: 32px; text-align: center; color: var(--text-lo); font-size: 14px;
  background: rgba(255,255,255,.02); border: 1px dashed rgba(255,255,255,.08); border-radius: 14px;
}
.lb-empty code {
  background: rgba(255,255,255,.06); padding: 2px 6px; border-radius: 4px;
  font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 12.5px;
  color: var(--text-hi);
}
.lb-row {
  display: grid; grid-template-columns: 56px 38px 1fr auto auto; gap: 14px;
  align-items: center; padding: 12px 18px; border-radius: 14px;
  background: rgba(255,255,255,.025); border: 1px solid rgba(255,255,255,.05);
  transition: background 160ms ease, transform 160ms cubic-bezier(.16,1,.3,1);
}
.lb-row:hover { background: rgba(255,255,255,.04); }
.lb-row.lb-me {
  background: linear-gradient(90deg, rgba(167,139,250,.10), rgba(167,139,250,.02));
  border-color: rgba(167,139,250,.32);
}
.lb-row.lb-gold { border-color: rgba(251,191,36,.4); background: linear-gradient(90deg, rgba(251,191,36,.10), transparent); }
.lb-row.lb-silver { border-color: rgba(203,213,225,.3); background: linear-gradient(90deg, rgba(203,213,225,.07), transparent); }
.lb-row.lb-bronze { border-color: rgba(217,119,6,.3); background: linear-gradient(90deg, rgba(217,119,6,.07), transparent); }
.lb-rank {
  font-family: 'Space Grotesk'; font-weight: 600; font-size: 20px; color: var(--text-lo);
  text-align: center; font-variant-numeric: tabular-nums;
}
.lb-gold .lb-rank { color: #FBBF24; }
.lb-silver .lb-rank { color: #E2E8F0; }
.lb-bronze .lb-rank { color: #FB923C; }
.lb-avatar {
  width: 38px; height: 38px; border-radius: 50%; overflow: hidden;
  background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.08);
  display: flex; align-items: center; justify-content: center;
}
.lb-avatar img { width: 100%; height: 100%; object-fit: cover; }
.lb-initials { color: var(--text-md); font-weight: 600; font-size: 14px; font-family: 'Space Grotesk'; }
.lb-name { color: var(--text-hi); font-size: 15px; font-weight: 500; }
.lb-name em { color: var(--text-lo); font-style: normal; font-size: 12px; font-weight: 400; }
.lb-streak { color: var(--text-md); font-size: 13px; font-family: 'JetBrains Mono', ui-monospace, monospace; }
.lb-stars {
  color: var(--text-hi); font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums;
  font-family: 'Space Grotesk'; display: inline-flex; align-items: baseline; gap: 4px;
}
.lb-stars-l { color: #FBBF24; font-size: 13px; }
.lb-divider { text-align: center; color: var(--text-vlo); font-size: 14px; padding: 8px 0; letter-spacing: .3em; }

/* 15) Wend — colored-region word tracing (LinkedIn-style) */
.wend-wrap { display: flex; flex-direction: column; align-items: center; gap: 18px; }
.wend-status { font-size: 13px; color: var(--text-md); text-align: center; max-width: 460px; line-height: 1.55; min-height: 18px; }
.wend-board {
  position: relative;
  background: rgba(255,255,255,.02);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 20px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05), 0 20px 40px -20px rgba(0,0,0,.6);
  touch-action: none; user-select: none; -webkit-user-select: none;
}
.wend-cells { position: absolute; inset: 0; }
.wend-cell {
  position: absolute;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  pointer-events: none;
  /* Neutral start state — no region color revealed yet */
  background: linear-gradient(180deg, #22283A, #1A1F2E);
  border: 1px solid rgba(255,255,255,.06);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05);
  transition: transform 140ms cubic-bezier(.16,1,.3,1), background 320ms ease, border-color 320ms ease, box-shadow 260ms ease;
}
.wend-cell.wend-blocked {
  background: repeating-linear-gradient(45deg, #171B26, #171B26 4px, #1D2233 4px, #1D2233 8px);
  border-color: rgba(255,255,255,.04);
  box-shadow: none;
  pointer-events: none;
}
.wend-letter {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-weight: 700; font-size: 22px;
  color: #F5F7FB;
  text-shadow: 0 1px 2px rgba(0,0,0,.5);
}
.wend-cell.wend-active {
  transform: scale(0.94);
  background: linear-gradient(180deg, #2F3550, #23283F);
  border-color: rgba(255,255,255,.24);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.14),
    0 0 0 2px rgba(255,255,255,.5);
}
.wend-cell.wend-head {
  transform: scale(0.92);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.18), 0 0 0 3px #ffffff;
}
/* Solved state — region color reveals here */
.wend-cell.wend-solved {
  background: linear-gradient(135deg,
    color-mix(in oklab, var(--region-color, #64748B) 60%, #0F172A),
    color-mix(in oklab, var(--region-color, #64748B) 35%, #0F172A));
  border-color: color-mix(in oklab, var(--region-color) 50%, transparent);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.24),
    0 0 20px color-mix(in oklab, var(--region-color) 60%, transparent);
  transform: scale(1);
}
.wend-cell.wend-solved .wend-letter { text-shadow: 0 1px 3px rgba(0,0,0,.7); }

/* Word list at the bottom */
.wend-words {
  display: flex; flex-wrap: wrap; gap: 8px; justify-content: center;
  max-width: 540px;
}
.wend-word {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 6px 10px; border-radius: 10px;
  background: rgba(255,255,255,.03);
  border: 1px solid color-mix(in oklab, var(--region-color, #64748B) 30%, rgba(255,255,255,.06));
  transition: all 260ms cubic-bezier(.16,1,.3,1);
}
.wend-word.done {
  background: color-mix(in oklab, var(--region-color) 20%, transparent);
  border-color: color-mix(in oklab, var(--region-color) 60%, transparent);
}
.wend-word-letter {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 26px;
  border-radius: 4px;
  background: color-mix(in oklab, var(--region-color) 40%, #0F172A);
  color: #fff; font-family: 'Space Grotesk'; font-weight: 700; font-size: 12.5px;
}
.wend-word.done .wend-word-letter {
  background: var(--region-color);
  color: #0F0A02;
}
.wend-len {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10px; color: var(--text-lo);
  margin-left: 4px;
}
.wend-check { color: #6EE7B7; margin-left: 4px; font-size: 14px; font-weight: 700; }
.wend-actions { display: flex; gap: 10px; margin-top: 4px; }

/* Direction chevrons — HIDDEN by default, revealed only on their region's solve */
.wend-arrows { position: absolute; inset: 0; pointer-events: none; z-index: 2; }
.wend-arrow {
  position: absolute;
  width: 20px; height: 20px;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-size: 22px; font-weight: 900; line-height: 1;
  text-shadow: 0 1px 2px rgba(0,0,0,.5);
  opacity: 0;
  transform-origin: center;
  transition: opacity 400ms ease;
}
.wend-arrow-up.wend-arrow-shown    { transform: rotate(-90deg); opacity: .95; }
.wend-arrow-down.wend-arrow-shown  { transform: rotate(90deg);  opacity: .95; }
.wend-arrow-left.wend-arrow-shown  { transform: rotate(180deg); opacity: .95; }
.wend-arrow-right.wend-arrow-shown { transform: rotate(0deg);   opacity: .95; }

/* Hint cell highlight (pulses to indicate the correct starting spot) */
.wend-cell.wend-hint {
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.24),
    0 0 0 3px #FBBF24,
    0 0 20px #FBBF24;
  animation: wendHintPulse 1s ease-in-out infinite;
}
@keyframes wendHintPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

/* Hint button + counter styling */
.btn-hint { color: #FBBF24 !important; }
.btn-hint:hover { background: rgba(251,191,36,.08) !important; border-color: rgba(251,191,36,.28) !important; }
.hint-count { color: var(--text-lo); font-size: 11px; font-family: 'JetBrains Mono', ui-monospace, monospace; font-weight: 500; }
.hint-penalty { color: #FBBF24; font-size: 12px; font-weight: 500; font-family: 'JetBrains Mono', ui-monospace, monospace; }

/* ========== Prose pages (Privacy / Terms / About) ========== */
.prose-page {
  max-width: 760px;
  margin: 0 auto;
  padding: 56px 24px 96px;
  color: var(--text-md);
  font-size: 16px;
  line-height: 1.7;
}
.prose-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 11px; font-weight: 600; letter-spacing: .22em; text-transform: uppercase;
  color: var(--text-lo);
  padding: 5px 12px; border-radius: 999px;
  background: rgba(255,255,255,.03); border: 1px solid rgba(255,255,255,.06);
  margin-bottom: 22px;
}
.prose-page h1 {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-weight: 600; font-size: 54px; letter-spacing: -.032em; line-height: 1.03;
  color: var(--text-hi);
  margin-bottom: 18px;
  max-width: 720px;
}
@media (max-width: 640px) { .prose-page h1 { font-size: 36px; } }
.prose-page h2 {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-weight: 600; font-size: 22px; letter-spacing: -.015em;
  color: var(--text-hi);
  margin-top: 40px; margin-bottom: 10px;
}
.prose-page h3 {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-weight: 500; font-size: 16px; letter-spacing: -.005em;
  color: var(--text-hi);
  margin-top: 22px; margin-bottom: 8px;
}
.prose-page p, .prose-page ul, .prose-page ol { margin-bottom: 14px; }
.prose-page ul, .prose-page ol { padding-left: 22px; }
.prose-page li { margin-bottom: 6px; }
.prose-page li::marker { color: var(--text-vlo); }
.prose-page a {
  color: #C4B5FD; text-decoration: underline;
  text-decoration-color: rgba(196,181,253,.4);
  text-underline-offset: 3px;
  transition: color 160ms, text-decoration-color 160ms;
}
.prose-page a:hover { color: #DDD6FE; text-decoration-color: rgba(196,181,253,.9); }
.prose-page b { color: var(--text-hi); font-weight: 600; }
.prose-page code {
  background: rgba(255,255,255,.06); padding: 2px 6px; border-radius: 4px;
  font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 13.5px;
  color: var(--text-hi);
}
.prose-lead {
  font-size: 19px; color: var(--text-md);
  line-height: 1.55; font-weight: 300;
  margin-bottom: 20px; max-width: 640px;
}
.prose-meta {
  font-size: 13px; color: var(--text-lo);
  padding: 14px 18px; border-radius: 12px;
  background: rgba(255,255,255,.02); border: 1px solid rgba(255,255,255,.05);
  margin-bottom: 36px;
}
.prose-quote {
  font-family: 'Instrument Serif', Georgia, serif;
  font-style: italic; font-weight: 400;
  font-size: 22px; line-height: 1.5;
  color: var(--text-hi);
  padding: 18px 24px;
  border-left: 3px solid var(--accent);
  background: rgba(167,139,250,.04);
  border-radius: 0 12px 12px 0;
  margin: 24px 0 !important;
}
.prose-cta { margin-top: 36px; }
.prose-footer {
  max-width: 1400px; margin: 0 auto;
  padding: 32px 24px 40px;
  display: flex; flex-direction: column; sm:flex-row: 1;
  gap: 12px; align-items: flex-start; justify-content: space-between;
  font-size: 12.5px; color: var(--text-lo);
  border-top: 1px solid rgba(255,255,255,.05);
}
.prose-footer-links { display: flex; gap: 18px; flex-wrap: wrap; }
.prose-footer-links a { color: var(--text-lo); text-decoration: none; }
.prose-footer-links a:hover { color: var(--text-hi); }
@media (min-width: 640px) { .prose-footer { flex-direction: row; align-items: center; } }

/* ========== Cookie consent banner ========== */
.cookie-banner {
  position: fixed; bottom: 20px; left: 20px; right: 20px;
  max-width: 640px; margin: 0 auto;
  background: rgba(14, 17, 28, 0.92);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 18px;
  padding: 22px 24px;
  box-shadow: 0 30px 60px -20px rgba(0,0,0,.7), 0 0 0 1px rgba(255,255,255,.03) inset;
  z-index: 100;
  animation: cookieUp 480ms cubic-bezier(.16,1,.3,1) both;
}
@keyframes cookieUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}
.cookie-banner.hidden { display: none; }
.cookie-title {
  font-family: 'Space Grotesk'; font-weight: 600; font-size: 15px;
  color: var(--text-hi); margin-bottom: 6px;
  display: flex; align-items: center; gap: 8px;
}
.cookie-title::before {
  content: '🍪'; font-size: 18px;
}
.cookie-body {
  font-size: 13.5px; color: var(--text-md); line-height: 1.5;
  margin-bottom: 14px;
}
.cookie-body a { color: #C4B5FD; text-decoration: underline; text-underline-offset: 3px; }
.cookie-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.cookie-btn {
  padding: 9px 18px; border-radius: 999px; font-size: 13px; font-weight: 500;
  cursor: pointer; transition: all 180ms;
  font-family: inherit;
}
.cookie-btn-accept {
  background: linear-gradient(135deg, #A78BFA, #67E8F9);
  color: #0F0A1E; border: 0; font-weight: 600;
  box-shadow: 0 4px 16px -4px rgba(167,139,250,.5);
}
.cookie-btn-accept:hover { transform: translateY(-1px); }
.cookie-btn-decline {
  background: rgba(255,255,255,.04);
  color: var(--text-hi);
  border: 1px solid rgba(255,255,255,.1);
}
.cookie-btn-decline:hover { background: rgba(255,255,255,.08); }
.cookie-btn-link {
  background: transparent; border: 0; color: var(--text-lo);
  padding: 9px 12px; font-size: 13px;
}
.cookie-btn-link:hover { color: var(--text-md); }

/* Counters / stats */
.stats-row { display: flex; gap: 18px; padding: 10px 0 18px; color: #64748b; font-size: 12.5px; }
.stats-row b { color: #fff; font-family: ui-monospace, monospace; font-weight: 500; }

/* Difficulty stars / icons consistent sizing */
svg { display: inline-block; vertical-align: middle; }
