:root {
  --bg: #fbf7f2;
  --card: #ffffff;
  --ink: #23201c;
  --muted: #8a8178;
  --line: #ece4da;
  --accent: #e2553f;
  --accent-soft: #fde8e3;
  --good: #2f9e6e;
  --radius: 18px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body { font: 16px/1.5 ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", sans-serif; }
#app { max-width: 560px; margin: 0 auto; padding: 28px 18px 80px; min-height: 100vh; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }

.brand { display: flex; align-items: center; gap: 8px; font-weight: 800; letter-spacing: -0.02em; font-size: 18px; }
.brand .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.link { color: var(--muted); font-size: 14px; text-decoration: underline; text-underline-offset: 3px; }
.link:disabled { opacity: 0.3; cursor: default; }

/* Intro */
.hero { text-align: center; padding: 48px 0 24px; }
.hero .gift { font-size: 84px; animation: bob 2.4s ease-in-out infinite; }
.hero h1 { font-size: 38px; line-height: 1.1; letter-spacing: -0.03em; margin: 12px 0; }
.hero p { color: var(--muted); margin: 0 auto 28px; max-width: 380px; }
.facts { display: flex; justify-content: center; gap: 22px; color: var(--muted); font-size: 13px; margin-top: 28px; }
.facts b { display: block; color: var(--ink); font-size: 20px; }
@keyframes bob { 50% { transform: translateY(-8px) rotate(-4deg); } }

.primary { background: var(--accent); color: #fff; font-weight: 700; padding: 16px 40px; border-radius: 999px; font-size: 18px; box-shadow: 0 6px 18px rgba(226, 85, 63, 0.3); transition: transform 0.1s; }
.primary:active { transform: scale(0.97); }
.secondary { background: var(--card); border: 1.5px solid var(--line); font-weight: 600; padding: 12px 22px; border-radius: 999px; }

/* Question */
.meter { margin-bottom: 26px; }
.meter-row { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.meter-row b { color: var(--ink); }
.bar { height: 8px; background: var(--line); border-radius: 99px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: linear-gradient(90deg, #f3a35b, var(--accent)); border-radius: 99px; transition: width 0.5s cubic-bezier(.2,.8,.2,1); }
.qno { font-weight: 800; color: var(--accent); font-size: 15px; }
.question { font-size: 27px; line-height: 1.25; letter-spacing: -0.02em; font-weight: 750; margin: 6px 0 26px; min-height: 2.5em; animation: rise 0.35s ease; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
.answers { display: grid; gap: 10px; }
.answer { background: var(--card); border: 1.5px solid var(--line); border-radius: var(--radius); padding: 16px 18px; text-align: left; font-weight: 600; font-size: 17px; transition: border-color 0.15s, transform 0.1s, background 0.15s; }
.answer:hover { border-color: var(--accent); background: var(--accent-soft); }
.answer:active { transform: scale(0.985); }
.answer.dim { color: var(--muted); font-weight: 500; }
.qfoot { display: flex; justify-content: space-between; margin-top: 22px; }

/* Math panel */
details.math { margin-top: 34px; background: var(--card); border: 1.5px dashed var(--line); border-radius: var(--radius); padding: 12px 16px; font-size: 13px; }
details.math summary { cursor: pointer; color: var(--muted); font-weight: 600; }
.math h4 { margin: 14px 0 6px; font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.math .row { display: grid; grid-template-columns: 1fr 70px 52px; gap: 8px; align-items: center; padding: 2px 0; }
.math .row span:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.math .mini { height: 6px; background: var(--line); border-radius: 9px; overflow: hidden; }
.math .mini i { display: block; height: 100%; background: var(--accent); }
.math .num { text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); }
.math .formula { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11.5px; background: var(--bg); padding: 8px 10px; border-radius: 10px; line-height: 1.6; color: #5d554d; }

/* Result */
.reveal { text-align: center; padding: 10px 0 0; }
.reveal .label { color: var(--muted); font-size: 14px; font-weight: 600; }
.card { background: var(--card); border-radius: 24px; padding: 26px 22px; margin: 14px 0; border: 1.5px solid var(--line); box-shadow: 0 10px 30px rgba(60, 40, 20, 0.06); animation: pop 0.5s cubic-bezier(.2,1.4,.4,1); }
@keyframes pop { from { opacity: 0; transform: scale(0.9); } }
.card .emoji { font-size: 66px; }
.card h2 { font-size: 25px; letter-spacing: -0.02em; line-height: 1.2; margin: 8px 0 4px; }
.card .meta { color: var(--muted); font-size: 14px; }
.conf { display: inline-block; margin-top: 12px; background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 13px; padding: 5px 12px; border-radius: 99px; }
.factors { text-align: left; margin-top: 20px; border-top: 1.5px solid var(--line); padding-top: 14px; }
.factors h3 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 0 0 8px; }
.factor { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; font-size: 14.5px; }
.factor b { color: var(--good); white-space: nowrap; font-variant-numeric: tabular-nums; }
.factor small { color: var(--muted); display: block; }
.actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin: 18px 0 8px; }
.shop { display: inline-block; margin-top: 14px; color: var(--accent); font-weight: 700; text-decoration: none; }

.runners h3 { font-size: 16px; margin: 30px 0 10px; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mini-card { background: var(--card); border: 1.5px solid var(--line); border-radius: 16px; padding: 14px; text-align: left; }
.mini-card .e { font-size: 28px; }
.mini-card .n { font-weight: 650; font-size: 14px; line-height: 1.3; margin: 4px 0; }
.mini-card .p { color: var(--muted); font-size: 13px; }
.mini-card .s { font-size: 12px; color: var(--accent); font-weight: 700; }

details.review { margin-top: 26px; font-size: 14px; }
details.review summary { cursor: pointer; font-weight: 650; }
.review ol { padding-left: 22px; color: var(--muted); }
.review li b { color: var(--ink); font-weight: 600; }

.toast { z-index: 10; position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 99px; font-size: 14px; animation: rise 0.25s; }
.confetti { position: fixed; top: -20px; font-size: 22px; pointer-events: none; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(110vh) rotate(540deg); } }

/* "This or that" comparison */
.vs { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: stretch; }
.vs .or { align-self: center; color: var(--muted); font-weight: 700; font-size: 14px; }
.answer.tile { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 18px 12px; }
.answer.tile .e { font-size: 40px; }
.answer.tile .n { font-size: 15px; line-height: 1.25; }
.answer.tile .p { color: var(--muted); font-size: 13px; font-weight: 500; }
.disclosure { color: var(--muted); font-size: 12px; text-align: center; margin-top: 18px; }
