:root {
  --bg: #0a0a0a;
  --surface: #111111;
  --border: #1e1e1e;
  --text: #e8e8e8;
  --muted: #555;
  --accent: #e63946;
  --accent-dim: rgba(230, 57, 70, 0.15);
  --green: #2ec4b6;
  --yellow: #f4a261;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
}

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

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ── Layout ── */
.screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  position: relative;
  overflow: hidden;
}

/* ── Typography ── */
.eyebrow {
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1.5rem;
}

h1 {
  font-size: clamp(3rem, 10vw, 7rem);
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: -0.03em;
  color: var(--text);
}

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

.tagline {
  font-size: clamp(1rem, 2.5vw, 1.3rem);
  color: var(--muted);
  margin-top: 1.5rem;
  max-width: 42ch;
  line-height: 1.6;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.9rem 2rem;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: all 0.2s ease;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: #c1121f; transform: translateY(-1px); }

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
}
.btn-ghost:hover { color: var(--text); border-color: var(--muted); }

/* ── Diagnostic station ── */
.station {
  width: 100%;
  max-width: 680px;
  display: none;
}
.station.active { display: block; }

.station-header {
  margin-bottom: 3rem;
}

.station-num {
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

.station h2 {
  font-size: clamp(1.8rem, 5vw, 2.8rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.station .sub {
  font-size: 1rem;
  color: var(--muted);
  margin-top: 0.75rem;
  line-height: 1.6;
}

/* ── Slider ── */
.slider-wrap {
  margin: 2.5rem 0;
}

.slider-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 0.75rem;
  letter-spacing: 0.04em;
}

input[type="range"] {
  -webkit-appearance: none;
  width: 100%;
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  outline: none;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  transition: transform 0.15s;
}
input[type="range"]::-webkit-slider-thumb:hover { transform: scale(1.2); }

.slider-value {
  text-align: center;
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--accent);
  margin-top: 1.5rem;
  min-height: 3.5rem;
  transition: color 0.2s;
}

/* ── Option grid ── */
.option-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
  margin: 2rem 0;
}

.option-card {
  padding: 1.2rem 1rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s;
  background: var(--surface);
}
.option-card:hover { border-color: var(--muted); }
.option-card.selected {
  border-color: var(--accent);
  background: var(--accent-dim);
  color: var(--text);
}
.option-card .opt-label {
  font-size: 0.85rem;
  font-weight: 600;
  display: block;
}
.option-card .opt-sub {
  font-size: 0.7rem;
  color: var(--muted);
  margin-top: 0.3rem;
  display: block;
}

/* ── Station nav ── */
.station-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 2.5rem;
}

.progress-dots {
  display: flex;
  gap: 0.4rem;
}
.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--border);
  transition: background 0.2s;
}
.dot.done { background: var(--accent); }
.dot.current { background: var(--text); }

/* ── Verdict ── */
.verdict-wrap {
  width: 100%;
  max-width: 720px;
}

.verdict-label {
  font-size: clamp(2.5rem, 8vw, 5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 1rem 0;
}

.verdict-label.kill   { color: var(--accent); }
.verdict-label.pivot  { color: var(--yellow); }
.verdict-label.keep   { color: var(--green); }
.verdict-label.double { color: var(--text); }

.verdict-explanation {
  font-size: 1.05rem;
  color: var(--muted);
  line-height: 1.75;
  margin: 1.5rem 0 2.5rem;
  max-width: 60ch;
}

.next-steps {
  border-top: 1px solid var(--border);
  padding-top: 2rem;
  margin-top: 2rem;
}

.next-steps h3 {
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1.2rem;
}

.next-steps ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.next-steps li {
  display: flex;
  gap: 0.75rem;
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--text);
}
.next-steps li::before {
  content: '→';
  color: var(--accent);
  flex-shrink: 0;
  font-weight: 700;
}

/* ── Canvas radar ── */
#radarCanvas {
  display: block;
  margin: 2rem auto;
}

/* ── Atmospheric BG ── */
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' 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");
  background-size: 200px;
  z-index: 999;
}

.glow {
  position: absolute;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(230,57,70,0.06) 0%, transparent 70%);
  pointer-events: none;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

/* ── Fade transitions ── */
.fade-in {
  animation: fadeIn 0.4s ease forwards;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Mobile ── */
@media (max-width: 600px) {
  .screen { padding: 1.5rem 1.25rem; }
  .option-grid { grid-template-columns: 1fr 1fr; }
}
