@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;700&display=swap');
:root{
  --bg:#0e1116; --card:#171b22; --line:#262c36; --txt:#e8eaed;
  --muted:#9aa3af; --accent:#b388ff; --good:#39d98a; --warn:#ffd166; --bad:#e85d5d;
}
*{box-sizing:border-box}
html,body{margin:0}
body{
  min-height:100vh;background:var(--bg);color:var(--txt);
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
  display:flex;flex-direction:column;align-items:center;padding:0 16px 60px;
}
a{color:inherit;text-decoration:none}
.wrap{width:100%;max-width:460px}

/* ---- top nav ---- */
.nav{width:100%;max-width:560px;display:flex;align-items:center;gap:6px;
  padding:14px 4px 10px;margin-bottom:6px;flex-wrap:wrap}
.brand{font-weight:800;font-size:20px;letter-spacing:.5px;margin-right:6px}
.brand b{color:var(--accent)}
.tabs{display:flex;gap:4px;flex-wrap:wrap}
.tab{font-size:13px;padding:6px 11px;border-radius:999px;color:var(--muted);
  border:1px solid transparent}
.tab:hover{color:var(--txt);background:#1b212a}
.tab.active{color:var(--txt);background:#1d2530;border-color:var(--line)}
.tab.soon{opacity:.45;pointer-events:none}

/* ---- generic ---- */
h1{font-size:24px;margin:0}
.sub{color:var(--muted);font-size:13px;margin:2px 0 18px}
.card{background:var(--card);border:1px solid var(--line);border-radius:16px;padding:18px;margin-bottom:16px}
.btn{width:100%;padding:14px;border:none;border-radius:12px;background:var(--accent);color:#06101f;
  font-weight:700;font-size:15px;cursor:pointer;margin-top:14px}
.btn:disabled{opacity:.4;cursor:not-allowed}
.btn.alt{background:#232a34;color:var(--txt);border:1px solid var(--line)}
.muted{color:var(--muted);font-size:13px}
.big{font-size:32px;font-weight:800;margin:6px 0}
.center{text-align:center}
footer{color:var(--muted);font-size:12px;margin-top:8px;text-align:center;max-width:460px}

/* swatches / sliders */
.swatch{height:110px;border-radius:12px;border:1px solid var(--line);transition:background .15s;
  display:flex;align-items:center;justify-content:center;font-weight:600;font-size:14px;
  color:rgba(255,255,255,.85);text-shadow:0 1px 2px rgba(0,0,0,.5)}
.sliders{margin-top:16px;display:flex;flex-direction:column;gap:14px}
.slider-row label{display:flex;justify-content:space-between;font-size:12px;color:var(--muted);margin-bottom:6px}
input[type=range]{width:100%;height:14px;border-radius:8px;appearance:none;outline:none;cursor:pointer}
input[type=range]::-webkit-slider-thumb{appearance:none;width:22px;height:22px;border-radius:50%;background:#fff;border:2px solid #0008;box-shadow:0 1px 4px #0006;cursor:pointer}
input[type=range]::-moz-range-thumb{width:22px;height:22px;border-radius:50%;background:#fff;border:2px solid #0008;cursor:pointer}

/* hints */
.hints{display:flex;gap:8px;margin-top:14px}
.hint{flex:1;text-align:center;background:#1d232c;border:1px solid var(--line);border-radius:10px;padding:8px 4px;font-size:12px;color:var(--muted)}
.hint b{display:block;font-size:15px;margin-top:2px;color:var(--txt)}

/* toast */
.toast{position:fixed;bottom:24px;left:50%;transform:translateX(-50%);background:#fff;color:#111;
  padding:10px 16px;border-radius:10px;font-size:13px;font-weight:600;opacity:0;transition:opacity .2s;pointer-events:none;z-index:50}
.toast.show{opacity:1}

/* share sheet (B2-7, desktop / no native share) */
.share-bk{position:fixed;inset:0;background:rgba(0,0,0,.5);z-index:60}
.share-sheet{position:fixed;left:50%;bottom:24px;transform:translateX(-50%);width:min(420px,calc(100vw - 32px));background:var(--card);border:1px solid var(--line);border-radius:16px;padding:16px;z-index:61;box-shadow:0 12px 40px rgba(0,0,0,.5)}
.share-ttl{font-weight:700;font-size:14px;margin-bottom:10px;color:var(--txt)}
.share-row{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.share-row .btn{margin:0}
.share-native{grid-column:1/-1}
/* anonymous percentile (B2-8) */
.pct-line{font-size:14px;font-weight:700;margin:8px 0 12px;color:var(--txt)}
/* onboarding welcome strip (B2-10) */
.onboard{position:relative}
.onboard .ob-tx{font-size:14px;color:var(--txt);margin:2px 28px 12px 0;line-height:1.45}
.onboard .ob-btns{display:flex;gap:8px;flex-wrap:wrap}
.onboard .ob-btns .btn{width:auto;flex:1;min-width:140px;margin:0}
.onboard-x{position:absolute;top:8px;right:8px;width:30px;height:30px;border:none;background:transparent;color:var(--muted);font-size:20px;line-height:1;cursor:pointer;border-radius:8px}
.onboard-x:hover{color:var(--txt)}
@media (min-width:480px){.share-sheet{bottom:50%;transform:translate(-50%,50%)}}

/* hub cards */
.hub{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.hub a{background:var(--card);border:1px solid var(--line);border-radius:16px;padding:16px;display:block;transition:transform .1s,border-color .1s}
.hub a:hover{transform:translateY(-2px);border-color:var(--accent)}
.hub .ic{height:54px;border-radius:10px;margin-bottom:10px}
.hub h3{margin:0 0 4px;font-size:16px}
.hub p{margin:0;font-size:12px;color:var(--muted)}
.hub .soon{opacity:.5}
.hub .soon:hover{transform:none;border-color:var(--line)}
@media(max-width:380px){.hub{grid-template-columns:1fr}}

/* prose (legal / info pages) */
.prose{max-width:680px;line-height:1.65;font-size:15px}
.prose h1{margin-bottom:4px}
.prose h2{font-size:18px;margin:26px 0 8px}
.prose p,.prose li{color:#cfd4dc}
.prose a{color:var(--accent);text-decoration:underline}
.prose ul{padding-left:20px}
.prose .upd{color:var(--muted);font-size:13px;margin-bottom:18px}
.prose table{width:100%;border-collapse:collapse;margin:10px 0;font-size:14px}
.prose th,.prose td{border:1px solid var(--line);padding:8px;text-align:left;vertical-align:top}

/* accessibility (Sprint 1) */
@media (prefers-reduced-motion: reduce){
  *{animation-duration:.001ms!important;animation-iteration-count:1!important;transition-duration:.001ms!important;scroll-behavior:auto!important}
}
button:focus-visible,a:focus-visible,input:focus-visible,[tabindex]:focus-visible{outline:2px solid var(--accent);outline-offset:2px;border-radius:6px}

/* === Design overhaul (Bold&Vibrant + glassy) 2026-06-25 === */
body{ background:
  radial-gradient(620px 540px at 85% -8%, rgba(110,168,254,.18), transparent 60%),
  radial-gradient(560px 480px at -5% 108%, rgba(179,136,255,.16), transparent 58%),
  radial-gradient(440px 400px at 45% 55%, rgba(57,217,138,.09), transparent 60%),
  #090b12;
  background-attachment:fixed; }
.brand{ font-family:'Space Grotesk',-apple-system,BlinkMacSystemFont,sans-serif; font-weight:700; letter-spacing:-.5px; }
.brand b{ background:linear-gradient(90deg,#6ee7ff,var(--accent),#b388ff); -webkit-background-clip:text; background-clip:text; color:transparent; }
.tabs{ background:rgba(255,255,255,.06); -webkit-backdrop-filter:blur(14px); backdrop-filter:blur(14px); border:1px solid rgba(255,255,255,.12); padding:5px; border-radius:999px; }
.tab.active{ background:linear-gradient(90deg,#6ee7ff,var(--accent)); color:#06101f; font-weight:600; border-color:transparent; }
h1,.big{ font-family:'Space Grotesk',-apple-system,BlinkMacSystemFont,sans-serif; letter-spacing:-.5px; }
.hub a{ border-radius:20px; }
.hub .ic{ height:112px; border-radius:14px; position:relative; overflow:hidden; }
.hub .ic::after{ content:""; position:absolute; inset:0; background:radial-gradient(120px 60px at 70% 20%, rgba(255,255,255,.26), transparent 60%); }
.hub h3{ font-family:'Space Grotesk',-apple-system,sans-serif; font-weight:700; font-size:19px; letter-spacing:-.3px; }
.hub a:hover{ transform:translateY(-5px); border-color:rgba(110,130,180,.4); box-shadow:0 16px 44px rgba(0,0,0,.5); }
.wrap:not(.prose) > h1{ font-size:46px; line-height:1.05; margin:8px 0 14px; }
/* hub hero polish (blend) 2026-06-25 */
.hero{ margin:8px 0 26px; }
.kicker{ display:inline-flex; align-items:center; gap:8px; font-size:13px; color:var(--txt);
  padding:7px 14px; border-radius:999px; margin:2px 0 16px;
  background:rgba(255,255,255,.07); -webkit-backdrop-filter:blur(12px); backdrop-filter:blur(12px);
  border:1px solid rgba(255,255,255,.12); }
.kicker .pip{ width:8px; height:8px; border-radius:50%; background:var(--good); box-shadow:0 0 10px var(--good); }
.hero h1{ font-family:'Space Grotesk',-apple-system,sans-serif; font-weight:700; font-size:42px;
  line-height:1.05; letter-spacing:-1.4px; margin:0 0 12px; }
.hero .grad{ background:linear-gradient(92deg,#6ee7ff,var(--accent),#b388ff);
  -webkit-background-clip:text; background-clip:text; color:transparent; }
.hero .lead{ font-size:15px; color:var(--muted); line-height:1.55; margin:0; }
.hub a{ position:relative; }
.hub .num{ position:absolute; top:14px; right:16px; font-family:'Space Grotesk',sans-serif;
  font-weight:700; font-size:13px; color:rgba(255,255,255,.42); }
.hub .play{ margin-top:10px; display:inline-flex; gap:6px; font-size:13px; font-weight:600;
  color:var(--txt); opacity:.85; }
/* === HOME (hub) = blend mockup parity, scoped so games stay narrow === 2026-06-25 */
body.home{ background:#090b12; }
body.home .blob{ position:fixed; border-radius:50%; filter:blur(100px); opacity:.5; z-index:0; pointer-events:none; }
body.home .b1{ width:540px; height:540px; background:#6ea8fe; top:-140px; right:-90px; }
body.home .b2{ width:500px; height:500px; background:#b388ff; bottom:-160px; left:-110px; }
body.home .b3{ width:380px; height:380px; background:#39d98a; top:280px; left:42%; opacity:.38; }
body.home .nav{ position:relative; z-index:1; max-width:1040px; justify-content:space-between; }
body.home .wrap{ position:relative; z-index:1; max-width:1040px; }
body.home .hero{ margin:6px 0 38px; }
body.home .hero h1{ font-size:60px; line-height:1.02; letter-spacing:-2px; }
body.home .hero .lead{ font-size:18px; max-width:620px; }
body.home .hub{ grid-template-columns:repeat(auto-fit,minmax(232px,1fr)); gap:16px; margin-top:36px; }
body.home .hub .ic{ height:112px; margin-bottom:14px; }
@media(max-width:560px){
  body.home .hero h1{ font-size:40px; letter-spacing:-1px; }
  body.home .hub{ grid-template-columns:1fr 1fr; }
}
@media(max-width:380px){ body.home .hub{ grid-template-columns:1fr; } }
/* === GAME pages: faint ambient blobs + glass panel (scoped, no per-file edits) === 2026-06-25 */
body:not(.home){ position:relative; }
body:not(.home)::before, body:not(.home)::after{ content:""; position:fixed; border-radius:50%;
  filter:blur(100px); pointer-events:none; z-index:0; }
body:not(.home)::before{ width:460px; height:460px; background:var(--accent); opacity:.15; top:-170px; right:-130px; }
body:not(.home)::after{ width:420px; height:420px; background:#6ee7ff; opacity:.10; bottom:-190px; left:-150px; }
body:not(.home) .nav, body:not(.home) .wrap, body:not(.home) footer, body:not(.home) .toast{ position:relative; z-index:1; }
body:not(.home) .card{ background:rgba(255,255,255,.045); -webkit-backdrop-filter:blur(12px);
  backdrop-filter:blur(12px); border:1px solid rgba(255,255,255,.10); }
@media (prefers-reduced-motion: reduce){
  body:not(.home)::before, body:not(.home)::after{ filter:blur(80px); }
}
/* === "How to play" accordion (shared, auto-injected by shared.js) === 2026-06-25 */
.howto{ margin:0 0 16px; border:1px solid rgba(255,255,255,.10); border-radius:12px;
  background:rgba(255,255,255,.04); -webkit-backdrop-filter:blur(8px); backdrop-filter:blur(8px); overflow:hidden; }
.howto>summary{ list-style:none; cursor:pointer; padding:11px 14px; font-size:13px; font-weight:600;
  color:var(--txt); display:flex; align-items:center; justify-content:space-between; }
.howto>summary::-webkit-details-marker{ display:none; }
.howto>summary .chev{ color:var(--muted); transition:transform .15s; }
.howto[open]>summary .chev{ transform:rotate(180deg); }
.howto .body{ padding:0 14px 14px; }
.howto ol{ margin:4px 0 0; padding-left:18px; }
.howto li{ font-size:13px; color:#cfd4dc; line-height:1.5; margin:5px 0; }
.howto .tip{ margin:10px 0 0; font-size:12px; color:var(--muted); }
/* === Cross-link to sister site (hub banner + footer link) === 2026-06-25 */
.crosslink{ display:flex; align-items:center; gap:14px; margin:6px 0 4px; padding:14px 16px;
  border-radius:16px; border:1px solid rgba(255,255,255,.12);
  background:rgba(255,255,255,.05); -webkit-backdrop-filter:blur(12px); backdrop-filter:blur(12px);
  transition:transform .12s, border-color .12s, box-shadow .12s; }
.crosslink:hover{ transform:translateY(-3px); border-color:rgba(255,255,255,.22); box-shadow:0 14px 36px rgba(0,0,0,.45); }
.crosslink .cl-ic{ width:46px; height:46px; border-radius:12px; flex:0 0 auto; box-shadow:0 4px 14px rgba(0,0,0,.35); }
.crosslink .cl-tx{ flex:1; }
.crosslink b{ font-family:'Space Grotesk',-apple-system,sans-serif; font-weight:700; font-size:16px; }
.crosslink .cl-sub{ display:block; font-size:12.5px; color:var(--muted); margin-top:2px; }
.crosslink .cl-go{ font-size:22px; color:var(--muted); }
body.home .crosslink{ max-width:560px; margin-top:30px; }
.xlink{ margin-top:7px; font-size:12px; }
.xlink a{ color:var(--accent); text-decoration:none; border-bottom:1px solid transparent; }
.xlink a:hover{ border-bottom-color:var(--accent); }
/* === Daily / Playground tabs + practice controls (shared) === 2026-06-25 */
.gtabs{ display:flex; gap:6px; margin:2px 0 14px; }
.gtab{ flex:0 0 auto; font-size:13px; font-weight:600; padding:8px 16px; border-radius:999px;
  border:1px solid var(--line); background:rgba(255,255,255,.04); color:var(--muted); cursor:pointer;
  font-family:inherit; transition:color .12s, background .12s; }
.gtab:hover{ color:var(--txt); }
.gtab.active{ background:linear-gradient(90deg,#6ee7ff,var(--accent)); color:#06101f; border-color:transparent; }
.pg-note{ font-size:12px; color:var(--muted); margin:0 0 12px; }
.pg-controls .pg-row{ margin-bottom:12px; }
.pg-controls .pg-row:last-of-type{ margin-bottom:4px; }
.pg-controls label{ display:flex; justify-content:space-between; font-size:12px; color:var(--muted); margin-bottom:6px; }
.pg-controls select{ width:100%; padding:9px 10px; border-radius:10px; background:#1b212a; color:var(--txt);
  border:1px solid var(--line); font-size:14px; cursor:pointer; }
/* === Slider +/- steppers (shared, single-source) === 2026-06-26 (B2-3) */
.stepper{ display:flex; align-items:center; gap:8px; }
.stepper > input[type=range]{ flex:1; }
.stepper-btn{ flex:0 0 auto; width:36px; height:36px; border-radius:8px; border:1px solid var(--line);
  background:#1b212a; color:var(--txt); font-size:18px; line-height:1; font-weight:700; cursor:pointer;
  display:flex; align-items:center; justify-content:center; user-select:none; padding:0; font-family:inherit; }
.stepper-btn:hover{ background:#232b36; }
.stepper-btn:active{ transform:scale(.94); }
/* === Portal streak widget + heatmap (B2-4) === 2026-06-26 */
.streak-w{ }
.streak-w .sc-top{ display:flex; align-items:baseline; gap:10px; flex-wrap:wrap; }
.streak-w .sc-num{ font-family:'Space Grotesk',-apple-system,sans-serif; font-weight:700; font-size:26px; letter-spacing:-.5px; }
.streak-w .sc-meta{ font-size:13px; color:var(--muted); }
.streak-w .sc-grid{ display:grid; grid-template-columns:repeat(7,1fr); gap:4px; margin:12px 0 0; max-width:260px; }
.streak-w .sc-cell{ aspect-ratio:1/1; border-radius:4px; background:#222934; border:1px solid var(--line); }
.streak-w .sc-cell.on{ background:linear-gradient(135deg,#ff8a3d,#ff5d5d); border-color:transparent; }
.streak-w .sc-next{ margin-top:10px; font-size:12px; color:var(--muted); }
/* === Favorites: hub star + reorder (B2-5) === 2026-06-26 */
.fav-label{ font-family:'Space Grotesk',-apple-system,sans-serif; font-weight:700; font-size:14px; color:var(--muted); margin:4px 0 8px; }
.hub a .fav-star{ position:absolute; top:12px; left:14px; background:none; border:none; color:#ffd166; font-size:18px; line-height:1; cursor:pointer; padding:0; z-index:3; }
.hub a .fav-star:hover{ transform:scale(1.15); }
.hub a .fav-reorder{ position:absolute; bottom:12px; right:12px; display:none; gap:4px; z-index:3; }
.hub a.is-fav .fav-reorder{ display:flex; }
.hub a .fav-reorder button{ width:24px; height:24px; border-radius:6px; border:1px solid var(--line); background:#1b212a; color:var(--txt); font-size:13px; line-height:1; cursor:pointer; padding:0; }
.hub a .fav-reorder button:hover{ background:#232b36; }
.hub a .fav-reorder button:disabled{ opacity:.35; cursor:default; }
/* B2-5 a11y polish (committee CR): bigger star tap-target + visually-hidden helper */
.hub a .fav-star{ width:30px; height:30px; top:6px; left:8px; display:flex; align-items:center; justify-content:center; }
.fav-vh{ position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; border:0; }
/* === Daily run: hub entry + run bar (B2-6) === 2026-06-26 */
.run-entry{ display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; }
.run-entry .re-tx b{ font-family:'Space Grotesk',-apple-system,sans-serif; font-weight:700; font-size:16px; display:block; }
.run-entry .re-tx span{ font-size:12.5px; color:var(--muted); }
.run-entry .re-btns{ display:flex; gap:8px; }
.run-entry .btn{ width:auto; margin-top:0; padding:10px 14px; }
.runbar{ display:block; margin-bottom:14px; }
.runbar .rb-top{ display:flex; align-items:center; justify-content:space-between; gap:10px; flex-wrap:wrap; }
.runbar .rb-label{ font-family:'Space Grotesk',-apple-system,sans-serif; font-weight:700; font-size:14px; }
.runbar .rb-actions{ display:flex; gap:8px; }
.runbar .btn{ width:auto; margin-top:0; padding:8px 14px; }
