*, *::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 h1 { position:relative; }
.hero h1 .mb-glitch-layer { display:block; }
.hero h1.mb-glitching { text-shadow:-2px 0 rgba(0,255,65,.7), 2px 0 rgba(255,43,214,.55); }
.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:space-between; 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-app-promo + .hero-app-promo { margin-top:14px; }
.hero-avatar-icon { width:16px; height:16px; flex:none; }
.hero-app-promo-wrap { padding:0 0 24px; display:flex; justify-content:center; }
.hero.app-hero { padding:32px 20px 20px; }
.hero.app-hero h1 { margin-bottom:0; }
.avatar-builder-button { background:var(--purple); border-color:var(--purple-dark); }
.avatar-builder-button svg { width:26px; height:26px; flex:none; }
.avatar-builder-button:hover { background:var(--purple-dark); }
.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; }

/* ── Community milestones banner (index.html #milestones-wrap) ──────────
   Same card language as the hero banners (.hb): tinted gradient, copy on
   the left, a still Blip scene on the right (js/home-heroes.js), then the
   stat tiles (js/site-milestones.js), each tinted by its own --ms colour.
   Scoped to .ms-card — the Global Challenge card reuses .milestone-*. */
.ms-card {
  --hb: var(--purple);   /* for the .hb-bubble decorations */
  width: 100%;
  max-width: 932px;   /* = .home-heroes' 980px minus its 24px side padding, so it lines up with the banners */
  padding: 26px 26px 24px;
  border-radius: 20px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--purple) 12%, var(--surface)), color-mix(in srgb, var(--purple) 4%, var(--surface)) 70%);
  border: 1.5px solid color-mix(in srgb, var(--purple) 24%, var(--toolbar-border));
  box-shadow: 0 6px 22px color-mix(in srgb, var(--purple) 12%, transparent);
}
.ms-head { display: flex; align-items: center; justify-content: space-between; gap: 12px 24px; margin-bottom: 18px; }
.ms-copy { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; max-width: 460px; }
.ms-kicker { display: inline-flex; align-items: center; gap: 6px; padding: 5px 14px; border-radius: 20px; background: var(--purple-light); color: var(--purple); font-size: 12.5px; font-weight: 700; }
.ms-copy h2 { font-size: clamp(22px, 2.8vw, 30px); font-weight: 800; line-height: 1.12; letter-spacing: -.02em; color: var(--btn-text); }
.ms-sub { font-size: 14.5px; line-height: 1.55; color: color-mix(in srgb, var(--text-muted) 55%, var(--btn-text)); }
.ms-art {
  position: relative;
  flex: 0 0 280px;
  height: 170px;
  background: radial-gradient(ellipse 80% 24% at 50% 100%, color-mix(in srgb, var(--purple) 16%, var(--surface)) 0 60%, transparent 61%);
}
.ms-art canvas { position: absolute; display: block; }

