/* Achilles Pulse ("The Morning Tape") — Commercial Benchmark Design System ("Obsidian, Marble & Imperial Gold" + NYT Broadsheet Paper) (`public/css/pulse.css`) */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@500;600;700;800&family=Playfair+Display:ital,wght@0,700;0,800;0,900;1,700&display=swap');

:root {
  --bg: #050811;
  --bg-gradient: radial-gradient(circle at 50% 0%, #0f1b38 0%, #050811 72%);
  --card: #0c1324;
  --card-elev: #111b33;
  --card-hover: #172544;
  --border: #1e293b;
  --border-strong: rgba(148, 163, 184, 0.32);
  --border-gold: rgba(212, 175, 55, 0.45);
  --text: #f8fafc;
  --muted: #94a3b8;
  --subtle: #64748b;
  --gold: #d4af37;
  --gold-soft: rgba(212, 175, 55, 0.14);
  --emerald: #10b981;
  --emerald-soft: rgba(16, 185, 129, 0.14);
  --sky: #38bdf8;
  --crimson: #ef4444;
  --crimson-soft: rgba(239, 68, 68, 0.14);
  --purple: #a855f7;
  --topbar-bg: rgba(5, 8, 17, 0.88);
  --tile-lip: rgba(0, 0, 0, 0.5);
  --shadow-soft: 0 12px 32px rgba(0, 0, 0, 0.42);

  --conn-yellow-bg: #facc15;
  --conn-yellow-text: #0f172a;
  --conn-green-bg: #34d399;
  --conn-green-text: #052e16;
  --conn-blue-bg: #38bdf8;
  --conn-blue-text: #082f49;
  --conn-purple-bg: #c084fc;
  --conn-purple-text: #1e1b4b;

  --font-display: "Playfair Display", Georgia, serif;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: "JetBrains Mono", monospace;
}

body[data-theme="paper"],
.theme-paper {
  --bg: #fbf9f5;
  --bg-gradient: none;
  --card: #ffffff;
  --card-elev: #f3efe6;
  --card-hover: #e5e0d5;
  --border: #d6d0c4;
  --border-strong: rgba(15, 23, 42, 0.25);
  --border-gold: rgba(180, 134, 24, 0.48);
  --text: #0f172a;
  --muted: #475569;
  --subtle: #64748b;
  --gold: #9a6d0c;
  --gold-soft: rgba(180, 134, 24, 0.12);
  --emerald: #059669;
  --emerald-soft: rgba(5, 150, 105, 0.12);
  --sky: #0284c7;
  --crimson: #dc2626;
  --crimson-soft: rgba(220, 38, 38, 0.12);
  --topbar-bg: rgba(251, 249, 245, 0.94);
  --tile-lip: rgba(15, 23, 42, 0.14);
  --shadow-soft: 0 8px 24px rgba(15, 23, 42, 0.08);
}

*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background-color: var(--bg);
  background-image: var(--bg-gradient);
  color: var(--text);
  font-family: var(--font-sans);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  overflow-x: hidden;
}

/* Interactive HiDPI Particle & Tactile Feedback Canvas */
.pulse-fx-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 250;
}

body.reduced-motion *,
body.reduced-motion *::before,
body.reduced-motion *::after {
  animation-duration: 0.01ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.01ms !important;
}

/* ============================================================================
   1. Sticky Header, Live Market Tape Marquee & 9-Desk Ribbon
   ============================================================================ */
.pulse-topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: var(--topbar-bg);
  border-bottom: 1px solid var(--border);
  padding: max(0.45rem, env(safe-area-inset-top)) max(0.85rem, env(safe-area-inset-right)) 0.4rem max(0.85rem, env(safe-area-inset-left));
}

.topbar-inner {
  max-width: 1060px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.brand-cluster {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--text);
  flex-shrink: 0;
}

.brand-crest {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  border: 1px solid var(--border-gold);
}

