:root {
  --bg: #f5f6fb; --surface: #ffffff; --surface-2: #eef0f8; --text: #1b1d2a; --muted: #636782; --border: #dfe2ef;
  --primary: #5048e5; --primary-2: #6d66f0; --primary-soft: #e9e8fd; --on-primary: #fff;
  --good: #149a52; --good-soft: #e1f6ea; --bad: #d4343c; --bad-soft: #fde7e8; --warn: #c27407; --warn-soft: #fff2dc;
  --c-grammar: #5048e5; --c-vocab: #0f9d8a; --c-games: #e2552d; --c-listen: #0b84d6; --c-speak: #c2338f; --c-read: #7a4fd6; --c-write: #b7791f; --c-video: #d43030;
  --radius: 14px; --shadow: 0 1px 2px rgba(20,22,40,.06), 0 4px 14px rgba(20,22,40,.06);
  --font: 'Nunito', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #12131c; --surface: #1b1d29; --surface-2: #242737; --text: #eceef8; --muted: #9a9eb8; --border: #2f3246;
  --primary: #8d87ff; --primary-2: #a19cff; --primary-soft: #2a2950; --on-primary: #12131c;
  --good: #3ccf7f; --good-soft: #163626; --bad: #ff6b72; --bad-soft: #3d1c20; --warn: #f2b14b; --warn-soft: #3a2c12;
  --c-grammar: #8d87ff; --c-vocab: #35c9b3; --c-games: #ff7a52; --c-listen: #4fb3ff; --c-speak: #f067bf; --c-read: #a985ff; --c-write: #e3a948; --c-video: #ff6363;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 20px rgba(0,0,0,.25); color-scheme: dark; } }
:root[data-theme="dark"] {
  --bg: #12131c; --surface: #1b1d29; --surface-2: #242737; --text: #eceef8; --muted: #9a9eb8; --border: #2f3246;
  --primary: #8d87ff; --primary-2: #a19cff; --primary-soft: #2a2950; --on-primary: #12131c;
  --good: #3ccf7f; --good-soft: #163626; --bad: #ff6b72; --bad-soft: #3d1c20; --warn: #f2b14b; --warn-soft: #3a2c12;
  --c-grammar: #8d87ff; --c-vocab: #35c9b3; --c-games: #ff7a52; --c-listen: #4fb3ff; --c-speak: #f067bf; --c-read: #a985ff; --c-write: #e3a948; --c-video: #ff6363;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 20px rgba(0,0,0,.25); color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font-family: var(--font); font-size: 16px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
a { color: var(--primary); }
button, input, textarea, select { font: inherit; color: inherit; }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .5em; }
h1 { font-size: 1.7rem; } h2 { font-size: 1.3rem; } h3 { font-size: 1.12rem; margin-top: 1.4em; } h4 { font-size: 1rem; }
p { margin: 0 0 .8em; }
.muted { color: var(--muted); } .small { font-size: .88rem; } .tiny { font-size: .78rem; }
.hidden { display: none !important; }

/* ---------- layout ---------- */
.app { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--surface); border-right: 1px solid var(--border); padding: 18px 12px; display: flex; flex-direction: column; gap: 4px; z-index: 30; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.1rem; padding: 4px 10px 14px; }
.brand .logo { width: 34px; height: 34px; border-radius: 10px; background: linear-gradient(135deg, var(--primary), #e2552d); display: grid; place-items: center; color: #fff; font-size: 1.05rem; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px; color: var(--text); text-decoration: none; font-weight: 600; font-size: .95rem; }
.nav a:hover { background: var(--surface-2); }
.nav a.active { background: var(--primary-soft); color: var(--primary); }
.nav .ico { width: 22px; text-align: center; }
.nav .sep { height: 1px; background: var(--border); margin: 8px 6px; }
.side-stats { margin-top: auto; padding: 12px; border-radius: 12px; background: var(--surface-2); font-size: .85rem; }
.side-stats b { font-size: 1rem; }
.main { min-width: 0; }
.view { max-width: 1040px; margin: 0 auto; padding: 26px 26px 110px; }
.topbar { display: none; }
.bottom-nav { display: none; }

@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; width: 260px; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow); }
  .sidebar.open { transform: none; }
  .topbar { display: flex; align-items: center; gap: 10px; padding: 10px 16px; background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 20; }
  .topbar .brand { padding: 0; font-size: 1rem; white-space: nowrap; }
  #topStats { white-space: nowrap; }
  .view { padding: 18px 16px 120px; }
  .bottom-nav { display: flex; position: fixed; bottom: 0; left: 0; right: 0; background: var(--surface); border-top: 1px solid var(--border); z-index: 25; padding-bottom: env(safe-area-inset-bottom); }
  .bottom-nav a { flex: 1; text-align: center; padding: 8px 2px 9px; font-size: .7rem; color: var(--muted); text-decoration: none; font-weight: 700; }
  .bottom-nav a .ico { display: block; font-size: 1.25rem; line-height: 1.3; }
  .bottom-nav a.active { color: var(--primary); }
}
.scrim { position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 29; }

