[hidden] { display: none !important; }
:root {
  --green: #0b7a3e;
  --green-2: #1f9a48;
  --green-3: #34c95a;
  --yellow: #f7c638;
  --red: #e5484d;
  --ink: #1f1f24;
  --muted: #5b6270;
  --line: #e3e7ee;
  --bg: #eef6f1;
  --card: #ffffff;
  --radius: 20px;
  --font: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(circle at 15% 0%, #d7f2df 0, transparent 40%),
    radial-gradient(circle at 100% 30%, #fff2c6 0, transparent 35%),
    var(--bg);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; }

.top {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 12px 16px; font-weight: 800; font-size: 15px; color: var(--green);
}
.flag {
  width: 26px; height: 18px; border-radius: 4px; position: relative;
  background: linear-gradient(90deg, #046a38 0 40%, #da291c 40% 100%);
  box-shadow: 0 0 0 2px var(--ink);
}
.flag::after { content: ""; position: absolute; left: 40%; top: 50%; width: 8px; height: 8px; transform: translate(-50%, -50%); border-radius: 50%; background: var(--yellow); }

.page { width: 100%; max-width: 480px; margin: 0 auto; padding: 0 16px 24px; flex: 1; }

.step { display: none; }
.step.is-active { display: block; animation: enter .35s ease both; }
@keyframes enter { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

.headline {
  font-size: clamp(20px, 5.4vw, 26px); line-height: 1.25; font-weight: 800; text-align: center; margin: 4px 0 14px;
}
mark { background: linear-gradient(transparent 55%, #ffe27a 55%); color: inherit; padding: 0 2px; }

/* ---------- player ---------- */
/* Height drives the size so the 9:16 frame always fits the screen: the
   smaller of 72% of the viewport height and the column width in 9:16. */
.player {
  --h: min(72vh, calc((min(100vw, 480px) - 32px) * 16 / 9));
  position: relative; height: var(--h); width: calc(var(--h) * 9 / 16); margin: 0 auto;
  border-radius: var(--radius); overflow: hidden; background: #000;
  border: 4px solid var(--ink); box-shadow: 0 8px 0 rgba(0,0,0,.15);
}
.player video { width: 100%; height: 100%; object-fit: cover; display: block; cursor: pointer; }
.unmute {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 18px 22px; border-radius: 18px; border: 4px solid var(--ink); min-width: 230px; white-space: nowrap;
  background: var(--yellow); color: var(--ink); cursor: pointer; text-align: center;
  box-shadow: 0 6px 0 rgba(0,0,0,.25); animation: pulse 1.2s ease-in-out infinite;
}
.unmute strong { font-size: 18px; font-weight: 800; }
.unmute span { font-size: 15px; font-weight: 600; }
.unmute-icon { font-size: 34px; line-height: 1; }
.paused {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 84px; height: 84px; border-radius: 50%; border: 4px solid var(--ink);
  background: rgba(255,255,255,.92); font-size: 30px; cursor: pointer; padding-left: 6px;
}
.player-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 6px; background: rgba(255,255,255,.25); }
.player-bar i { display: block; height: 100%; width: 0; background: var(--yellow); }

@keyframes pulse { 0%, 100% { transform: translate(-50%, -50%) scale(1); } 50% { transform: translate(-50%, -50%) scale(1.05); } }

/* ---------- CTA ---------- */
.gate { margin-top: 18px; text-align: center; }
.cta {
  width: 100%; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 64px; padding: 14px 20px; border-radius: 999px; border: 4px solid var(--ink);
  font-weight: 900; font-size: 19px; letter-spacing: .3px; text-decoration: none; cursor: pointer;
  color: #fff; background: linear-gradient(#34c95a, #1f9a48); box-shadow: 0 7px 0 #12602c;
  transition: transform .1s, box-shadow .1s;
}
.cta:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 3px 0 #12602c; }
.cta:disabled { cursor: not-allowed; color: #5b6270; background: #dfe3ea; box-shadow: 0 7px 0 #b9bfca; }
.cta:disabled b { color: var(--ink); font-variant-numeric: tabular-nums; }
.cta.is-ready { animation: ready 1.1s ease-in-out infinite; }
@keyframes ready { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.04); } }
.gate-hint { font-size: 13px; color: var(--muted); margin: 12px 4px 0; }

/* ---------- quiz ---------- */
.quiz-head { display: flex; align-items: center; gap: 12px; margin: 8px 0 18px; }
.back {
  flex: none; width: 44px; height: 44px; border-radius: 12px; border: 3px solid var(--ink);
  background: #fff; font-size: 20px; font-weight: 800; cursor: pointer;
}
.back:disabled { opacity: .3; cursor: default; }
.quiz-progress { flex: 1; font-size: 13px; font-weight: 700; color: var(--muted); }
.bar { height: 12px; border-radius: 99px; background: #dfe3ea; border: 2px solid var(--ink); overflow: hidden; margin-top: 6px; }
.bar i { display: block; height: 100%; width: 0; background: var(--green-3); transition: width .35s ease; }
.quiz-question { font-size: clamp(21px, 5.6vw, 26px); line-height: 1.25; font-weight: 800; margin: 0 0 6px; }
.quiz-sub { color: var(--muted); font-size: 14px; margin: 0 0 16px; min-height: 1em; }
.options { display: grid; gap: 12px; }
.option {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left;
  padding: 14px 16px; min-height: 64px; border-radius: 16px; border: 3px solid var(--ink);
  background: #fff; cursor: pointer; font-weight: 700; font-size: 16px; color: var(--ink);
  box-shadow: 0 5px 0 rgba(0,0,0,.12); transition: transform .1s, background .15s;
}
.option:hover { background: #f6fbf8; }
.option:active { transform: translateY(3px); box-shadow: 0 2px 0 rgba(0,0,0,.12); }
.option.is-picked { background: #d9f7df; border-color: var(--green-2); }
.option-emoji { font-size: 26px; line-height: 1; flex: none; width: 34px; text-align: center; }
.option small { display: block; font-weight: 500; color: var(--muted); font-size: 13px; }

/* ---------- loading ---------- */
.loading { text-align: center; padding: 40px 8px; }
.loading h2 { font-size: 22px; margin: 18px 0; }
.spinner { width: 64px; height: 64px; margin: 0 auto; border-radius: 50%; border: 7px solid #dfe3ea; border-top-color: var(--green-2); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.checks { list-style: none; padding: 0; margin: 0 auto; max-width: 340px; text-align: left; }
.checks li { padding: 10px 12px 10px 40px; position: relative; font-weight: 600; color: #a0a7b4; transition: color .3s; }
.checks li::before { content: ""; position: absolute; left: 8px; top: 50%; width: 20px; height: 20px; margin-top: -10px; border-radius: 6px; border: 2px solid #c3cad6; }
.checks li.done { color: var(--ink); }
.checks li.done::before { background: var(--green-2); border-color: var(--green-2); }
.checks li.done::after { content: "✓"; position: absolute; left: 13px; top: 50%; transform: translateY(-52%); color: #fff; font-weight: 900; font-size: 14px; }

/* ---------- result ---------- */
#step-result { position: relative; }
#confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 5; }
.result { position: relative; z-index: 6; text-align: center; background: var(--card); border: 4px solid var(--ink); border-radius: 24px; padding: 20px 16px; box-shadow: 0 8px 0 rgba(0,0,0,.12); margin-top: 4px; }
.badge { display: inline-block; background: #d9f7df; color: var(--green); border: 2px solid var(--green-2); font-weight: 800; border-radius: 999px; padding: 6px 14px; font-size: 14px; }
.result h2 { font-size: clamp(22px, 6vw, 30px); line-height: 1.18; font-weight: 900; margin: 12px 0; }
.result-points { list-style: none; padding: 0; margin: 0 0 16px; text-align: left; display: grid; gap: 8px; }
.result-points li { background: #f6f8fb; border-radius: 12px; padding: 8px 12px 8px 38px; position: relative; font-size: 14px; font-weight: 600; line-height: 1.4; }
.result-points li::before { content: "✅"; position: absolute; left: 10px; top: 9px; }
.result-text { font-size: 15px; line-height: 1.45; margin: 0 0 16px; }
.cta-go { animation: ready 1.1s ease-in-out infinite; }
.safe { font-size: 13px; color: var(--muted); margin: 14px 0 0; }

.foot { max-width: 480px; margin: 0 auto; padding: 8px 20px 24px; font-size: 11.5px; color: #8a8f99; text-align: center; }

@media (min-width: 900px) {
  .page { max-width: 520px; padding-top: 8px; }
  .player { --h: min(64vh, calc((520px - 32px) * 16 / 9)); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