.brand-title-stack {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand-masthead {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.06rem;
  letter-spacing: -0.01em;
}

.brand-era-sub {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--gold);
  font-weight: 700;
}

.topbar-controls {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
}

.topbar-controls::-webkit-scrollbar {
  display: none;
}

.pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.26rem;
  padding: 0.32rem 0.6rem;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 0.73rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.14s ease, border-color 0.14s ease;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  flex-shrink: 0;
}

.pill-btn:hover {
  background: var(--card-elev);
  border-color: var(--border-strong);
  transform: translateY(-1px);
}

.pill-btn:active {
  transform: translateY(1px);
}

.pill-btn.gold-pill {
  background: var(--gold-soft);
  border-color: var(--border-gold);
  color: var(--gold);
}

.pill-btn.oracle-pill.active {
  background: var(--emerald-soft);
  border-color: var(--emerald);
  color: var(--emerald);
}

.pill-btn.strict-active {
  background: var(--crimson-soft);
  border-color: var(--crimson);
  color: var(--crimson);
}

.pill-btn.icon-only {
  padding: 0.32rem 0.48rem;
}

.streak-shield-mini {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  padding-left: 0.18rem;
  opacity: 0.92;
}

/* Live Empirical Market Tape Ticker */
.morning-tape-marquee-bar {
  max-width: 1060px;
  margin: 0.38rem auto 0;
  padding: 0.22rem 0.55rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 7px;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: 0.67rem;
  font-variant-numeric: tabular-nums;
}

.tape-live-dot {
  color: var(--emerald);
  font-weight: 800;
  letter-spacing: 0.04em;
  white-space: nowrap;
  flex-shrink: 0;
}

.tape-marquee-viewport {
  overflow: hidden;
  flex: 1;
}

.tape-marquee-track {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  white-space: nowrap;
  color: var(--muted);
  animation: tapeMarqueeScroll 38s linear infinite;
}

.morning-tape-marquee-bar:hover .tape-marquee-track,
body.reduced-motion .tape-marquee-track {
  animation-play-state: paused;
}

.tape-marquee-track strong {
  color: var(--gold);
}

@keyframes tapeMarqueeScroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-45%); }
}

/* 9-Desk Horizontal Scrollable Ribbon */
.nine-desk-ribbon-wrap {
  max-width: 1060px;
  margin: 0.38rem auto 0;
  padding-top: 0.35rem;
  border-top: 1px solid var(--border);
}

.round-tabs {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.18rem;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 0.1rem;
}

.round-tabs::-webkit-scrollbar {
  display: none;
}

.round-tab {
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: 0.71rem;
  font-weight: 600;
  padding: 0.24rem 0.5rem;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.14s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.24rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.round-tab:hover {
  color: var(--text);
  background: var(--card);
}

.round-tab.active {
  background: var(--card-elev);
  color: var(--text);
  border-color: var(--border-gold);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.22);
}

.round-tab.completed {
  color: var(--emerald);
  border-color: rgba(16, 185, 129, 0.35);
}

.round-tab.completed .round-tab-dot {
  background: var(--emerald);
  box-shadow: 0 0 6px var(--emerald);
}

.round-tab-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--subtle);
}

.round-tab.active .round-tab-dot {
  background: var(--gold);
  box-shadow: 0 0 6px var(--gold);
}

.round-tab-score {
  font-family: var(--font-mono);
  font-size: 0.64rem;
  padding: 0.05rem 0.32rem;
  border-radius: 99px;
  background: rgba(148, 163, 184, 0.12);
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}

/* ============================================================================
   2. Main Single-Focus Canvas, Vault Chests & Dynamic Athena Coach
   ============================================================================ */
.pulse-shell {
  max-width: 640px;
  margin: 0 auto;
  padding: 0.5rem max(0.85rem, env(safe-area-inset-right)) max(1.5rem, calc(env(safe-area-inset-bottom) + 1rem)) max(0.85rem, env(safe-area-inset-left));
}