/* ---------- components ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.card + .card { margin-top: 14px; }
.card.flat { box-shadow: none; }
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(2, minmax(0,1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0,1fr)); } .g4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.gauto { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.g-write { grid-template-columns: 2fr 1fr; }
@media (max-width: 760px) { .g2, .g3, .g4, .g-write { grid-template-columns: 1fr; } .g4.keep { grid-template-columns: repeat(2, 1fr); } }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack > * + * { margin-top: 12px; }
.mt { margin-top: 16px; } .mt2 { margin-top: 26px; } .mb { margin-bottom: 16px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 16px; border-radius: 11px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; font-weight: 700; text-decoration: none; color: var(--text); transition: transform .05s, background .15s; font-size: .95rem; }
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.btn.primary:hover { background: var(--primary-2); }
.btn.good { background: var(--good); border-color: var(--good); color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.sm { padding: 6px 11px; font-size: .85rem; border-radius: 9px; }
.btn.lg { padding: 14px 22px; font-size: 1.05rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.block { width: 100%; }
.icon-btn { border: 0; background: transparent; cursor: pointer; font-size: 1.1rem; padding: 4px 6px; border-radius: 8px; }
.icon-btn:hover { background: var(--surface-2); }

.chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; font-weight: 700; font-size: .9rem; }
.chip.on { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .75rem; font-weight: 800; background: var(--surface-2); color: var(--muted); }
.badge.b1 { background: #e3f4ea; color: #12784a; } .badge.b1p { background: #e6effd; color: #2559b8; } .badge.b2 { background: #f1e8fd; color: #6b35c2; }
:root[data-theme="dark"] .badge.b1, :root[data-theme="dark"] .badge.b1p, :root[data-theme="dark"] .badge.b2 { background: var(--surface-2); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .badge.b1, :root:not([data-theme="light"]) .badge.b1p, :root:not([data-theme="light"]) .badge.b2 { background: var(--surface-2); } }
.badge.good { background: var(--good-soft); color: var(--good); } .badge.warn { background: var(--warn-soft); color: var(--warn); } .badge.pri { background: var(--primary-soft); color: var(--primary); }

.input, textarea.input, select.input { width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); outline: none; }
.input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
textarea.input { min-height: 220px; resize: vertical; line-height: 1.6; }
label.lbl { font-weight: 700; font-size: .9rem; display: block; margin-bottom: 4px; }

.progress { height: 9px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--primary); border-radius: 99px; transition: width .3s; }
.progress.good > i { background: var(--good); }

.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--border); margin: 16px 0; overflow-x: auto; }
.tabs button { border: 0; background: transparent; padding: 10px 14px; font-weight: 800; color: var(--muted); cursor: pointer; border-bottom: 3px solid transparent; white-space: nowrap; }
.tabs button.on { color: var(--primary); border-bottom-color: var(--primary); }

.page-head { margin-bottom: 18px; }
.page-head .kicker { font-size: .8rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.page-head p { color: var(--muted); margin: 4px 0 0; }
.back { display: inline-flex; gap: 6px; align-items: center; color: var(--muted); text-decoration: none; font-weight: 700; font-size: .9rem; margin-bottom: 10px; }

/* tiles */
.tile { display: block; text-decoration: none; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); transition: transform .12s, border-color .12s; position: relative; cursor: pointer; }
.tile:hover { transform: translateY(-2px); border-color: var(--primary); }
.tile .t-ico { font-size: 1.7rem; line-height: 1; margin-bottom: 8px; display: block; }
.tile h3, .tile h4 { margin: 0 0 4px; }
.tile p { margin: 0; color: var(--muted); font-size: .9rem; }
.tile .corner { position: absolute; top: 12px; right: 12px; }
.tile.accent { border-left: 5px solid var(--accent, var(--primary)); }

