*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg:#f0eee8; --surface:#ffffff; --surface-2:#fafaf8;
  --toolbar-bg:#ffffff; --toolbar-border:#e2e0d8;
  --btn-border:#d4d2ca; --btn-text:#2c2c2a; --btn-hover:#f5f3ef;
  --text-muted:#888780; --purple:#534AB7; --purple-light:#EEEDFE; --purple-dark:#4540a0;
  --amber:#B5650A; --amber-light:#FCEBD1; --amber-tint:#FFF7EC; --amber-border:#F2D9AE;
  --teal:#0E7A6D; --teal-light:#D3F3EC; --teal-tint:#ECFBF8; --teal-border:#B9E8DF;
  --blue:#0369A1; --blue-light:#E0F0FB; --blue-tint:#F2F9FE; --blue-border:#BFE1F5;
  /* Poll result bars/date use a separate accent derived from the theme's own
     --purple (rather than a fixed hex) so they always match the active
     theme's identity — e.g. green-ish in "forest", gold in "midnight" —
     while the card chrome above (--blue) keeps its own fixed brand colour. */
  --poll-accent: var(--purple);
  --poll-accent-light: color-mix(in srgb, var(--purple) 16%, var(--surface));
}
/* Dark-background themes need brighter accents on dark tints, not the light-mode
   pastel set above — otherwise the riddle/fact/question cards wash out to near-white.
   (--poll-accent isn't listed here — it's derived from --purple above and
   already adapts correctly on its own.) */
:root[data-theme="dark"],
:root[data-theme="ocean"],
:root[data-theme="forest"],
:root[data-theme="slate"],
:root[data-theme="dusk"],
:root[data-theme="galaxy"],
:root[data-theme="midnight"],
:root[data-theme="neon"] {
  --amber:#E8A756; --amber-light:#3D2C14; --amber-tint:#221A0E; --amber-border:#5A4322;
  --teal:#5FD9C4; --teal-light:#123A34; --teal-tint:#0F1E1B; --teal-border:#1F4A42;
  --blue:#6EC1F0; --blue-light:#153049; --blue-tint:#0F1B27; --blue-border:#204863;
}
body { font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif; background:var(--bg); color:var(--btn-text); }

