:root {
  --bg: #06080f;
  --bg-card: rgba(14, 18, 32, 0.72);
  --bg-elevated: rgba(20, 26, 46, 0.85);
  --text: #eef2ff;
  --text-muted: #8b95b8;
  --accent: #f0c96b;
  --accent-dim: #b8943f;
  --human: #6ee7b7;
  --human-glow: rgba(110, 231, 183, 0.35);
  --bot: #a78bfa;
  --bot-glow: rgba(167, 139, 250, 0.35);
  --correct: #6ee7b7;
  --wrong: #fb7185;
  --border: rgba(148, 163, 184, 0.14);
  --glass: rgba(255, 255, 255, 0.04);
  --font-serif: 'Cormorant Garamond', Georgia, serif;
  --font-sans: 'Instrument Sans', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --radius: 16px;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.6;
  overflow-x: hidden;
}

/* Background */
.bg-layer {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background:
    radial-gradient(ellipse 80% 60% at 20% 10%, rgba(99, 102, 241, 0.18), transparent 55%),
    radial-gradient(ellipse 70% 50% at 85% 80%, rgba(16, 185, 129, 0.12), transparent 50%),
    radial-gradient(ellipse 60% 40% at 50% 50%, rgba(139, 92, 246, 0.08), transparent 60%),
    linear-gradient(160deg, #06080f 0%, #0a0f1e 50%, #08060f 100%);
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  animation: float 18s ease-in-out infinite;
}

.orb-1 {
  width: 420px;
  height: 420px;
  background: rgba(99, 102, 241, 0.22);
  top: -120px;
  left: -80px;
}

.orb-2 {
  width: 360px;
  height: 360px;
  background: rgba(16, 185, 129, 0.16);
  bottom: -100px;
  right: -60px;
  animation-delay: -6s;
}

.orb-3 {
  width: 280px;
  height: 280px;
  background: rgba(167, 139, 250, 0.14);
  top: 40%;
  left: 55%;
  animation-delay: -12s;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -20px) scale(1.05); }
  66% { transform: translate(-20px, 25px) scale(0.95); }
}

#quantum-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.55;
}

.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  z-index: 1;
}

#app {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 720px;
  padding: 2rem 1.5rem 3rem;
  flex: 1;
}

.screen {
  display: none;
  animation: fadeIn 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.screen.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Hero */
.hero {
  text-align: center;
  margin-bottom: 2rem;
}

.hero-compact {
  margin-bottom: 1.25rem;
}

.logo-mark {
  display: inline-grid;
  place-items: center;
  width: 3.5rem;
  height: 3.5rem;
  margin-bottom: 1.25rem;
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 600;
  color: var(--accent);
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  box-shadow: 0 0 32px rgba(240, 201, 107, 0.15);
}

.eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

h1 {
  font-family: var(--font-serif);
  font-size: clamp(2.6rem, 8vw, 3.8rem);
  font-weight: 600;
  line-height: 1.05;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, #fff 0%, #c7d2fe 45%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.subtitle {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 540px;
  margin: 0 auto;
  line-height: 1.75;
}

/* Stats */
.stats-preview {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.stat-pill {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.9rem 1.2rem;
  text-align: center;
  min-width: 120px;
  backdrop-filter: blur(16px);
}

.stat-num {
  display: block;
  font-family: var(--font-serif);
  font-size: 1.8rem;
  font-weight: 600;
  color: var(--accent);
  line-height: 1;
}

.stat-label {
  display: block;
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
}

/* Buttons */
.btn {
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.22, 1, 0.36, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: linear-gradient(135deg, #f0c96b 0%, #d4a843 100%);
  color: #1a1208;
  padding: 1rem 2rem;
  width: 100%;
  max-width: 340px;
  margin: 0 auto;
  display: flex;
  box-shadow: 0 8px 32px rgba(240, 201, 107, 0.25);
}

.btn-glow {
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 40%, rgba(255,255,255,0.35) 50%, transparent 60%);
  transform: translateX(-100%);
  transition: transform 0.6s ease;
}

.btn-primary:hover .btn-glow {
  transform: translateX(100%);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(240, 201, 107, 0.35);
}

.btn-secondary {
  background: var(--glass);
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 0.8rem 1.5rem;
  width: 100%;
  max-width: 340px;
  backdrop-filter: blur(12px);
}

.btn-secondary:hover {
  border-color: var(--accent-dim);
  color: var(--text);
}

.hint {
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 1.5rem;
}

/* Game layout */
.progress-bar {
  height: 4px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 4px;
  margin-bottom: 0.75rem;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--bot), var(--human));
  border-radius: 4px;
  transition: width 0.5s cubic-bezier(0.22, 1, 0.36, 1);
  width: 0%;
  box-shadow: 0 0 12px var(--human-glow);
}