/* hero */
.hero { background: linear-gradient(135deg, var(--primary), #7b4fe0 60%, #e2552d); color: #fff; border-radius: 20px; padding: 24px; box-shadow: var(--shadow); }
.hero h1 { margin: 0 0 4px; }
.hero p { opacity: .92; margin: 0; }
.hero .chip { background: rgba(255,255,255,.16); border-color: rgba(255,255,255,.35); color: #fff; }
.hero .chip:hover { background: rgba(255,255,255,.3); }
.hero .chip.on { background: #fff; color: var(--primary); }
.hero select { background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.35); color: #fff; border-radius: 10px; padding: 8px 10px; font-weight: 700; }
.hero select option { color: #111; }
.stat { text-align: center; }
.stat .v { font-size: 1.6rem; font-weight: 900; line-height: 1.1; }
.stat .l { font-size: .8rem; color: var(--muted); font-weight: 700; }

/* lesson content */
.lesson h3 { color: var(--c-grammar); }
.lesson ul { padding-left: 1.2em; margin: 0 0 .8em; }
.lesson li { margin: .3em 0; }
.tbl { overflow-x: auto; margin: .6em 0 1em; }
table { border-collapse: collapse; width: 100%; font-size: .94rem; }
th, td { border: 1px solid var(--border); padding: 8px 10px; text-align: left; vertical-align: top; }
th { background: var(--surface-2); font-weight: 800; }
.en { color: var(--primary); font-weight: 700; cursor: pointer; border-bottom: 1px dashed transparent; }
.en:hover { border-bottom-color: var(--primary); }
.note { border-radius: 12px; padding: 12px 14px; margin: .8em 0; font-size: .95rem; }
.note.tip { background: var(--primary-soft); }
.note.warn { background: var(--warn-soft); }
.ex-list { list-style: none; padding: 0; margin: 0; }
.ex-list li { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--border); }
.ex-list li:last-child { border-bottom: 0; }
.ex-list .pt { color: var(--muted); font-size: .9rem; }
.mistake { display: grid; gap: 2px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); margin-bottom: 8px; }
.mistake .w { color: var(--bad); text-decoration: line-through; }
.mistake .r { color: var(--good); font-weight: 700; }

/* exercises & games */
.q-box { max-width: 720px; margin: 0 auto; }
.q-text { font-size: 1.25rem; font-weight: 800; margin: 10px 0 18px; }
.opts { display: grid; gap: 10px; }
.opt { text-align: left; padding: 13px 16px; border-radius: 12px; border: 2px solid var(--border); background: var(--surface); cursor: pointer; font-weight: 700; font-size: 1rem; }
.opt:hover:not(:disabled) { border-color: var(--primary); }
.opt.right { border-color: var(--good); background: var(--good-soft); }
.opt.wrong { border-color: var(--bad); background: var(--bad-soft); }
.feedback { margin-top: 14px; padding: 12px 14px; border-radius: 12px; font-weight: 600; }
.feedback.ok { background: var(--good-soft); color: var(--good); }
.feedback.no { background: var(--bad-soft); color: var(--bad); }
.feedback .exp { color: var(--text); font-weight: 500; margin-top: 4px; }
.gap-input { display: inline-block; min-width: 140px; width: auto; padding: 6px 10px; border: 0; border-bottom: 3px solid var(--primary); background: var(--primary-soft); border-radius: 8px 8px 0 0; font-weight: 800; font-size: 1.1rem; outline: none; }
.tokens { display: flex; flex-wrap: wrap; gap: 8px; min-height: 52px; padding: 10px; border-radius: 12px; border: 2px dashed var(--border); }
.tokens.answer { background: var(--surface-2); border-style: solid; }
.token { padding: 8px 13px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); cursor: pointer; font-weight: 700; user-select: none; }
.token:hover { border-color: var(--primary); }
.token.used { visibility: hidden; }
.qhead { display: flex; align-items: center; gap: 12px; }
.qhead .progress { flex: 1; }
.big-score { font-size: 3rem; font-weight: 900; text-align: center; line-height: 1; }
.shake { animation: shake .35s; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.pop { animation: pop .3s; }
@keyframes pop { 50% { transform: scale(1.06); } }

.match-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.match-item { padding: 12px; border-radius: 12px; border: 2px solid var(--border); background: var(--surface); cursor: pointer; font-weight: 700; min-height: 54px; display: flex; align-items: center; }
.match-item.sel { border-color: var(--primary); background: var(--primary-soft); }
.match-item.done { opacity: .25; pointer-events: none; border-color: var(--good); }
.match-item.bad { border-color: var(--bad); background: var(--bad-soft); }
.timer { font-variant-numeric: tabular-nums; font-weight: 900; font-size: 1.3rem; }
.word-diff span { padding: 1px 3px; border-radius: 5px; margin-right: 2px; }
.word-diff .ok { background: var(--good-soft); color: var(--good); }
.word-diff .miss { background: var(--bad-soft); color: var(--bad); text-decoration: underline; }
.word-diff .extra { color: var(--muted); text-decoration: line-through; }
.err-sentence { display: flex; flex-wrap: wrap; gap: 6px; font-size: 1.3rem; font-weight: 800; }
.err-sentence span { padding: 4px 8px; border-radius: 8px; cursor: pointer; border: 2px solid transparent; }
.err-sentence span:hover { border-color: var(--primary); }
.err-sentence span.right { background: var(--good-soft); border-color: var(--good); }
.err-sentence span.wrong { background: var(--bad-soft); border-color: var(--bad); }

/* flashcard */
.flash { perspective: 1000px; max-width: 560px; margin: 0 auto; }
.flash-card { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; box-shadow: var(--shadow); padding: 34px 24px; text-align: center; min-height: 250px; display: flex; flex-direction: column; justify-content: center; gap: 10px; }
.flash-card .word { font-size: 2rem; font-weight: 900; }
.flash-card .trans { font-size: 1.25rem; font-weight: 800; color: var(--c-vocab); }
.flash-card .exs { color: var(--muted); }
.grades { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; max-width: 560px; margin: 14px auto 0; }
.grades .btn { flex-direction: column; gap: 0; padding: 10px 6px; }
.grades .btn small { font-weight: 600; opacity: .75; font-size: .75rem; }
.g-again { border-color: var(--bad) !important; color: var(--bad) !important; }
.g-hard { border-color: var(--warn) !important; color: var(--warn) !important; }
.g-good { border-color: var(--good) !important; color: var(--good) !important; }
.g-easy { border-color: var(--primary) !important; color: var(--primary) !important; }

/* reading */
.reading p { font-size: 1.08rem; line-height: 1.8; }
.gloss { background: var(--warn-soft); border-radius: 5px; padding: 0 3px; cursor: help; border-bottom: 2px solid var(--warn); }
.para { position: relative; padding-right: 36px; }
.para .icon-btn { position: absolute; right: 0; top: 0; }
.popover { position: fixed; z-index: 80; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); padding: 10px 12px; max-width: 280px; font-size: .92rem; }

/* video */
.vcard { cursor: pointer; overflow: hidden; padding: 0; }
.vcard .thumb { position: relative; aspect-ratio: 16/9; background: #000 center/cover no-repeat; }
.vcard .thumb .dur { position: absolute; right: 8px; bottom: 8px; background: rgba(0,0,0,.75); color: #fff; font-size: .75rem; font-weight: 800; padding: 2px 6px; border-radius: 6px; }
.vcard .thumb .seen { position: absolute; left: 8px; top: 8px; background: var(--good); color: #fff; font-size: .75rem; font-weight: 800; padding: 2px 8px; border-radius: 6px; }
.vcard .thumb .lang { position: absolute; left: 8px; bottom: 8px; background: rgba(0,0,0,.7); color: #fff; font-size: .72rem; font-weight: 800; padding: 2px 6px; border-radius: 6px; }
.vcard .meta { padding: 10px 12px 12px; }
.vcard .meta b { display: block; font-size: .95rem; line-height: 1.3; }
.vcard .meta span { font-size: .8rem; color: var(--muted); }
.modal-bg { position: fixed; inset: 0; background: rgba(8,9,16,.7); z-index: 90; display: grid; place-items: center; padding: 16px; }
.modal { background: var(--surface); border-radius: 18px; width: min(920px, 100%); max-height: 92vh; overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,.4); }
.modal .mhead { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.modal .mbody { padding: 16px; }
.yt { position: relative; aspect-ratio: 16/9; background: #000; border-radius: 12px; overflow: hidden; }
.yt iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* session bar */
#sessionBar { position: sticky; top: 0; z-index: 22; }
.session-bar { background: var(--surface); border-bottom: 2px solid var(--primary); box-shadow: var(--shadow); }
.session-bar .inner { max-width: 1040px; margin: 0 auto; padding: 10px 26px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.session-bar .title { font-weight: 800; flex: 1; min-width: 180px; }
.session-bar .title small { display: block; color: var(--muted); font-weight: 700; font-size: .78rem; }
.session-bar .btn.pulse { animation: pulse 1.2s infinite; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(20,154,82,.5); } 50% { box-shadow: 0 0 0 8px rgba(20,154,82,0); } }
@media (max-width: 900px) { #sessionBar { top: 53px; } .session-bar .inner { padding: 8px 16px; } }
.plan-list { list-style: none; padding: 0; margin: 0; }
.plan-list li { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 12px; border: 1px solid var(--border); margin-bottom: 8px; background: var(--surface); }
.plan-list li.cur { border-color: var(--primary); background: var(--primary-soft); }
.plan-list li.done { opacity: .6; }
.plan-list .pi { font-size: 1.3rem; width: 30px; text-align: center; }
.plan-list .pm { margin-left: auto; font-weight: 800; color: var(--muted); font-size: .85rem; white-space: nowrap; }

/* units */
.unit-row { display: flex; gap: 14px; align-items: center; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); text-decoration: none; color: var(--text); margin-bottom: 10px; box-shadow: var(--shadow); }
.unit-row:hover { border-color: var(--primary); }
.unit-row .num { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-weight: 900; background: var(--surface-2); flex-shrink: 0; }
.unit-row.done .num { background: var(--good); color: #fff; }
.unit-row.started .num { background: var(--primary-soft); color: var(--primary); }
.unit-row .info { flex: 1; min-width: 0; }
.unit-row .info b { display: block; }
.unit-row .info span { color: var(--muted); font-size: .88rem; }

/* toasts */
.toasts { position: fixed; right: 18px; bottom: 18px; z-index: 100; display: grid; gap: 8px; }
.toast { background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 12px; font-weight: 800; box-shadow: var(--shadow); animation: toast-in .25s; }
.toast.xp { background: var(--good); color: #fff; }
@keyframes toast-in { from { transform: translateY(10px); opacity: 0; } }
@media (max-width: 900px) { .toasts { bottom: 76px; right: 12px; left: 12px; } }

.banner { background: var(--warn-soft); color: var(--text); border: 1px solid var(--warn); border-radius: 12px; padding: 10px 14px; font-size: .9rem; margin-bottom: 16px; }
.bars { display: flex; align-items: flex-end; gap: 6px; height: 140px; padding-top: 10px; }
.bars .bar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; justify-content: flex-end; }
.bars .bar .stk { width: 100%; max-width: 34px; display: flex; flex-direction: column; border-radius: 6px 6px 2px 2px; overflow: hidden; min-height: 2px; background: var(--surface-2); }
.bars .bar .stk i { display: block; width: 100%; background: var(--primary); }
.bars .bar .stk i.ext { background: var(--c-games); }
.bars .bar.today .stk { outline: 2px solid var(--primary); outline-offset: 1px; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: var(--primary); margin-right: 4px; vertical-align: -1px; }
.dot.ext { background: var(--c-games); }
.bars .bar span { font-size: .7rem; color: var(--muted); font-weight: 700; }
.bars .bar em { font-size: .7rem; font-style: normal; font-weight: 800; color: var(--muted); }
.ach { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--border); }
.ach .ai { font-size: 1.6rem; filter: grayscale(1); opacity: .35; }
.ach.on .ai { filter: none; opacity: 1; }
.ach.on { border-color: var(--good); background: var(--good-soft); }
.mic-on { background: var(--bad) !important; border-color: var(--bad) !important; color: #fff !important; animation: pulse-red 1.2s infinite; }
@keyframes pulse-red { 0%,100% { box-shadow: 0 0 0 0 rgba(212,52,60,.5); } 50% { box-shadow: 0 0 0 8px rgba(212,52,60,0); } }
.transcript { min-height: 80px; padding: 12px; border-radius: 12px; background: var(--surface-2); font-size: 1.05rem; }
.copybox { white-space: pre-wrap; font-family: ui-monospace, Consolas, monospace; font-size: .85rem; background: var(--surface-2); border-radius: 12px; padding: 12px; max-height: 260px; overflow-y: auto; }
.kbd { display: inline-block; padding: 1px 6px; border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 6px; font-size: .8rem; font-weight: 800; background: var(--surface); }

/* ---------- plataforma: entrada, níveis, conta ---------- */
.splash { padding: 60px 20px; text-align: center; color: var(--muted); font-weight: 700; }
body.locked .sidebar, body.locked .bottom-nav, body.locked #sessionBar, body.locked #topStats, body.locked #menuBtn { display: none !important; }
body.locked .app { grid-template-columns: 1fr; }
.auth-wrap { min-height: 80vh; display: grid; place-items: center; }
.auth-card { width: min(440px, 100%); padding: 26px; }
.or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .85rem; margin: 14px 0; }
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.lvl-pill { display: block; margin: 0 6px 10px; padding: 9px 12px; border-radius: 12px; background: var(--primary-soft); color: var(--text); text-decoration: none; font-size: .88rem; font-weight: 700; }
.lvl-pill:hover { outline: 2px solid var(--primary); }
.user-line { display: block; margin: 8px 6px 0; padding: 8px 12px; border-radius: 10px; color: var(--text); text-decoration: none; font-size: .88rem; font-weight: 700; }
.user-line:hover { background: var(--surface-2); }
.level-card.cur { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-soft), var(--shadow); }
.level-card.soon { opacity: .7; }
.badge.a1 { background: #fff1e0; color: #b35c00; } .badge.a2 { background: #fdf6d8; color: #8a6d00; }
:root[data-theme="dark"] .badge.a1, :root[data-theme="dark"] .badge.a2 { background: var(--surface-2); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .badge.a1, :root:not([data-theme="light"]) .badge.a2 { background: var(--surface-2); } }

/* Aparelhos de toque: sem efeito de "hover" preso depois do toque */
@media (hover: none) { .tile:hover { transform: none; } }
@media (hover: none) and (pointer: coarse) { .kbd-hint, .btn .kbd { display: none; } }

/* Política de Privacidade e Termos de Uso */
.tabs a { padding: 10px 14px; font-weight: 800; color: var(--muted); text-decoration: none; border-bottom: 3px solid transparent; white-space: nowrap; }
.tabs a.on { color: var(--primary); border-bottom-color: var(--primary); }
.legal { line-height: 1.65; }
.legal h3 { margin: 22px 0 6px; }
.legal h3:first-of-type { margin-top: 14px; }
.legal li { margin: 4px 0; }
.legal-todo { background: #fde68a; color: #7c2d12; padding: 0 4px; border-radius: 4px; font-weight: 800; }
.legal-links { text-align: center; margin: 10px 0 0; }
.legal-links a { color: var(--muted); }
.check-line { display: flex; gap: 8px; align-items: flex-start; font-size: .88rem; cursor: pointer; }
.check-line input { margin-top: 3px; width: 18px; height: 18px; flex-shrink: 0; }

/* Sobre e apoio */
.about-warn { border-left: 5px solid var(--warn); }
.about-pix { border-left: 5px solid var(--good); }
.pix-box { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; margin: 8px 0 10px; }
.pix-box img { width: 200px; height: 200px; background: #fff; padding: 6px; border-radius: 12px; border: 1px solid var(--border); image-rendering: pixelated; flex-shrink: 0; }
.pix-box .stack { flex: 1; min-width: 220px; gap: 10px; }
@media (max-width: 520px) { .pix-box { justify-content: center; } .pix-box img { width: 180px; height: 180px; } }
