/* ============================================================
   MOMO — shared stylesheet (all pages)
   Brand: navy #05090F · gold #D4AF37 (--accent) · Cinzel / Poppins / Space Mono
   ============================================================ */

/* ---------- accent system ----------
   Every gold accent below reads from these variables. html[data-accent="..."] (set by
   gate.js from the account's admin-granted theme, accounts.html) swaps the whole family.
   Default = the MOMO brand gold. */
:root {
  --accent:#D4AF37;            --accent-rgb:212,175,55;
  --accent-bright:#ECD27E;     --accent-bright-rgb:236,210,126;
  --accent-hi:#F0D680;         /* btn-gold gradient top */
  --accent-lo:#B8941F;         /* btn-gold gradient bottom */
  --accent-shadow:#8F6B1A;     /* btn-gold hard shadow */
}
html[data-accent="emerald"] {
  --accent:#43C990;            --accent-rgb:67,201,144;
  --accent-bright:#8FE7C0;     --accent-bright-rgb:143,231,192;
  --accent-hi:#A9F0CF; --accent-lo:#2FA774; --accent-shadow:#1E7050;
}
html[data-accent="ruby"] {
  --accent:#E15A72;            --accent-rgb:225,90,114;
  --accent-bright:#F2A0AE;     --accent-bright-rgb:242,160,174;
  --accent-hi:#F7B8C2; --accent-lo:#C13D55; --accent-shadow:#8A2338;
}
html[data-accent="violet"] {
  --accent:#9D7BEA;            --accent-rgb:157,123,234;
  --accent-bright:#C3ABF5;     --accent-bright-rgb:195,171,245;
  --accent-hi:#D4C2F8; --accent-lo:#7E5CD1; --accent-shadow:#58399E;
}
html[data-accent="ocean"] {
  --accent:#4FB6E6;            --accent-rgb:79,182,230;
  --accent-bright:#9AD7F2;     --accent-bright-rgb:154,215,242;
  --accent-hi:#B7E3F6; --accent-lo:#338FBF; --accent-shadow:#1F648A;
}