/* ── Bob: coming soon (index.html / app.html #bob-wrap). The milestone card in Bob's own night colours, whatever the theme. ── */
.bob-card { background: linear-gradient(135deg, #1b2050, #0e1124 78%); border-color: rgba(255,255,255,.14); box-shadow: 0 8px 26px rgba(14,17,36,.35); }
.bob-card .ms-kicker { background: #ff5a36; color: #fff; }
.bob-card h2 { color: #fff; }
.bob-card .ms-sub { color: #c9cfee; }
.bob-art { background: none; flex-basis: 240px; }
.bob-art svg { display: block; width: 100%; height: 100%; }
.bob-hop { transform-box: fill-box; transform-origin: 50% 100%; animation: bob-hero-hop 2.6s ease-in-out infinite; }
@keyframes bob-hero-hop { 0%, 100% { transform: translateY(0) scale(1.02, .97); } 45% { transform: translateY(-9px) scale(.98, 1.03); } 70% { transform: translateY(0) scale(1.03, .96); } }
/* Bob waves once (the arm appears just for the wave) and says hello once, when the banner first scrolls into view (.is-live, set by a
   few lines of script in index.html / app.html). Then he just hops. */
.bob-arm { transform-box: fill-box; transform-origin: 10% 90%; opacity: 0; animation: bob-hero-wave 7s ease-in-out .3s 1 both paused; }
@keyframes bob-hero-wave {
  0% { opacity: 0; transform: scale(.2) rotate(0); } 3% { opacity: 1; transform: scale(1) rotate(0); }
  7% { transform: rotate(-34deg); } 12% { transform: rotate(6deg); } 17% { transform: rotate(-30deg); } 22% { transform: rotate(6deg); } 27% { transform: rotate(-28deg); }
  30% { opacity: 1; transform: scale(1) rotate(0); } 33%, 100% { opacity: 0; transform: scale(.2) rotate(0); }
}
.bob-say { transform-box: fill-box; transform-origin: 20% 100%; animation: bob-hero-say 7s ease-in-out .3s 1 both paused; }
@keyframes bob-hero-say { 0% { opacity: 0; transform: scale(.6); } 4% { opacity: 1; transform: scale(1.06); } 7%, 82% { opacity: 1; transform: scale(1); } 90%, 100% { opacity: 0; transform: scale(.9); } }
.bob-card.is-live .bob-arm, .bob-card.is-live .bob-say { animation-play-state: running; }
html[data-reduce-motion] .bob-hop, html[data-reduce-motion] .bob-arm, html[data-reduce-motion] .bob-say { animation: none; }

/* Always four tiles: 2 × 2, or one row of 4 once there's room (an auto-fit
   grid left a lone fourth tile on its own row at tablet widths). */
.ms-card .milestones-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@container lander (min-width: 740px) {
  .ms-card .milestones-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.ms-card .milestone {
  --ms: var(--purple);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  padding: 16px 16px 14px;
  border-radius: 16px;
  background: var(--surface);
  border: 1.5px solid color-mix(in srgb, var(--ms) 22%, var(--toolbar-border));
}
.ms-card .milestone-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  margin-bottom: 10px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--ms) 14%, var(--surface));
  color: var(--ms);
  font-size: 17px;
}
.ms-card .milestone-num { color: var(--ms); font-size: clamp(24px, 3vw, 30px); line-height: 1.05; font-variant-numeric: tabular-nums; }
.ms-card .milestone-label { margin-top: 2px; font-size: 13px; font-weight: 700; color: var(--btn-text); }
.ms-card .milestone-label i { display: none; }   /* icon is in .milestone-icon */
.ms-card .milestone-progress { width: 100%; height: 8px; background: color-mix(in srgb, var(--ms) 14%, var(--surface-2)); }
.ms-card .milestone-progress-fill { background: var(--ms); }
.ms-card .milestone-target { font-weight: 600; }

@container lander (max-width: 700px) {
  .ms-head { flex-direction: column; align-items: stretch; }
  .ms-art { flex-basis: auto; width: 100%; max-width: 280px; height: 140px; align-self: center; }
}
@container lander (max-width: 460px) {
  #milestones-wrap, #treasure-wrap { padding-left: 14px; padding-right: 14px; }   /* match .home-heroes on phones */
  .ms-card { padding: 20px 16px; }
  .ms-card .milestones-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .ms-card .milestone { padding: 12px; }
}

/* 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-main {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

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

/* The games menu is the Game Menu launcher in the nav bar (js/nav.js); the
   page no longer has its own games column. */
@media (max-width: 700px) {
  .lander-main .hero.home-hero { padding: 26px 18px 20px; }
}

/* ── Home top: heading, then Join a Game (left) + Trivia (right).
   index.html + js/home-join.js. Same card language as the daily
   cards above: tinted gradient, 1.5px border, badge pill, watermark icon.
   Layout follows .lander-main's width (the games sidebar takes a share). */
.lander-main { container: lander / inline-size; }
.hero.home-hero { padding: 48px 24px 28px; }
.hero.home-hero h1 { margin-bottom: 0; }

.home-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
  align-items: stretch;
  max-width: 980px;
  margin: 0 auto;
  padding: 0 24px 28px;
}
@container lander (min-width: 760px) {
  .home-top { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
}

/* Join a Game */
.home-join {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 30px 28px 24px;
  border-radius: 16px;
  background: linear-gradient(160deg, color-mix(in srgb, var(--purple) 13%, var(--surface)), var(--surface) 68%);
  border: 1.5px solid color-mix(in srgb, var(--purple) 30%, var(--btn-border));
  box-shadow: 0 4px 18px color-mix(in srgb, var(--purple) 14%, transparent);
}
.home-join .daily-card-watermark { color: var(--purple); }
.home-join-badge,
.home-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 12.5px;
  font-weight: 700;
}
.home-join-badge { background: var(--purple-light); color: var(--purple); margin-bottom: 14px; }
.home-join-title {
  max-width: 360px;
  margin-bottom: 20px;
  font-size: 22px;
  font-weight: 800;
  line-height: 1.25;
  color: var(--btn-text);
}
.home-code {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: text;
}
.home-code-label {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.home-cells { display: flex; gap: 8px; }
.home-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 58px;
  box-sizing: border-box;
  border-radius: 12px;
  border: 1.5px solid var(--btn-border);
  background: var(--surface);
  color: var(--btn-text);
  font-size: 26px;
  font-weight: 800;
  transition: border-color .12s, box-shadow .12s;
}
.home-cell.is-filled { border-color: color-mix(in srgb, var(--purple) 45%, var(--btn-border)); }
.home-cell.is-current { border-color: var(--purple); box-shadow: 0 0 0 3px var(--purple-light); }
/* The real input covers the boxes (invisible) so the whole row is tappable */
.home-code input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  border: 0;
  font-size: 16px; /* no iOS zoom on focus */
  cursor: text;
}
.home-join-btn {
  justify-content: center;
  margin-top: 18px;
  min-width: 180px;
  border: 0;
  font-family: inherit;
  cursor: pointer;
}
.home-join-btn:focus-visible { outline: 3px solid color-mix(in srgb, var(--purple) 45%, transparent); outline-offset: 3px; }
.home-code-msg { min-height: 1.2em; margin-top: 8px; font-size: 13px; font-weight: 700; color: var(--amber); }
.home-join.is-invalid .home-cell { border-color: var(--amber); }

/* Right column */
.home-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.home-card {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 20px 22px;
  border-radius: 16px;
}
.home-card .home-badge { margin-bottom: 12px; }
.home-card-text { font-size: 16px; font-weight: 600; line-height: 1.45; color: var(--btn-text); margin-bottom: 14px; }

.home-card--trivia {
  flex: 1;
  justify-content: center;
  background: linear-gradient(160deg, var(--amber-tint), var(--surface) 65%);
  border: 1.5px solid var(--amber-border);
  box-shadow: 0 4px 18px rgba(181,101,10,.1);
}
.home-card--trivia .home-badge { background: var(--amber-light); color: var(--amber); }
.home-card--trivia .daily-card-watermark { color: var(--amber); }
.home-trivia-part { display: flex; flex-direction: column; align-items: center; width: 100%; }
.home-trivia-part .home-card-text { margin-bottom: 12px; }
.home-trivia-part .riddle-answer.show { margin: 0 0 12px; }
.home-trivia-part--fact {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1.5px dashed var(--amber-border);
}
.home-trivia-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 6px;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--amber);
}
.home-trivia-part--fact .home-trivia-label { color: var(--teal); }
.home-trivia-fact { font-size: 14.5px; line-height: 1.55; color: color-mix(in srgb, var(--text-muted) 45%, var(--btn-text)); }