.edition-whisper-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--muted);
  padding-bottom: 0.35rem;
  margin-bottom: 0.4rem;
  border-bottom: 1px solid var(--border);
  font-variant-numeric: tabular-nums;
}

.whisper-right {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.vault-chest-strip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.chest-pill {
  padding: 0.12rem 0.38rem;
  border-radius: 6px;
  background: var(--card);
  border: 1px solid var(--border);
  font-size: 0.65rem;
  opacity: 0.65;
  cursor: pointer;
  transition: all 0.2s ease;
}

.chest-pill.unlocked {
  opacity: 1;
  border-color: var(--border-gold);
  background: var(--gold-soft);
  color: var(--gold);
  font-weight: 700;
}

.whisper-toggle-btn {
  background: none;
  border: none;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  cursor: pointer;
  padding: 0.15rem 0.4rem;
  border-radius: 6px;
}

.whisper-toggle-btn:hover {
  color: var(--text);
  background: var(--card-elev);
}

.edition-drawer {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.85rem 1rem;
  margin-bottom: 0.85rem;
  font-size: 0.8rem;
}

.edition-headline {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.38;
  margin: 0 0 0.5rem;
}

.edition-drawer-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted);
}

.seed-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  background: var(--card-elev);
  border: 1px solid var(--border-gold);
  color: var(--gold);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
}

.edition-link {
  color: var(--gold);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 0.73rem;
  font-weight: 600;
}

.edition-link:hover {
  text-decoration: underline;
}

/* Duolingo-Style Dynamic Athena Owl Micro-Coach Banner */
.athena-coach-banner {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  background: var(--card);
  border: 1px solid var(--border-gold);
  border-radius: 10px;
  padding: 0.38rem 0.65rem;
  margin-bottom: 0.42rem;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.16);
}

.athena-coach-avatar {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  object-fit: cover;
  border: 1.5px solid var(--gold);
  background: #080e1e;
  flex-shrink: 0;
}

.athena-coach-content {
  flex: 1;
  min-width: 0;
}

.athena-coach-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  margin-bottom: 0.08rem;
}

.athena-coach-badge {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 800;
  color: var(--gold);
  letter-spacing: 0.04em;
}

.athena-key-hint {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--muted);
}

.athena-coach-msg {
  margin: 0;
  font-size: 0.72rem;
  line-height: 1.28;
  color: var(--text);
}

/* Live Desk Newsletter Strip above Active Round */
.live-desk-brief-strip {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 0.38rem 0.65rem;
  margin-bottom: 0.45rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  font-size: 0.72rem;
}

.live-desk-brief-text {
  color: var(--muted);
  line-height: 1.28;
  flex: 1;
}

.live-desk-brief-text strong {
  color: var(--text);
}

/* Stage Header & Coach Tip Card */
.stage-card {
  background: transparent;
  border: none;
  padding: 0;
}

.stage-header {
  text-align: center;
  margin-bottom: 0.42rem;
}

.stage-step-pill {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.64rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gold);
  margin-bottom: 0.1rem;
}

.stage-title {
  font-family: var(--font-display);
  font-size: 1.26rem;
  font-weight: 900;
  margin: 0 0 0.1rem;
  letter-spacing: -0.01em;
}

.stage-subtitle {
  margin: 0;
  font-size: 0.78rem;
  color: var(--muted);
}

.coach-tip-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--gold);
  border-radius: 9px;
  padding: 0.4rem 0.68rem;
  margin-bottom: 0.48rem;
  font-size: 0.72rem;
  line-height: 1.32;
  color: var(--muted);
}

.coach-tip-card strong {
  color: var(--text);
}

.coach-tip-card code {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 0.08rem 0.3rem;
  border-radius: 4px;
  background: var(--card-elev);
  color: var(--gold);
}

.difficulty-legend {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  flex-wrap: wrap;
  margin-top: 0.2rem;
  font-family: var(--font-mono);
  font-size: 0.67rem;
}