html, body { background:#05090F; }
body { font-family:'Poppins', system-ui, sans-serif; color:#F2E9D8; -webkit-font-smoothing:antialiased; position:relative; }
::selection { background:rgba(var(--accent-rgb),.32); color:#fff; }

.bg-fx { position:fixed; inset:0; z-index:0; pointer-events:none;
  background:
    radial-gradient(900px 540px at 80% -10%, rgba(var(--accent-rgb),.12), transparent 60%),
    radial-gradient(720px 520px at 6% 2%, rgba(33,86,107,.16), transparent 58%),
    radial-gradient(680px 600px at 50% 120%, rgba(163,59,55,.08), transparent 60%); }
.grain { position:fixed; inset:0; z-index:0; pointer-events:none; opacity:.05; mix-blend-mode:overlay;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
main, header, footer { position:relative; z-index:1; }

.container-x { width:100%; max-width:1120px; margin-inline:auto; padding-inline:1.5rem; }

/* the hidden attribute must always win — some components set display:flex */
[hidden] { display:none !important; }

.display { font-family:'Cinzel', serif; }
h2.section { font-family:'Cinzel', serif; font-weight:700; font-size:1.1rem; color:#F2E9D8; display:flex; align-items:center; gap:.6rem; }
h2.section::before { content:""; width:16px; height:1.5px; background:linear-gradient(90deg,var(--accent),transparent); display:inline-block; }

.eyebrow { font-family:'Space Mono',monospace; font-size:.64rem; font-weight:700; letter-spacing:.22em; text-transform:uppercase; color:var(--accent); }
.mono { font-family:'Space Mono',monospace; }

/* ---------- cards (quiet: fade-up in, gentle lift on hover) ---------- */
/* elevation scale — consistent resting depth + inset top highlight for material feel */
.card  { background:linear-gradient(180deg,#0B1828,#081320); border:1px solid #173049; border-radius:16px;
  box-shadow:inset 0 1px 0 rgba(var(--accent-bright-rgb),.05), 0 10px 30px -24px rgba(0,0,0,.9); }
.card-2{ background:#0A1422; border:1px solid #14283C; border-radius:14px;
  box-shadow:inset 0 1px 0 rgba(var(--accent-bright-rgb),.04); }
@keyframes fadeUp { from{ opacity:0; transform:translateY(10px);} to{ opacity:1; transform:none;} }
main .card { animation:fadeUp .5s ease both; }
.card, .card-2 { transition:transform .2s ease, border-color .2s ease, box-shadow .2s ease; }
.card:hover { transform:translateY(-3px); border-color:rgba(var(--accent-rgb),.45);
  box-shadow:inset 0 1px 0 rgba(var(--accent-bright-rgb),.07), 0 18px 40px -22px rgba(0,0,0,.9); }
.card-2:hover { transform:translateY(-2px); border-color:rgba(var(--accent-rgb),.35);
  box-shadow:inset 0 1px 0 rgba(var(--accent-bright-rgb),.06), 0 14px 30px -24px rgba(0,0,0,.85); }
/* keyboard focus for clickable card blocks (they are <a>) */
.card:focus-visible, .card-2:focus-visible { outline:2px solid var(--accent-bright); outline-offset:3px;
  border-color:rgba(var(--accent-rgb),.55); }

/* ---------- buttons ---------- */
.btn { display:inline-flex; align-items:center; justify-content:center; gap:.5rem; font-family:'Poppins',sans-serif;
  font-weight:600; border-radius:999px; min-height:44px; touch-action:manipulation;
  transition:transform .15s ease, filter .15s ease; cursor:pointer; border:none; }
.btn:focus-visible { outline:2px solid var(--accent-bright); outline-offset:2px; }

/* ---------- global focus + skip link (accessibility baseline) ---------- */
/* visible keyboard focus on any inline link that has no dedicated state above */
a:focus-visible { outline:2px solid var(--accent-bright); outline-offset:3px; border-radius:6px; }
.skip-link { position:absolute; left:12px; top:-56px; z-index:100; background:#0E2236;
  border:1px solid rgba(var(--accent-rgb),.55); color:#F2E9D8; font-size:.85rem; font-weight:600;
  padding:.55rem 1rem; border-radius:9px; transition:top .18s ease; }
.skip-link:focus { top:12px; outline:2px solid var(--accent-bright); outline-offset:2px; }
.btn:hover:not([disabled]) { transform:translateY(-1px); }
.btn:active:not([disabled]) { transform:translateY(1px); }
.btn[disabled]{ opacity:.4; cursor:not-allowed; filter:grayscale(.3); }
.btn-gold { color:#1A1205; padding:.6rem 1.25rem; background:linear-gradient(180deg,var(--accent-hi) 0%,var(--accent) 52%,var(--accent-lo) 100%); box-shadow:0 2px 0 var(--accent-shadow), 0 6px 14px -6px rgba(var(--accent-rgb),.5); }
.btn-gold:hover:not([disabled]) { filter:brightness(1.05); }
.btn-ghost { background:transparent; color:#F2E9D8; border:1px solid rgba(var(--accent-rgb),.4); padding:.5rem 1rem; }
.btn-ghost:hover { background:rgba(var(--accent-rgb),.10); border-color:rgba(var(--accent-rgb),.7); }
.btn-danger { background:transparent; color:#E9A29E; border:1px solid rgba(163,59,55,.55); padding:.5rem 1rem; }
.btn-danger:hover { background:rgba(163,59,55,.14); }

/* ---------- site header / nav ---------- */
.site-head { position:sticky; top:0; z-index:30; border-bottom:1px solid #173049; background:rgba(5,9,15,.9); backdrop-filter:blur(10px); }
/* Header layout lives HERE (not Tailwind) so the nav text never wraps onto a second line,
   even when the Tailwind CDN is slow or blocked: one row, logo pinned, links scroll sideways. */
.site-head .container-x { height:4rem; display:flex; flex-wrap:nowrap; align-items:center;
  justify-content:space-between; gap:1rem; min-width:0; }
.site-head .container-x > a[aria-label] { flex-shrink:0; display:flex; align-items:center; }
.site-nav { min-width:0; flex:0 1 auto; }
.site-nav { display:flex; align-items:center; gap:.25rem; overflow-x:auto; scrollbar-width:none; }
.site-nav::-webkit-scrollbar { display:none; }
.site-nav a { position:relative; display:inline-flex; align-items:center; min-height:44px; white-space:nowrap; padding:.45rem .8rem;
  font-size:.85rem; font-weight:500; color:#CFC3A6; border-radius:8px; touch-action:manipulation;
  transition:color .15s ease, background-color .15s ease; }
/* the admin nav carries 12 links (incl. Accounts) — tighten them so none clip on desktop */
html.role-admin .site-nav { gap:.1rem; }
html.role-admin .site-nav a { padding:.45rem .42rem; font-size:.8rem; }
.site-nav a:hover { color:#F2E9D8; background:rgba(var(--accent-rgb),.08); }
.site-nav a:focus-visible { outline:2px solid var(--accent-bright); outline-offset:-2px; color:#F2E9D8; }
.site-nav a::after { content:""; position:absolute; left:.8rem; right:.8rem; bottom:2px; height:2px; border-radius:2px;
  background:linear-gradient(90deg,var(--accent-bright),#9C7C28); transform:scaleX(0); transform-origin:left; transition:transform .2s ease; }
body[data-page="home"]      .site-nav a[data-nav="home"],
body[data-page="oracle"]    .site-nav a[data-nav="oracle"],
body[data-page="study"]     .site-nav a[data-nav="study"],
body[data-page="games"]     .site-nav a[data-nav="games"],
body[data-page="premium"]   .site-nav a[data-nav="premium"],
body[data-page="settings"]  .site-nav a[data-nav="settings"],
body[data-page="homework"]  .site-nav a[data-nav="homework"],
body[data-page="calendar"]  .site-nav a[data-nav="calendar"],
body[data-page="pipelines"] .site-nav a[data-nav="pipelines"],
body[data-page="voice"]     .site-nav a[data-nav="voice"] { color:var(--accent-bright); }
body[data-page="home"]      .site-nav a[data-nav="home"]::after,
body[data-page="oracle"]    .site-nav a[data-nav="oracle"]::after,
body[data-page="study"]     .site-nav a[data-nav="study"]::after,
body[data-page="games"]     .site-nav a[data-nav="games"]::after,
body[data-page="premium"]   .site-nav a[data-nav="premium"]::after,
body[data-page="settings"]  .site-nav a[data-nav="settings"]::after,
body[data-page="homework"]  .site-nav a[data-nav="homework"]::after,
body[data-page="calendar"]  .site-nav a[data-nav="calendar"]::after,
body[data-page="pipelines"] .site-nav a[data-nav="pipelines"]::after,
body[data-page="voice"]     .site-nav a[data-nav="voice"]::after { transform:scaleX(1); }

/* ---------- roles: admin-only features (Calendar / Pipelines / Voice / LMS) ----------
   Hidden for everyone by default; gate.js adds .role-admin on <html> for admin accounts.
   Cosmetic only — the APIs 403 non-admins server-side regardless. */
.admin-only { display:none !important; }
.role-admin .admin-only { display:revert !important; }
/* revert computes <a> back to inline, and as a flex item that blockifies — the nav text
   then sits at the top of its 44px box while normal links stay centered (the "words at
   different heights" bug). Re-assert the real display for revealed admin links. */
.role-admin .site-nav a.admin-only { display:inline-flex !important; }
.role-admin a.card.admin-only, .role-admin a.card-2.admin-only { display:block !important; }

/* account chip in the nav (signed-in email + switch account) */
.nav-account { display:inline-flex; align-items:center; min-height:44px; white-space:nowrap; margin-left:.35rem;
  padding:.3rem .75rem; font-size:.72rem; font-weight:500; font-family:'Space Mono',monospace; color:#9FB1C4;
  background:transparent; border:1px solid #24405d; border-radius:999px; cursor:pointer; touch-action:manipulation;
  transition:color .15s ease, border-color .15s ease; }
.nav-account:hover { color:var(--accent-bright); border-color:rgba(var(--accent-rgb),.6); }
.nav-account:focus-visible { outline:2px solid var(--accent-bright); outline-offset:2px; }

/* ---------- page header band ---------- */
.page-head { padding:2.2rem 0 1.6rem; }
.page-head h1 { font-family:'Cinzel',serif; font-weight:700; font-size:clamp(1.55rem, 1.15rem + 2vw, 2.1rem); line-height:1.14; letter-spacing:-.01em; color:#F2E9D8; margin-top:.55rem; }
.page-head p { font-size:.92rem; line-height:1.6; color:#E6DBC3; margin-top:.5rem; max-width:60ch; }

/* ---------- forms ---------- */
.field { width:100%; background:#07101B; border:1px solid #14283C; border-radius:10px; padding:.55rem .8rem;
  color:#F2E9D8; font-size:.9rem; font-family:'Poppins',sans-serif; outline:none; transition:border-color .15s ease; }
.field:focus { border-color:var(--accent); }
.field:focus-visible { border-color:var(--accent); box-shadow:0 0 0 3px rgba(var(--accent-rgb),.18); }
.field::placeholder { color:#8F836C; }
.field:disabled { opacity:.4; }
label.flabel { display:block; font-family:'Space Mono',monospace; font-size:.66rem; color:#E6DBC3; margin-bottom:.3rem; }

/* ---------- meters / progress ---------- */
.meter { height:7px; border-radius:999px; background:#08131F; overflow:hidden; border:1px solid #14283C; }
.meter > span { display:block; height:100%; background:linear-gradient(90deg,#9C7C28,var(--accent-bright)); border-radius:999px; transition:width .4s ease; }

/* ---------- toast ---------- */
.toast { position:fixed; left:50%; bottom:22px; transform:translateX(-50%) translateY(20px); opacity:0;
  background:#0E2236; border:1px solid rgba(var(--accent-rgb),.5); color:#F2E9D8; font-size:.85rem; padding:.6rem 1rem; border-radius:10px;
  z-index:60; pointer-events:none; transition:opacity .25s ease, transform .25s ease; box-shadow:0 10px 30px -8px rgba(0,0,0,.7); }
.toast.show { opacity:1; transform:translateX(-50%) translateY(0); }

/* ---------- segmented tabs ---------- */
.seg { display:inline-flex; gap:.25rem; padding:.28rem; background:#081320; border:1px solid #173049; border-radius:999px; max-width:100%; overflow-x:auto; scrollbar-width:none; }
.seg::-webkit-scrollbar { display:none; }
.seg button { border:none; cursor:pointer; white-space:nowrap; background:transparent; color:#CFC3A6;
  font-family:'Poppins',sans-serif; font-weight:500; font-size:.85rem; padding:.42rem 1rem; border-radius:999px;
  transition:background-color .15s ease, color .15s ease; }
.seg button:hover { color:#F2E9D8; }
.seg button.on { background:linear-gradient(180deg,var(--accent-hi),var(--accent)); color:#1A1205; font-weight:600; }
.seg button:focus-visible { outline:2px solid var(--accent-bright); outline-offset:2px; }

/* ---------- data table ---------- */
.dtable { width:100%; border-collapse:collapse; font-size:.84rem; }
.dtable th { font-family:'Space Mono',monospace; font-size:.62rem; font-weight:700; letter-spacing:.12em; text-transform:uppercase;
  color:var(--accent); text-align:left; padding:.45rem .6rem; border-bottom:1px solid #173049; }
.dtable td { padding:.5rem .6rem; border-bottom:1px solid #0E2236; color:#E6DBC3; }
.dtable tr:last-child td { border-bottom:none; }

/* ---------- confidence pips (syllabus) ---------- */
.pips { display:inline-flex; gap:.3rem; }
.pips button { min-width:44px; height:40px; border-radius:8px; border:1px solid #14283C; background:#07101B; cursor:pointer;
  touch-action:manipulation; font-family:'Space Mono',monospace; font-size:.62rem; font-weight:700; color:#8F836C;
  transition:transform .12s ease, background-color .12s ease, color .12s ease, border-color .12s ease; }
.pips button:hover { transform:translateY(-1px); border-color:rgba(var(--accent-rgb),.5); }
.pips button:focus-visible { outline:2px solid var(--accent-bright); outline-offset:2px; }
.pips button.on-1 { background:rgba(163,59,55,.25); border-color:#A33B37; color:#E9A29E; }
.pips button.on-2 { background:rgba(28,77,99,.35); border-color:#2E7391; color:#9FD3E8; }
.pips button.on-3 { background:rgba(var(--accent-rgb),.22); border-color:var(--accent); color:var(--accent-bright); }

/* ---------- flashcard flip ---------- */
.fc-stage { perspective:1200px; }
.fc-card { position:relative; width:100%; min-height:230px; transform-style:preserve-3d; transition:transform .5s cubic-bezier(.4,.1,.2,1); }
.fc-card.flip { transform:rotateY(180deg); }
.fc-face { position:absolute; inset:0; backface-visibility:hidden; -webkit-backface-visibility:hidden; display:flex; flex-direction:column;
  align-items:center; justify-content:center; gap:.6rem; padding:1.6rem; text-align:center;
  background:linear-gradient(180deg,#0B1828,#081320); border:1px solid rgba(var(--accent-rgb),.35); border-radius:16px; }
.fc-face.back { transform:rotateY(180deg); border-color:rgba(var(--accent-rgb),.55); }
.fc-face .fc-tag { font-family:'Space Mono',monospace; font-size:.6rem; letter-spacing:.2em; text-transform:uppercase; color:var(--accent); }
.fc-face .fc-text { font-size:1.02rem; line-height:1.55; color:#F2E9D8; max-width:52ch; }

/* ---------- timer ring (adapted from 21st.dev CircleProgress) ---------- */
.ring-wrap { position:relative; width:230px; height:230px; margin-inline:auto; }
.ring-wrap svg { width:100%; height:100%; transform:rotate(-90deg); }
.ring-track { fill:none; stroke:#0E2236; stroke-width:10; }
.ring-fill  { fill:none; stroke-width:10; stroke-linecap:round; transition:stroke-dashoffset .9s linear; } /* stroke gradient set inline per SVG */
.ring-center { position:absolute; inset:0; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:.15rem; }
.ring-time { font-family:'Space Mono',monospace; font-weight:700; font-size:2.5rem; color:#F2E9D8; letter-spacing:.02em; font-variant-numeric:tabular-nums; }
.ring-sub { font-family:'Space Mono',monospace; font-size:.64rem; letter-spacing:.18em; text-transform:uppercase; color:var(--accent); }

/* ---------- gumball mascot ---------- */
.gcomp { position:absolute; z-index:6; width:44px; height:44px; pointer-events:none;
  filter:drop-shadow(0 3px 5px rgba(0,0,0,.5)); animation:gcompBob 5s ease-in-out infinite; }
.gcomp svg { width:100%; height:100%; display:block; }
.gcomp .gc-eyes { transform-box:fill-box; transform-origin:center; animation:gcompBlink 6.5s infinite; }
.gcomp.tr { top:-19px; right:20px; }
.gcomp.tl { top:-19px; left:20px; }
@keyframes gcompBob  { 0%,100%{ transform:translateY(0) rotate(-2deg);} 50%{ transform:translateY(-4px) rotate(2deg);} }
@keyframes gcompBlink{ 0%,94%,100%{ transform:scaleY(1);} 97%{ transform:scaleY(.1);} }
[data-mascot]:hover > .gcomp { animation:gcompPop .55s cubic-bezier(.34,1.7,.5,1); }
@keyframes gcompPop { 0%{ transform:scale(1);} 42%{ transform:scale(1.22) rotate(6deg);} 100%{ transform:scale(1);} }

/* hero gumball (home) */
.hero-char { position:absolute; top:0; right:0; bottom:0; width:50%; max-width:380px; z-index:0; overflow:hidden; border-radius:0 16px 16px 0; pointer-events:none; }
.hero-char svg { position:absolute; right:-12%; bottom:-8%; height:122%; width:auto; }
.hero-scrim { position:absolute; inset:0; z-index:1; border-radius:16px; pointer-events:none;
  background:linear-gradient(90deg,#0B1828 0%, rgba(11,24,40,.97) 32%, rgba(11,24,40,.7) 58%, rgba(11,24,40,.2) 84%, rgba(11,24,40,0) 100%); }
.hero-glow { position:absolute; z-index:1; left:-6%; top:-30%; width:60%; height:150%; pointer-events:none;
  background:radial-gradient(closest-side, rgba(var(--accent-rgb),.16), transparent 70%); filter:blur(8px); }
.float-hero { animation:floatHero 6s ease-in-out infinite, boing 7s ease-in-out infinite; will-change:transform; }
@keyframes floatHero { 0%,100%{ transform:translateY(0);} 50%{ transform:translateY(-12px);} }
@keyframes boing { 0%,80%,100%{ scale:1 1;} 86%{ scale:1.06 .93;} 92%{ scale:.96 1.05;} 96%{ scale:1.01 .99;} }
.eyes { transform-box:fill-box; transform-origin:center; animation:blink 5s infinite; }
@keyframes blink { 0%,92%,100%{ transform:scaleY(1);} 96%{ transform:scaleY(.08);} }

/* gumball celebration (pomodoro done / good score) */
.gcheer { position:fixed; right:26px; bottom:18px; width:110px; z-index:55; pointer-events:none; opacity:0; transform:translateY(30px); }
.gcheer.show { animation:cheerIn 3.4s cubic-bezier(.34,1.56,.64,1) both; }
@keyframes cheerIn { 0%{ opacity:0; transform:translateY(40px);} 12%,80%{ opacity:1; transform:translateY(0);} 100%{ opacity:0; transform:translateY(40px);} }
.gcheer .gc-arms { transform-box:fill-box; transform-origin:center; animation:armWave .5s ease-in-out infinite alternate; }
@keyframes armWave { from{ transform:rotate(-4deg);} to{ transform:rotate(4deg);} }

@media (max-width: 980px){ .hero-char { width:70%; opacity:.22; } }
@media (max-width: 640px){
  .hero-char { display:none; }
  .site-nav a { padding:.4rem .5rem; font-size:.78rem; }
}
@media (prefers-reduced-motion: reduce){ *{ animation:none !important; transition:none !important; } }

/* ---------- MOMO Arcade (gamification) ---------- */
#gameChip { display:inline-flex; align-items:center; gap:.35rem; margin-left:.4rem; padding:.28rem .7rem;
  border:1px solid rgba(var(--accent-rgb),.45); border-radius:999px; background:rgba(var(--accent-rgb),.08);
  color:var(--accent-bright); font-family:'Space Mono',monospace; font-size:.72rem; text-decoration:none; white-space:nowrap;
  transition:background-color .15s ease, transform .15s ease; }
#gameChip:hover { background:rgba(var(--accent-rgb),.18); transform:translateY(-1px); }
#gameChip.bump { animation:chipBump .5s cubic-bezier(.34,1.7,.5,1); }
@keyframes chipBump { 0%{transform:scale(1);} 45%{transform:scale(1.18);} 100%{transform:scale(1);} }

.dance-bounce { animation:danceBounce .62s ease-in-out infinite; }
.dance-spin   { animation:danceSpin 1.6s linear infinite; }
.dance-wiggle { animation:danceWiggle .5s ease-in-out infinite; }
.dance-moon   { animation:danceMoon 1.3s ease-in-out infinite; }
@keyframes danceBounce { 0%,100%{ transform:translateY(0) rotate(-4deg);} 50%{ transform:translateY(-16px) rotate(4deg);} }
@keyframes danceSpin   { 0%{ transform:rotate(0);} 100%{ transform:rotate(360deg);} }
@keyframes danceWiggle { 0%,100%{ transform:rotate(-10deg);} 50%{ transform:rotate(10deg);} }
@keyframes danceMoon   { 0%,100%{ transform:translateX(0) scaleX(1);} 25%{ transform:translateX(-10px) scaleX(-1);} 75%{ transform:translateX(10px) scaleX(1);} }

.party-stage { position:fixed; inset:0; z-index:70; pointer-events:none; overflow:hidden; }
.party-char { position:absolute; bottom:12px; width:92px; height:92px; filter:drop-shadow(0 6px 10px rgba(0,0,0,.55)); }
.party-char svg { width:100%; height:100%; }
.confetti { position:absolute; top:-12px; width:8px; height:14px; border-radius:2px; opacity:.95;
  animation:confettiFall 3.4s linear infinite; }
@keyframes confettiFall { 0%{ transform:translateY(-4vh) rotate(0);} 100%{ transform:translateY(106vh) rotate(560deg);} }

.shop-grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(190px, 1fr)); gap:1rem; }
.shop-card { background:#07101B; border:1px solid #14283C; border-radius:14px; padding:1.1rem; text-align:center;
  transition:border-color .15s ease, transform .15s ease; }
.shop-card:hover { border-color:rgba(var(--accent-rgb),.5); transform:translateY(-2px); }
.shop-card.owned { border-color:rgba(62,156,92,.55); }
.shop-fig { width:84px; height:84px; margin:0 auto .6rem; }
.shop-fig svg { width:100%; height:100%; }
.floor-row { display:flex; flex-wrap:wrap; gap:1.4rem; justify-content:center; padding:1rem 0; }
.floor-char { width:96px; height:96px; cursor:pointer; transition:transform .15s ease; }
.floor-char:hover { transform:scale(1.08); }
.floor-char svg { width:100%; height:100%; }
.earn-row { display:flex; align-items:center; justify-content:space-between; gap:.8rem; padding:.55rem 0; border-top:1px solid #14283C; }
.earn-row:first-child { border-top:none; }
.earn-val { font-family:'Space Mono',monospace; font-size:.72rem; color:var(--accent-bright); white-space:nowrap; }

/* arcade a11y (ui-ux-pro-max audit) */
#gameChip { min-height:34px; }
#gameChip:focus-visible, .floor-char:focus-visible, .shop-card button:focus-visible { outline:2px solid var(--accent-bright); outline-offset:2px; }
@media (prefers-reduced-motion: reduce){
  .dance-bounce, .dance-spin, .dance-wiggle, .dance-moon, .confetti, .party-char { animation:none !important; }
}

/* token coin: PNG instead of the U+1FA99 emoji (missing on older Android) */
.coin { display:inline-block; width:1em; height:1em; vertical-align:-.12em; background:transparent; }

/* notebook / paper selector tabs (Oracle + Study hub share these) */
.paper-tab { font-family:'Space Mono',monospace; font-size:.7rem; font-weight:700; color:#CFC3A6;
  background:#07101B; border:1px solid #14283C; border-radius:10px; padding:.5rem .8rem; min-height:44px;
  cursor:pointer; transition:background-color .15s ease, border-color .15s ease, color .15s ease; }
.paper-tab:hover { border-color:rgba(var(--accent-rgb),.5); }
.paper-tab.on { color:var(--accent-bright); background:rgba(var(--accent-rgb),.10); border-color:rgba(var(--accent-rgb),.55); }
.paper-tab:focus-visible { outline:2px solid var(--accent-bright); outline-offset:2px; }

/* ============================================================
   Gumball is the admin's mascot only — hidden for every other
   account (role-admin lands on <html> from gate.js/localStorage).
   ============================================================ */
html:not(.role-admin) .gcomp,
html:not(.role-admin) .hero-char,
html:not(.role-admin) .hero-glow,
html:not(.role-admin) .gcheer { display:none !important; }

/* ============================================================
   Header tools (theme toggle + account chip) — fixed slot so the
   nav links never shift when gate.js mounts the chip after load.
   ============================================================ */
.nav-tools { display:flex; align-items:center; gap:.4rem; flex-shrink:0; min-width:44px; justify-content:flex-end; }
.theme-toggle { display:inline-flex; align-items:center; justify-content:center; width:38px; height:38px;
  border-radius:999px; border:1px solid #24405d; background:transparent; color:#CFC3A6; cursor:pointer;
  font-size:1rem; line-height:1; touch-action:manipulation; transition:color .15s ease, border-color .15s ease; }
.theme-toggle:hover { color:var(--accent-bright); border-color:rgba(var(--accent-rgb),.6); }
.theme-toggle:focus-visible { outline:2px solid var(--accent-bright); outline-offset:2px; }

/* ============================================================
   Page transitions — navigations cross-fade instead of snapping.
   Modern engines: View Transitions API (same-origin MPA). Fallback:
   a short body fade driven by site.js on link clicks.
   ============================================================ */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation:vtFadeOut .22s ease both; }
::view-transition-new(root) { animation:vtFadeIn .26s ease both; }
@keyframes vtFadeOut { to{ opacity:0; } }
@keyframes vtFadeIn { from{ opacity:0; transform:translateY(6px); } to{ opacity:1; transform:none; } }
body { transition:opacity .18s ease; }
body.page-leave { opacity:0; }
@media (prefers-reduced-motion: reduce){
  ::view-transition-old(root), ::view-transition-new(root) { animation:none !important; }
}

/* ============================================================
   House ad (free accounts, until AdSense is approved) — one quiet
   branded slot above the footer; Premium/admin never see it.
   ============================================================ */
.house-ad { display:flex; align-items:center; gap:1rem; flex-wrap:wrap; padding:1rem 1.2rem;
  background:#0A1422; border:1px solid #14283C; border-radius:14px; }
.house-ad p { font-size:.86rem; color:#E6DBC3; flex:1; min-width:200px; line-height:1.5; }
.house-ad .mono { font-size:.58rem; letter-spacing:.14em; text-transform:uppercase; color:#5E7288; width:100%; }

/* ============================================================
   LIGHT MODE — html[data-theme="light"], toggled in the header,
   persisted as momo_theme. Same brand (navy ink + gold) on warm
   parchment surfaces; overrides win over inline styles via
   !important only where inline styles exist (footer).
   ============================================================ */
html[data-theme="light"], html[data-theme="light"] body { background:#F6F0E1; color:#243244; }
html[data-theme="light"] .bg-fx { background:
    radial-gradient(900px 540px at 80% -10%, rgba(156,124,40,.10), transparent 60%),
    radial-gradient(720px 520px at 6% 2%, rgba(28,77,99,.08), transparent 58%),
    radial-gradient(680px 600px at 50% 120%, rgba(163,59,55,.05), transparent 60%); }
html[data-theme="light"] .grain { opacity:.035; mix-blend-mode:multiply; }
html[data-theme="light"] ::selection { background:rgba(156,124,40,.28); color:#1b2635; }

html[data-theme="light"] .card { background:linear-gradient(180deg,#FEFBF3,#F9F3E4); border-color:#E3D6B8;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.8), 0 10px 30px -24px rgba(90,70,20,.45); }
html[data-theme="light"] .card-2 { background:#FBF6E9; border-color:#E7DCC1;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.7); }
html[data-theme="light"] .card:hover { border-color:rgba(156,124,40,.55);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.85), 0 18px 40px -22px rgba(90,70,20,.5); }
html[data-theme="light"] .card-2:hover { border-color:rgba(156,124,40,.45); }

html[data-theme="light"] h2.section, html[data-theme="light"] .page-head h1 { color:#1E2A38; }
html[data-theme="light"] .page-head p { color:#4A5560; }
html[data-theme="light"] .eyebrow { color:#8A6C1B; }

html[data-theme="light"] .site-head { background:rgba(246,240,225,.92); border-bottom-color:#E3D6B8; }
html[data-theme="light"] .site-nav a { color:#5B6673; }
html[data-theme="light"] .site-nav a:hover { color:#1E2A38; background:rgba(156,124,40,.10); }
html[data-theme="light"] body[data-page] .site-nav a[data-nav] { }
html[data-theme="light"] body[data-page="home"]      .site-nav a[data-nav="home"],
html[data-theme="light"] body[data-page="oracle"]    .site-nav a[data-nav="oracle"],
html[data-theme="light"] body[data-page="study"]     .site-nav a[data-nav="study"],
html[data-theme="light"] body[data-page="games"]     .site-nav a[data-nav="games"],
html[data-theme="light"] body[data-page="premium"]   .site-nav a[data-nav="premium"],
html[data-theme="light"] body[data-page="settings"]  .site-nav a[data-nav="settings"],
html[data-theme="light"] body[data-page="homework"]  .site-nav a[data-nav="homework"],
html[data-theme="light"] body[data-page="calendar"]  .site-nav a[data-nav="calendar"],
html[data-theme="light"] body[data-page="pipelines"] .site-nav a[data-nav="pipelines"],
html[data-theme="light"] body[data-page="voice"]     .site-nav a[data-nav="voice"] { color:#8A6C1B; }
html[data-theme="light"] .nav-account { color:#5B6673; border-color:#D8CBAA; }
html[data-theme="light"] .nav-account:hover { color:#8A6C1B; border-color:rgba(156,124,40,.6); }
html[data-theme="light"] .theme-toggle { color:#5B6673; border-color:#D8CBAA; }
html[data-theme="light"] .theme-toggle:hover { color:#8A6C1B; border-color:rgba(156,124,40,.6); }

html[data-theme="light"] .btn-ghost { color:#243244; border-color:rgba(156,124,40,.5); }
html[data-theme="light"] .btn-ghost:hover { background:rgba(156,124,40,.10); border-color:rgba(156,124,40,.8); }
html[data-theme="light"] .btn-danger { color:#A33B37; border-color:rgba(163,59,55,.5); }
html[data-theme="light"] .skip-link { background:#FEFBF3; color:#243244; }

html[data-theme="light"] .field, html[data-theme="light"] .mock-q textarea { background:#FFFDF7; border-color:#DED1B1; color:#243244; }
html[data-theme="light"] .field::placeholder { color:#9A8F76; }
html[data-theme="light"] label.flabel { color:#4A5560; }
html[data-theme="light"] .meter { background:#EDE4CE; border-color:#E0D3B3; }
html[data-theme="light"] .toast { background:#FEFBF3; color:#243244; box-shadow:0 10px 30px -8px rgba(90,70,20,.4); }
html[data-theme="light"] .seg { background:#F3ECDA; border-color:#E3D6B8; }
html[data-theme="light"] .seg button { color:#5B6673; }
html[data-theme="light"] .seg button:hover { color:#1E2A38; }
html[data-theme="light"] .dtable th { color:#8A6C1B; border-bottom-color:#E3D6B8; }
html[data-theme="light"] .dtable td { color:#3A4550; border-bottom-color:#EFE7D2; }
html[data-theme="light"] .pips button { background:#FFFDF7; border-color:#DED1B1; color:#9A8F76; }
html[data-theme="light"] .fc-face { background:linear-gradient(180deg,#FEFBF3,#F9F3E4); border-color:rgba(156,124,40,.45); }
html[data-theme="light"] .fc-face .fc-text { color:#243244; }
html[data-theme="light"] .ring-track { stroke:#EDE4CE; }
html[data-theme="light"] .ring-time { color:#1E2A38; }
html[data-theme="light"] footer { background:#F0E8D4 !important; border-color:#E3D6B8 !important; }
html[data-theme="light"] .house-ad { background:#FBF6E9; border-color:#E7DCC1; }
html[data-theme="light"] .house-ad p { color:#3A4550; }

/* hero (home): the dark scrim + heavy text-shadow read wrong on parchment */
html[data-theme="light"] .hero-scrim { background:linear-gradient(90deg,#FEFBF3 0%, rgba(254,251,243,.97) 32%, rgba(254,251,243,.7) 58%, rgba(254,251,243,.2) 84%, rgba(254,251,243,0) 100%); }
html[data-theme="light"] main h1 { text-shadow:none !important; }

/* Tailwind utility text/border colors (from tw.js) */
html[data-theme="light"] .text-ink { color:#1E2A38 !important; }
html[data-theme="light"] .text-muted { color:#55606C !important; }
html[data-theme="light"] .text-gold-l { color:#8A6C1B !important; }
html[data-theme="light"] .border-line { border-color:#E3D6B8 !important; }

/* Oracle / page-local surfaces */
html[data-theme="light"] .dropzone { background:#FFFDF7; border-color:rgba(156,124,40,.5); }
html[data-theme="light"] .dropzone:hover, html[data-theme="light"] .dropzone.drag { background:rgba(156,124,40,.08); }
html[data-theme="light"] .askbox { background:#FFFDF7; border-color:rgba(156,124,40,.55); }
html[data-theme="light"] .askbox input { color:#243244; }
html[data-theme="light"] .askbox input::placeholder { color:#9A8F76; }
html[data-theme="light"] .ans-body { color:#243244; }
html[data-theme="light"] .ans-meta, html[data-theme="light"] .psg-cap { color:#5B6673; }
html[data-theme="light"] .ans-empty { color:#847961; }
html[data-theme="light"] mark { background:rgba(156,124,40,.22); color:#4a3d12; }
html[data-theme="light"] .chip { color:#8A6C1B; background:rgba(156,124,40,.10); border-color:rgba(156,124,40,.4); }
html[data-theme="light"] .psg { background:#FBF6E9; border-color:#E7DCC1; border-left-color:#9C7C28; }
html[data-theme="light"] .psg p { color:#3A4550; }
html[data-theme="light"] .psg-h { color:#1E2A38; }
html[data-theme="light"] .nb-btn, html[data-theme="light"] .paper-tab { color:#8A6C1B; background:rgba(156,124,40,.07); border-color:rgba(156,124,40,.4); }
html[data-theme="light"] .paper-tab { color:#5B6673; background:#FFFDF7; border-color:#DED1B1; }
html[data-theme="light"] .paper-tab.on { color:#8A6C1B; background:rgba(156,124,40,.12); border-color:rgba(156,124,40,.55); }
html[data-theme="light"] .qz-opt { background:#FFFDF7; border-color:#DED1B1; color:#3A4550; }
html[data-theme="light"] .qz-why, html[data-theme="light"] .mock-fb { color:#5B6673; }
html[data-theme="light"] details.nb-faq { background:#FFFDF7; border-color:#E7DCC1; }
html[data-theme="light"] details.nb-faq summary { color:#1E2A38; }
html[data-theme="light"] details.nb-faq p { color:#3A4550; }
html[data-theme="light"] .nb-guide li, html[data-theme="light"] .nb-guide p { color:#3A4550; }
html[data-theme="light"] .nb-guide h3 { color:#1E2A38; }
html[data-theme="light"] .nb-guide b { color:#8A6C1B; }
html[data-theme="light"] .mm-wrap { background:#FFFDF7; border-color:#E7DCC1; }
html[data-theme="light"] .ov-line p { color:#3A4550; }
html[data-theme="light"] .vo-cap { color:#3A4550; }
html[data-theme="light"] .unit-name { color:#1E2A38; }
html[data-theme="light"] .sub-row { border-top-color:#EFE7D2; }
html[data-theme="light"] .sub-row p { color:#3A4550; }
html[data-theme="light"] .deck-row { border-top-color:#EFE7D2; }
html[data-theme="light"] .frow { border-top-color:#EFE7D2; }