/* Nav */
nav { position:sticky; top:0; z-index:100; display:flex; align-items:center; height:60px; padding:0 40px; background:var(--surface); border-bottom:1px solid var(--toolbar-border); }
.nav-logo img { height:32px; display:block; }
.nav-links { display:flex; align-items:center; gap:6px; margin-left:auto; }
.nav-link { font-size:13.5px; color:var(--text-muted); text-decoration:none; padding:7px 14px; border-radius:8px; transition:background .12s,color .12s; border:none; background:none; cursor:pointer; font-family:inherit; }
.nav-link:hover { background:var(--btn-hover); color:var(--btn-text); }
.nav-cta { font-size:13.5px; font-weight:600; color:#fff; background:var(--purple); padding:8px 18px; border-radius:8px; text-decoration:none; transition:background .12s; }
.nav-cta:hover { background:var(--purple-dark); }

/* Hero */
.hero { display:flex; flex-direction:column; align-items:center; text-align:center; padding:80px 24px 24px; }
.hero-badge { display:inline-flex; align-items:center; gap:6px; background:var(--purple-light); color:var(--purple); font-size:12.5px; font-weight:600; padding:5px 14px; border-radius:20px; margin-bottom:28px; }
.hero h1 { font-size:clamp(32px,5vw,52px); font-weight:800; line-height:1.1; letter-spacing:-.02em; max-width:700px; margin:0 auto 20px; }
.hero h1 span { color:var(--purple); }
.hero p { font-size:17px; color:var(--text-muted); max-width:520px; line-height:1.6; margin:0 auto; }
.hero-app-promo { display:flex; align-items:center; justify-content:center; gap:22px; max-width:650px; margin:0 auto; padding:15px 18px 15px 22px; text-align:left; background:color-mix(in srgb,var(--purple) 10%,var(--surface)); border:1.5px solid color-mix(in srgb,var(--purple) 28%,var(--btn-border)); border-radius:18px; box-shadow:0 5px 18px color-mix(in srgb,var(--purple) 12%,transparent); }
.hero-app-copy { display:flex; flex-direction:column; gap:3px; }
.hero-app-kicker { display:flex; align-items:center; gap:7px; color:var(--purple); font-size:16px; font-weight:800; line-height:1.3; }
.hero-app-note { color:var(--text-muted); font-size:13px; line-height:1.45; }
.app-store-button { flex:0 0 auto; display:inline-flex; align-items:center; gap:9px; min-width:172px; padding:9px 16px; color:#fff; background:#050505; border:1px solid #555; border-radius:11px; text-decoration:none; box-shadow:0 3px 9px rgba(0,0,0,.2); transition:transform .15s ease,box-shadow .15s ease,background .15s ease; }
.app-store-button .bi-apple { font-size:28px; line-height:1; }
.app-store-button span { display:flex; flex-direction:column; line-height:1; }
.app-store-button small { margin-bottom:3px; color:#fff; font-size:9px; font-weight:500; letter-spacing:.02em; }
.app-store-button strong { color:#fff; font-size:19px; font-weight:600; letter-spacing:-.02em; }
.app-store-button:hover { color:#fff; background:#1d1d1f; transform:translateY(-2px); box-shadow:0 6px 14px rgba(0,0,0,.25); }
.app-store-button:focus-visible { outline:3px solid color-mix(in srgb,var(--purple) 45%,transparent); outline-offset:3px; }
.hero-btns { display:flex; gap:12px; flex-wrap:wrap; justify-content:center; }
.btn-primary { display:inline-flex; align-items:center; gap:8px; background:var(--purple); color:#fff; font-size:15px; font-weight:600; padding:13px 28px; border-radius:10px; text-decoration:none; transition:background .12s; box-shadow:0 4px 14px rgba(83,74,183,.3); }
.btn-primary:hover { background:var(--purple-dark); }
.btn-secondary { display:inline-flex; align-items:center; gap:8px; background:var(--surface); color:var(--btn-text); font-size:15px; font-weight:500; padding:13px 28px; border-radius:10px; text-decoration:none; border:1.5px solid var(--btn-border); transition:border-color .12s,background .12s; }
.btn-secondary:hover { border-color:var(--purple); background:var(--purple-light); color:var(--purple); }

/* Daily riddle */
.riddle-card { position:relative; isolation:isolate; overflow:hidden; min-height:170px; background:linear-gradient(160deg,var(--amber-tint),var(--surface) 65%); border:1.5px solid var(--amber-border); border-radius:16px; padding:22px; max-width:520px; width:100%; text-align:center; box-shadow:0 4px 18px rgba(181,101,10,.1); }
.riddle-badge { display:inline-flex; align-items:center; gap:6px; background:var(--amber-light); color:var(--amber); font-size:12.5px; font-weight:700; padding:5px 14px; border-radius:20px; margin-bottom:16px; }
.riddle-question { font-size:17px; font-weight:600; line-height:1.5; margin-bottom:18px; }
.riddle-reveal-btn { font-size:12px; font-weight:600; color:var(--amber); background:var(--amber-light); border:none; padding:6px 14px; border-radius:8px; cursor:pointer; transition:background .12s; }
.riddle-reveal-btn:hover { background:color-mix(in srgb, var(--amber) 25%, var(--amber-light)); }
.riddle-answer { font-size:15px; color:var(--text-muted); margin-top:0; line-height:1.6; max-height:0; opacity:0; overflow:hidden; transition:max-height .2s ease, opacity .2s ease, margin-top .2s ease; }
.riddle-answer.show { max-height:120px; opacity:1; margin-top:14px; }

/* Fact of the day */
.daily-fact-wrap { padding:0 24px 24px; display:flex; justify-content:center; }
.daily-fact-card { position:relative; isolation:isolate; overflow:hidden; min-height:170px; background:linear-gradient(160deg,var(--teal-tint),var(--surface) 65%); border:1.5px solid var(--teal-border); border-radius:16px; padding:22px; max-width:520px; width:100%; text-align:center; box-shadow:0 4px 18px rgba(14,122,109,.1); }
.daily-fact-badge { display:inline-flex; align-items:center; gap:6px; background:var(--teal-light); color:var(--teal); font-size:12.5px; font-weight:700; padding:5px 14px; border-radius:20px; margin-bottom:16px; }
.daily-fact-text { font-size:15px; color:var(--text-muted); line-height:1.6; }

/* Daily items row — riddle + fact side by side */
.daily-items-wrap { padding:0 24px 24px; display:flex; justify-content:center; }
.daily-items-row { display:flex; flex-wrap:wrap; justify-content:center; gap:20px; max-width:900px; width:100%; }
.daily-items-row .riddle-card,
.daily-items-row .daily-fact-card { flex:1 1 380px; max-width:440px; display:flex; flex-direction:column; align-items:center; justify-content:center; }
.daily-items-row .riddle-reveal-btn { align-self:center; }
.daily-items-row .daily-fact-text { margin:auto 0; }
.daily-card-watermark { position:absolute; z-index:-1; left:-18px; bottom:-24px; font-size:126px; line-height:1; opacity:.12; transform:rotate(-9deg); }
.riddle-card .daily-card-watermark { color:var(--amber); }
.daily-fact-card .daily-card-watermark { color:var(--teal); }
@media(max-width:600px){.riddle-card,.daily-fact-card{min-height:155px;padding:20px 18px}.daily-card-watermark{left:-22px;bottom:-18px;font-size:112px}}

/* Daily Question — site-wide A/B poll + yesterday's results */
/* Front-page cards keep the fixed brand blue for the result bars too (only
   the history page's bars/date use the theme-derived --poll-accent). */
.daily-poll-wrap { --poll-accent:var(--blue); --poll-accent-light:var(--blue-light); padding:0 24px 24px; display:flex; justify-content:center; }
.daily-poll-row { display:flex; flex-wrap:wrap; justify-content:center; gap:20px; max-width:900px; width:100%; }
.daily-question-card,
.daily-question-yesterday-card { background:linear-gradient(160deg,var(--blue-tint),var(--surface) 65%); border:1.5px solid var(--blue-border); border-radius:16px; padding:28px 32px; max-width:440px; width:100%; flex:1 1 380px; text-align:center; box-shadow:0 4px 18px rgba(3,105,161,.1); display:flex; flex-direction:column; align-items:center; }
.daily-question-badge { display:inline-flex; align-items:center; gap:6px; background:var(--blue-light); color:var(--blue); font-size:12.5px; font-weight:700; padding:5px 14px; border-radius:20px; margin-bottom:16px; }
.daily-question-text { font-size:17px; font-weight:600; line-height:1.5; margin-bottom:18px; }
.daily-question-options { display:flex; gap:10px; flex-wrap:wrap; justify-content:center; width:100%; }
.dq-option-btn { flex:1 1 140px; font-size:14px; font-weight:600; color:var(--blue); background:var(--blue-light); border:1.5px solid transparent; padding:10px 14px; border-radius:10px; cursor:pointer; transition:background .12s,border-color .12s; }
.dq-option-btn:hover { background:color-mix(in srgb, var(--blue) 25%, var(--blue-light)); }
.dq-option-btn:disabled { cursor:default; opacity:.6; }
.daily-question-result { width:100%; margin-top:4px; }
.dq-result-row { display:flex; align-items:center; gap:8px; font-size:13px; color:var(--text-muted); margin-bottom:10px; }
.dq-result-row.dq-mine .dq-result-label { color:var(--poll-accent); }
.dq-result-label { flex:0 0 34%; max-width:34%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; text-align:left; font-weight:600; }
.dq-result-bar-track { flex:1; height:10px; border-radius:6px; background:var(--poll-accent-light); overflow:hidden; }
.dq-result-bar-fill { display:block; height:100%; background:var(--poll-accent); border-radius:6px; transition:width .3s ease; }
.dq-result-pct { flex:0 0 auto; font-weight:700; color:var(--poll-accent); font-size:12.5px; min-width:36px; text-align:right; }
.dq-result-count { flex:0 0 auto; color:var(--text-muted); font-size:11px; min-width:22px; text-align:right; }
.daily-question-total { font-size:11px; color:var(--text-muted); font-style:italic; margin-top:2px; }
.dq-history-link { font-size:12.5px; font-weight:600; color:var(--blue); text-decoration:none; margin-top:16px; }
.dq-history-link:hover { text-decoration:underline; }

/* Milestones */
.milestones-wrap { padding:0 24px 24px; display:flex; justify-content:center; }
.milestones-bar { background:var(--surface); border:1.5px solid var(--toolbar-border); border-radius:16px; padding:24px 20px; max-width:900px; width:100%; box-shadow:0 4px 18px rgba(0,0,0,.05); }
.milestones-header { display:flex; align-items:center; justify-content:center; gap:6px; font-size:13px; font-weight:700; color:var(--purple); text-transform:uppercase; letter-spacing:.06em; margin-bottom:20px; }
.milestones-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(140px,1fr)); gap:24px 20px; }
.milestone { text-align:center; }
.milestone-num { font-size:clamp(22px,3.2vw,32px); font-weight:900; color:var(--purple); letter-spacing:-.02em; }
.milestone-label { display:inline-flex; align-items:center; justify-content:center; gap:5px; font-size:12.5px; color:var(--text-muted); font-weight:600; margin-top:4px; }
.milestone-progress { height:6px; border-radius:4px; background:var(--purple-light); overflow:hidden; margin-top:12px; }
.milestone-progress-fill { height:100%; width:0%; background:var(--purple); border-radius:4px; transition:width .3s ease; }
.milestone-target { font-size:11px; color:var(--text-muted); margin-top:6px; }

/* Global Challenge (public widget) */
.gc-wrap { padding:0 24px 24px; display:flex; justify-content:center; }
.game-events-wrap { padding:0 24px 24px; display:flex; justify-content:center; }
.game-events-bar { width:100%; max-width:900px; padding:24px 20px; border:1.5px solid var(--toolbar-border); border-radius:16px; background:var(--surface); box-shadow:0 4px 18px rgba(0,0,0,.05); }
.game-events-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(260px,1fr)); gap:14px; }
.game-event-card { position:relative; isolation:isolate; overflow:hidden; display:flex; flex-direction:column; align-items:center; justify-content:center; min-height:150px; padding:24px; text-align:center; text-decoration:none; color:var(--btn-text); border:1.5px solid color-mix(in srgb,var(--event-color) 35%,var(--btn-border)); border-radius:15px; background:color-mix(in srgb,var(--event-color) 16%,var(--surface)); transition:transform .15s ease,box-shadow .15s ease; }
.game-event-card:hover { transform:translateY(-2px); box-shadow:0 8px 20px color-mix(in srgb,var(--event-color) 16%,transparent); }
.game-event-card:hover .game-event-title { color:var(--btn-text); }
.game-event-watermark { position:absolute; z-index:-1; left:-24px; bottom:-34px; width:178px; height:178px; display:flex; align-items:center; justify-content:center; color:var(--event-color); opacity:.14; transform:rotate(-9deg); }
.game-event-watermark svg { width:100%; height:100%; }
.game-event-heading { display:flex; align-items:center; justify-content:center; gap:9px; }
.game-event-icon { width:32px; height:32px; flex:none; display:flex; align-items:center; justify-content:center; border-radius:9px; color:var(--event-color); background:var(--event-bg); box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--event-color) 12%,transparent); }
.game-event-icon svg { width:19px; height:19px; }
.game-event-copy { min-width:0; display:flex; flex-direction:column; align-items:center; }
.game-event-title { font-size:15px; font-weight:700; transition:color .15s ease; }
.game-event-desc { margin-top:7px; color:var(--text-muted); font-size:13px; line-height:1.4; }
.game-event-time { margin-top:8px; color:var(--btn-text); font-size:11.5px; font-weight:700; text-transform:uppercase; letter-spacing:.02em; }
@media(max-width:600px){.game-events-wrap{padding:0 14px 16px}.game-events-bar{padding:20px 14px}.game-events-grid{grid-template-columns:1fr}.game-event-card{min-height:138px;padding:20px 18px}.game-event-watermark{left:-28px;bottom:-24px;width:140px;height:140px}}
.gc-heading { display:flex; align-items:center; justify-content:center; gap:9px; }
.gc-game-icon { width:32px; height:32px; flex:none; display:flex; align-items:center; justify-content:center; border-radius:9px; color:var(--gc-color); background:var(--gc-bg); box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--gc-color) 12%,transparent); }
.gc-game-icon svg { width:19px; height:19px; }
.gc-title { font-size:15px; font-weight:700; text-align:center; }
.gc-desc { font-size:13px; color:var(--text-muted); text-align:center; margin:6px 0 14px; }
.gc-sub { font-size:11.5px; color:var(--text-muted); text-align:center; margin-top:8px; }
.gc-card { position:relative; isolation:isolate; overflow:hidden; min-height:150px; padding:24px; display:flex; flex-direction:column; justify-content:center; color:var(--btn-text); text-decoration:none; border:1.5px solid color-mix(in srgb,var(--gc-color) 35%,var(--btn-border)); border-radius:15px; background:color-mix(in srgb,var(--gc-color) 16%,var(--surface)); transition:transform .15s ease,box-shadow .15s ease; }
.gc-card:hover { transform:translateY(-2px); box-shadow:0 8px 20px color-mix(in srgb,var(--gc-color) 16%,transparent); }
.gc-watermark { position:absolute; z-index:-1; left:-24px; bottom:-34px; width:178px; height:178px; color:var(--gc-color); opacity:.14; transform:rotate(-9deg); }
.gc-watermark svg { width:100%; height:100%; }
.gc-card .milestone-progress { background:color-mix(in srgb,var(--surface) 65%,transparent); }
.gc-card .milestone-progress-fill { background:var(--gc-color); }
@media(max-width:600px){.gc-card{min-height:138px;padding:20px 18px}.gc-watermark{left:-28px;bottom:-24px;width:140px;height:140px}}

