/* AcePal prototype v2 — "playful academic". Tokens first, then layout, components, views. */
:root {
  --ink: #1C1838; --ink2: #676285; --line: #E5E1F5; --canvas: #F6F5FC; --card: #fff;
  --pri: #5B4CE6; --pri-d: #3A2CA8; --pri-soft: #EEECFF;
  --act: #FF8A1E; --act-d: #D96806; --act-soft: #FFF1E0;
  --coin: #FFC933; --coin-soft: #FFF8DB;
  --ok: #16A34A; --ok-b: #22C55E; --ok-d: #15803D; --ok-soft: #DCFCE7;
  --bad: #EF4444; --bad-d: #B91C1C; --bad-soft: #FEE2E2;
  --warn: #B45309; --warn-soft: #FEF3C7;
  --side1: #2E2266; --side2: #3F2E8A;
  --r: 18px; --r-sm: 12px;
  --head: "Fredoka", ui-rounded, "SF Pro Rounded", "PingFang SC", "Noto Sans SC", system-ui, sans-serif;
  --body: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Noto Sans SC", sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--canvas); color: var(--ink); font: 500 15px/1.55 var(--body); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { font-family: var(--head); font-weight: 600; line-height: 1.2; margin: 0 0 8px; letter-spacing: -.01em; }
h1 { font-size: 30px; } h2 { font-size: 22px; } h3 { font-size: 18px; } h4 { font-size: 15px; }
p { margin: 0 0 10px; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid #A59BFF; outline-offset: 2px; border-radius: 8px; }
.muted { color: var(--ink2); } .small { font-size: 13px; } .tiny { font-size: 12px; }
.num { font-family: var(--head); font-variant-numeric: tabular-nums; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.between { justify-content: space-between; } .nowrap { flex-wrap: nowrap; }
.grow { flex: 1; min-width: 0; }
.stack > * + * { margin-top: 16px; }
.grid { display: grid; gap: 16px; }
.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .c4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.c21 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); } .c12 { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
@media (max-width: 899px) { .c2, .c3, .c21, .c12 { grid-template-columns: 1fr; } .c4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.ico { flex: none; vertical-align: -4px; }
.hide-m { } .only-m { display: none !important; }
@media (max-width: 899px) { .hide-m { display: none !important; } .only-m { display: revert !important; } }

/* ---------- Demo strip (prototype controls, not product UI) ---------- */
.demo { position: sticky; top: 0; z-index: 100; height: 34px; background: #14112B; color: #C9C4EE; font-size: 12px; display: flex; align-items: center; gap: 6px; padding: 6px 12px; overflow-x: auto; white-space: nowrap; scrollbar-width: none; }
.demo b { color: var(--coin); letter-spacing: .08em; font-size: 11px; margin-right: 4px; }
.demo button { border: 1px solid #3B356A; background: transparent; color: #C9C4EE; border-radius: 99px; padding: 3px 11px; font-size: 12px; font-weight: 600; }
.demo button.on { background: #fff; color: #14112B; border-color: #fff; }
.demo .sp { flex: 1; }

/* ---------- Buttons ---------- */
.btn { --bg: #fff; --bd: var(--line); --fg: var(--ink); display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 20px; border-radius: 14px; border: 2px solid var(--bd); border-bottom-width: 4px; background: var(--bg); color: var(--fg); font-family: var(--head); font-weight: 600; font-size: 16px; letter-spacing: .01em; transition: transform .06s, filter .12s; user-select: none; white-space: nowrap; }
.btn:hover { filter: brightness(1.04); }
.btn:active { transform: translateY(2px); border-bottom-width: 2px; margin-bottom: 2px; }
.btn.act { --bg: var(--act); --bd: var(--act-d); --fg: #fff; border-color: var(--act); border-bottom-color: var(--act-d); }
.btn.pri { --bg: var(--pri); --fg: #fff; border-color: var(--pri); border-bottom-color: var(--pri-d); }
.btn.ok { --bg: var(--ok-b); --fg: #fff; border-color: var(--ok-b); border-bottom-color: var(--ok-d); }
.btn.bad { --bg: var(--bad); --fg: #fff; border-color: var(--bad); border-bottom-color: var(--bad-d); }
.btn.wa { --bg: #25D366; --fg: #fff; border-color: #25D366; border-bottom-color: #169C48; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--pri); border-bottom-width: 2px; }
.btn.ghost:hover { background: var(--pri-soft); }
.btn.pill { border-radius: 99px; }
.btn.lg { min-height: 54px; font-size: 18px; padding: 0 28px; }
.btn.sm { min-height: 36px; font-size: 14px; padding: 0 14px; border-radius: 11px; border-bottom-width: 3px; }
.btn.block { width: 100%; }
.btn:disabled { --bg: #E9E7F3; --fg: #A7A3C0; border-color: #E9E7F3; border-bottom-color: #D6D2E8; cursor: not-allowed; filter: none; transform: none; }
/* flatter buttons for tutor / parent / partner */
.staff .btn { font-family: var(--body); font-weight: 700; font-size: 14px; min-height: 40px; border-width: 1.5px; border-bottom-width: 1.5px; border-radius: 10px; padding: 0 16px; box-shadow: 0 1px 2px rgba(28, 24, 56, .06); }
.staff .btn:active { transform: none; margin-bottom: 0; filter: brightness(.96); }
.staff .btn.sm { min-height: 32px; font-size: 13px; padding: 0 11px; }
.iconbtn { width: 40px; height: 40px; border-radius: 12px; border: 0; background: transparent; display: inline-grid; place-items: center; color: var(--ink2); position: relative; }
.iconbtn:hover { background: var(--pri-soft); color: var(--pri); }
.linkbtn { border: 0; background: none; padding: 0; color: var(--pri); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Cards / chips ---------- */
.card { background: var(--card); border: 2px solid var(--line); border-radius: var(--r); padding: 20px; box-shadow: 0 4px 0 var(--line); min-width: 0; }
.staff .card { border-width: 1px; box-shadow: 0 1px 3px rgba(28, 24, 56, .06); border-radius: 14px; }
.card.flat { box-shadow: none; }
.card h3 { margin-bottom: 4px; }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 700; background: #F0EEF9; color: var(--ink2); white-space: nowrap; }
.chip.ok { background: var(--ok-soft); color: var(--ok-d); } .chip.bad { background: var(--bad-soft); color: var(--bad-d); }
.chip.warn { background: var(--warn-soft); color: var(--warn); } .chip.pri { background: var(--pri-soft); color: var(--pri); }
.chip.act { background: var(--act-soft); color: var(--act-d); } .chip.coin { background: var(--coin-soft); color: #8A6400; }
.subj { --c: var(--pri); --s: var(--pri-soft); background: var(--s); color: var(--c); }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; background: var(--c, var(--pri)); }
.tag-sim { font-size: 11px; font-weight: 700; color: var(--warn); background: var(--warn-soft); padding: 2px 8px; border-radius: 6px; vertical-align: middle; font-family: var(--body); letter-spacing: 0; }
.bar { height: 10px; background: #ECEAF7; border-radius: 99px; overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 99px; background: var(--pri); transition: width .4s ease; }
.bar.ok > i { background: var(--ok-b); } .bar.act > i { background: var(--act); } .bar.bad > i { background: var(--bad); } .bar.coin > i { background: var(--coin); }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--coin-soft); border: 2px solid #fff; box-shadow: 0 0 0 2px var(--line); display: inline-grid; place-items: center; font-size: 22px; flex: none; line-height: 1; }
.avatar.lg { width: 64px; height: 64px; font-size: 36px; } .avatar.sm { width: 32px; height: 32px; font-size: 17px; }
.seg { display: inline-flex; background: #ECEAF7; border-radius: 12px; padding: 4px; gap: 2px; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg button { border: 0; background: transparent; padding: 7px 14px; border-radius: 9px; font-weight: 700; font-size: 14px; color: var(--ink2); white-space: nowrap; min-height: 36px; }
.seg button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(28, 24, 56, .12); }
.pills { display: flex; gap: 8px; flex-wrap: wrap; }
.pills button { border: 2px solid var(--line); background: #fff; border-radius: 99px; padding: 6px 14px; font-weight: 700; font-size: 14px; color: var(--ink2); min-height: 38px; display: inline-flex; align-items: center; gap: 6px; }
.pills button.on { border-color: var(--c, var(--pri)); background: var(--s, var(--pri-soft)); color: var(--c, var(--pri)); }
.field { display: block; } .field > span { display: block; font-size: 13px; font-weight: 700; margin-bottom: 5px; }
.input { width: 100%; min-height: 44px; border: 2px solid var(--line); border-radius: 12px; padding: 0 14px; background: #fff; }
.input:focus { outline: none; border-color: var(--pri); box-shadow: 0 0 0 3px var(--pri-soft); }
.input.err { border-color: var(--bad); } .errtxt { color: var(--bad-d); font-size: 13px; margin-top: 4px; }
.switch { position: relative; width: 46px; height: 28px; flex: none; }
.switch input { opacity: 0; width: 100%; height: 100%; position: absolute; margin: 0; cursor: pointer; z-index: 1; }
.switch i { position: absolute; inset: 0; background: #D6D2E8; border-radius: 99px; transition: .15s; }
.switch i::after { content: ""; position: absolute; width: 22px; height: 22px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .15s; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); }
.switch input:checked + i { background: var(--ok-b); } .switch input:checked + i::after { transform: translateX(18px); }
.switch input:focus-visible + i { outline: 3px solid #A59BFF; outline-offset: 2px; }
.setting { display: flex; gap: 14px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); }
.setting:last-child { border-bottom: 0; }
.empty { text-align: center; padding: 28px 16px; }

/* ---------- Marketing site ---------- */
.site-nav { position: sticky; top: 34px; z-index: 30; background: rgba(255, 255, 255, .94); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.site-nav .in { max-width: 1120px; margin: 0 auto; padding: 12px 20px; display: flex; align-items: center; gap: 22px; }
.site-nav .links { display: flex; gap: 22px; margin-left: 18px; font-weight: 600; color: var(--ink2); }
.site-nav .links a:hover { color: var(--pri); }
.logo { display: inline-flex; align-items: center; gap: 8px; font-family: var(--head); font-weight: 700; font-size: 22px; color: var(--pri); letter-spacing: -.02em; }
.logo .mark { width: 36px; height: 36px; border-radius: 11px; background: var(--coin-soft); display: grid; place-items: center; border: 2px solid var(--coin); overflow: hidden; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.hero { background: radial-gradient(900px 420px at 85% 10%, #E4E0FF 0, transparent 60%), linear-gradient(#fff, var(--canvas)); padding: 48px 0 40px; overflow: hidden; }
.hero .in { display: grid; grid-template-columns: 1.05fr 1fr; gap: 36px; align-items: center; }
.hero h1 { font-size: 50px; font-weight: 700; line-height: 1.05; letter-spacing: -.02em; }
.hero h1 em { font-style: normal; color: var(--act); }
.hero .sub { font-size: 18px; color: var(--ink2); max-width: 520px; margin: 14px 0 22px; }
.trust { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--ink2); margin-top: 16px; }
.trust span { display: inline-flex; gap: 5px; align-items: center; }
.device { background: linear-gradient(160deg, var(--side2), var(--side1)); border-radius: 28px; padding: 18px; position: relative; box-shadow: 0 24px 60px rgba(46, 34, 102, .28); }
.device .screen { background: var(--canvas); border-radius: 16px; padding: 16px; }
.device .ol { position: absolute; right: -18px; top: -42px; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .18)); animation: bob 3s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-7px) rotate(3deg); } }
.band { padding: 56px 0; } .band.alt { background: #fff; border-block: 1px solid var(--line); }
.band h2 { font-size: 34px; text-align: center; margin-bottom: 6px; }
.band .lead { text-align: center; color: var(--ink2); max-width: 600px; margin: 0 auto 30px; font-size: 16px; }
.step { text-align: center; padding: 8px 10px; }
.step .n { font-family: var(--head); font-size: 44px; font-weight: 700; color: var(--act); line-height: 1; }
.step .art { height: 132px; border-radius: var(--r); display: grid; place-items: center; margin-bottom: 14px; font-size: 54px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; text-align: center; }
.stats b { font-family: var(--head); font-size: 38px; color: var(--pri); display: block; line-height: 1.1; }
.feat { display: flex; gap: 14px; align-items: flex-start; }
.feat .i { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; font-size: 24px; flex: none; }
.price-card { position: relative; text-align: left; }
.price-card.hot { border-color: var(--pri); box-shadow: 0 4px 0 var(--pri); }
.price-card .ribbon { position: absolute; top: -14px; left: 20px; background: var(--act); color: #fff; font-family: var(--head); font-size: 13px; padding: 3px 12px; border-radius: 99px; }
.price { font-family: var(--head); font-size: 46px; font-weight: 700; line-height: 1; }
.price small { font-size: 15px; font-weight: 500; color: var(--ink2); font-family: var(--body); }
.ticks { list-style: none; padding: 0; margin: 14px 0; } .ticks li { display: flex; gap: 8px; padding: 4px 0; } .ticks li::before { content: "✓"; color: var(--ok); font-weight: 800; }
details.faq { background: #fff; border: 2px solid var(--line); border-radius: 14px; padding: 0 18px; margin-bottom: 10px; }
details.faq summary { cursor: pointer; padding: 15px 0; font-weight: 700; list-style: none; display: flex; justify-content: space-between; gap: 10px; }
details.faq summary::after { content: "+"; font-family: var(--head); font-size: 22px; color: var(--pri); line-height: 1; }
details.faq[open] summary::after { content: "–"; }
details.faq p { color: var(--ink2); padding-bottom: 14px; margin: 0; }
.quote { font-size: 15px; } .quote footer { margin-top: 10px; font-size: 13px; color: var(--ink2); display: flex; gap: 8px; align-items: center; }
.site-foot { background: var(--side1); color: #C9C4EE; padding: 32px 0 90px; font-size: 13px; }
.site-foot a { text-decoration: underline; text-underline-offset: 3px; }
.sticky-cta { position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; background: rgba(255, 255, 255, .96); backdrop-filter: blur(10px); border-top: 1px solid var(--line); padding: 10px 20px; display: flex; justify-content: center; align-items: center; gap: 14px; flex-wrap: wrap; }
.cookie { position: fixed; left: 16px; bottom: 84px; z-index: 26; max-width: 340px; background: #fff; border: 2px solid var(--line); border-radius: 16px; padding: 14px; box-shadow: 0 12px 30px rgba(28, 24, 56, .16); font-size: 13px; }
@media (max-width: 899px) {
  .hero .in { grid-template-columns: 1fr; } .hero h1 { font-size: 36px; } .site-nav .links { display: none; }
  .stats { grid-template-columns: repeat(2, 1fr); } .band h2 { font-size: 27px; } .device .ol { right: 0; }
}

/* ---------- App shell ---------- */
.shell { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: calc(100vh - 34px); }
.side { background: linear-gradient(175deg, var(--side2), var(--side1)); color: #fff; padding: 18px 14px; display: flex; flex-direction: column; gap: 14px; position: sticky; top: 34px; height: calc(100vh - 34px); overflow-y: auto; }
.side .logo { color: #fff; padding: 2px 8px; }
.shell.r-tutor .side { background: linear-gradient(175deg, #1F2B52, #151D3B); }
.shell.r-parent .side { background: linear-gradient(175deg, #243B6B, #18284C); }
.shell.r-partner .side { background: linear-gradient(175deg, #115E59, #0B3F3C); }
.gradepill { align-self: flex-start; margin-left: 8px; background: var(--act); color: #fff; border: 0; border-radius: 99px; padding: 6px 14px; font-family: var(--head); font-weight: 600; font-size: 14px; display: inline-flex; gap: 6px; align-items: center; box-shadow: 0 3px 0 var(--act-d); }
.side nav { display: flex; flex-direction: column; gap: 4px; margin-top: 4px; }
.side nav a { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 14px; font-family: var(--head); font-size: 16px; font-weight: 500; color: #D9D4FF; min-height: 46px; }
.side nav a:hover { background: rgba(255, 255, 255, .09); color: #fff; }
.side nav a.on { background: #fff; color: var(--pri); font-weight: 600; box-shadow: 0 3px 0 rgba(0, 0, 0, .18); }
.shell.r-tutor .side nav a.on, .shell.r-parent .side nav a.on { color: #1F2B52; } .shell.r-partner .side nav a.on { color: #115E59; }
.side nav a .badge { margin-left: auto; background: var(--bad); color: #fff; border-radius: 99px; font-size: 11px; padding: 1px 7px; font-family: var(--body); font-weight: 800; }
.side .sp { flex: 1; }
.lvl { background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .14); border-radius: 16px; padding: 14px; }
.lvl .bar { background: rgba(255, 255, 255, .2); height: 8px; margin-top: 8px; } .lvl .bar > i { background: var(--coin); }
.side .foot-link { display: flex; gap: 8px; align-items: center; color: #BDB6F2; font-size: 13px; padding: 6px 8px; border: 0; background: none; text-align: left; border-radius: 10px; }
.side .foot-link:hover { color: #fff; background: rgba(255, 255, 255, .08); }
.main { min-width: 0; display: flex; flex-direction: column; }
.top { position: sticky; top: 34px; z-index: 20; height: 60px; background: rgba(246, 245, 252, .92); backdrop-filter: blur(10px); display: flex; align-items: center; gap: 8px; padding: 0 24px; border-bottom: 1px solid var(--line); }
.top .logo { display: none; }
.stat-pill { display: inline-flex; align-items: center; gap: 6px; background: #fff; border: 2px solid var(--line); border-radius: 99px; padding: 4px 12px 4px 8px; font-family: var(--head); font-weight: 600; font-size: 15px; min-height: 36px; }
.me { display: inline-flex; align-items: center; gap: 8px; border: 0; background: none; padding: 4px 6px; border-radius: 99px; font-weight: 700; }
.me:hover { background: var(--pri-soft); }
.redot { position: absolute; top: 6px; right: 6px; min-width: 16px; height: 16px; background: var(--bad); color: #fff; border-radius: 99px; font-size: 10px; font-weight: 800; display: grid; place-items: center; border: 2px solid var(--canvas); padding: 0 3px; }
.popwrap { position: relative; }
.pop { position: absolute; right: 0; top: calc(100% + 8px); z-index: 40; width: 290px; background: #fff; border: 2px solid var(--line); border-radius: 16px; box-shadow: 0 16px 40px rgba(28, 24, 56, .18); padding: 8px; }
.pop.left { right: auto; left: 0; }
.pop a, .pop button.item { display: flex; gap: 10px; align-items: center; width: 100%; text-align: left; padding: 10px 12px; border-radius: 10px; border: 0; background: none; font-weight: 600; font-size: 14px; }
.pop a:hover, .pop button.item:hover { background: var(--pri-soft); }
.pop hr { border: 0; border-top: 1px solid var(--line); margin: 6px 0; }
.pop .note { padding: 10px 12px; border-radius: 10px; font-size: 13px; display: flex; gap: 10px; }
.pop .note + .note { border-top: 1px solid var(--line); border-radius: 0; }
.side .pop { color: var(--ink); top: auto; left: 8px; margin-top: 6px; }
.page { padding: 24px; max-width: 1140px; width: 100%; margin: 0 auto; flex: 1; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.tabs { display: none; }
@media (max-width: 899px) {
  .shell { grid-template-columns: 1fr; } .side { display: none; }
  .top { padding: 0 12px; height: 56px; } .top .logo { display: inline-flex; font-size: 19px; } .top .logo .mark { width: 32px; height: 32px; }
  .page { padding: 16px 16px 96px; }
  .tabs { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: #fff; border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
  .tabs a { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; font-weight: 700; color: var(--ink2); padding: 6px 0; border-radius: 12px; min-height: 52px; justify-content: center; }
  .tabs a.on { color: var(--pri); background: var(--pri-soft); }
  .pop { position: fixed; left: 12px; right: 12px; top: 100px; width: auto; }
  h1 { font-size: 25px; }
}

/* ---------- Student home ---------- */
.mission { background: linear-gradient(135deg, #5B4CE6, #7C5CF0 55%, #9B6BF2); color: #fff; border-radius: 24px; padding: 22px; position: relative; overflow: hidden; box-shadow: 0 6px 0 var(--pri-d); }
.mission::before { content: ""; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px; border-radius: 50%; background: rgba(255, 255, 255, .08); }
.mission h2 { font-size: 26px; color: #fff; }
.mission .meta { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0 4px; }
.mission .meta span { background: rgba(255, 255, 255, .16); border-radius: 99px; padding: 3px 11px; font-size: 13px; font-weight: 700; }
.path { width: 100%; height: auto; display: block; margin: 6px 0 2px; }
.path .node text { font-family: var(--head); font-weight: 600; font-size: 15px; text-anchor: middle; dominant-baseline: central; }
.path .cur { animation: pulse 1.4s ease-in-out infinite; transform-origin: center; transform-box: fill-box; }
@keyframes pulse { 50% { transform: scale(1.14); } }
.bubble { background: #fff; color: var(--ink); border-radius: 16px; padding: 10px 14px; font-weight: 600; position: relative; font-size: 14px; border: 2px solid var(--line); }
.bubble::after { content: ""; position: absolute; left: -9px; top: 18px; border: 8px solid transparent; border-right-color: #fff; border-left: 0; }
.tile { --c: var(--pri); --s: var(--pri-soft); display: block; border-radius: var(--r); padding: 16px; background: var(--c); color: #fff; position: relative; overflow: hidden; border: 0; text-align: left; box-shadow: 0 5px 0 color-mix(in srgb, var(--c) 70%, #000); transition: transform .08s; min-height: 118px; width: 100%; }
.tile:hover { transform: translateY(-2px); } .tile:active { transform: translateY(2px); box-shadow: 0 2px 0 color-mix(in srgb, var(--c) 70%, #000); }
.tile::after { content: ""; position: absolute; right: -30px; bottom: -40px; width: 120px; height: 120px; border-radius: 50%; background: rgba(255, 255, 255, .14); }
.tile .tname { font-family: var(--head); font-size: 19px; font-weight: 600; }
.tile .tic { position: absolute; right: 14px; top: 12px; width: 44px; height: 44px; border-radius: 50%; background: rgba(255, 255, 255, .22); display: grid; place-items: center; font-size: 22px; font-family: var(--head); z-index: 1; }
.tile .tsub { font-size: 13px; opacity: .92; }
.tile .bar { background: rgba(255, 255, 255, .28); height: 7px; margin-top: 10px; max-width: 70%; position: relative; z-index: 1; } .tile .bar > i { background: #fff; }
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; text-align: center; }
.week div { font-size: 12px; font-weight: 700; color: var(--ink2); }
.week i { display: grid; place-items: center; height: 38px; border-radius: 12px; background: #F0EEF9; margin-top: 4px; font-style: normal; font-size: 16px; }
.week .done i { background: var(--act-soft); } .week .today i { outline: 2.5px solid var(--act); outline-offset: 1px; background: #fff; }
.journey { display: grid; grid-template-columns: repeat(16, 1fr); gap: 4px; align-items: center; }
.journey i { height: 12px; border-radius: 6px; background: #ECEAF7; display: block; position: relative; }
.journey i.done { background: var(--ok-b); } .journey i.now { background: var(--act); }
.journey i.ms::after { content: "🎁"; position: absolute; left: 50%; top: -22px; transform: translateX(-50%); font-size: 14px; }
.chest { font-size: 46px; line-height: 1; filter: drop-shadow(0 4px 0 rgba(0, 0, 0, .12)); }
.chest.ready { animation: wiggle 1s ease-in-out infinite; cursor: pointer; }
@keyframes wiggle { 0%, 100% { transform: rotate(-4deg); } 50% { transform: rotate(5deg) scale(1.06); } }
.qrow { display: flex; gap: 12px; align-items: flex-start; padding: 13px 0; border-bottom: 1px solid var(--line); }
.qrow:last-child { border-bottom: 0; } .qrow .qt { font-weight: 600; }
.missbar { width: 96px; flex: none; text-align: center; }
.missbar b { font-family: var(--head); font-size: 20px; color: var(--bad-d); display: block; line-height: 1.1; }

/* ---------- Quiz player ---------- */
.play { min-height: calc(100vh - 34px); display: flex; flex-direction: column; background: linear-gradient(#EFEDFF, var(--canvas) 240px); }
.play-top { display: flex; align-items: center; gap: 12px; padding: 14px 20px; max-width: 880px; margin: 0 auto; width: 100%; }
.play-top .segbar { flex: 1; display: flex; gap: 4px; }
.play-top .segbar i { flex: 1; height: 12px; border-radius: 99px; background: #DCD8F3; }
.play-top .segbar i.ok { background: var(--ok-b); } .play-top .segbar i.bad { background: #FCA5A5; } .play-top .segbar i.cur { background: var(--pri); }
.play-body { flex: 1; max-width: 760px; margin: 0 auto; width: 100%; padding: 6px 20px 150px; }
.qcard { background: #fff; border: 2px solid var(--line); border-radius: 22px; padding: 22px; box-shadow: 0 5px 0 var(--line); }
.qtext { font-size: 20px; font-weight: 700; line-height: 1.45; margin: 12px 0 4px; }
.opts { display: grid; gap: 10px; margin-top: 16px; }
.opt { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; background: #fff; border: 2px solid var(--line); border-bottom-width: 4px; border-radius: 16px; padding: 12px 16px; font-size: 16px; font-weight: 600; min-height: 58px; transition: transform .06s, border-color .1s; }
.opt kbd { flex: none; width: 32px; height: 32px; border-radius: 10px; background: #F0EEF9; display: grid; place-items: center; font-family: var(--head); font-size: 15px; color: var(--ink2); }
.opt:hover:not(:disabled) { border-color: #B8B0F5; }
.opt:active:not(:disabled) { transform: translateY(2px); border-bottom-width: 2px; margin-bottom: 2px; }
.opt.sel { border-color: var(--pri); background: var(--pri-soft); } .opt.sel kbd { background: var(--pri); color: #fff; }
.opt.right { border-color: var(--ok-b); background: var(--ok-soft); } .opt.right kbd { background: var(--ok-b); color: #fff; }
.opt.wrong { border-color: var(--bad); background: var(--bad-soft); } .opt.wrong kbd { background: var(--bad); color: #fff; }
.opt:disabled { cursor: default; color: var(--ink); }
.hintbox { background: var(--coin-soft); border: 2px dashed var(--coin); border-radius: 14px; padding: 10px 14px; margin-top: 14px; font-weight: 600; display: flex; gap: 10px; align-items: center; }
.play-foot { position: fixed; left: 0; right: 0; bottom: 0; z-index: 15; background: #fff; border-top: 2px solid var(--line); }
.play-foot .in { max-width: 760px; margin: 0 auto; padding: 14px 20px calc(14px + env(safe-area-inset-bottom)); display: flex; gap: 12px; align-items: center; }
.play-foot.good { background: var(--ok-soft); border-color: #86EFAC; } .play-foot.oops { background: var(--bad-soft); border-color: #FCA5A5; }
.fb { flex: 1; min-width: 0; } .fb h3 { margin: 0 0 2px; font-size: 20px; }
.play-foot.good h3 { color: var(--ok-d); } .play-foot.oops h3 { color: var(--bad-d); }
.fb .ex { font-size: 14px; }
.kbdhint { font-size: 12px; color: var(--ink2); } .kbdhint kbd { background: #F0EEF9; border-radius: 5px; padding: 1px 6px; font-family: var(--body); font-weight: 700; border: 1px solid var(--line); }
.xp-pop { position: fixed; left: 50%; top: 38%; z-index: 60; font-family: var(--head); font-weight: 700; font-size: 30px; color: var(--ok-b); pointer-events: none; animation: floatup .9s ease-out forwards; text-shadow: 0 2px 0 #fff; }
@keyframes floatup { from { opacity: 0; transform: translate(-50%, 10px) scale(.7); } 30% { opacity: 1; transform: translate(-50%, -6px) scale(1.1); } to { opacity: 0; transform: translate(-50%, -60px); } }
.result { max-width: 640px; margin: 0 auto; padding: 24px 20px 60px; text-align: center; }
.ring { position: relative; display: inline-grid; place-items: center; }
.ring svg { transform: rotate(-90deg); } .ring b { position: absolute; font-family: var(--head); font-size: 30px; }
.reward { border-radius: 16px; padding: 12px 8px; border: 2px solid var(--line); background: #fff; animation: popin .5s cubic-bezier(.3, 1.6, .5, 1) both; }
.reward b { font-family: var(--head); font-size: 24px; display: block; line-height: 1.1; }
@keyframes popin { from { transform: scale(.5); opacity: 0; } }
.confetti { position: fixed; top: -12px; width: 10px; height: 14px; z-index: 70; pointer-events: none; border-radius: 2px; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(105vh) rotate(720deg); opacity: .9; } }
@media (max-width: 899px) { .qtext { font-size: 18px; } .play-top { padding: 12px 14px; } .play-body { padding: 4px 14px 170px; } .kbdhint { display: none; } }

/* ---------- Leaderboard ---------- */
.podium { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; align-items: end; max-width: 520px; margin: 4px auto 0; text-align: center; }
.podium .p b { display: block; font-family: var(--head); } .podium .blk { border-radius: 16px 16px 0 0; color: #fff; font-family: var(--head); font-size: 28px; font-weight: 700; display: grid; place-items: center; margin-top: 8px; }
.podium .p1 .blk { height: 104px; background: linear-gradient(#FFD75E, #F5B400); } .podium .p2 .blk { height: 78px; background: linear-gradient(#CBD2E0, #9CA7BD); } .podium .p3 .blk { height: 60px; background: linear-gradient(#F3B98A, #D98A4E); }
.lb-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; }
.lb-row + .lb-row { margin-top: 2px; } .lb-row .rk { width: 28px; text-align: center; font-family: var(--head); color: var(--ink2); }
.lb-row.me-row { background: var(--pri-soft); outline: 2px solid var(--pri); position: sticky; bottom: 76px; z-index: 2; }

/* ---------- Scan ---------- */
.stepper { display: flex; gap: 8px; align-items: center; margin-bottom: 18px; flex-wrap: wrap; }
.stepper .s { display: flex; gap: 8px; align-items: center; font-weight: 700; color: var(--ink2); font-size: 14px; }
.stepper .s i { width: 28px; height: 28px; border-radius: 50%; background: #E3E0F2; display: grid; place-items: center; font-style: normal; font-family: var(--head); color: var(--ink2); }
.stepper .s.on { color: var(--ink); } .stepper .s.on i { background: var(--pri); color: #fff; } .stepper .s.done i { background: var(--ok-b); color: #fff; }
.stepper .ln { width: 34px; height: 3px; background: #E3E0F2; border-radius: 2px; }
.drop { display: block; border: 3px dashed #C9C3EE; border-radius: 22px; padding: 30px 18px; text-align: center; background: #FBFAFF; cursor: pointer; }
.drop:hover { border-color: var(--pri); background: var(--pri-soft); }
.sheet { background: #fff; border: 1px solid #DDD; border-radius: 6px; padding: 18px 16px; font-family: Georgia, "Times New Roman", serif; font-size: 13px; color: #333; position: relative; overflow: hidden; box-shadow: 0 8px 24px rgba(28, 24, 56, .12); }
.sheet .l { display: flex; gap: 8px; align-items: center; height: 30px; border-bottom: 1px dotted #DDD; cursor: default; }
.sheet .l u { flex: 1; height: 7px; background: #EEE; border-radius: 3px; text-decoration: none; }
.sheet .l em { font-family: "Bradley Hand", "Comic Sans MS", cursive; color: #1D4ED8; font-style: normal; width: 64px; }
.sheet .l b { font-size: 20px; width: 22px; text-align: center; }
.sheet .l.hl { background: #FFF8DB; }
.scanline { position: absolute; left: 0; right: 0; height: 4px; background: linear-gradient(90deg, transparent, var(--pri), transparent); animation: scan 1.3s linear infinite; box-shadow: 0 0 14px var(--pri); }
@keyframes scan { from { top: 0; } to { top: 100%; } }
.plist { list-style: none; padding: 0; margin: 0; } .plist li { display: flex; gap: 10px; align-items: center; padding: 8px 0; color: var(--ink2); font-weight: 600; }
.plist li.done { color: var(--ink); } .plist .d { width: 22px; height: 22px; border-radius: 50%; border: 3px solid #D6D2E8; display: grid; place-items: center; font-size: 12px; flex: none; }
.plist li.done .d { background: var(--ok-b); border-color: var(--ok-b); color: #fff; } .plist li.cur .d { border-color: var(--pri); border-top-color: transparent; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.skel { background: linear-gradient(90deg, #ECEAF7 25%, #F6F5FC 50%, #ECEAF7 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 8px; height: 14px; margin: 10px 0; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- Tables / staff ---------- */
.kpi b { font-family: var(--head); font-size: 30px; display: block; line-height: 1.15; font-variant-numeric: tabular-nums; } .kpi > span { font-size: 13px; color: var(--ink2); }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink2); padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl th button { border: 0; background: none; font: inherit; color: inherit; text-transform: inherit; letter-spacing: inherit; padding: 0; display: inline-flex; gap: 4px; }
.tbl td { padding: 10px; border-bottom: 1px solid #F0EEF9; vertical-align: middle; font-variant-numeric: tabular-nums; }
.tbl tr:last-child td { border-bottom: 0; } .tbl tbody tr:hover td { background: #FAF9FF; }
.xscroll { overflow-x: auto; }
.heat td.h { padding: 3px; } .heat td.h button { width: 100%; min-width: 54px; height: 36px; border: 0; border-radius: 8px; font-weight: 700; font-size: 13px; }
.heat td.h button:hover { outline: 2px solid var(--pri); }
.bars { display: flex; align-items: flex-end; gap: 10px; height: 150px; }
.bars .col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; height: 100%; font-size: 12px; color: var(--ink2); }
.bars .col i { width: 100%; max-width: 36px; border-radius: 8px 8px 3px 3px; background: var(--pri); display: block; } .bars .col i.z { background: #E3E0F2; }
.bars .col b { color: var(--ink); font-family: var(--head); }
.al { display: flex; gap: 6px; align-items: flex-end; height: 90px; }
.al div { flex: 1; text-align: center; font-size: 11px; color: var(--ink2); } .al i { display: block; border-radius: 6px 6px 2px 2px; background: #D9D4FF; margin-bottom: 4px; } .al .cur i { background: var(--pri); }
pre.msg { white-space: pre-wrap; background: #ECFDF3; border: 1px solid #BBF7D0; border-radius: 4px 16px 16px 16px; padding: 12px 14px; font: 500 14px/1.6 var(--body); margin: 0; }
.sharecard { background: linear-gradient(150deg, #5B4CE6, #8B6BF5); color: #fff; border-radius: 20px; padding: 20px; position: relative; overflow: hidden; }
.sharecard .qr { background: #fff; border-radius: 10px; padding: 6px; display: inline-block; line-height: 0; }

/* ---------- Modal / toast / widget ---------- */
.overlay { position: fixed; inset: 0; background: rgba(28, 24, 56, .55); z-index: 80; display: grid; place-items: center; padding: 16px; animation: fade .15s; }
@keyframes fade { from { opacity: 0; } }
.modal { background: #fff; border-radius: 24px; padding: 24px; width: 100%; max-width: 460px; max-height: 90vh; overflow: auto; position: relative; animation: popin .25s cubic-bezier(.3, 1.4, .5, 1) both; }
.modal.wide { max-width: 640px; }
.modal .x { position: absolute; right: 12px; top: 12px; }
.toasts { position: fixed; right: 16px; top: 50px; z-index: 90; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.toast { background: var(--ink); color: #fff; padding: 11px 16px; border-radius: 14px; font-weight: 600; font-size: 14px; box-shadow: 0 10px 26px rgba(28, 24, 56, .28); display: flex; gap: 10px; align-items: center; animation: slidein .25s ease-out both; max-width: 340px; }
@keyframes slidein { from { transform: translateX(30px); opacity: 0; } }
@media (max-width: 899px) { .toasts { left: 12px; right: 12px; align-items: stretch; } .toast { max-width: none; } }
.gbtn { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 46px; border: 1.5px solid #DADCE0; border-radius: 10px; background: #fff; font-weight: 700; }
.gbtn:hover { background: #F8F9FA; }
.or { display: flex; align-items: center; gap: 10px; color: var(--ink2); font-size: 12px; margin: 14px 0; } .or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.help-fab { position: fixed; right: 18px; bottom: 18px; z-index: 35; height: 52px; padding: 0 18px 0 8px; border-radius: 99px; border: 0; background: var(--pri); color: #fff; font-family: var(--head); font-size: 15px; font-weight: 600; display: inline-flex; align-items: center; gap: 8px; box-shadow: 0 4px 0 var(--pri-d), 0 12px 26px rgba(58, 44, 168, .3); }
.help-fab .avatar { box-shadow: none; border: 0; background: #fff; overflow: hidden; width: 36px; height: 36px; }
.has-cta .help-fab { bottom: 84px; } .has-tabs .help-fab { bottom: 84px; }
.helpbox { position: fixed; right: 18px; bottom: 82px; z-index: 36; width: min(370px, calc(100vw - 24px)); height: min(540px, calc(100vh - 140px)); background: #fff; border: 2px solid var(--line); border-radius: 22px; box-shadow: 0 24px 60px rgba(28, 24, 56, .25); display: flex; flex-direction: column; overflow: hidden; }
.has-cta .helpbox, .has-tabs .helpbox { bottom: 146px; }
.helpbox header { background: linear-gradient(135deg, var(--pri), #8B6BF5); color: #fff; padding: 14px 16px; display: flex; align-items: center; gap: 10px; }
.helpbox .msgs { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 8px; background: #FBFAFF; }
.helpbox .m { max-width: 86%; padding: 9px 13px; border-radius: 16px; font-size: 14px; }
.helpbox .m.a { background: #fff; border: 1px solid var(--line); align-self: flex-start; border-bottom-left-radius: 4px; }
.helpbox .m.u { background: var(--pri); color: #fff; align-self: flex-end; border-bottom-right-radius: 4px; }
.helpbox .quick { display: flex; gap: 6px; flex-wrap: wrap; padding: 8px 12px; border-top: 1px solid var(--line); }
.helpbox .quick button { border: 1.5px solid var(--pri); color: var(--pri); background: #fff; border-radius: 99px; padding: 4px 11px; font-size: 12.5px; font-weight: 700; }
.helpbox form { display: flex; border-top: 1px solid var(--line); } .helpbox form input { flex: 1; border: 0; padding: 14px; outline: none; min-width: 0; }
.helpbox form button { border: 0; background: none; color: var(--pri); padding: 0 16px; }

/* ---------- Print ---------- */
#print-area { display: none; }
@media print {
  body > *:not(#print-area) { display: none !important; }
  #print-area { display: block; font-family: Georgia, serif; color: #000; padding: 10px; }
  #print-area .pq { margin: 18px 0; page-break-inside: avoid; } #print-area .work { height: 70px; border-bottom: 1px dashed #999; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition: none !important; } }

.coinic { display: inline-block; width: 1.05em; height: 1.05em; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #FFE680, #FFC933 60%, #E6A800); box-shadow: inset 0 0 0 .14em #E6A800, 0 1px 0 #B98500; vertical-align: -.16em; font-style: normal; flex: none; }

/* ---------- Mobile refinements ---------- */
.mdots { display: none; }
@media (max-width: 899px) {
  .path { display: none; }
  .mdots { display: flex; gap: 5px; margin: 14px 0 16px; }
  .mdots i { flex: 1; height: 26px; border-radius: 9px; background: rgba(255, 255, 255, .22); display: grid; place-items: center; font: 600 12px var(--head); color: #fff; font-style: normal; }
  .mdots i.ok { background: #22C55E; } .mdots i.no { background: #FB923C; } .mdots i.cur { background: var(--act); outline: 2px solid #fff; }
  .site-nav .in { gap: 10px; padding: 10px 14px; } .site-nav .seg { flex: none; } .site-nav .logo { font-size: 19px; } .site-nav .logo .mark { width: 32px; height: 32px; }
  .site-nav .btn.sm { padding: 0 12px; }
  .cookie { left: 12px; right: 12px; max-width: none; bottom: 146px; }
  .me .ico { display: none; }
  .play-foot .in { flex-wrap: wrap; gap: 10px; } .play-foot .fb { flex-basis: 100%; } .play-foot .btn.lg { flex: 1; min-height: 50px; }
  .play-body { padding-bottom: 280px; }
  .stat-pill { padding: 3px 9px 3px 6px; font-size: 14px; }
  .mission { padding: 18px; } .mission h2 { font-size: 23px; }
  .lb-row.me-row { bottom: 84px; }
}

/* Grid / stack children may shrink below their content width (prevents horizontal page scroll on phones). */
.grid > *, .stack > * { min-width: 0; }
@media (max-width: 560px) {
  .seg.fill { display: flex; overflow: visible; }
  .seg.fill button { flex: 1 1 0; white-space: normal; padding: 6px 6px; line-height: 1.25; font-size: 13px; }
}
