:root {
  --bg: #06101c;
  --card: rgba(15, 27, 46, 0.86);
  --line: rgba(255, 255, 255, 0.09);
  --text: #edf3ff;
  --muted: #a8b7d6;
  --teal: #7eebf0;
  --teal2: #4dbcd8;
  --violet: #9a8cff;
  --win: #7ef0b0;
  --lose: #ffb27e;
  --radius: 18px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 0% 0%, rgba(126, 235, 240, 0.14), transparent 40%),
    radial-gradient(circle at 100% 0%, rgba(154, 140, 255, 0.18), transparent 40%),
    linear-gradient(180deg, #06101c 0%, #091423 55%, #0c1829 100%);
  background-attachment: fixed;
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}
a { color: var(--teal); }
button, input { font: inherit; color: inherit; }
.hidden { display: none !important; }

.wrap {
  max-width: 560px;
  margin: 0 auto;
  padding: max(18px, env(safe-area-inset-top)) 20px 28px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.brand {
  font-weight: 800;
  letter-spacing: 0.32em;
  font-size: 12px;
  color: var(--teal);
  text-align: center;
  margin: 4px 0 18px;
}
.screen { flex: 1 0 auto; animation: rise 0.35s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .screen { animation: none; } .bar i { transition: none !important; } }

/* ---------- landing */
.badge {
  display: inline-block;
  font-size: 11px; font-weight: 800; letter-spacing: 0.18em;
  color: #06101c; background: var(--teal);
  padding: 6px 10px; border-radius: 999px; margin-bottom: 14px;
}
#scrStart { text-align: center; }
h1 {
  font-size: clamp(34px, 9.5vw, 54px);
  line-height: 1.05;
  letter-spacing: -0.03em;
  font-weight: 800;
  margin: 6px 0 12px;
}
.hl {
  background: linear-gradient(90deg, var(--teal), var(--violet));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.sub { color: var(--muted); font-size: 17px; line-height: 1.4; margin: 0 auto 22px; max-width: 30ch; }
.start-form {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; display: grid; gap: 14px; text-align: left;
}
.age-field span, .name-field span {
  display: block; font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px;
}
.name-field em { font-style: normal; text-transform: none; letter-spacing: 0; font-weight: 500; }
input[type=number], input[type=text] {
  width: 100%; font-size: 22px; font-weight: 700; padding: 14px 16px;
  background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.14); border-radius: 14px; outline: none;
}
input[type=text] { font-size: 18px; font-weight: 600; }
input[type=number] { -moz-appearance: textfield; appearance: textfield; }
input[type=number]::-webkit-inner-spin-button, input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(126, 235, 240, 0.18); }
input::placeholder { color: rgba(168, 183, 214, 0.55); font-weight: 500; }
.sex-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 10px; }
.pill {
  cursor: pointer; border: 1px solid rgba(126, 235, 240, 0.35); background: rgba(126, 235, 240, 0.08);
  border-radius: 14px; padding: 16px 12px; font-weight: 700; font-size: 18px; transition: transform 0.1s, background 0.15s;
}
.pill:hover { background: rgba(126, 235, 240, 0.16); }
.pill:active { transform: scale(0.97); }
.pill.small { font-size: 15px; padding: 16px 14px; color: var(--muted); }
.err { color: var(--lose); margin: 0; font-size: 14px; }
.trust { color: var(--muted); font-size: 13px; margin: 14px 0 0; }

/* ---------- quiz */
.progress { height: 6px; background: rgba(255, 255, 255, 0.08); border-radius: 99px; overflow: hidden; margin: 6px 0 22px; }
.progress i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--teal), var(--violet)); transition: width 0.3s ease; }
.q-count { color: var(--muted); font-size: 13px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; margin: 0 0 8px; }
.q-title { font-size: clamp(28px, 7.5vw, 40px); line-height: 1.1; letter-spacing: -0.02em; margin: 0 0 22px; font-weight: 800; }
.answers { display: grid; gap: 12px; }
.answer {
  cursor: pointer; text-align: left; font-size: 19px; font-weight: 700; padding: 18px 18px;
  background: var(--card); border: 1px solid var(--line); border-radius: 16px; transition: border-color 0.15s, background 0.15s, transform 0.1s;
}
.answer:hover { border-color: rgba(126, 235, 240, 0.45); }
.answer:active { transform: scale(0.985); }
.answer.on { border-color: var(--teal); background: rgba(126, 235, 240, 0.14); }
.link { background: none; border: 0; color: var(--muted); text-decoration: underline; cursor: pointer; padding: 14px 4px; font-size: 15px; display: block; margin: 8px auto 0; }