/* Narrow main column (phones) */
@container lander (max-width: 460px) {
  .hero.home-hero { padding: 32px 16px 20px; }
  .home-top { padding: 0 14px 20px; gap: 14px; }
  .home-join { padding: 24px 16px 20px; }
  .home-join-title { font-size: 19px; }
  .home-cells { gap: 6px; }
  .home-cell { width: 42px; height: 50px; font-size: 22px; }
  .home-join-btn { align-self: stretch; }
}
/* Beside the game menu, tablets in landscape and smaller laptops land just
   under 760px, so pair Join + Trivia from 680px with smaller code boxes. */
@container lander (min-width: 680px) and (max-width: 759px) {
  .home-top { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }
  .home-join { padding: 24px 18px 20px; }
  .home-cells { gap: 6px; }
  .home-cell { width: 40px; height: 50px; font-size: 22px; }
}

/* ── Hero banners (index.html, js/home-heroes.js) ─────────────────────
   Large, still banners — copy on one side, a Blip scene on the other,
   alternating sides. Each banner's colour is --hb (mixed with the theme's
   surface, so it suits light and dark themes). */
.home-heroes {
  display: flex;
  flex-direction: column;
  gap: 22px;
  max-width: 980px;
  margin: 0 auto;
  padding: 12px 24px 56px;
}
.hb {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  overflow: hidden;
  border-radius: 20px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--hb) 16%, var(--surface)), color-mix(in srgb, var(--hb) 5%, var(--surface)) 70%);
  border: 1.5px solid color-mix(in srgb, var(--hb) 26%, var(--toolbar-border));
  box-shadow: 0 6px 22px color-mix(in srgb, var(--hb) 12%, transparent);
}
.hb-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 12px;
  padding: 28px 30px 30px;
}
.hb-kicker {
  display: inline-flex;
  padding: 5px 14px;
  border-radius: 20px;
  background: color-mix(in srgb, var(--hb) 16%, var(--surface));
  color: color-mix(in srgb, var(--hb) 80%, var(--btn-text));
  font-size: 12.5px;
  font-weight: 700;
}
.hb-copy h2 { font-size: clamp(24px, 3vw, 32px); font-weight: 800; line-height: 1.12; letter-spacing: -.02em; color: var(--btn-text); }
.hb-copy > p:not(.hb-kicker) { font-size: 15px; line-height: 1.6; color: color-mix(in srgb, var(--text-muted) 55%, var(--btn-text)); max-width: 460px; }
.hb-copy .btn-primary { margin-top: 6px; }
.hb-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 14px 20px; margin-top: 6px; }
.hb-actions .feature-card-link { margin-top: 0; }

