:root {
  --orange: #f15a29;
  --orange-dark: #b93614;
  --peach: #f5b5a0;
  --blue: #9dc7d5;
  --ink: #20202a;
  --paper: #fffaf7;
  --white: #ffffff;
  --muted: #65616b;
  --line: #e8ddd7;
  --success: #176b51;
  --error: #a22b26;
  --shadow: 0 24px 70px rgba(65, 35, 25, 0.14);
  color-scheme: light;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { min-width: 320px; background: #f7e9e2; }

body {
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 14% 12%, rgba(245, 181, 160, 0.88), transparent 29rem),
    radial-gradient(circle at 88% 84%, rgba(157, 199, 213, 0.66), transparent 32rem),
    var(--paper);
  color: var(--ink);
}

button, input { font: inherit; }
button { touch-action: manipulation; }

.ambient {
  position: fixed;
  z-index: 0;
  width: 18rem;
  height: 18rem;
  border: 2px solid rgba(241, 90, 41, 0.12);
  border-radius: 48% 52% 63% 37%;
  pointer-events: none;
}
.ambient-one { left: -8rem; bottom: -5rem; transform: rotate(24deg); }
.ambient-two { right: -9rem; top: -5rem; border-color: rgba(51, 79, 93, 0.11); transform: rotate(-14deg); }

.app-shell {
  position: relative;
  z-index: 1;
  width: min(100%, 640px);
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  padding: max(16px, env(safe-area-inset-top)) 20px max(24px, env(safe-area-inset-bottom));
}

.brand-bar { display: flex; min-height: 74px; align-items: center; justify-content: space-between; }
.brand-logo { width: 82px; height: auto; display: block; }
.connection-status {
  margin: 8px 0;
  padding: 10px 12px;
  border-radius: 12px;
  color: #5d3b00;
  background: #fff0bd;
  font-size: 0.85rem;
  font-weight: 700;
}

.screen { display: none; padding: 28px 0 24px; animation: screen-in 280ms ease-out both; }
.screen.is-active { display: block; }
.centered-screen { text-align: center; }

@keyframes screen-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

h1 { margin: 0; font-size: clamp(2.15rem, 9.6vw, 4rem); line-height: 0.98; letter-spacing: -0.055em; }
.lead { max-width: 34rem; margin: 20px 0 28px; color: #4d4850; font-size: 1.08rem; line-height: 1.55; }
.lead.compact { margin: 14px auto 24px; font-size: 1rem; }
.eyebrow, .step-label { margin: 0 0 12px; color: var(--orange-dark); font-size: 0.75rem; font-weight: 900; letter-spacing: 0.14em; text-transform: uppercase; }

.experience-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 0 0 28px;
}
.experience-summary div { min-width: 0; padding: 14px 8px; border: 1px solid rgba(255, 255, 255, 0.8); border-radius: 18px; background: rgba(255, 255, 255, 0.58); }
.experience-summary strong, .experience-summary span { display: block; }
.experience-summary strong { font-size: 1rem; }
.experience-summary span { margin-top: 3px; color: var(--muted); font-size: 0.7rem; }

.button {
  min-height: 52px;
  padding: 14px 22px;
  border: 0;
  border-radius: 16px;
  cursor: pointer;
  font-weight: 850;
  transition: transform 130ms ease, box-shadow 130ms ease, opacity 130ms ease;
}
.button:hover { transform: translateY(-1px); }
.button:active { transform: translateY(1px) scale(0.99); }
.button:focus-visible, input:focus-visible, summary:focus-visible { outline: 3px solid #2f7189; outline-offset: 3px; }
.button:disabled { cursor: wait; opacity: 0.58; transform: none; }
.button-large { width: 100%; min-height: 58px; font-size: 1.03rem; }
.button-primary { color: #fff; background: var(--orange-dark); box-shadow: 0 12px 24px rgba(185, 54, 20, 0.22); }
.button-dark { color: #fff; background: var(--ink); }
.microcopy, .screenshot-tip { margin: 12px 0 0; color: var(--muted); font-size: 0.78rem; text-align: center; }

.back-button { min-height: 44px; margin: -10px 0 28px; padding: 8px 0; border: 0; color: var(--ink); background: transparent; cursor: pointer; font-weight: 750; }
form { margin-top: 26px; }
form > label:not(.checkbox-row) { display: block; margin: 18px 0 8px; font-size: 0.9rem; font-weight: 800; }
input[type="text"], input[type="email"] {
  width: 100%;
  min-height: 56px;
  padding: 14px 16px;
  border: 2px solid var(--line);
  border-radius: 15px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.92);
  font-size: 1rem;
}
input[type="text"]:focus, input[type="email"]:focus { border-color: #2f7189; }

.privacy-card { margin-top: 22px; padding: 16px; border: 1px solid var(--line); border-radius: 16px; background: rgba(255, 255, 255, 0.7); }
.checkbox-row { display: flex; align-items: flex-start; gap: 11px; font-size: 0.86rem; line-height: 1.45; cursor: pointer; }
.checkbox-row input { flex: 0 0 auto; width: 22px; height: 22px; margin: 0; accent-color: var(--orange-dark); }
.optional-consent { margin: 15px 0 22px; }
details { margin-top: 12px; color: var(--muted); font-size: 0.8rem; }
summary { min-height: 36px; cursor: pointer; color: #3f3a42; font-weight: 750; }
.privacy-copy p { margin: 8px 0; line-height: 1.45; }
.form-error { margin: 12px 0; padding: 11px 13px; border-radius: 12px; color: #761a18; background: #ffe1dd; font-size: 0.87rem; font-weight: 700; }

.quiz-topline { display: flex; justify-content: space-between; margin-bottom: 10px; font-size: 0.82rem; }
.quiz-topline span { color: var(--muted); font-weight: 750; }
.progress-track { height: 7px; overflow: hidden; border-radius: 99px; background: #e8d9d1; }
.progress-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--orange-dark); transition: width 240ms ease; }
.question-card { margin-top: 22px; padding: 24px 18px; border: 1px solid rgba(255, 255, 255, 0.9); border-radius: 28px; background: rgba(255, 255, 255, 0.78); box-shadow: var(--shadow); }
.question-card h1 { font-size: clamp(1.7rem, 7vw, 2.5rem); line-height: 1.08; }
.answer-list { display: grid; gap: 10px; margin-top: 24px; }
.answer-button { position: relative; width: 100%; min-height: 58px; padding: 14px 16px 14px 48px; border: 2px solid var(--line); border-radius: 16px; color: var(--ink); background: #fff; cursor: pointer; text-align: left; font-weight: 750; line-height: 1.3; }
.answer-button::before { position: absolute; left: 15px; top: 50%; width: 22px; height: 22px; border: 2px solid #b8aaa3; border-radius: 50%; content: ""; transform: translateY(-50%); }
.answer-button:hover { border-color: var(--orange); }
.answer-button.is-correct { border-color: var(--success); color: #0d4c39; background: #e0f4ec; }
.answer-button.is-wrong { border-color: var(--error); color: #751c19; background: #ffe3df; }
.answer-button:disabled { cursor: default; opacity: 0.8; }
.feedback { margin-top: 18px; padding: 17px; border-radius: 16px; text-align: left; }
.feedback.correct { color: #0d4c39; background: #daf1e8; }
.feedback.wrong { color: #751c19; background: #ffe3df; }
.feedback strong { font-size: 1.05rem; }
.feedback p { margin: 7px 0 15px; line-height: 1.45; }

.celebration-mark { width: 68px; height: 68px; margin: 10px auto 24px; border-radius: 50%; color: var(--orange-dark); background: #ffd9cb; font-size: 2.4rem; line-height: 68px; }
.score-disc { display: grid; place-content: center; width: 176px; height: 176px; margin: 28px auto 24px; border: 12px solid rgba(241, 90, 41, 0.18); border-radius: 50%; background: #fff; box-shadow: var(--shadow); }
.score-disc strong, .score-disc span { display: block; }
.score-disc strong { color: var(--orange-dark); font-size: 2.2rem; letter-spacing: -0.05em; }
.score-disc span { margin-top: 3px; color: var(--muted); font-size: 0.72rem; }

.wheel-stage { position: relative; width: min(84vw, 390px); aspect-ratio: 1; margin: 20px auto 24px; }
#wheel-canvas { display: block; width: 100%; height: 100%; border-radius: 50%; filter: drop-shadow(0 18px 25px rgba(60, 37, 27, 0.2)); transform: rotate(0deg); will-change: transform; }
.wheel-pointer { position: absolute; z-index: 4; left: 50%; top: -7px; width: 0; height: 0; border-right: 18px solid transparent; border-left: 18px solid transparent; border-top: 42px solid var(--ink); filter: drop-shadow(0 3px 2px rgba(0, 0, 0, 0.18)); transform: translateX(-50%); }
.wheel-hub { position: absolute; z-index: 3; left: 50%; top: 50%; display: grid; place-items: center; width: 66px; height: 66px; border: 7px solid #fff; border-radius: 50%; color: #fff; background: var(--ink); font-size: 0.9rem; font-weight: 950; letter-spacing: 0.08em; transform: translate(-50%, -50%); }
.spin-status { min-height: 22px; margin: 12px 0 0; color: var(--muted); font-size: 0.85rem; }

.prize-burst { display: inline-block; margin: 8px 0 22px; padding: 10px 16px; border-radius: 5px; color: #fff; background: var(--orange-dark); font-size: 0.78rem; font-weight: 950; letter-spacing: 0.18em; transform: rotate(-3deg); }
.replay-burst { display: inline-block; margin: 8px 0 22px; padding: 10px 17px; border-radius: 999px; color: var(--ink); background: #ffd36a; box-shadow: 0 8px 22px rgba(126, 88, 0, 0.18); font-size: 0.78rem; font-weight: 950; letter-spacing: 0.18em; transform: rotate(2deg); }
.replay-card { margin: 24px 0; padding: 22px 18px; border: 2px solid #e3ad28; border-radius: 22px; background: rgba(255, 244, 204, 0.82); }
.replay-card strong { display: block; color: #704c00; font-size: 1.08rem; }
.replay-card p { margin: 8px 0 0; color: #5f4c25; line-height: 1.5; }
.claim-card { margin: 24px 0; padding: 22px 18px; border: 2px dashed var(--orange-dark); border-radius: 22px; background: rgba(255, 255, 255, 0.8); }
.claim-card span, .claim-card strong { display: block; }
.claim-card span { color: var(--muted); font-size: 0.72rem; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; }
.claim-card strong { margin: 8px 0 13px; color: var(--orange-dark); font-size: clamp(2rem, 10vw, 3rem); letter-spacing: 0.04em; }
.claim-card p { margin: 0; line-height: 1.45; }

.loading-overlay { position: fixed; z-index: 10; inset: 0; display: grid; place-content: center; justify-items: center; color: var(--ink); background: rgba(255, 250, 247, 0.96); transition: opacity 200ms ease; }
.loading-overlay.is-hidden { visibility: hidden; opacity: 0; }
.loading-overlay p { font-weight: 750; }
.loader { width: 42px; height: 42px; border: 5px solid #efcec0; border-top-color: var(--orange-dark); border-radius: 50%; animation: rotate 700ms linear infinite; }
@keyframes rotate { to { transform: rotate(360deg); } }

@media (min-width: 700px) {
  .app-shell { padding-right: 36px; padding-left: 36px; }
  .screen { padding-top: 38px; }
  .welcome-screen { padding-top: 52px; }
  .question-card { padding: 34px; }
}

@media (max-height: 700px) {
  .screen { padding-top: 12px; }
  .brand-bar { min-height: 58px; }
  .brand-logo { width: 64px; }
  .wheel-stage { width: min(70vw, 310px); margin-top: 12px; margin-bottom: 12px; }
  .lead { margin-top: 12px; margin-bottom: 18px; }
}

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