:root {
  --bg: #0b1a2b;
  --panel: #12263a;
  --panel2: #18324a;
  --text: #e8f1fa;
  --muted: #8aa0b8;
  --accent: #e11d48;
  --accent2: #38bdf8;
  --good: #34d399;
  --warn: #fbbf24;
  --bad: #fb7185;
  --gold: #fde68a;
  --border: #243b55;
  --font: "Segoe UI", system-ui, -apple-system, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  min-height: 100%;
  background:
    radial-gradient(900px 480px at 50% -8%, #1e3a5f 0%, transparent 55%),
    radial-gradient(700px 400px at 100% 20%, rgba(225, 29, 72, 0.12), transparent 50%),
    var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.55;
  -webkit-tap-highlight-color: transparent;
}

.skip {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--accent);
  color: #fff;
  padding: 8px 12px;
  z-index: 20;
}
.skip:focus { left: 8px; }

#app {
  max-width: 920px;
  margin: 0 auto;
  padding: 20px 14px 40px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.hero {
  text-align: center;
  padding: 12px 4px 4px;
}
.eyebrow {
  color: var(--accent2);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.hero h1 {
  font-size: clamp(1.55rem, 4.6vw, 2.35rem);
  letter-spacing: 0.01em;
  line-height: 1.15;
  background: linear-gradient(92deg, #fff 10%, #7dd3fc 45%, #fb7185 90%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.tagline {
  margin-top: 10px;
  font-size: 1.05rem;
  color: var(--gold);
}
.tagline em { font-style: italic; color: #fff; }
.sub {
  margin: 8px auto 0;
  max-width: 34rem;
  color: var(--muted);
  font-size: 0.98rem;
}
.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 16px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 999px;
  padding: 11px 18px;
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.12s ease, border-color 0.12s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn.primary {
  background: linear-gradient(135deg, #e11d48, #be123c);
  color: #fff;
  box-shadow: 0 10px 28px rgba(225, 29, 72, 0.35);
}
.btn.ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
.btn.choice {
  background: var(--panel2);
  color: var(--text);
  border-color: var(--border);
  width: 100%;
  border-radius: 12px;
  text-align: left;
  font-weight: 600;
}
.btn.choice:hover { border-color: var(--accent2); }
.btn.choice.correct-ish { border-color: var(--good); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

.panel {
  background: rgba(18, 38, 58, 0.92);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.28);
}

#hud {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}
.hud-item {
  background: var(--panel2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 10px;
  text-align: center;
}
.hud-item .label {
  display: block;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.hud-item span:last-child {
  font-size: 1.2rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
#streak { color: var(--gold); }

.stage {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, #0f2740 0%, #0a1624 100%);
  min-height: 320px;
  display: grid;
  grid-template-rows: 140px 1fr;
}
.stage-art {
  position: relative;
  background:
    linear-gradient(180deg, rgba(56, 189, 248, 0.08), transparent 60%),
    repeating-linear-gradient(90deg, transparent, transparent 38px, rgba(255,255,255,0.03) 38px, rgba(255,255,255,0.03) 39px);
  border-bottom: 1px solid var(--border);
}
.stage-art::before {
  content: "";
  position: absolute;
  inset: auto 0 18px 0;
  height: 28px;
  background: linear-gradient(180deg, #1d4e78, #0e7490);
  opacity: 0.85;
  clip-path: polygon(0 40%, 8% 20%, 18% 45%, 30% 15%, 42% 50%, 55% 22%, 68% 48%, 80% 18%, 92% 42%, 100% 28%, 100% 100%, 0 100%);
}
.boats {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: space-around;
  padding: 18px 24px 36px;
}
.boat {
  width: 54px;
  height: 70px;
  position: relative;
  filter: drop-shadow(0 6px 8px rgba(0,0,0,0.35));
}
.boat .hull {
  position: absolute;
  bottom: 0;
  left: 6px;
  right: 6px;
  height: 16px;
  background: #f8fafc;
  border-radius: 0 0 40% 40%;
}
.boat .mast {
  position: absolute;
  bottom: 14px;
  left: 50%;
  width: 3px;
  height: 46px;
  background: #cbd5e1;
  transform: translateX(-50%);
}
.boat .sail {
  position: absolute;
  bottom: 20px;
  left: 50%;
  width: 0;
  height: 0;
  border-style: solid;
}
.boat.you .sail { border-width: 0 0 36px 28px; border-color: transparent transparent #38bdf8 transparent; }
.boat.them .sail { border-width: 0 28px 36px 0; border-color: transparent #fb7185 transparent transparent; left: calc(50% - 28px); }
.boat.mark {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #fbbf24;
  border: 3px solid #fff;
  margin-bottom: 20px;
}
.flag-fly {
  position: absolute;
  top: 12px;
  right: 16px;
  font-size: 1.6rem;
  animation: flutter 0.8s ease-in-out infinite alternate;
}
@keyframes flutter {
  from { transform: rotate(-6deg) translateY(0); }
  to { transform: rotate(8deg) translateY(2px); }
}

#stage-copy {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
#stage-title {
  font-size: 1.15rem;
}
#stage-text {
  color: var(--muted);
  font-size: 0.95rem;
}
.actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}
.verdict {
  margin-top: 4px;
  padding: 10px 12px;
  border-radius: 10px;
  font-weight: 700;
  text-align: center;
}
.verdict.good { background: rgba(52, 211, 153, 0.15); color: var(--good); border: 1px solid rgba(52, 211, 153, 0.35); }
.verdict.bad { background: rgba(251, 113, 133, 0.15); color: var(--bad); border: 1px solid rgba(251, 113, 133, 0.35); }
.verdict.mid { background: rgba(251, 191, 36, 0.12); color: var(--warn); border: 1px solid rgba(251, 191, 36, 0.35); }

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

.seo-block h2 {
  font-size: 1.25rem;
  margin-bottom: 10px;
}
.seo-block p, .seo-block li {
  color: #c5d4e4;
  margin-bottom: 8px;
}
.steps {
  padding-left: 1.2rem;
  margin-bottom: 10px;
}
.steps li { margin-bottom: 8px; }

details {
  border-top: 1px solid var(--border);
  padding: 10px 0;
}
details:first-of-type { border-top: none; }
summary {
  cursor: pointer;
  font-weight: 700;
  color: #fff;
}
details p {
  margin-top: 8px;
  color: var(--muted);
}

.foot {
  text-align: center;
  color: var(--muted);
  font-size: 0.82rem;
  padding: 8px 4px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.foot a { color: var(--accent2); }
.muted { opacity: 0.8; }

@media (max-width: 560px) {
  #hud { grid-template-columns: repeat(2, 1fr); }
  .stage { min-height: 380px; grid-template-rows: 120px 1fr; }
}
