:root {
  --bg: #0c1220; --card: rgba(28, 23, 18, 0.95); --ink: #efe4d4; --muted: #b9ab96; --gold: #e0a457;
  --edge: rgba(224, 164, 87, 0.45); --green: #9fe3a0; --red: #ff8a7a;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: radial-gradient(ellipse at top, #1b2438 0%, var(--bg) 60%) fixed, var(--bg);
  color: var(--ink); font: 600 17px/1.5 'Nunito', system-ui, sans-serif;
  padding: max(16px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom));
}
.wrap { max-width: 760px; margin: 0 auto; }
.top { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; }
.back { color: var(--muted); font-weight: 800; text-decoration: none; white-space: nowrap; }
.back:hover { color: var(--ink); }
.progress { flex: 1; height: 10px; border-radius: 6px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
#bar { height: 100%; width: 0; background: linear-gradient(90deg, #e0a457, #f2c470); transition: width 0.3s; }

.screen { display: none; background: var(--card); border: 1px solid var(--edge); border-radius: 18px; padding: clamp(20px, 4vw, 36px); box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5); }
.screen.show { display: block; animation: pop 0.25s ease-out; }
@keyframes pop { from { opacity: 0; transform: translateY(8px); } }
@media (prefers-reduced-motion: reduce) { .screen.show { animation: none; } #bar { transition: none; } }

.eyebrow { color: var(--green); font-weight: 900; letter-spacing: 3px; text-transform: uppercase; font-size: 13px; margin-bottom: 6px; }
h1, h2 { font-family: 'Cinzel', serif; font-weight: 900; color: var(--gold); line-height: 1.15; margin: 0 0 12px; outline: none; }
h1 { font-size: clamp(30px, 6vw, 44px); }
h2 { font-size: clamp(22px, 4.5vw, 30px); }
.lead { font-size: 18px; color: var(--ink); }
.note { color: var(--muted); margin: 0 0 12px; }
.note.flash { color: var(--gold); animation: shake 0.3s; }
@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.safe { margin: 18px 0 22px; padding: 12px 16px; border-radius: 12px; background: rgba(159, 227, 160, 0.08); border: 1px solid rgba(159, 227, 160, 0.35); color: var(--green); font-weight: 800; }

.choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin: 14px 0 18px; }
.choice { min-height: 56px; padding: 10px 14px; border-radius: 14px; border: 2px solid rgba(255, 255, 255, 0.14); background: rgba(255, 255, 255, 0.04);
  color: var(--ink); font: 800 16px 'Nunito', sans-serif; text-align: left; cursor: pointer; }
.choice:hover { border-color: var(--edge); }
.choice.on { border-color: var(--gold); background: rgba(224, 164, 87, 0.18); color: #fff; }
.choice.on::before { content: '✓ '; color: var(--gold); }

.text-wrap { display: grid; gap: 6px; margin: 8px 0 18px; font-weight: 800; }
.text-wrap[hidden] { display: none; }
.text-wrap input, .text-wrap textarea { width: 100%; padding: 12px 14px; border-radius: 12px; border: 2px solid rgba(255, 255, 255, 0.18); background: rgba(0, 0, 0, 0.35);
  color: var(--ink); font: 700 17px 'Nunito', sans-serif; resize: vertical; -webkit-user-select: text; user-select: text; }
.text-wrap input[hidden], .text-wrap textarea[hidden] { display: none; }
.text-wrap input:focus, .text-wrap textarea:focus { outline: none; border-color: var(--gold); }
.hint { color: var(--muted); font-size: 14px; font-weight: 700; }

.nav { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-top: 10px; }
.nav.center { justify-content: flex-start; }
.big { display: inline-flex; align-items: center; justify-content: center; min-height: 54px; padding: 0 26px; border: 0; border-radius: 14px; background: var(--gold); color: #1c1712;
  font: 900 17px 'Nunito', sans-serif; letter-spacing: 1px; cursor: pointer; text-decoration: none; box-shadow: 0 4px 0 #9a6a2a; }
.big:disabled { opacity: 0.5; cursor: default; }
.ghost { min-height: 48px; padding: 0 18px; border-radius: 12px; border: 2px solid rgba(255, 255, 255, 0.18); background: transparent; color: var(--ink); font: 800 16px 'Nunito', sans-serif; cursor: pointer; }
.ghost:hover { border-color: var(--edge); }
#next { margin-left: auto; }
button:focus-visible, a:focus-visible, select:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }

.nick-card { margin: 18px 0; padding: 22px; border-radius: 16px; border: 2px dashed var(--gold); text-align: center; font: 900 clamp(26px, 6vw, 38px) 'Cinzel', serif; color: #fff; }
.nick-row { display: flex; justify-content: center; margin-bottom: 18px; }
.nick-pick { color: var(--muted); font-weight: 800; margin-bottom: 18px; }
.nick-pick select { margin: 6px 6px 0 0; min-height: 44px; padding: 0 10px; border-radius: 10px; border: 2px solid rgba(255, 255, 255, 0.18); background: #1a140f; color: var(--ink); font: 800 16px 'Nunito', sans-serif; }

.summary { display: grid; gap: 2px; margin: 12px 0 16px; }
.summary .row { display: grid; gap: 2px; padding: 10px 0; border-bottom: 1px dashed rgba(255, 255, 255, 0.1); }
.summary .row span { color: var(--muted); font-size: 15px; }
.summary .row b { color: var(--ink); }
.error { color: var(--red); font-weight: 800; min-height: 1.5em; }

@media (max-width: 520px) {
  .choices { grid-template-columns: 1fr 1fr; }
  .choice { font-size: 15px; min-height: 52px; }
  .nav { justify-content: stretch; }
  .nav .big, .nav .ghost { flex: 1 1 auto; }
  #skip { order: 3; flex-basis: 100%; }
}