/* Features */
.features { padding:70px 24px; max-width:1040px; margin:0 auto; }
.section-label { text-align:center; font-size:12px; font-weight:700; color:var(--purple); text-transform:uppercase; letter-spacing:.1em; margin-bottom:14px; }
.section-title { text-align:center; font-size:clamp(24px,3.5vw,36px); font-weight:800; letter-spacing:-.02em; margin-bottom:52px; }
.section-sub { text-align:center; font-size:15px; color:var(--text-muted); max-width:560px; margin:-32px auto 40px; line-height:1.6; }
.features-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(260px,1fr)); gap:20px; }
.feature-card { background:var(--surface); border-radius:14px; padding:26px 28px; border:1px solid var(--toolbar-border); }
.feature-icon { width:42px; height:42px; border-radius:10px; margin-bottom:14px; display:flex; align-items:center; justify-content:center; background:var(--dgc-bg); color:var(--dgc-color); }
.feature-icon svg { width:21px; height:21px; }
.feature-card h3 { font-size:15px; font-weight:700; margin-bottom:8px; }
.feature-card p  { font-size:13.5px; color:var(--text-muted); line-height:1.6; }
.feature-card-link { display:inline-block; margin-top:12px; font-size:13px; font-weight:600; color:var(--purple); text-decoration:none; }
.feature-card-link:hover { text-decoration:underline; }