.game-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 1.75rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.round-label {
  font-weight: 600;
  color: var(--accent);
}

.score-label {
  font-variant-numeric: tabular-nums;
}

/* Quote card */
.quote-card {
  font-family: var(--font-serif);
  font-size: clamp(1.35rem, 4.2vw, 1.85rem);
  font-style: italic;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2.5rem 2rem;
  margin-bottom: 1.75rem;
  position: relative;
  box-shadow: var(--shadow);
  min-height: 170px;
  display: flex;
  align-items: center;
  backdrop-filter: blur(20px);
  overflow: hidden;
}

.quote-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
}

.quote-card::after {
  content: '„';
  position: absolute;
  top: 0.25rem;
  left: 1.25rem;
  font-size: 5rem;
  color: var(--accent);
  opacity: 0.12;
  font-style: normal;
  line-height: 1;
}

.quote-card.reveal .quote-inner {
  animation: quoteReveal 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes quoteReveal {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.quote-card-small {
  font-size: 1.15rem;
  padding: 1.5rem;
  min-height: auto;
  margin-bottom: 1.25rem;
}

/* Choices */
.choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.btn-choice {
  flex-direction: column;
  padding: 1.6rem 1rem;
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: 18px;
  color: var(--text);
  text-align: center;
  gap: 0.2rem;
  backdrop-filter: blur(16px);
  position: relative;
}

.choice-ring {
  position: absolute;
  inset: -2px;
  border-radius: 20px;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}

.btn-human .choice-ring {
  background: radial-gradient(circle at center, var(--human-glow), transparent 70%);
}

.btn-bot .choice-ring {
  background: radial-gradient(circle at center, var(--bot-glow), transparent 70%);
}

.btn-choice:hover .choice-ring {
  opacity: 1;
}

.btn-choice:hover {
  transform: translateY(-3px);
}

.btn-human:hover {
  border-color: var(--human);
  box-shadow: 0 12px 40px var(--human-glow);
}

.btn-bot:hover {
  border-color: var(--bot);
  box-shadow: 0 12px 40px var(--bot-glow);
}

.choice-icon {
  font-size: 1.6rem;
  margin-bottom: 0.15rem;
}

.choice-text {
  font-size: 1.25rem;
  font-weight: 700;
}

.choice-sub {
  font-size: 0.68rem;
  color: var(--text-muted);
}

/* Feedback */
.feedback-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.result-badge {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.45rem 1.1rem;
  border-radius: 100px;
  margin-bottom: 0.75rem;
}

.result-badge.correct {
  background: rgba(110, 231, 183, 0.15);
  color: var(--correct);
  border: 1px solid rgba(110, 231, 183, 0.3);
}

.result-badge.wrong {
  background: rgba(251, 113, 133, 0.15);
  color: var(--wrong);
  border: 1px solid rgba(251, 113, 133, 0.3);
}

.result-answer {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  color: var(--text-muted);
}

.result-answer strong {
  color: var(--text);
}

.source-proof {
  background: rgba(110, 231, 183, 0.08);
  border: 1px solid rgba(110, 231, 183, 0.25);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  backdrop-filter: blur(12px);
}

.source-proof.hidden {
  display: none;
}

.source-label {
  display: block;
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--human);
  margin-bottom: 0.4rem;
}

.source-text {
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.source-text strong {
  color: var(--text);
}

.source-text em {
  color: var(--text-muted);
  font-style: normal;
}

.reflection-box {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 1.25rem 1.5rem;
  margin-bottom: 2rem;
  backdrop-filter: blur(12px);
}

.reflection-box h3 {
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.reflection-box p {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.75;
}

/* Results */
.score-hero {
  text-align: center;
  padding: 2rem 1.5rem;
  margin-bottom: 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  backdrop-filter: blur(16px);
}

.score-big {
  font-family: var(--font-serif);
  font-size: clamp(4rem, 18vw, 6.5rem);
  font-weight: 600;
  line-height: 1;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, #fff 30%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.score-fraction {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.score-verdict {
  font-size: clamp(1.1rem, 4vw, 1.45rem);
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
  max-width: 520px;
  margin: 0 auto;
}

.score-hero.tier-low .score-big {
  background: linear-gradient(135deg, #fb7185 0%, #f97316 100%);
  -webkit-background-clip: text;
  background-clip: text;
}

.score-hero.tier-random .score-big {
  background: linear-gradient(135deg, #94a3b8 0%, #cbd5e1 100%);
  -webkit-background-clip: text;
  background-clip: text;
}

.score-hero.tier-signals .score-big {
  background: linear-gradient(135deg, #6ee7b7 0%, #34d399 100%);
  -webkit-background-clip: text;
  background-clip: text;
}

.score-hero.tier-genius .score-big {
  background: linear-gradient(135deg, #a78bfa 0%, #c4b5fd 50%, #f0c96b 100%);
  -webkit-background-clip: text;
  background-clip: text;
}

.score-hero.tier-super .score-big {
  background: linear-gradient(135deg, #f0c96b 0%, #f59e0b 50%, #fff 100%);
  -webkit-background-clip: text;
  background-clip: text;
}

.score-legend {
  margin-bottom: 1.75rem;
  padding: 1.25rem 1.5rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(12px);
}

.legend-title {
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1rem;
  text-align: center;
}

.legend-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.legend-item {
  display: grid;
  grid-template-columns: 72px 1fr;
  grid-template-rows: auto auto;
  gap: 0.15rem 0.75rem;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  border: 1px solid transparent;
  transition: background 0.2s, border-color 0.2s;
}

.legend-item.active {
  background: rgba(240, 201, 107, 0.1);
  border-color: rgba(240, 201, 107, 0.35);
}

.legend-range {
  grid-row: 1 / 3;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent);
  align-self: center;
}

.legend-label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
}

.legend-desc {
  grid-column: 2;
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 8px;
  margin: 1.5rem 0;
}

.result-dot {
  aspect-ratio: 1;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 600;
  cursor: default;
  transition: transform 0.2s ease;
  border: 1px solid var(--border);
  background: var(--bg-card);
  backdrop-filter: blur(8px);
}

.result-dot:hover {
  transform: scale(1.1);
}

.result-dot.correct {
  border-color: rgba(110, 231, 183, 0.4);
  background: rgba(110, 231, 183, 0.1);
}

.result-dot.wrong {
  border-color: rgba(251, 113, 133, 0.4);
  background: rgba(251, 113, 133, 0.1);
}

.results-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.probability-note {
  margin-top: 1.75rem;
  padding: 1rem 1.25rem;
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: var(--radius);
  text-align: center;
  backdrop-filter: blur(12px);
}

.probability-note p {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.65;
  margin: 0;
}

.probability-note strong {
  color: var(--text);
  font-weight: 600;
}

footer {
  position: relative;
  z-index: 2;
  padding: 1.5rem;
  text-align: center;
  font-size: 0.72rem;
  color: var(--text-muted);
}

footer a {
  color: var(--accent-dim);
  text-decoration: none;
}

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

/* Responsive */
@media (max-width: 600px) {
  #app {
    padding: 1.5rem 1rem 2rem;
  }

  .choices {
    grid-template-columns: 1fr;
  }

  .quote-card {
    padding: 2rem 1.25rem;
  }

  .results-grid {
    grid-template-columns: repeat(5, 1fr);
  }

  .stat-pill {
    min-width: 100px;
    padding: 0.75rem 1rem;
  }
}