/* ============================================================================
   3. Game Mechanics (Connections, Pinpoint, Higher/Lower)
   ============================================================================ */
.solved-banners-stack {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.solved-category-banner {
  border-radius: 10px;
  padding: 0.78rem 0.95rem;
  text-align: center;
  animation: collapseRowIn 0.28s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.solved-category-banner.yellow { background: var(--conn-yellow-bg); color: var(--conn-yellow-text); }
.solved-category-banner.green { background: var(--conn-green-bg); color: var(--conn-green-text); }
.solved-category-banner.blue { background: var(--conn-blue-bg); color: var(--conn-blue-text); }
.solved-category-banner.purple { background: var(--conn-purple-bg); color: var(--conn-purple-text); }

.solved-banner-title { font-weight: 800; font-size: 0.82rem; letter-spacing: 0.04em; text-transform: uppercase; }
.solved-banner-items { font-family: var(--font-mono); font-size: 0.76rem; font-weight: 700; margin-top: 0.16rem; }
.solved-banner-expl { font-size: 0.72rem; opacity: 0.92; margin-top: 0.16rem; }

@keyframes collapseRowIn {
  from { opacity: 0; transform: scale(0.96) translateY(6px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes shakeTiles {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

@keyframes tileHop {
  0%, 100% { transform: translateY(-2px) scale(1); }
  50% { transform: translateY(-9px) scale(1.03); }
}

.connections-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.42rem;
  margin-bottom: 0.45rem;
}

.connections-grid.shake {
  animation: shakeTiles 0.35s ease;
}

.conn-tile {
  position: relative;
  min-height: 62px;
  padding: 0.38rem 0.32rem;
  border-radius: 9px;
  background: var(--card-elev);
  border: 1px solid var(--border);
  box-shadow: 0 3px 0 var(--tile-lip);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 0.74rem;
  font-weight: 700;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  transition: transform 0.1s ease, background 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
  word-break: break-word;
}

.conn-tile:hover {
  background: var(--card-hover);
  border-color: var(--border-gold);
}

.conn-tile:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 var(--tile-lip);
}

.conn-tile.selected {
  background: var(--text);
  color: var(--bg);
  border-color: var(--gold);
  transform: translateY(-2px);
  box-shadow: 0 5px 12px rgba(212, 175, 55, 0.28);
  animation: tileHop 0.22s ease;
}

.conn-guess-history-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  flex-wrap: wrap;
  margin-bottom: 0.55rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
}

.conn-guess-pill {
  padding: 0.18rem 0.45rem;
  border-radius: 6px;
  background: var(--card);
  border: 1px solid var(--border);
  letter-spacing: 0.08em;
}

.selection-status-bar {
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--gold);
  margin-bottom: 0.38rem;
  min-height: 1.05rem;
}

.connections-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
}

.mistakes-cluster {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
  color: var(--muted);
}

.mistake-dots { display: inline-flex; gap: 0.36rem; }
.mistake-dot { width: 11px; height: 11px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 6px rgba(212, 175, 55, 0.4); transition: all 0.22s ease; }
.mistake-dot.spent { opacity: 0.15; transform: scale(0.65); background: var(--muted); box-shadow: none; }

.action-btn-group {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.btn {
  padding: 0.52rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--card);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 0.79rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.14s ease;
}

.btn:hover:not(:disabled) { background: var(--card-elev); border-color: var(--gold); transform: translateY(-1px); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: 0.35; cursor: not-allowed; }
.btn-primary { background: var(--gold); color: #050811; border-color: var(--gold); font-weight: 800; }
.btn-primary:hover:not(:disabled) { background: #e5c148; border-color: #e5c148; color: #050811; }

/* Pinpoint Clue Ladder, Locked Clue Slots & Candidate Chips */
.clue-steps-track {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.28rem;
  margin-bottom: 0.45rem;
}

.clue-step-pill {
  text-align: center;
  padding: 0.22rem 0.18rem;
  border-radius: 7px;
  background: var(--card);
  border: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.64rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.clue-step-pill.active { border-color: var(--gold); color: var(--gold); background: var(--gold-soft); font-weight: 700; }
.clue-step-pill.revealed { border-color: var(--border-strong); color: var(--text); }

.clues-stack { display: flex; flex-direction: column; gap: 0.32rem; margin-bottom: 0.45rem; }
.clue-card { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 0.5rem 0.75rem; animation: collapseRowIn 0.22s ease; }
.clue-card.locked-clue {
  background: rgba(12, 19, 36, 0.48);
  border-style: dashed;
  padding: 0.34rem 0.72rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.68rem;
}
body[data-theme="paper"] .clue-card.locked-clue {
  background: rgba(243, 239, 230, 0.65);
}
.clue-meta { display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: 0.64rem; text-transform: uppercase; color: var(--gold); margin-bottom: 0.15rem; font-weight: 700; }
.clue-text { font-size: 0.81rem; line-height: 1.34; }

.pinpoint-guesses-bar {
  display: flex;
  align-items: center;
  gap: 0.32rem;
  flex-wrap: wrap;
  margin-bottom: 0.45rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
}

.pinpoint-guess-tag {
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-weight: 600;
}

.pinpoint-guess-tag.miss {
  background: var(--crimson-soft);
  border: 1px solid var(--crimson);
  color: var(--crimson);
}

.pinpoint-guess-tag.hit {
  background: var(--emerald-soft);
  border: 1px solid var(--emerald);
  color: var(--emerald);
}

.pinpoint-input-wrap { position: relative; display: flex; gap: 0.45rem; flex-wrap: wrap; }
.pinpoint-input { flex: 1; min-width: 190px; padding: 0.66rem 0.95rem; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--card); color: var(--text); font-family: var(--font-sans); font-size: 0.85rem; outline: none; }
.pinpoint-input:focus { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold-soft); }

.candidate-chips-wrap { margin-top: 0.7rem; }
.candidate-chips-label { font-family: var(--font-mono); font-size: 0.69rem; color: var(--muted); margin-bottom: 0.38rem; display: block; }
.candidate-chips-grid { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.candidate-chip { padding: 0.4rem 0.75rem; border-radius: 999px; background: var(--card-elev); border: 1px solid var(--border); color: var(--text); font-family: var(--font-sans); font-size: 0.76rem; font-weight: 600; cursor: pointer; transition: all 0.14s ease; }
.candidate-chip:hover:not(:disabled) { border-color: var(--gold); background: var(--gold-soft); color: var(--gold); transform: translateY(-1px); }

.autocomplete-dropdown { position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: var(--card); border: 1px solid var(--border-gold); border-radius: 12px; max-height: 220px; overflow-y: auto; z-index: 50; box-shadow: var(--shadow-soft); }
.autocomplete-item { padding: 0.58rem 0.95rem; display: flex; justify-content: space-between; align-items: center; cursor: pointer; border-bottom: 1px solid var(--border); font-size: 0.82rem; }
.autocomplete-item:hover, .autocomplete-item.active { background: var(--card-elev); }

/* Higher / Lower Arena */
.hl-progress-track {
  display: flex;
  align-items: center;
  gap: 0.28rem;
  margin-bottom: 0.65rem;
}

.hl-progress-seg {
  flex: 1;
  height: 6px;
  border-radius: 99px;
  background: var(--card-elev);
  border: 1px solid var(--border);
  transition: all 0.2s ease;
}

.hl-progress-seg.current { border-color: var(--gold); background: var(--gold-soft); }
.hl-progress-seg.won { background: var(--emerald); border-color: var(--emerald); }
.hl-progress-seg.lost { background: var(--crimson); border-color: var(--crimson); }

.hl-arena { display: flex; flex-direction: column; gap: 0.35rem; margin-bottom: 0.45rem; }
.hl-vs-divider { display: flex; align-items: center; justify-content: center; font-family: var(--font-mono); font-size: 0.66rem; font-weight: 800; color: var(--muted); }
.hl-vs-pill { padding: 0.16rem 0.58rem; border-radius: 999px; background: var(--card-elev); border: 1px solid var(--border-gold); color: var(--gold); transition: all 0.2s ease; }
.hl-vs-pill.correct { background: var(--emerald); color: #052e16; border-color: var(--emerald); transform: scale(1.06); }
.hl-vs-pill.wrong { background: var(--crimson); color: #ffffff; border-color: var(--crimson); transform: scale(1.06); }

.hl-card { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 0.75rem 0.95rem; display: flex; flex-direction: column; justify-content: space-between; transition: border-color 0.2s ease, transform 0.2s ease; }
.hl-card.challenger { border-color: var(--border-gold); }
.hl-card.challenger.flash-win { border-color: var(--emerald); box-shadow: 0 0 20px rgba(16, 185, 129, 0.22); }
.hl-card.challenger.flash-loss { border-color: var(--crimson); box-shadow: 0 0 20px rgba(239, 68, 68, 0.22); }
.hl-desk-pill { display: inline-block; font-family: var(--font-mono); font-size: 0.64rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--gold); font-weight: 700; margin-bottom: 0.16rem; }
.hl-metric-title { font-family: var(--font-display); font-size: 0.98rem; font-weight: 800; margin: 0 0 0.14rem; }
.hl-metric-sub { font-size: 0.74rem; color: var(--muted); margin: 0 0 0.3rem; }
.hl-odometer { font-family: var(--font-mono); font-size: 1.55rem; font-weight: 800; color: var(--text); font-variant-numeric: tabular-nums; margin: 0.05rem 0; }
.hl-prompt-question { font-size: 0.74rem; font-weight: 600; color: var(--muted); margin: 0.26rem 0; }
.hl-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 0.45rem; }
.btn-higher, .btn-lower { padding: 0.56rem 0.85rem; border-radius: 999px; font-family: var(--font-sans); font-weight: 800; font-size: 0.8rem; cursor: pointer; transition: all 0.14s ease; }
.btn-higher { background: var(--emerald-soft); border: 1.5px solid var(--emerald); color: var(--emerald); }
.btn-higher:hover { background: var(--emerald); color: #052e16; transform: translateY(-1px); }
.btn-lower { background: var(--crimson-soft); border: 1.5px solid var(--crimson); color: var(--crimson); }
.btn-lower:hover { background: var(--crimson); color: #ffffff; transform: translateY(-1px); }
.hl-feedback-banner { font-family: var(--font-mono); font-size: 0.76rem; color: var(--text); margin: 0 0 0.75rem; min-height: 1.2rem; line-height: 1.4; }

/* ============================================================================
   4. Civilopedia Codex Modal & Sanctuary Auth Modal
   ============================================================================ */
.codex-era-banner {
  background: var(--card-elev);
  border: 1px solid var(--border-gold);
  border-radius: 12px;
  padding: 0.75rem 0.95rem;
  margin-bottom: 0.85rem;
}

.codex-content-scroll {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0.6rem;
  max-height: 52vh;
  overflow-y: auto;
  padding-right: 0.25rem;
}

.codex-entry-card {
  background: var(--card-elev);
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 0.75rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
}

.codex-entry-card.unlocked {
  border-color: var(--border-gold);
}

.auth-sanctuary-header {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  background: var(--card-elev);
  border: 1px solid var(--border-gold);
  border-radius: 14px;
  padding: 0.75rem 0.95rem;
  margin-bottom: 0.9rem;
}

.auth-mentor-avatar {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  object-fit: contain;
  border: 1.5px solid var(--gold);
  background: #080e1e;
  flex-shrink: 0;
}

.auth-mentor-speaker {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.05em;
}

.auth-mentor-copy {
  font-size: 0.78rem;
  color: var(--text);
  line-height: 1.38;
  margin-top: 0.15rem;
}

.auth-mode-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem;
  background: var(--card-elev);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.25rem;
  margin-bottom: 0.9rem;
}

.auth-mode-tab {
  padding: 0.48rem;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}

.auth-mode-tab.active {
  background: var(--card);
  color: var(--gold);
  border: 1px solid var(--border-gold);
}

.auth-oauth-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.45rem;
  margin-bottom: 0.8rem;
}

.btn-oauth {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.6rem 0.5rem;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: var(--card-elev);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.14s ease;
}

.btn-oauth:hover {
  border-color: var(--gold);
  background: var(--card-hover);
}

.auth-or-divider {
  display: flex;
  align-items: center;
  text-align: center;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  margin: 0.7rem 0;
}

.auth-or-divider::before,
.auth-or-divider::after {
  content: "";
  flex: 1;
  border-bottom: 1px solid var(--border);
}

.auth-or-divider span {
  padding: 0 0.6rem;
}

.otp-visual-boxes {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.4rem;
  margin: 0.55rem 0 0.75rem;
}

.otp-box {
  height: 42px;
  border-radius: 8px;
  background: var(--card-elev);
  border: 1px solid var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--gold);
}

.otp-box.active {
  border-color: var(--gold);
  box-shadow: 0 0 0 2px var(--gold-soft);
}

/* ============================================================================
   5. Results, Share Stack & Responsive Breakpoints
   ============================================================================ */
.results-grid { display: flex; flex-direction: column; gap: 0.9rem; }
.trophy-preview-box { background: var(--card); border: 1px solid var(--border-gold); border-radius: 14px; padding: 0.5rem; box-shadow: var(--shadow-soft); }
.trophy-canvas-view { width: 100%; height: auto; border-radius: 10px; display: block; }
.share-actions-stack { display: grid; grid-template-columns: 1fr 1fr; gap: 0.55rem; }

.modal-backdrop { position: fixed; inset: 0; background: rgba(5, 8, 17, 0.78); backdrop-filter: blur(8px); display: flex; align-items: center; justify-content: center; z-index: 200; padding: 1rem; }
.modal-backdrop[hidden] { display: none !important; }
.modal-panel { background: var(--card); border: 1px solid var(--border-strong); border-radius: 18px; width: 100%; max-width: 700px; max-height: 88vh; overflow-y: auto; padding: 1.25rem; box-shadow: var(--shadow-soft); }
.modal-header { display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--border); padding-bottom: 0.7rem; margin-bottom: 0.85rem; }

.tutorial-step-card { background: var(--card-elev); border: 1px solid var(--border); border-radius: 12px; padding: 0.78rem 0.95rem; margin-bottom: 0.65rem; }
.tutorial-step-card h3 { margin: 0 0 0.25rem; font-size: 0.9rem; color: var(--gold); }
.tutorial-step-card p { margin: 0; font-size: 0.8rem; line-height: 1.45; color: var(--text); }

.deity-identity-card { display: flex; align-items: center; gap: 0.9rem; background: var(--card-elev); border: 1px solid var(--border); border-radius: 12px; padding: 0.85rem 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.deity-avatar-lg { width: 56px; height: 56px; border-radius: 12px; object-fit: cover; border: 1.5px solid var(--gold); background: #0f172a; }
.genome-bars { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.6rem; margin-bottom: 1rem; }
.genome-bar-card { background: var(--card-elev); border: 1px solid var(--border); border-radius: 10px; padding: 0.6rem 0.75rem; }
.genome-bar-track { height: 6px; border-radius: 99px; background: rgba(148, 163, 184, 0.16); overflow: hidden; margin-top: 0.35rem; }
.genome-bar-fill { height: 100%; border-radius: 99px; background: var(--gold); transition: width 0.3s ease; }
.passport-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.5rem; margin-bottom: 1rem; }
.passport-app-card { background: var(--card-elev); border: 1px solid var(--border); border-radius: 10px; padding: 0.55rem; font-size: 0.73rem; text-decoration: none; color: var(--text); display: flex; flex-direction: column; gap: 0.15rem; }
.passport-app-card.active { border-color: var(--border-gold); }

.leaderboard-table { width: 100%; border-collapse: collapse; font-size: 0.78rem; font-variant-numeric: tabular-nums; }
.leaderboard-table th, .leaderboard-table td { padding: 0.48rem 0.55rem; border-bottom: 1px solid var(--border); text-align: left; }
.leaderboard-table th { font-family: var(--font-mono); font-size: 0.65rem; text-transform: uppercase; color: var(--muted); }

.pulse-toast {
  position: fixed;
  bottom: 1.35rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--gold);
  color: #050811;
  font-weight: 800;
  font-size: 0.81rem;
  padding: 0.54rem 1.2rem;
  border-radius: 999px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.55);
  z-index: 300;
  text-align: center;
  max-width: 92vw;
  pointer-events: none;
}

