/* Base reset */
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
img, svg { max-width: 100%; }
:root { padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }

/* Layout: one phone-width game column; sticker-style cards with ink borders and offset shadows; scene on top, answers within thumb reach. */
:root {
  --bg: #EEF3F8; --surface: #FFFFFF; --ink: #132039; --muted: #56637A; --line: #132039; --shadow: #132039;
  --sky: #D6E6FF; --sky2: #BCD3FA; --sea: #2D5BE3; --sun: #FFC53D; --mint: #1FA98B; --red: #E5484D; --plum: #7C5CFA; --coral: #FF6C51;
  --on-bright: #132039; --on-sea: #FFFFFF;
  --font-display: "Rubik", "Arial Rounded MT Bold", system-ui, sans-serif;
  --font-body: "Assistant", "Segoe UI", system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #0D1526; --surface: #18233A; --ink: #EDF2FA; --muted: #A3B1C7; --line: #7F93B5; --shadow: #03070F;
  --sky: #1C2C4D; --sky2: #26395F; --sea: #7194FF; --sun: #FFCF5C; --mint: #3CCFAE; --red: #FF6B6E; --plum: #9D86FF; --coral: #FF7E66;
  --on-sea: #0D1526; color-scheme: dark; } }
:root[data-theme="dark"] {
  --bg: #0D1526; --surface: #18233A; --ink: #EDF2FA; --muted: #A3B1C7; --line: #7F93B5; --shadow: #03070F;
  --sky: #1C2C4D; --sky2: #26395F; --sea: #7194FF; --sun: #FFCF5C; --mint: #3CCFAE; --red: #FF6B6E; --plum: #9D86FF; --coral: #FF7E66;
  --on-sea: #0D1526; color-scheme: dark; }

html, body { height: 100%; }
body { background: var(--bg); color: var(--ink); font-family: var(--font-body); font-size: 17px; line-height: 1.45; -webkit-tap-highlight-color: transparent; }
* { box-sizing: border-box; }
button { font: inherit; color: inherit; cursor: pointer; }
button:focus-visible, input:focus-visible, a:focus-visible, summary:focus-visible { outline: 3px solid var(--sea); outline-offset: 2px; }
.app { max-width: 460px; margin: 0 auto; min-height: 100%; display: flex; flex-direction: column; gap: 14px; padding-inline: 16px; padding-block: 12px 240px; }
h1, h2, h3 { font-family: var(--font-display); text-wrap: balance; margin: 0; letter-spacing: -0.01em; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 0.86rem; }
.label { font-family: var(--font-display); font-weight: 700; font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }

/* HUD */
.hud { display: grid; grid-template-columns: 40px 1fr 40px; align-items: center; gap: 10px; }
.iconbtn { width: 40px; height: 40px; border-radius: 12px; border: 2px solid var(--line); background: var(--surface); display: grid; place-items: center; box-shadow: 2px 2px 0 var(--shadow); font-weight: 800; font-family: var(--font-display); }
.iconbtn:active { transform: translate(2px,2px); box-shadow: none; }
.track { display: flex; gap: 4px; align-items: center; }
.track i { flex: 1; height: 8px; border-radius: 4px; background: var(--sky2); }
.track i.done { background: var(--sea); }
.track i.now { background: var(--sun); box-shadow: 0 0 0 2px var(--line) inset; animation: pulse 1.4s ease-in-out infinite; }
.xp { display: flex; align-items: center; gap: 6px; padding: 6px 10px 6px 6px; border: 2px solid var(--line); border-radius: 999px; background: var(--surface); font-family: var(--font-display); font-weight: 800; font-variant-numeric: tabular-nums; box-shadow: 2px 2px 0 var(--shadow); }
.xp svg { width: 22px; height: 22px; }
.xp.bump { animation: bump .4s ease; }

/* Scene */
.scene { border: 2px solid var(--line); border-radius: 22px; overflow: hidden; background: var(--sky); box-shadow: 4px 4px 0 var(--shadow); max-width: 100%; }
.scene svg { display: block; width: 100%; height: auto; }
.kicker { display: flex; justify-content: space-between; align-items: baseline; }
.qtext { font-size: 1.5rem; line-height: 1.18; font-weight: 800; }
.sub { color: var(--muted); margin-top: -6px; }

/* Options */
.opts { display: grid; gap: 10px; }
.opt { display: flex; align-items: center; gap: 12px; width: 100%; text-align: start; padding: 12px 14px; border: 2px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: 3px 3px 0 var(--shadow); font-weight: 600; font-size: 1.02rem; line-height: 1.25; transition: transform .12s ease, box-shadow .12s ease, background .15s ease; animation: rise .35s ease both; }
.opt:active { transform: translate(3px,3px); box-shadow: 0 0 0 var(--shadow); }
.opt .key { flex: none; width: 32px; height: 32px; border-radius: 10px; border: 2px solid var(--line); display: grid; place-items: center; font-family: var(--font-display); font-weight: 800; font-size: 0.9rem; background: var(--sky); color: var(--ink); }
.opt.sel { background: var(--sun); color: var(--on-bright); }
.opt.sel .key { background: var(--surface); color: var(--ink); }
.opt.right { background: var(--mint); color: var(--on-bright); }
.opt.wrong { background: var(--red); color: var(--on-bright); }
.opt.dim { opacity: .55; }
.opts.locked .opt { pointer-events: none; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 9px 14px; border: 2px solid var(--line); border-radius: 999px; background: var(--surface); font-weight: 600; box-shadow: 2px 2px 0 var(--shadow); }
.chip[aria-pressed="true"] { background: var(--sun); color: var(--on-bright); }
.chip:active { transform: translate(2px,2px); box-shadow: none; }

.btn { display: inline-flex; justify-content: center; align-items: center; gap: 8px; width: 100%; padding: 14px 18px; border: 2px solid var(--line); border-radius: 16px; background: var(--sea); color: var(--on-sea); font-family: var(--font-display); font-weight: 800; font-size: 1.06rem; box-shadow: 3px 3px 0 var(--shadow); text-decoration: none; }
.btn:active { transform: translate(3px,3px); box-shadow: none; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn.sun { background: var(--sun); color: var(--on-bright); }
.btn.coral { background: var(--coral); color: var(--on-bright); }
.btn.ghost { background: var(--surface); color: var(--ink); }

/* Fact sheet */
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; justify-content: center; pointer-events: none; }
.sheet-inner { pointer-events: auto; width: 100%; max-width: 460px; margin-inline: 8px; background: var(--surface); border: 2px solid var(--line); border-bottom: 0; border-radius: 22px 22px 0 0; box-shadow: 0 -4px 0 var(--shadow); padding: 16px 16px calc(16px + env(safe-area-inset-bottom, 0px)); display: grid; gap: 12px; animation: sheetup .3s cubic-bezier(.2,.9,.3,1.2) both; }
.fact-head { display: flex; align-items: center; gap: 10px; }
.bulb { width: 36px; height: 36px; flex: none; }
.gain { margin-inline-start: auto; font-family: var(--font-display); font-weight: 800; color: var(--mint); }
.floater { position: fixed; z-index: 30; font-family: var(--font-display); font-weight: 800; color: var(--on-bright); background: var(--sun); border: 2px solid var(--line); border-radius: 999px; padding: 2px 10px; pointer-events: none; animation: floatup 1s ease forwards; }

/* Intro */
.hero { display: grid; gap: 14px; padding-top: 6px; }
.hero h1 { font-size: 2.3rem; line-height: 1.02; font-weight: 800; }
.hero h1 em { font-style: normal; background: var(--sun); color: var(--on-bright); padding: 0 .18em; border-radius: 8px; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.facts3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.facts3 div { border: 2px solid var(--line); border-radius: 14px; padding: 10px; background: var(--surface); text-align: center; }
.facts3 b { display: block; font-family: var(--font-display); font-size: 1.35rem; font-variant-numeric: tabular-nums; }
.typesrow { display: flex; justify-content: space-between; gap: 6px; }
.typesrow figure { margin: 0; display: grid; justify-items: center; gap: 4px; flex: 1; min-width: 0; }
.typesrow svg { width: 100%; max-width: 64px; height: auto; animation: bob 3s ease-in-out infinite; }
.typesrow figcaption { font-size: .72rem; font-weight: 700; text-align: center; line-height: 1.1; }
.powered { text-align: center; font-size: .82rem; color: var(--muted); }
.powered a { color: var(--ink); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }

/* Results */
.reveal { border: 2px solid var(--line); border-radius: 24px; background: var(--surface); box-shadow: 5px 5px 0 var(--shadow); padding: 20px 16px; display: grid; gap: 10px; justify-items: center; text-align: center; animation: flipin .7s cubic-bezier(.2,.9,.3,1.15) both; }
.reveal .medal { width: 120px; height: 120px; animation: pop .6s .3s cubic-bezier(.2,.9,.3,1.4) both; }
.reveal h1 { font-size: 2.1rem; line-height: 1.05; font-weight: 800; }
.goalchip { display: inline-flex; gap: 6px; align-items: center; padding: 6px 12px; border-radius: 999px; border: 2px solid var(--line); background: var(--sky); font-weight: 700; }
.section { display: grid; gap: 10px; }
.section > h2 { font-size: 1.25rem; font-weight: 800; }
.card { border: 2px solid var(--line); border-radius: 18px; background: var(--surface); padding: 14px; display: grid; gap: 8px; min-width: 0; }
.mapwrap { border: 2px solid var(--line); border-radius: 18px; background: var(--surface); padding: 8px; }
.mapwrap svg { display: block; width: 100%; height: auto; }
#dot { transition: transform 1.2s cubic-bezier(.2,.9,.3,1.2); }
.bias { background: var(--sky); }
.bias b { font-family: var(--font-display); }
.idea { animation: rise .4s ease both; }
.idea-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.tag { font-family: var(--font-display); font-weight: 700; font-size: .7rem; letter-spacing: .06em; text-transform: uppercase; padding: 3px 8px; border-radius: 6px; border: 2px solid var(--line); }
.tag.anchor { background: var(--mint); color: var(--on-bright); }
.tag.match { background: var(--sky); }
.tag.stretch { background: var(--plum); color: #fff; }
.match { font-size: .85rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.match b { font-family: var(--font-display); font-size: 1.05rem; color: var(--ink); }
.idea h3 { font-size: 1.12rem; font-weight: 700; }
.meter { display: flex; align-items: center; gap: 8px; }
.meter .segs { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; flex: 1; max-width: 180px; }
.meter .segs i { height: 10px; border-radius: 3px; background: var(--sky2); }
.meter .segs i.on.lo { background: var(--mint); }
.meter .segs i.on.mid { background: var(--sun); }
.meter .segs i.on.hi { background: var(--red); }
.meter span { font-family: var(--font-display); font-weight: 700; font-size: .85rem; font-variant-numeric: tabular-nums; }
.meta { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .88rem; color: var(--muted); }
.meta b { color: var(--ink); font-weight: 700; }
.warn { font-size: .85rem; color: var(--red); font-weight: 700; }
.badges { display: flex; gap: 10px; flex-wrap: wrap; }
.badge { display: flex; align-items: center; gap: 8px; padding: 8px 12px 8px 8px; border: 2px solid var(--line); border-radius: 14px; background: var(--surface); font-weight: 700; }
.badge svg { width: 30px; height: 30px; }

.cta-strong { border: 2px solid var(--line); border-radius: 22px; background: var(--coral); color: var(--on-bright); padding: 18px 16px; box-shadow: 5px 5px 0 var(--shadow); display: grid; gap: 10px; }
.cta-strong h2 { font-size: 1.35rem; font-weight: 800; }
.cta-strong .btn { background: var(--surface); color: var(--ink); }
.cta-strong a.textlink { color: var(--on-bright); font-weight: 700; }
.cta-soft { border: 2px dashed var(--line); border-radius: 20px; padding: 16px; display: grid; gap: 10px; background: var(--surface); }
.cta-soft h2 { font-size: 1.15rem; font-weight: 800; }
.cta-low { font-size: .95rem; color: var(--muted); }
.cta-low button { background: none; border: 0; padding: 0; color: var(--sea); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.homega-mark { font-family: var(--font-display); font-weight: 700; font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; opacity: .85; }
a.textlink { color: var(--sea); font-weight: 700; }

.inline-form { display: flex; gap: 8px; }
.inline-form input { flex: 1; min-width: 0; }
input[type=text], input[type=email], input[type=tel] { width: 100%; padding: 12px 14px; border: 2px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--ink); font: inherit; }
.inline-form .btn { width: auto; flex: none; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
details.team { border: 2px dashed var(--line); border-radius: 16px; padding: 10px 14px; background: var(--surface); }
details.team summary { font-weight: 700; cursor: pointer; }
.scoretable { width: 100%; border-collapse: collapse; font-size: .9rem; font-variant-numeric: tabular-nums; margin-top: 8px; }
.scoretable td { padding: 4px 0; border-bottom: 1px solid var(--sky2); }
.scoretable td:last-child { text-align: end; font-weight: 700; }
.disclaimer { font-size: .8rem; color: var(--muted); text-align: center; }
.proto { font-size: .78rem; color: var(--muted); border: 1px dashed var(--muted); border-radius: 10px; padding: 6px 10px; }

/* Modal */
.modal { position: fixed; inset: 0; z-index: 40; background: rgba(8,14,28,.55); display: flex; align-items: flex-end; justify-content: center; }
.modal-inner { width: 100%; max-width: 460px; max-height: 92%; overflow-y: auto; background: var(--bg); border: 2px solid var(--line); border-bottom: 0; border-radius: 24px 24px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom, 0px)); display: grid; gap: 14px; animation: sheetup .3s cubic-bezier(.2,.9,.3,1.1) both; }
.modal-inner h2 { font-size: 1.3rem; font-weight: 800; }
.field { display: grid; gap: 6px; }
.field > span { font-weight: 700; }
.err { color: var(--red); font-weight: 700; font-size: .9rem; }
.leadbox { font-size: .9rem; }
.leadbox td { padding: 3px 0; vertical-align: top; }
.leadbox td:first-child { color: var(--muted); padding-inline-end: 12px; white-space: nowrap; }

.scene svg, .mapwrap svg, .typesrow svg, svg.medal, .badge svg, .xp svg, .bulb { direction: ltr; }
input[dir="ltr"] { text-align: right; }
.hero h1 { line-height: 1.12; }

.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; }

/* Confetti */
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 50; overflow: hidden; }
.confetti i { position: absolute; top: -20px; width: 10px; height: 14px; border-radius: 2px; animation: fall linear forwards; }

/* SVG paint classes */
.f-sky { fill: var(--sky); } .f-sky2 { fill: var(--sky2); } .f-surface { fill: var(--surface); } .f-ink { fill: var(--ink); }
.f-sun { fill: var(--sun); } .f-sea { fill: var(--sea); } .f-mint { fill: var(--mint); } .f-red { fill: var(--red); } .f-plum { fill: var(--plum); } .f-coral { fill: var(--coral); } .fn { fill: none; }
.k { stroke: var(--line); stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
.k2 { stroke: var(--line); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.s-sea { stroke: var(--sea); } .s-red { stroke: var(--red); } .s-ink { stroke: var(--ink); } .s-muted { stroke: var(--muted); }
.st { fill: var(--ink); font-family: var(--font-display); font-weight: 800; }
.sb { fill: var(--on-bright); font-family: var(--font-display); font-weight: 800; }
.sm { fill: var(--muted); font-family: var(--font-display); font-weight: 700; }
.scene svg *, .typesrow svg *, .medal * { transform-box: fill-box; transform-origin: center; }

/* Animations */
.a-pop { animation: pop .5s cubic-bezier(.2,.9,.3,1.5) both; }
.a-drop { animation: drop .9s cubic-bezier(.3,1.4,.5,1) both; }
.a-bob { animation: bob 2.6s ease-in-out infinite; }
.a-twinkle { animation: twinkle 1.6s ease-in-out infinite; }
.a-draw { stroke-dasharray: 1; animation: draw 1.2s ease both; }
.a-shake { animation: shake 1.8s ease-in-out infinite; transform-origin: 50% 100%; }
.a-rock { animation: rock 3.2s ease-in-out infinite; }
.a-slide { animation: slidein .6s cubic-bezier(.2,.9,.3,1.1) both; }
.a-roll { animation: roll 3.4s cubic-bezier(.5,0,.6,1) infinite; }
.a-fill { animation: fillup 3s ease-in-out infinite alternate; transform-origin: 50% 100%; }
.a-grow { animation: grow 1s cubic-bezier(.2,.9,.3,1.3) both; transform-origin: 50% 100%; }
.a-sand-top { animation: sandtop 4s linear infinite; transform-origin: 50% 100%; }
.a-sand-bot { animation: sandbot 4s linear infinite; transform-origin: 50% 100%; }
.a-spin { animation: spin 12s linear infinite; }
.a-blink { animation: blink 1.2s ease-in-out infinite; }
@keyframes pop { 0% { transform: scale(0); } 70% { transform: scale(1.12); } 100% { transform: scale(1); } }
@keyframes drop { 0% { transform: translateY(-140px); } 100% { transform: translateY(0); } }
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes twinkle { 0%,100% { transform: scale(.6); opacity: .5; } 50% { transform: scale(1.1); opacity: 1; } }
@keyframes draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes shake { 0%,60%,100% { transform: rotate(0); } 66% { transform: rotate(-5deg); } 72% { transform: rotate(5deg); } 78% { transform: rotate(-4deg); } 84% { transform: rotate(3deg); } }
@keyframes rock { 0%,100% { transform: rotate(-6deg); } 50% { transform: rotate(6deg); } }
@keyframes slidein { from { transform: translateX(260px) rotate(8deg); } to { transform: translateX(0); } }
@keyframes roll { 0% { transform: translate(0,0) scale(.45) rotate(0); } 85% { transform: translate(190px,62px) scale(1.35) rotate(540deg); } 100% { transform: translate(190px,62px) scale(1.35) rotate(540deg); } }
@keyframes fillup { from { transform: scaleY(.15); } to { transform: scaleY(1); } }
@keyframes grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes sandtop { from { transform: scaleY(1); } to { transform: scaleY(.1); } }
@keyframes sandbot { from { transform: scaleY(.15); } to { transform: scaleY(1); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes blink { 0%,100% { opacity: .3; } 50% { opacity: 1; } }
@keyframes pulse { 0%,100% { transform: scaleY(1); } 50% { transform: scaleY(1.5); } }
@keyframes bump { 50% { transform: scale(1.15); } }
@keyframes rise { from { transform: translateY(14px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes sheetup { from { transform: translateY(100%); } to { transform: none; } }
@keyframes floatup { from { transform: translateY(0); opacity: 1; } to { transform: translateY(-70px); opacity: 0; } }
@keyframes flipin { from { transform: perspective(800px) rotateY(90deg); } to { transform: none; } }
@keyframes fall { to { transform: translateY(110vh) rotate(720deg); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .confetti { display: none; }
}

/* ---------- Production additions ---------- */
html { direction: rtl; }
.report-form { display: grid; gap: 10px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: .9rem; line-height: 1.35; cursor: pointer; }
.check input { flex: none; width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--sea); }
.disclaimer a, .small a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
#ctaslot:empty { min-height: 120px; border: 2px dashed var(--sky2); border-radius: 20px; }
.legal { display: grid; gap: 14px; padding-bottom: 40px; }
.legal h1 { font-size: 1.8rem; }
.legal h2 { font-size: 1.15rem; margin-top: 8px; }
.legal p, .legal li { line-height: 1.6; }
.legal ul { margin: 0; padding-inline-start: 20px; display: grid; gap: 6px; }