/* The scene: Blips stand on a soft "floor" */
.hb-art {
  position: relative;
  height: 220px;
  overflow: hidden;
  background: radial-gradient(ellipse 80% 55% at 50% 100%, color-mix(in srgb, var(--hb) 20%, var(--surface)) 0 60%, transparent 61%);
}
.hb-art canvas { position: absolute; display: block; }
.hb-bubble {
  position: absolute;
  border-radius: 50%;
  border: 1.5px solid color-mix(in srgb, var(--hb) 35%, transparent);
  background: radial-gradient(circle at 32% 30%, rgba(255,255,255,.7), color-mix(in srgb, var(--hb) 10%, transparent) 60%);
}
/* The app icon sits in a wrapper so the rebrand glitch (js/home-heroes.js)
   can swap the image inside it; the tilt lives on the image itself. */
.hb-app-icon {
  position: absolute;
  left: 8%;
  top: 50%;
  width: 34%;
  max-width: 124px;
  margin-top: -70px;
}
.hb-app-icon-img {
  display: block;
  width: 100%;
  height: auto;
  transform: rotate(-6deg);
  border-radius: 24%;
  box-shadow: 0 10px 24px rgba(0,0,0,.16);
}
/* "BubbleBlip" in the banner text glitches to "BubbleBlip" and back */
.hb-brand { position: relative; display: inline-block; }
.hb-brand .mb-glitch-layer { display: block; }

@container lander (min-width: 760px) {
  .hb { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); min-height: 280px; }
  .hb-art { height: auto; min-height: 280px; }
  .hb-copy { padding: 36px 20px 36px 40px; }
  /* Alternate: the middle banner has its scene on the left */
  .hb:nth-child(even) .hb-art { order: -1; }
  .hb:nth-child(even) .hb-copy { padding: 36px 40px 36px 20px; }
}
@container lander (max-width: 460px) {
  .home-heroes { padding: 8px 14px 40px; gap: 16px; }
  .hb-copy { padding: 22px 20px 24px; }
  .hb-art { height: 190px; }
}

/* ── Teacher band: CTA + "how it works" in one solid panel (index.html).
   Opaque so it stays readable over any page scene, but tinted from the
   theme's own surface + accent so it sits in the theme rather than
   inverting it (same card language as the hero banners above). */