/* Laptop 1280x720 & Compact Height Above-the-Fold Ergonomics */
@media (max-height: 800px) {
  .morning-tape-marquee-bar,
  .coach-tip-card {
    display: none !important;
  }

  .pulse-topbar {
    padding-top: 0.3rem;
    padding-bottom: 0.28rem;
  }

  .nine-desk-ribbon-wrap {
    margin-top: 0.22rem;
    padding-top: 0.22rem;
  }

  .pulse-shell {
    padding-top: 0.35rem;
  }

  .edition-whisper-bar {
    padding-bottom: 0.22rem;
    margin-bottom: 0.28rem;
  }

  .athena-coach-banner,
  .live-desk-brief-strip {
    padding: 0.28rem 0.55rem;
    margin-bottom: 0.3rem;
  }

  .stage-header {
    margin-bottom: 0.28rem;
  }

  .stage-title {
    font-size: 1.12rem;
  }

  .clue-card {
    padding: 0.38rem 0.65rem;
  }

  .clue-card.locked-clue {
    padding: 0.24rem 0.65rem;
  }

  .clue-text {
    font-size: 0.76rem;
    line-height: 1.26;
  }

  .pinpoint-input {
    padding: 0.45rem 0.75rem;
    font-size: 0.78rem;
  }

  .candidate-chips-wrap {
    margin-top: 0.38rem;
  }

  .candidate-chip {
    padding: 0.25rem 0.55rem;
    font-size: 0.7rem;
  }
}

