:root {
  color-scheme: dark;
  --night: #06182b;
  --night-deep: #03101e;
  --panel: rgba(7, 20, 34, 0.84);
  --panel-strong: rgba(14, 22, 32, 0.94);
  --gold: #f4bd52;
  --gold-light: #ffe29a;
  --cream: #fff7e7;
  --muted: #d5d5d2;
  --danger: #ff9b8d;
  --success: #aee9bc;
  --border: rgba(247, 190, 79, 0.72);
  --shadow: 0 16px 48px rgba(0, 0, 0, 0.4);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--night-deep); }
body {
  min-height: 100vh;
  margin: 0;
  color: var(--cream);
  background: var(--night-deep) url("images/night-city.946be7d28224.png") center top / cover fixed no-repeat;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(2, 14, 28, 0.16), rgba(2, 11, 20, 0.6) 62%, rgba(2, 8, 15, 0.82));
}
button, input, textarea { font: inherit; }
a { color: var(--gold-light); }
.page-shell { position: relative; z-index: 1; width: min(100%, 760px); min-height: 100vh; margin: 0 auto; padding: env(safe-area-inset-top) 18px calc(28px + env(safe-area-inset-bottom)); }
.skip-link { position: fixed; left: 12px; top: -80px; z-index: 10; padding: 10px 14px; background: white; color: black; }
.skip-link:focus { top: 12px; }
.site-header { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 9px; color: var(--cream); text-decoration: none; font-weight: 750; font-size: 1.1rem; }
.brand-hearts { color: var(--gold-light); font-size: 1.45rem; letter-spacing: -9px; margin-right: 6px; transform: rotate(-8deg); }
.main-content { padding: 12px 0 38px; }
.hero { min-height: calc(100vh - 110px); display: grid; align-content: center; gap: 20px; text-align: center; padding: 5vh 0 3vh; }
.hero-card, .content-card { border: 1px solid var(--border); background: linear-gradient(160deg, rgba(30, 31, 34, 0.87), rgba(7, 20, 34, 0.9)); box-shadow: var(--shadow), inset 0 0 30px rgba(244, 189, 82, 0.08); backdrop-filter: blur(14px); }
.hero-card { border-radius: 38px; padding: clamp(28px, 7vw, 54px) clamp(20px, 7vw, 54px); }
.content-card { border-radius: 30px; padding: clamp(22px, 5vw, 42px); }
.narrow-card { max-width: 580px; margin: 5vh auto 0; }
.questionnaire-card, .game-card, .result-card { max-width: 650px; margin: 1vh auto 0; }
.center-card { text-align: center; }
h1 { margin: 10px 0 14px; font-size: clamp(2rem, 8vw, 3.55rem); line-height: 1.03; letter-spacing: -0.035em; text-wrap: balance; }
.narrow-card h1, .questionnaire-card h1, .game-card h1 { font-size: clamp(1.85rem, 7vw, 3rem); }
p { line-height: 1.5; }
.eyebrow { margin: 0 0 12px; color: var(--gold-light); font-size: 0.82rem; font-weight: 750; letter-spacing: 0.2em; text-transform: uppercase; }
.lead { max-width: 25ch; margin: 0 auto 28px; font-size: clamp(1.15rem, 4.5vw, 1.5rem); }
.lead-small { max-width: 45ch; margin: 0 auto 24px; color: var(--muted); font-size: 1.05rem; }
.muted, .field-help { color: var(--muted); }
.field-help { margin: 7px 0 0; font-size: 0.88rem; }
.heart-mark { color: var(--gold-light); font-size: 3.5rem; line-height: 1; filter: drop-shadow(0 0 12px rgba(244, 189, 82, 0.55)); }
.hero-note { margin: 0; color: var(--cream); font-style: italic; }
.stack-actions { display: grid; gap: 12px; }
.button { min-height: 54px; display: inline-flex; align-items: center; justify-content: center; width: 100%; padding: 13px 22px; border: 1px solid transparent; border-radius: 999px; text-align: center; text-decoration: none; font-weight: 780; cursor: pointer; transition: transform 150ms ease, filter 150ms ease, background 150ms ease; }
.button:hover { filter: brightness(1.06); }
.button:active { transform: translateY(1px); }
.button-primary { color: #231305; background: linear-gradient(180deg, #ffe18b, #efa52d); border-color: #ffe7a9; box-shadow: 0 6px 24px rgba(242, 168, 46, 0.3); }
.button-secondary { color: var(--cream); background: rgba(12, 30, 48, 0.9); border-color: var(--gold); }
.button-quiet { color: var(--cream); background: rgba(18, 20, 22, 0.55); border-color: rgba(255, 226, 154, 0.48); }
.text-button, .comment-toggle { border: 0; color: var(--gold-light); background: transparent; padding: 10px 4px; cursor: pointer; text-decoration: underline; text-underline-offset: 4px; }
.text-button.danger { color: var(--danger); }
.form-stack { display: grid; gap: 18px; margin-top: 24px; }
.field-group, .comment-field, .invite-box { display: grid; gap: 8px; text-align: left; }
label { font-weight: 700; }
input[type="text"], input[type="password"], input[type="tel"], textarea {
  width: 100%; min-height: 52px; border: 1px solid rgba(255, 226, 154, 0.55); border-radius: 14px; padding: 12px 14px; color: var(--cream); background: rgba(2, 12, 24, 0.78); outline: none;
}
textarea { resize: vertical; }
input:focus, textarea:focus, button:focus-visible, a:focus-visible { outline: 3px solid var(--gold-light); outline-offset: 3px; }
.form-error, .field-error { padding: 10px 12px; border-radius: 12px; color: #2d0703; background: #ffd7cf; text-align: left; }
.field-error ul, .form-error ul { margin: 0; padding-left: 20px; }
.switch-auth { text-align: center; }
.messages { position: relative; z-index: 2; }
.message { margin: 0 0 10px; padding: 12px 16px; border: 1px solid var(--gold); border-radius: 14px; background: rgba(5, 25, 42, 0.94); }
.progress-head { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.progress-label { color: var(--muted); font-size: 0.88rem; }
.progress-track { height: 5px; margin-bottom: 28px; overflow: hidden; border-radius: 999px; background: rgba(255, 255, 255, 0.17); }
.progress-track span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #e89525, #ffe29a); box-shadow: 0 0 12px #f4bd52; }
.color-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0; padding: 0; border: 0; }
.color-choice { position: relative; min-height: 62px; display: grid; grid-template-columns: 28px 1fr 24px; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid rgba(244, 189, 82, 0.5); border-radius: 16px; background: rgba(4, 20, 36, 0.82); cursor: pointer; }
.color-choice input, .answer-choice input { position: absolute; opacity: 0; pointer-events: none; }
.color-choice:has(input:checked), .answer-choice:has(input:checked) { border-color: var(--gold-light); background: linear-gradient(160deg, rgba(134, 83, 22, 0.75), rgba(57, 35, 12, 0.82)); box-shadow: 0 0 18px rgba(244, 189, 82, 0.28); }
.color-choice-none { grid-column: 1 / -1; }
.swatch, .answer-swatch { width: 26px; height: 26px; border: 2px solid rgba(255, 255, 255, 0.65); border-radius: 50%; background: var(--swatch); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3); }
.swatch-none { display: grid; place-items: center; color: var(--muted); background: transparent; }
.choice-check { opacity: 0; color: var(--gold-light); font-weight: 900; }
.color-choice:has(input:checked) .choice-check { opacity: 1; }
.comment-toggle { justify-self: start; }
.finalize-box { display: grid; gap: 10px; margin-top: 10px; padding: 18px; border: 1px solid rgba(255, 226, 154, 0.35); border-radius: 18px; background: rgba(0, 0, 0, 0.22); }
.finalize-box p { margin: 0; color: var(--muted); }
.success-mark, .outcome-icon { width: 74px; height: 74px; display: grid; place-items: center; margin: 0 auto 18px; border: 2px solid var(--gold-light); border-radius: 50%; color: var(--gold-light); font-size: 2.3rem; box-shadow: 0 0 30px rgba(244, 189, 82, 0.32); }
.outcome-correct { color: var(--success); border-color: var(--success); }
.outcome-wrong { color: var(--gold-light); }
.invite-box { margin: 24px 0; }
.inline-form { margin-top: 18px; }
.loading-ring { width: 42px; height: 42px; margin: 24px auto 0; border: 4px solid rgba(255, 255, 255, 0.2); border-top-color: var(--gold); border-radius: 50%; animation: spin 800ms linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.answer-form { display: grid; gap: 20px; }
.answer-list { display: grid; gap: 12px; padding: 0; border: 0; }
.answer-choice { position: relative; min-height: 64px; display: grid; grid-template-columns: 34px 1fr 26px; align-items: center; gap: 12px; padding: 12px 16px; border: 1px solid var(--border); border-radius: 18px; background: rgba(3, 18, 33, 0.86); cursor: pointer; font-size: 1.05rem; }
.radio-dot { width: 22px; height: 22px; border: 2px solid var(--gold); border-radius: 50%; }
.answer-choice:has(input:checked) .radio-dot { border: 6px solid var(--gold-light); background: #442708; }
.challenge-text { margin: 22px auto; padding: 20px; border: 1px solid var(--gold); border-radius: 18px; background: rgba(90, 53, 14, 0.45); font-size: clamp(1.1rem, 4.5vw, 1.35rem); }
.revealed-answer { margin: 24px auto; padding: 20px; border: 1px solid var(--gold-light); border-radius: 20px; background: linear-gradient(160deg, rgba(127, 75, 14, 0.72), rgba(43, 27, 9, 0.8)); color: #fff3c9; font-size: clamp(1.5rem, 7vw, 2.3rem); font-weight: 850; box-shadow: 0 0 24px rgba(244, 189, 82, 0.22); }
.result-heart { width: min(72vw, 320px); aspect-ratio: 1; display: grid; place-content: center; margin: 18px auto; border: 3px solid var(--gold); border-radius: 48% 48% 52% 52%; background: radial-gradient(circle, rgba(142, 83, 13, 0.45), rgba(3, 19, 34, 0.84) 68%); box-shadow: 0 0 38px rgba(244, 159, 45, 0.4); }
.result-heart strong { font-size: clamp(3.8rem, 18vw, 6.7rem); line-height: 1; color: var(--gold-light); }
.result-heart span { margin-top: 8px; color: var(--cream); font-weight: 700; }
.result-count { color: var(--gold-light); font-size: 1.1rem; font-weight: 800; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
[hidden] { display: none !important; }

@media (max-width: 480px) {
  .page-shell { padding-inline: 12px; }
  .site-header { min-height: 64px; }
  .hero-card, .content-card { border-radius: 24px; }
  .color-grid { grid-template-columns: 1fr; }
  .color-choice-none { grid-column: auto; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