/* How it works */
.how { background:var(--surface); padding:70px 24px; border-top:1px solid var(--toolbar-border); border-bottom:1px solid var(--toolbar-border); }
.how-inner { max-width:900px; margin:0 auto; }
.how-steps { display:grid; grid-template-columns:repeat(auto-fit,minmax(200px,1fr)); gap:32px; }
.how-step { text-align:center; }
.step-num { width:40px; height:40px; border-radius:50%; background:var(--purple-light); color:var(--purple); font-size:16px; font-weight:800; display:flex; align-items:center; justify-content:center; margin:0 auto 14px; }
.how-step h3 { font-size:15px; font-weight:700; margin-bottom:8px; }
.how-step p  { font-size:13.5px; color:var(--text-muted); line-height:1.6; }

/* CTA */
.cta-banner { padding:80px 24px; text-align:center; }
.cta-banner h2 { font-size:clamp(26px,4vw,42px); font-weight:800; letter-spacing:-.02em; margin-bottom:16px; }
.cta-banner p { font-size:16px; color:var(--text-muted); margin-bottom:36px; max-width:460px; margin-left:auto; margin-right:auto; }
.cta-btns { display:flex; gap:12px; justify-content:center; flex-wrap:wrap; }

/* Footer */
footer { background:var(--surface); border-top:1px solid var(--toolbar-border); padding:28px 40px; display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:12px; }
.footer-logo img { height:24px; opacity:.7; }
.footer-credit { font-size:13px; color:var(--text-muted); text-decoration:none; }
.footer-credit:hover { color:var(--btn-text); }
.footer-links { display:flex; gap:20px; }
.footer-links a { font-size:13px; color:var(--text-muted); text-decoration:none; }
.footer-links a:hover { color:var(--btn-text); }
.footer-copy { font-size:12px; color:var(--text-muted); }

@media(max-width:600px){
  nav { padding:0 20px; }
  .hero { padding:52px 20px 44px; }
  .hero-app-promo { flex-direction:column; gap:14px; padding:18px; text-align:center; }
  .hero-app-kicker { justify-content:center; }
  footer { flex-direction:column; align-items:flex-start; padding:24px 20px; }
}

/* ── Two-column lander layout ─────────────────────────────── */
.lander-wrap {
  flex: 1;
  display: flex;
  overflow: hidden;
  min-height: 0;
  position: relative;
  z-index: 1;
}

.lander-sidenav {
  width: 272px;
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--toolbar-border);
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.lander-main {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

#lander-tabstrip {
  margin: 0 4px 16px;
}

/* Mobile: stack vertically, sidenav above content */
@media (max-width: 700px) {
  .lander-wrap    { flex-direction: column; }
  .lander-sidenav { width: 100%; max-height: 260px; border-right: none; border-bottom: 1px solid var(--toolbar-border); }
}