@media (max-width: 820px) {
  .hide-md { display: none !important; }
}

@media (max-width: 680px) {
  .hide-sm,
  .morning-tape-marquee-bar,
  .coach-tip-card {
    display: none !important;
  }
  .auth-oauth-grid,
  .genome-bars,
  .share-actions-stack {
    grid-template-columns: 1fr;
  }
  .passport-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .pulse-shell {
    padding-top: 0.38rem;
  }
  .athena-coach-banner,
  .live-desk-brief-strip {
    padding: 0.32rem 0.55rem;
    margin-bottom: 0.32rem;
  }
  .conn-tile {
    font-size: 0.66rem;
    min-height: 54px;
    padding: 0.3rem 0.22rem;
  }
  .hl-card {
    padding: 0.6rem 0.75rem;
  }
  .hl-metric-title {
    font-size: 0.9rem;
  }
  .hl-metric-sub {
    font-size: 0.7rem;
    margin-bottom: 0.2rem;
  }
  .hl-odometer {
    font-size: 1.32rem;
  }
  .btn-higher,
  .btn-lower {
    padding: 0.5rem 0.7rem;
    font-size: 0.76rem;
  }
}

@media (max-width: 440px) {
  .hide-xs { display: none !important; }
  .pulse-topbar {
    padding: 0.4rem 0.55rem 0.35rem;
  }
  .brand-masthead {
    font-size: 0.94rem;
  }
  .brand-era-sub {
    display: none;
  }
  .pill-btn {
    padding: 0.28rem 0.46rem;
    font-size: 0.69rem;
  }
}