/* ---------- result */
#soloBox, #vsBox { text-align: center; }
.kicker { margin: 4px 0; color: var(--muted); font-size: 15px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; }
.kicker.strong { color: var(--teal); }
.big-num {
  font-size: clamp(76px, 24vw, 128px); font-weight: 800; letter-spacing: -0.02em; line-height: 1;
  font-variant-numeric: tabular-nums; margin: 6px 0;
}
.delta { color: var(--muted); font-size: 15px; line-height: 1.45; margin: 10px auto 0; max-width: 34ch; }
.verdict { font-size: clamp(30px, 8.5vw, 44px); line-height: 1.08; letter-spacing: -0.02em; margin: 4px 0 18px; font-weight: 800; }
.verdict.win { color: var(--win); }
.verdict.lose { color: var(--lose); }
.bars { display: grid; gap: 12px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.bar-row { display: grid; grid-template-columns: 64px 1fr auto; gap: 10px; align-items: center; text-align: left; }
.who { font-weight: 700; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar { height: 26px; background: rgba(255, 255, 255, 0.06); border-radius: 8px; overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; border-radius: 8px; background: linear-gradient(90deg, var(--teal2), var(--teal)); transition: width 1s cubic-bezier(0.2, 0.8, 0.2, 1); }
.bar.them i { background: linear-gradient(90deg, #6b5fd6, var(--violet)); }
.bar-row b { font-variant-numeric: tabular-nums; font-size: 17px; min-width: 52px; text-align: right; }

.cta-box { margin: 22px 0 6px; display: grid; gap: 12px; }
.primary, .ghost, .coffee-btn {
  cursor: pointer; border-radius: 16px; padding: 17px 18px; font-size: 18px; font-weight: 800; text-align: center; text-decoration: none; display: block; width: 100%;
}
.primary { border: 0; color: #04121c; background: linear-gradient(90deg, var(--teal), #a99cff); box-shadow: 0 10px 30px rgba(126, 235, 240, 0.22); }
.primary:active, .ghost:active { transform: scale(0.985); }
.ghost { background: transparent; border: 1px solid rgba(126, 235, 240, 0.4); color: var(--teal); }
.status { margin: 0; min-height: 1.2em; text-align: center; color: var(--win); font-size: 14px; word-break: break-word; }
.fine { margin: 0; color: var(--muted); font-size: 12px; text-align: center; }

/* ---------- prediction + board */
.hero-num { display: inline-flex; align-items: baseline; justify-content: center; gap: 12px; margin: 8px 0 0; }
.hero-num .you { font-size: clamp(34px, 9vw, 52px); font-weight: 800; color: var(--muted); letter-spacing: -0.02em; }
#myAge { background: linear-gradient(90deg, var(--teal), var(--violet)); -webkit-background-clip: text; background-clip: text; color: transparent; margin: 0; }
.pred-label { margin: 2px 0 0; font-size: 15px; font-weight: 700; letter-spacing: 0.04em; color: var(--teal); }
.mini-board { margin: -10px 0 18px; color: var(--teal); font-weight: 700; font-size: 15px; word-spacing: 2px; }
#vsBox { margin-top: 18px; }
#vsBox .verdict { margin-bottom: 4px; }
.board { margin-top: 16px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 14px 8px; }
.board h3 { margin: 0 0 10px; font-size: 17px; }
.board h3 span { color: var(--muted); font-weight: 600; font-size: 14px; }
.board ol { list-style: none; margin: 0; padding: 0; }
.board li { display: grid; grid-template-columns: 26px minmax(0, 110px) 1fr 40px; gap: 8px; align-items: center; padding: 7px 0; border-top: 1px solid var(--line); font-size: 15px; }
.board li:first-child { border-top: 0; }
.board li.me { color: var(--teal); font-weight: 700; }
.board .rk { color: var(--muted); font-weight: 700; }
.board .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.board .sbar { height: 12px; background: rgba(255, 255, 255, 0.06); border-radius: 6px; overflow: hidden; }
.board .sbar i { display: block; height: 100%; background: linear-gradient(90deg, #6b5fd6, var(--violet)); border-radius: 6px; }
.board li.me .sbar i { background: linear-gradient(90deg, var(--teal2), var(--teal)); }
.board b { text-align: right; font-variant-numeric: tabular-nums; font-size: 17px; }
.board-note { margin: 4px 0 6px; color: var(--muted); font-size: 12px; }

/* ---------- tips */
.tips { margin-top: 26px; }
.tips h3 { font-size: 22px; margin: 0 0 4px; letter-spacing: -0.01em; }
.tips-sub { color: var(--muted); margin: 0 0 14px; font-size: 15px; line-height: 1.4; }
.tip { background: var(--card); border: 1px solid var(--line); border-radius: 16px; margin-bottom: 10px; overflow: hidden; }
.tip summary {
  list-style: none; cursor: pointer; display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; padding: 16px;
}
.tip summary::-webkit-details-marker { display: none; }
.tip[open] { border-color: rgba(126, 235, 240, 0.4); }
.tip-head { font-weight: 700; font-size: 16px; line-height: 1.35; }
.tip-gain {
  font-weight: 800; font-size: 15px; color: #04121c; background: var(--win); padding: 6px 10px; border-radius: 999px; white-space: nowrap; font-variant-numeric: tabular-nums;
}
.tip-gain.done { background: rgba(255, 255, 255, 0.1); color: var(--muted); }
.tip-why { margin: 0; padding: 0 16px 16px; color: var(--muted); font-size: 15px; line-height: 1.45; }
.tip.is-done .tip-head { color: var(--muted); }
.sources { margin-top: 6px; color: var(--muted); font-size: 13px; }
.sources summary { cursor: pointer; padding: 6px 0; }
.sources ul { padding-left: 18px; margin: 6px 0; }
.sources li { margin: 6px 0; line-height: 1.4; }
.sources p { margin: 6px 0; line-height: 1.4; }

/* ---------- coffee */
.coffee {
  margin-top: 22px; background: linear-gradient(135deg, rgba(126, 235, 240, 0.08), rgba(154, 140, 255, 0.1));
  border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: grid; gap: 12px;
}
.coffee p { margin: 0; line-height: 1.45; font-size: 16px; font-weight: 600; text-align: center; }
.coffee-btn { background: #ffdd00; color: #1b1b1b; border: 0; font-size: 17px; padding: 14px; }

/* ---------- footer */
.foot { margin-top: 26px; color: var(--muted); font-size: 12px; text-align: center; line-height: 1.5; }
.foot p { margin: 2px 0; }

@media (min-width: 900px) {
  .wrap { padding-top: 48px; max-width: 600px; }
  .brand { margin-bottom: 34px; }
}
@media (max-height: 700px) and (max-width: 500px) {
  h1 { font-size: 32px; }
  .sub { margin-bottom: 14px; }
  .pill { padding: 13px 10px; }
}

/* ==================================================================== */
/* v3.3 (2026-11-05): headline, split-flap life clock, notice, legal     */
/* ==================================================================== */
#startTitle .h1-main { display: block; }
#startTitle .h1-follow {
  display: block; margin-top: 0.32em;
  font-size: 0.5em; line-height: 1.25; font-weight: 500; letter-spacing: -0.01em;
  color: var(--teal);
}
#startTitle .h1-follow > span { display: inline-block; white-space: nowrap; margin: 0 0.18em; }
@media (min-width: 900px) {
  #scrStart #startTitle { margin-left: -90px; margin-right: -90px; }
}

/* Split-flap life clock. Flap structure from the v2 "Your time left" clock
   (FlipDown by Peter Butcher, MIT, github.com/PButcher/flipdown). Fixed
   sizes from first paint, so the animation never shifts the layout. */
.flap-clock {
  --fw: clamp(24px, 7.4vw, 48px);
  --fh: calc(var(--fw) * 1.5);
  display: flex; justify-content: center; align-items: flex-start;
  gap: clamp(10px, 3.4vw, 22px);
  margin: 0 auto 20px;
  font-family: 'Inter', system-ui, sans-serif;
}
.flap-group { display: flex; flex-direction: column; align-items: center; gap: 7px; }
.flap-label {
  font-size: 10px; line-height: 1; font-weight: 700; letter-spacing: 0.2em; padding-left: 0.2em;
  text-transform: uppercase; color: var(--muted);
}
.flap-digits { display: flex; gap: 3px; }
.flap-clock .rotor {
  position: relative; display: block;
  width: var(--fw); height: var(--fh);
  font-size: calc(var(--fw) * 1.02); font-weight: 800; font-variant-numeric: tabular-nums;
  text-align: center; color: #f4f7ff;
  border-radius: 6px; background: #131c2b;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.07);
  perspective: 320px;
}
.flap-clock .rotor-top, .flap-clock .rotor-bottom {
  overflow: hidden; position: absolute; left: 0; width: 100%; height: 50%;
}
.flap-clock .rotor-leaf {
  z-index: 2; position: absolute; left: 0; top: 0; width: 100%; height: 100%;
  transform-style: preserve-3d; -webkit-transform-style: preserve-3d;
  will-change: transform;
}
.flap-clock .rotor-leaf-front, .flap-clock .rotor-leaf-rear {
  overflow: hidden; position: absolute; left: 0; top: 0; width: 100%; height: 50%; margin: 0;
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
}
.flap-clock .rotor-leaf-front, .flap-clock .rotor-top {
  top: 0; line-height: var(--fh); border-radius: 6px 6px 0 0;
  background: linear-gradient(180deg, #1d2840 0%, #172133 100%);
}
.flap-clock .rotor-leaf-rear, .flap-clock .rotor-bottom {
  line-height: 0; border-radius: 0 0 6px 6px; color: #e6ecf8;
  background: linear-gradient(180deg, #121a29 0%, #0f1622 100%);
}
.flap-clock .rotor-leaf-rear { transform: rotateX(-180deg); }
.flap-clock .rotor-bottom { bottom: 0; }
.flap-clock .rotor::after {
  content: ''; z-index: 3; position: absolute; left: 0; right: 0; top: calc(50% - 1px); height: 2px;
  background: rgba(3, 7, 14, 0.85); box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06);
  pointer-events: none;
}

/* One-time "no cookies" notice (bottom toast, never blocks the page). */
.nc-bar {
  position: fixed; z-index: 50; left: 12px; right: 12px;
  bottom: max(12px, env(safe-area-inset-bottom));
  max-width: 520px; margin: 0 auto;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 10px 10px 16px;
  background: rgba(13, 24, 41, 0.97); border: 1px solid rgba(126, 235, 240, 0.28); border-radius: 14px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
  font-size: 13px; line-height: 1.35;
  animation: ncIn 0.3s ease both;
}
.nc-bar p { margin: 0; flex: 1; color: var(--text); }
.nc-ok {
  flex: none; cursor: pointer; border: 0; border-radius: 10px; padding: 10px 16px;
  font-size: 14px; font-weight: 800; background: var(--teal); color: #04121c;
}
.nc-bar.nc-away { display: none; }
body.has-nc .wrap { padding-bottom: 96px; }
@keyframes ncIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .nc-bar { animation: none; } }

/* Footer links */
.foot a { color: var(--muted); text-decoration: underline; text-underline-offset: 2px; }
.foot a:hover { color: var(--teal); }
.foot-links { margin-top: 6px !important; }

/* Terms + Privacy pages */
.legal { text-align: left; }
.legal .brand a { color: inherit; text-decoration: none; }
.legal h1 { font-size: clamp(30px, 8vw, 40px); margin: 4px 0 6px; }
.legal .eff { color: var(--muted); font-size: 14px; margin: 0 0 22px; }
.legal h2 { font-size: 18px; margin: 26px 0 8px; letter-spacing: -0.01em; }
.legal p, .legal li { font-size: 15.5px; line-height: 1.6; color: #d6e0f5; }
.legal p { margin: 0 0 12px; }
.legal ul { margin: 0 0 12px; padding-left: 20px; }
.legal li { margin: 0 0 8px; }
.legal code { font-size: 13.5px; background: rgba(255, 255, 255, 0.07); padding: 1px 6px; border-radius: 6px; word-break: break-word; }
.legal address { font-style: normal; line-height: 1.6; color: #d6e0f5; margin: 0 0 12px; }
.legal .back { display: inline-block; margin: 0 0 18px; font-weight: 700; text-decoration: none; }
@media (max-width: 500px) {
  /* Room for the one-time notice: landing fits above it on a 390x664 iPhone view. */
  .brand { margin-bottom: 12px; }
  .flap-clock { margin-bottom: 14px; }
  .sub { margin-bottom: 16px; }
  .trust { margin-top: 10px; }
  .foot { margin-top: 16px; }
  body.has-nc .wrap { padding-bottom: 80px; }
  .nc-bar { left: 10px; right: 10px; bottom: max(10px, env(safe-area-inset-bottom)); padding: 8px 8px 8px 14px; gap: 10px; }
  .nc-ok { padding: 9px 14px; }
}