.teach-wrap { max-width: 980px; margin: 0 auto; padding: 8px 24px 64px; }
.teach-band {
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 44px 44px 40px;
  border-radius: 24px;
  background: linear-gradient(160deg, color-mix(in srgb, var(--purple) 15%, var(--surface)), color-mix(in srgb, var(--purple) 5%, var(--surface)) 70%);
  border: 1.5px solid color-mix(in srgb, var(--purple) 28%, var(--toolbar-border));
  color: var(--btn-text);
  box-shadow: 0 10px 30px color-mix(in srgb, var(--purple) 16%, transparent);
}
.teach-head { display: flex; align-items: center; justify-content: space-between; gap: 20px 40px; }
.teach-copy { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; max-width: 560px; }
.teach-copy .teach-btns { margin-top: 10px; }
/* Blips stand on a soft floor, like the hero banners' scenes */
.teach-art {
  position: relative;
  flex: 0 0 300px;
  height: 210px;
  background: radial-gradient(ellipse 85% 22% at 50% 100%, color-mix(in srgb, var(--purple) 16%, var(--surface)) 0 60%, transparent 61%);
}
.teach-art canvas { position: absolute; display: block; }
@container lander (max-width: 700px) {
  .teach-head { flex-direction: column; align-items: stretch; }
  .teach-art { flex-basis: auto; width: 100%; max-width: 300px; height: 170px; align-self: center; }
}
.teach-kicker { padding: 5px 14px; border-radius: 20px; background: var(--purple-light); color: var(--purple); font-size: 12.5px; font-weight: 700; }
.teach-copy h2 { font-size: clamp(28px, 3.4vw, 38px); font-weight: 800; line-height: 1.1; letter-spacing: -.02em; }
.teach-sub { font-size: 16.5px; line-height: 1.55; color: color-mix(in srgb, var(--text-muted) 55%, var(--btn-text)); }
.teach-btns { display: flex; gap: 12px; flex-wrap: wrap; }
.teach-btn { display: inline-flex; align-items: center; min-height: 50px; padding: 0 24px; border-radius: 14px; font-size: 15.5px; font-weight: 800; text-decoration: none; transition: transform .15s ease, background .15s ease, border-color .15s ease, color .15s ease; }
.teach-btn:hover { transform: translateY(-2px); }
.teach-btn:focus-visible { outline: 3px solid color-mix(in srgb, var(--purple) 45%, transparent); outline-offset: 3px; }
.teach-btn--solid { background: var(--purple); color: #fff; box-shadow: 0 4px 14px color-mix(in srgb, var(--purple) 30%, transparent); }
.teach-btn--solid:hover { background: var(--purple-dark); }
.teach-btn--ghost { background: var(--surface); color: var(--btn-text); border: 1.5px solid var(--btn-border); }
.teach-btn--ghost:hover { border-color: var(--purple); color: var(--purple); }
.teach-steps-title {
  padding-top: 24px;
  border-top: 1.5px dashed color-mix(in srgb, var(--purple) 25%, var(--toolbar-border));
  font-size: 12.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  color: var(--purple);
  margin-bottom: -12px;
}
/* Always four steps: 2 × 2, a single column on phones, or one row of 4 once
   there's room (an auto-fit grid left a lone fourth card on its own row at
   tablet widths). */
.teach-steps { list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
@container lander (min-width: 940px) { .teach-steps { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@container lander (max-width: 560px) { .teach-steps { grid-template-columns: minmax(0, 1fr); } }
.teach-step { display: flex; flex-direction: column; gap: 10px; padding: 22px; border-radius: 18px; background: var(--surface); border: 1px solid var(--toolbar-border); }
.teach-num { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--purple-light); color: var(--purple); font-size: 16px; font-weight: 800; }
.teach-step h4 { font-size: 17px; font-weight: 800; line-height: 1.25; }
.teach-step p { font-size: 14px; line-height: 1.55; color: color-mix(in srgb, var(--text-muted) 55%, var(--btn-text)); }
@container lander (max-width: 460px) {
  .teach-wrap { padding: 4px 14px 40px; }
  .teach-band { padding: 28px 20px; border-radius: 20px; gap: 22px; }
  .teach-btns, .teach-btn { width: 100%; justify-content: center; }
}
