/* Skipper — C2 vocabulary trainer. Visual language: Apple product pages. */
:root {
  --bg: #ffffff;
  --bg2: #f5f5f7;
  --ink: #1d1d1f;
  --ink2: #6e6e73;
  --ink3: #86868b;
  --line: #d2d2d7;
  --card: #ffffff;
  --blue: #0071e3;
  --blue-h: #0077ed;
  --link: #0066cc;
  --navbg: rgba(255, 255, 255, .72);
  --mature: #30d158;
  --young: #0a84ff;
  --learn: #ff9f0a;
  --new: #d2d2d7;
  --red: #e30000;
  --red-bg: #fff2f2;
  --ok: #1d8f3a;
  --no: #d70015;
  --grad: linear-gradient(90deg, #5e5cE6 0%, #0a84ff 50%, #3fb8ef 100%);
  --shadow: 0 2px 12px rgba(0, 0, 0, .06), 0 12px 40px rgba(0, 0, 0, .06);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Inter", "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #000000; --bg2: #161617; --ink: #f5f5f7; --ink2: #a1a1a6; --ink3: #86868b; --line: #424245; --card: #1d1d1f;
    --link: #2997ff; --navbg: rgba(22, 22, 23, .72); --new: #424245; --red-bg: #2a0d0d; --ok: #30d158; --no: #ff453a;
    --shadow: 0 2px 12px rgba(0, 0, 0, .4); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #000000; --bg2: #161617; --ink: #f5f5f7; --ink2: #a1a1a6; --ink3: #86868b; --line: #424245; --card: #1d1d1f;
  --link: #2997ff; --navbg: rgba(22, 22, 23, .72); --new: #424245; --red-bg: #2a0d0d; --ok: #30d158; --no: #ff453a;
  --shadow: 0 2px 12px rgba(0, 0, 0, .4); color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 17px; line-height: 1.47; letter-spacing: -.022em; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
a { color: var(--link); text-decoration: none; }
@media (hover: hover) { a:hover { text-decoration: underline; } }
:focus-visible { outline: 3px solid rgba(0, 113, 227, .55); outline-offset: 2px; border-radius: 8px; }
.hidden { display: none !important; }
.muted { color: var(--ink2); }
.small { font-size: 14px; letter-spacing: -.01em; }
.center { text-align: center; }
.grow { flex: 1; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.container { max-width: 1024px; margin: 0 auto; padding: 0 22px; }
.narrow { max-width: 760px; margin: 0 auto; padding: 0 22px; }

/* ---------- global nav ---------- */
.nav { position: sticky; top: 0; z-index: 40; background: var(--navbg); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); border-bottom: 1px solid rgba(0, 0, 0, .08); }
.nav-in { max-width: 1024px; margin: 0 auto; padding: 0 22px; height: 48px; display: flex; align-items: center; gap: 28px; font-size: 13px; letter-spacing: -.01em; }
.brand { font-weight: 600; font-size: 17px; letter-spacing: -.02em; cursor: pointer; display: flex; align-items: center; gap: 8px; }
.brand-mark { width: 22px; height: 22px; border-radius: 6px; background: var(--grad); display: grid; place-items: center; color: #fff; font-size: 12px; font-weight: 700; }
.nav-links { display: flex; gap: 26px; flex: 1; justify-content: center; }
.nav-links a { color: var(--ink); opacity: .8; cursor: pointer; }
@media (hover: hover) { .nav-links a:hover { opacity: 1; text-decoration: none; } }
.nav-links a.on { opacity: 1; font-weight: 600; }
.avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--grad); color: #fff; display: grid; place-items: center; font-weight: 600; font-size: 13px; cursor: pointer; border: 0; }
/* ---------- local sub-nav (product page style) ---------- */
.subnav { position: sticky; top: 48px; z-index: 30; background: var(--navbg); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); border-bottom: 1px solid rgba(0, 0, 0, .08); }
.subnav-in { max-width: 1024px; margin: 0 auto; padding: 0 22px; height: 52px; display: flex; align-items: center; gap: 16px; }
.subnav-title { font-size: 21px; font-weight: 600; letter-spacing: -.02em; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.subnav a { font-size: 12px; color: var(--ink); opacity: .8; cursor: pointer; }

/* ---------- type ---------- */
h1, h2, h3 { margin: 0; letter-spacing: -.03em; }
.hero { text-align: center; padding: 88px 22px 56px; }
.eyebrow-link { font-size: 17px; color: var(--link); cursor: pointer; }
.hero-title { font-size: clamp(48px, 8.5vw, 96px); line-height: 1.04; font-weight: 700; letter-spacing: -.035em; }
.hero-title .w { display: inline-block; opacity: 0; transform: translateY(.35em); filter: blur(10px); animation: rise .9s cubic-bezier(.2, .8, .2, 1) forwards; }
@keyframes rise { to { opacity: 1; transform: none; filter: none; } }
.grad-text, .grad-text .w { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.grad-text { background-size: 100% 100%; }
.grad-text .w { padding-bottom: .08em; }
.hero-sub { font-size: clamp(21px, 2.6vw, 28px); line-height: 1.18; font-weight: 600; color: var(--ink2); margin: 18px auto 0; max-width: 760px; letter-spacing: -.02em; }
.hero-cta { margin-top: 34px; display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.h2 { font-size: clamp(32px, 5vw, 56px); line-height: 1.07; font-weight: 700; }
.h3 { font-size: clamp(24px, 3vw, 32px); line-height: 1.12; font-weight: 700; }
.lead { font-size: 21px; line-height: 1.38; color: var(--ink2); max-width: 680px; }

.section { padding: 72px 0; }
.section.gray { background: var(--bg2); }
.section.dark { background: #000; color: #f5f5f7; --ink2: #a1a1a6; --card: #1d1d1f; --bg2: #161617; --line: #424245; --link: #2997ff; }
.section-head { margin-bottom: 34px; }
.section-head p { margin: 10px 0 0; }

/* ---------- scroll reveal (the one signature motion) ---------- */
.reveal { opacity: 0; transform: translateY(40px) scale(.985); transition: opacity 1s cubic-bezier(.2, .8, .2, 1), transform 1s cubic-bezier(.2, .8, .2, 1); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal, .hero-title .w { opacity: 1 !important; transform: none !important; filter: none !important; transition: none !important; animation: none !important; }
}

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 980px; background: var(--blue); color: #fff; padding: 11px 22px; font-size: 17px; cursor: pointer; transition: background .2s, transform .15s; white-space: nowrap; }
@media (hover: hover) { .btn:hover { background: var(--blue-h); } }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .35; cursor: default; transform: none; }
.btn.lg { padding: 14px 28px; font-size: 18px; }
.btn.sm { padding: 7px 15px; font-size: 14px; }
.btn.ghost { background: transparent; color: var(--link); box-shadow: inset 0 0 0 1px var(--link); }
@media (hover: hover) { .btn.ghost:hover { background: rgba(0, 113, 227, .07); } }
.btn.plain { background: var(--bg2); color: var(--ink); }
@media (hover: hover) { .btn.plain:hover { background: var(--line); } }
.btn.danger { background: var(--red); color: #fff; }
@media (hover: hover) { .btn.danger:hover { background: #c40000; } }
.textlink { background: none; border: 0; color: var(--link); cursor: pointer; padding: 0; font-size: inherit; }
@media (hover: hover) { .textlink:hover { text-decoration: underline; } }
.xbtn { width: 36px; height: 36px; border-radius: 50%; border: 0; background: rgba(120, 120, 128, .2); color: inherit; font-size: 15px; cursor: pointer; display: grid; place-items: center; flex: none; }
@media (hover: hover) { .xbtn:hover { background: rgba(120, 120, 128, .32); } }

/* segmented control */
.seg { display: inline-flex; background: rgba(118, 118, 128, .12); border-radius: 10px; padding: 2px; gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; padding: 7px 16px; border-radius: 8px; cursor: pointer; font-size: 15px; color: var(--ink); }
.seg button.on { background: var(--card); box-shadow: 0 1px 4px rgba(0, 0, 0, .14); font-weight: 600; }
.section.dark .seg button { color: #f5f5f7; }

/* inputs */
input[type=text], input[type=email], input[type=search], input[type=password], select, textarea { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; font-size: 17px; outline: none; max-width: 100%; }
input:focus, select:focus, textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(0, 113, 227, .15); }
textarea { width: 100%; min-height: 80px; resize: vertical; }
label.fl { display: block; font-size: 14px; color: var(--ink2); margin: 16px 0 6px; }
.search-big { width: 100%; max-width: 680px; font-size: 19px; padding: 15px 22px; border-radius: 14px; background: var(--bg2); border-color: transparent; }

/* ---------- cards & tiles ---------- */
.card { background: var(--card); border-radius: 22px; padding: 28px; box-shadow: var(--shadow); }
.section.gray .card { box-shadow: none; }
.tilegrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; }
.unit-tile { text-align: left; border: 0; background: var(--card); border-radius: 22px; padding: 24px; cursor: pointer; display: flex; flex-direction: column; gap: 10px; min-height: 200px; transition: transform .35s cubic-bezier(.2, .8, .2, 1), box-shadow .35s; box-shadow: 0 1px 2px rgba(0, 0, 0, .04); }
.section:not(.gray) .unit-tile { background: var(--bg2); }
@media (hover: hover) { .unit-tile:hover { transform: translateY(-4px); box-shadow: var(--shadow); } }
.unit-tile .num { font-size: 40px; font-weight: 700; letter-spacing: -.04em; line-height: 1; }
.unit-tile .ttl { font-size: 17px; font-weight: 600; line-height: 1.25; flex: 1; }
.unit-tile .foot { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--ink2); }
.ring { width: 34px; height: 34px; flex: none; }
.ring circle { fill: none; stroke-width: 4; }
.ring .bgc { stroke: var(--new); }
.ring .fgc { stroke: var(--mature); stroke-linecap: round; transform: rotate(-90deg); transform-origin: 50% 50%; transition: stroke-dashoffset .8s; }
.carousel { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(260px, 300px); gap: 18px; overflow-x: auto; padding: 4px 22px 24px; scroll-snap-type: x mandatory; max-width: 1024px; margin: 0 auto; }
.carousel > * { scroll-snap-align: start; }
.partlabel { font-size: 28px; font-weight: 700; letter-spacing: -.025em; margin: 56px 0 18px; }
.partlabel small { display: block; font-size: 17px; font-weight: 400; color: var(--ink2); letter-spacing: -.02em; margin-top: 4px; }

/* figures */
.figures { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 28px; text-align: left; }
.fig b { display: block; font-size: clamp(40px, 6vw, 64px); font-weight: 700; letter-spacing: -.04em; line-height: 1.02; }
.fig span { color: var(--ink2); font-size: 17px; }

/* bars */
.bar { height: 8px; border-radius: 8px; background: var(--new); overflow: hidden; display: flex; }
.bar i { display: block; height: 100%; transition: width .6s; }
.legend { display: flex; flex-wrap: wrap; gap: 18px; font-size: 14px; color: var(--ink2); margin-top: 12px; }
.legend span::before { content: ''; display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--c); margin-right: 7px; }
.heat { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 20px); grid-auto-columns: 20px; justify-content: start; gap: 3px; margin-top: 10px; overflow-x: auto; }
.heat i { width: 20px; height: 20px; border-radius: 4px; background: var(--new); }
.heat i.l1 { background: #9be9a8; } .heat i.l2 { background: #40c463; } .heat i.l3 { background: #216e39; }

/* pills / badges */
.pill { display: inline-block; font-size: 12px; padding: 4px 11px; border-radius: 980px; background: var(--bg2); color: var(--ink2); }
.tone { display: inline-block; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 980px; letter-spacing: 0; }
.tone.Formal { background: rgba(94, 92, 230, .14); color: #5e5ce6; }
.tone.Informal { background: rgba(255, 149, 0, .16); color: #c25e00; }
.tone.Neutral { background: rgba(120, 120, 128, .14); color: var(--ink2); }

/* pronunciation */
.prons { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.pron { display: inline-flex; align-items: center; gap: 7px; border: 0; border-radius: 980px; background: var(--bg2); padding: 5px 12px 5px 6px; cursor: pointer; font-size: 13px; color: var(--ink); }
@media (hover: hover) { .pron:hover { background: var(--line); } }
.pron .pi { width: 20px; height: 20px; border-radius: 50%; background: var(--blue); color: #fff; display: grid; place-items: center; }
.pron .pi svg { width: 9px; height: 9px; margin-left: 1px; }
.pron b { font-weight: 600; }
.pron .ipa { color: var(--ink2); font-family: "Lucida Sans Unicode", "Arial Unicode MS", var(--font); }
.pron.playing .pi { animation: pulse .8s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.18); } }

/* ---------- word card ---------- */
.wc-head { font-size: clamp(28px, 4vw, 40px); font-weight: 700; letter-spacing: -.03em; line-height: 1.1; }
.wc-meta { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 12px 0 0; }
.wc-meaning { font-size: 21px; line-height: 1.4; margin: 18px 0 8px; letter-spacing: -.02em; }
.wc-ex { margin: 14px 0 0; padding: 0; list-style: none; }
.wc-ex li { padding: 10px 0 10px 16px; border-left: 3px solid var(--line); margin: 8px 0; color: var(--ink); font-size: 17px; }
.wc-ex li.cam { border-left-color: rgba(0, 113, 227, .45); }
.wc-ex .src { display: block; font-size: 12px; color: var(--ink3); margin-top: 3px; }
mark { background: rgba(255, 214, 10, .38); color: inherit; border-radius: 4px; padding: 0 2px; }
.camlink { font-size: 14px; }

/* ---------- unit table (kept: Igor likes it) ---------- */
.tablewrap { overflow-x: auto; }
table.words { width: 100%; border-collapse: collapse; font-size: 15px; letter-spacing: -.01em; }
table.words th { text-align: left; font-weight: 600; color: var(--ink2); font-size: 13px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
table.words td { padding: 16px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.words td.w { min-width: 190px; }
table.words td.w .hw { font-weight: 600; font-size: 17px; display: block; margin-bottom: 8px; }
table.words td.w .prons { margin-bottom: 8px; }
table.words td.ex div { margin-bottom: 6px; color: var(--ink2); font-style: italic; }
table.words td.ex div.cam { color: var(--ink2); }
table.words tr.state-mature td.w .hw::after, table.words tr.state-young td.w .hw::after, table.words tr.state-learn td.w .hw::after { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-left: 8px; vertical-align: middle; }
table.words tr.state-mature td.w .hw::after { background: var(--mature); }
table.words tr.state-young td.w .hw::after { background: var(--young); }
table.words tr.state-learn td.w .hw::after { background: var(--learn); }
.icon { border: 0; background: none; cursor: pointer; color: var(--ink3); font-size: 15px; padding: 4px 6px; border-radius: 8px; }
@media (hover: hover) { .icon:hover { background: var(--bg2); color: var(--ink); } }
.blurred { filter: blur(7px); cursor: pointer; transition: filter .3s; }

/* ---------- session / questions ---------- */
.session-top { position: sticky; top: 0; z-index: 30; background: var(--navbg); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); }
.session-top-in { max-width: 820px; margin: 0 auto; padding: 12px 22px; display: flex; gap: 16px; align-items: center; }
.session-top .bar { flex: 1; height: 6px; }
.session-top .bar i { background: var(--blue); }
.stage { max-width: 820px; margin: 0 auto; padding: 34px 22px 80px; }
.q-card { background: var(--card); border-radius: 26px; padding: 34px; box-shadow: var(--shadow); animation: cardin .45s cubic-bezier(.2, .8, .2, 1); }
@keyframes cardin { from { opacity: 0; transform: translateY(14px); } }
.fmt { font-size: 14px; color: var(--ink2); margin-bottom: 14px; }
.prompt { font-size: clamp(22px, 3vw, 28px); line-height: 1.3; font-weight: 600; letter-spacing: -.025em; margin-bottom: 22px; }
.prompt.head { font-size: clamp(30px, 4.5vw, 44px); font-weight: 700; }
.opts { display: grid; gap: 10px; }
.opt { display: flex; gap: 14px; align-items: flex-start; text-align: left; border: 1px solid var(--line); background: var(--card); border-radius: 16px; padding: 15px 18px; cursor: pointer; font-size: 17px; transition: border-color .2s, background .2s, transform .12s; }
@media (hover: hover) { .opt:hover:not(:disabled) { border-color: var(--blue); } }
.opt:active:not(:disabled) { transform: scale(.99); }
.opt kbd { font-family: var(--font); font-size: 12px; color: var(--ink3); border: 1px solid var(--line); border-radius: 6px; padding: 1px 7px; margin-top: 2px; }
.opt.right { border-color: var(--ok); background: rgba(48, 209, 88, .12); }
.opt.wrong { border-color: var(--no); background: rgba(255, 59, 48, .1); }
.opt.gone { visibility: hidden; }
.typebox { display: flex; gap: 10px; flex-wrap: wrap; }
.typebox input { flex: 1; min-width: 220px; font-size: 20px; }
.typebox input.ok { border-color: var(--ok); }
.typebox input.no { border-color: var(--no); }
.gap { display: inline-block; border-bottom: 2.5px solid var(--blue); min-width: 3em; margin: 0 4px; }
.gap.filled { color: var(--blue); }
.reveal-box { margin-top: 26px; padding-top: 24px; border-top: 1px solid var(--line); }
.verdict { font-size: 21px; font-weight: 700; margin-bottom: 16px; }
.verdict.ok { color: var(--ok); } .verdict.close { color: #c25e00; } .verdict.no { color: var(--no); }
.keys { font-size: 13px; color: var(--ink3); margin-top: 16px; }
.big-emoji { font-size: 64px; line-height: 1; margin-bottom: 14px; }

/* ---------- games ---------- */
.game-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }
.game-tile { position: relative; text-align: left; border: 0; border-radius: 26px; padding: 28px; min-height: 230px; cursor: pointer; color: #fff; display: flex; flex-direction: column; justify-content: flex-end; gap: 6px; overflow: hidden; transition: transform .45s cubic-bezier(.2, .8, .2, 1); background: #1d1d1f; }
@media (hover: hover) { .game-tile:hover { transform: scale(1.02); } }
.game-tile::before { content: ''; position: absolute; inset: 0; background: var(--tint); opacity: .9; }
.game-tile > * { position: relative; }
.game-tile .gi { font-size: 46px; position: absolute; top: 24px; left: 26px; }
.game-tile h3 { font-size: 26px; letter-spacing: -.025em; }
.game-tile p { margin: 0; color: rgba(255, 255, 255, .78); font-size: 15px; line-height: 1.4; }
.game-tile .rec { position: absolute; top: 28px; right: 26px; font-size: 13px; color: rgba(255, 255, 255, .7); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1px solid var(--line); background: transparent; border-radius: 980px; padding: 6px 13px; font-size: 14px; cursor: pointer; color: inherit; }
.chip.on { background: var(--blue); border-color: var(--blue); color: #fff; }
details.partpick { border-top: 1px solid var(--line); padding: 12px 0; }
details.partpick summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; }
details.partpick summary::-webkit-details-marker { display: none; }
details.partpick .chips { margin-top: 12px; }

.game-page { min-height: 100vh; background: #000; color: #f5f5f7; --card: #1d1d1f; --line: #424245; --ink2: #a1a1a6; --ink3: #86868b; --bg2: #2c2c2e; --link: #2997ff; --ink: #f5f5f7; }
.game-top { position: sticky; top: 0; z-index: 20; background: rgba(0, 0, 0, .72); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); }
.game-top-in { max-width: 980px; margin: 0 auto; padding: 12px 22px; display: flex; align-items: center; gap: 16px; }
.game-title { flex: 1; font-weight: 600; font-size: 17px; }
.game-title small { display: block; color: #a1a1a6; font-weight: 400; font-size: 13px; }
.hud { display: flex; gap: 18px; align-items: center; font-variant-numeric: tabular-nums; font-size: 15px; }
.hud b { font-size: 21px; }
.game-body { max-width: 980px; margin: 0 auto; padding: 34px 22px 80px; }
.game-page .q-card { background: #1d1d1f; box-shadow: none; }
.game-page .opt { background: #1d1d1f; border-color: #424245; color: #f5f5f7; }
.timer-bar { height: 6px; border-radius: 6px; background: #2c2c2e; overflow: hidden; margin-bottom: 22px; }
.timer-bar i { display: block; height: 100%; background: var(--grad); transition: width .1s linear; }

.match { display: grid; grid-template-columns: 1fr 1.4fr; gap: 12px; }
.match .col { display: grid; gap: 10px; align-content: start; }
.tile { border: 1px solid #424245; background: #1d1d1f; color: #f5f5f7; border-radius: 14px; padding: 13px 15px; text-align: left; cursor: pointer; font-size: 15px; line-height: 1.35; transition: transform .2s, opacity .4s, border-color .2s; }
@media (hover: hover) { .tile:hover { border-color: #2997ff; } }
.tile.sel { border-color: #2997ff; background: rgba(41, 151, 255, .16); }
.tile.done { opacity: 0; transform: scale(.9); pointer-events: none; }
.tile.bad { border-color: #ff453a; animation: shake .3s; }
@keyframes shake { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }

.sky { position: relative; height: 460px; border-radius: 26px; overflow: hidden; background: radial-gradient(ellipse at 50% 120%, #1c2a5a 0%, #050510 70%); }
.sky .clue { position: absolute; top: 0; left: 0; right: 0; padding: 18px 22px; font-size: 19px; font-weight: 600; text-align: center; background: rgba(5, 5, 16, .94); border-bottom: 1px solid rgba(255, 255, 255, .08); z-index: 2; }
.sky .ground { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: linear-gradient(90deg, #ff453a, #ff9f0a); opacity: .6; }
.meteor { position: absolute; transform: translateX(-50%); border: 0; border-radius: 980px; padding: 10px 18px; background: linear-gradient(135deg, #5e5ce6, #0a84ff); color: #fff; font-size: 15px; font-weight: 600; cursor: pointer; box-shadow: 0 0 24px rgba(10, 132, 255, .5); white-space: normal; text-align: center; line-height: 1.2; max-width: 46%; }
@media (max-width: 640px) { .meteor { font-size: 13px; padding: 8px 12px; border-radius: 16px; } }
.meteor.hit { animation: pop .35s forwards; }
.meteor.miss { background: #ff453a; animation: shake .3s; }
@keyframes pop { to { transform: translateX(-50%) scale(1.6); opacity: 0; } }

.tf { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 26px; }
.tf button { border: 0; border-radius: 18px; padding: 20px; font-size: 19px; font-weight: 600; cursor: pointer; color: #fff; }
.tf .f { background: #3a1214; } @media (hover: hover) { .tf .f:hover { background: #ff453a; } }
.tf .t { background: #0f2e19; } @media (hover: hover) { .tf .t:hover { background: #30d158; } }

.mem { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; perspective: 1000px; }
@media (max-width: 640px) { .mem { grid-template-columns: repeat(3, 1fr); } .match { grid-template-columns: 1fr; } .tf { grid-template-columns: 1fr; } .sky { height: 400px; } }
.mcard { position: relative; height: 130px; cursor: pointer; transform-style: preserve-3d; transition: transform .5s cubic-bezier(.2, .8, .2, 1); border: 0; background: none; padding: 0; color: inherit; }
.mcard.flip { transform: rotateY(180deg); }
.mcard .face { position: absolute; inset: 0; border-radius: 16px; backface-visibility: hidden; -webkit-backface-visibility: hidden; display: grid; place-items: center; padding: 10px; font-size: 13px; line-height: 1.3; text-align: center; }
.mcard .front { background: linear-gradient(135deg, #5e5ce6, #0a84ff); font-size: 30px; }
.mcard .back { background: #1d1d1f; border: 1px solid #424245; transform: rotateY(180deg); }
.mcard .back.hw { font-size: 16px; font-weight: 600; }
.mcard.matched .back { border-color: #30d158; background: rgba(48, 209, 88, .14); }

.slots { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin: 22px 0; }
.slot { width: 44px; height: 54px; border-radius: 12px; border: 1.5px solid #424245; display: grid; place-items: center; font-size: 24px; font-weight: 600; text-transform: lowercase; }
.slot.f { border-color: #2997ff; }
.letters { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.letter { width: 48px; height: 48px; border-radius: 12px; border: 0; background: #2c2c2e; color: #f5f5f7; font-size: 22px; font-weight: 600; cursor: pointer; text-transform: lowercase; transition: transform .12s, opacity .2s; }
.letter:active { transform: scale(.92); }
.letter.used { opacity: .2; pointer-events: none; }
.phrase { font-size: 24px; font-weight: 600; text-align: center; letter-spacing: -.02em; }

/* ---------- modal ---------- */
.modal-bg { position: fixed; inset: 0; z-index: 100; background: rgba(0, 0, 0, .45); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); display: grid; place-items: center; padding: 22px; animation: fadein .2s; }
@keyframes fadein { from { opacity: 0; } }
.modal { background: var(--card); color: var(--ink); border-radius: 22px; padding: 30px; width: 100%; max-width: 520px; max-height: 90vh; overflow: auto; box-shadow: 0 30px 80px rgba(0, 0, 0, .35); animation: modalin .3s cubic-bezier(.2, .8, .2, 1); }
@keyframes modalin { from { opacity: 0; transform: scale(.94); } }
.modal h3 { font-size: 24px; margin-bottom: 8px; }
.modal .actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 24px; flex-wrap: wrap; }
.modal.warn h3 { color: var(--red); }

.toast { position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 12px 20px; border-radius: 14px; z-index: 120; font-size: 15px; animation: cardin .3s; box-shadow: var(--shadow); }

/* ---------- danger zone ---------- */
.danger-zone { border: 1.5px solid var(--red); background: var(--red-bg); border-radius: 22px; padding: 28px; }
.danger-zone h3 { color: var(--red); font-size: 24px; }

/* ---------- welcome ---------- */
.welcome { min-height: 100vh; display: grid; place-items: center; padding: 40px 22px; background: radial-gradient(ellipse at 50% -10%, rgba(10, 132, 255, .16), transparent 60%), var(--bg); }
.welcome-box { width: 100%; max-width: 560px; text-align: center; }
.welcome-box .logo { width: 72px; height: 72px; border-radius: 20px; background: var(--grad); color: #fff; display: grid; place-items: center; font-size: 34px; font-weight: 700; margin: 0 auto 26px; box-shadow: 0 16px 40px rgba(10, 132, 255, .35); }
.welcome-box form, .welcome-box .form { text-align: left; margin-top: 30px; }
.welcome-box input { width: 100%; }
.welcome-box .btn { width: 100%; margin-top: 22px; }
.err { color: var(--no); font-size: 14px; margin-top: 10px; min-height: 20px; }
.choice { margin-top: 26px; text-align: left; }
.choice .q { font-weight: 600; margin-bottom: 10px; }
.steps { display: flex; gap: 6px; justify-content: center; margin-bottom: 28px; }
.steps i { width: 26px; height: 4px; border-radius: 4px; background: var(--line); }
.steps i.on { background: var(--blue); }

/* ---------- export ---------- */
.export-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; }
.export-card { background: var(--card); border-radius: 22px; padding: 26px; display: flex; flex-direction: column; gap: 12px; }
.export-card ol { margin: 0; padding-left: 20px; color: var(--ink2); font-size: 15px; }
.export-card .app { font-size: 24px; font-weight: 700; letter-spacing: -.02em; }

footer.foot { padding: 40px 22px 60px; font-size: 12px; color: var(--ink3); text-align: center; background: var(--bg2); }

/* answer feedback in games: hover, selected, right/wrong, review */
.game-page .opt { transition: border-color .15s, background .15s, transform .12s, box-shadow .15s; }
@media (hover: hover) { .game-page .opt:hover:not(:disabled) { border-color: #2997ff; background: rgba(41, 151, 255, .16); transform: translateX(3px); } }
.game-page .opt:disabled { color: #f5f5f7; cursor: default; }
.game-page .opt:disabled:not(.right):not(.sel) { opacity: .5; }
.game-page .opt.sel { border-color: #2997ff; background: rgba(41, 151, 255, .26); box-shadow: 0 0 0 2px rgba(41, 151, 255, .45); }
.game-page .opt.right { border-color: #30d158; background: rgba(48, 209, 88, .2); opacity: 1; }
.game-page .opt.right.sel { box-shadow: 0 0 0 2px rgba(48, 209, 88, .5); }
.game-page .opt.wrong { border-color: #ff453a; background: rgba(255, 69, 58, .22); box-shadow: 0 0 0 2px rgba(255, 69, 58, .45); opacity: 1; }
.game-page .opt.right::after { content: '✓ correct'; margin-left: auto; color: #30d158; font-size: 13px; font-weight: 600; white-space: nowrap; }
.game-page .opt.wrong::after { content: '✗ your answer'; margin-left: auto; color: #ff453a; font-size: 13px; font-weight: 600; white-space: nowrap; }
.game-page .opt.right.sel::after { content: '✓ your answer'; }
.review { text-align: left; }
.review h3 { font-size: 21px; }
.rv { padding: 16px 0; border-top: 1px solid #424245; display: grid; gap: 8px; }
.rv:first-of-type { margin-top: 10px; }
.rv-q { font-size: 17px; font-weight: 600; line-height: 1.4; }
.rv-a { border-radius: 12px; padding: 10px 14px; font-size: 15px; line-height: 1.4; display: flex; gap: 12px; align-items: baseline; }
.rv-a span { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; opacity: .85; min-width: 74px; }
.rv-a.no { background: rgba(255, 69, 58, .16); border: 1px solid rgba(255, 69, 58, .5); }
.rv-a.ok { background: rgba(48, 209, 88, .16); border: 1px solid rgba(48, 209, 88, .5); }
.rv-n { color: #a1a1a6; font-size: 14px; line-height: 1.45; }
.match-note { min-height: 24px; margin-top: 16px; text-align: center; color: #ff6961; font-size: 15px; }
.spell { background: rgba(255, 159, 10, .14); border: 1px solid rgba(255, 159, 10, .5); border-radius: 12px; padding: 12px 14px; margin: -4px 0 14px; font-size: 15px; line-height: 1.45; }
.spell .bad { color: #ff453a; } .spell .good { color: #1c8c3a; }
.rv-tag { display: inline-block; justify-self: start; font-size: 12px; font-weight: 600; color: #ff9f0a; background: rgba(255, 159, 10, .14); border-radius: 980px; padding: 3px 10px; }

/* ---------- streak flame ---------- */
.flame { display: inline-block; position: relative; width: var(--sz, 22px); height: calc(var(--sz, 22px) * 1.25); filter: drop-shadow(0 0 calc(var(--sz, 22px) * .18) var(--glow)); }
.flame svg { width: 100%; height: 100%; display: block; overflow: visible; }
.flame .fo { transform-origin: 50% 100%; animation: flick 1.6s ease-in-out infinite alternate; }
.flame .fi { transform-origin: 50% 100%; animation: flick2 1.1s ease-in-out infinite alternate; }
@keyframes flick { 0% { transform: scale(1, 1) skewX(0); } 35% { transform: scale(.97, 1.04) skewX(1.5deg); } 70% { transform: scale(1.02, .97) skewX(-1.5deg); } 100% { transform: scale(.99, 1.03) skewX(.8deg); } }
@keyframes flick2 { 0% { transform: scale(1, 1); opacity: .95; } 50% { transform: scale(.92, 1.08); opacity: 1; } 100% { transform: scale(1.04, .94); opacity: .9; } }
.flame.sm { --sz: 16px; }
.flame.mid { --sz: 34px; }
.flame.halo::before { content: ''; position: absolute; inset: -30% -45%; border-radius: 50%; background: radial-gradient(circle, var(--glow) 0%, transparent 65%); animation: pulse 2.2s ease-in-out infinite; z-index: -1; }
.flame.ring2::after { content: ''; position: absolute; left: 50%; top: 60%; width: 135%; height: 108%; transform: translate(-50%, -50%); border-radius: 50%; border: 2px solid transparent; border-top-color: #ffd36b; border-left-color: #9fe8ff; animation: spin 3.2s linear infinite; opacity: .85; }
.flame.sm::after, .flame.sm::before { display: none; }
@keyframes pulse { 0%, 100% { opacity: .55; transform: scale(.92); } 50% { opacity: 1; transform: scale(1.06); } }
@keyframes spin { to { transform: translate(-50%, -50%) rotate(360deg); } }
.flame.big.sparks .fo { animation-duration: 1.2s; }
.streak-chip { display: flex; align-items: center; gap: 4px; border: 0; background: transparent; cursor: pointer; padding: 2px 6px; border-radius: 999px; font-size: 14px; color: var(--ink); }
@media (hover: hover) { .streak-chip:hover { background: var(--bg2); } }
.streak-chip.cold .flame { filter: grayscale(.65) opacity(.7); }
.streak-chip.land .flame { animation: land .7s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes land { 0% { transform: scale(1.8); } 100% { transform: scale(1); } }
.flame-stage { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; background: radial-gradient(circle at 50% 45%, rgba(20, 8, 0, .55), rgba(0, 0, 0, .82)); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: fadein .35s; cursor: pointer; color: #fff; }
.flame-center { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 22px; }
.flame-center .flame.big { animation: flamerise .9s cubic-bezier(.2, .9, .3, 1.3) both; filter: drop-shadow(0 0 30px var(--glow)) drop-shadow(0 0 70px var(--glow)); }
@keyframes flamerise { 0% { transform: translateY(40px) scale(.3); opacity: 0; } 100% { transform: none; opacity: 1; } }
.flame-num { font-size: 72px; font-weight: 700; letter-spacing: -.04em; line-height: 1; margin-top: 14px; animation: fadeup .6s .3s both; }
.flame-cap { font-size: 24px; font-weight: 600; margin-top: 6px; animation: fadeup .6s .4s both; }
.flame-sub { color: #d0d0d5; margin-top: 6px; animation: fadeup .6s .5s both; }
.flame-ice { color: #9fd8ff; font-size: 14px; margin-top: 10px; max-width: 340px; animation: fadeup .6s .5s both; }
.flame-ice.hit { background: rgba(120,200,255,.14); border: 1px solid rgba(120,200,255,.4); border-radius: 12px; padding: 8px 12px; color: #d6eeff; }
.flame-next { color: #a1a1a6; font-size: 14px; margin-top: 14px; animation: fadeup .6s .6s both; }
@keyframes fadeup { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.flame-stage.flying { background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; transition: background .6s; }
.flame-stage.flying .flame-num, .flame-stage.flying .flame-cap, .flame-stage.flying .flame-sub, .flame-stage.flying .flame-next, .flame-stage.flying .flame-ice { opacity: 0; transition: opacity .25s; animation: none; }
.flame-stage.flying .flame.big { animation: none; }
.flame-stage.fade { opacity: 0; transition: opacity .35s; }
@media (prefers-reduced-motion: reduce) { .flame .fo, .flame .fi, .flame::before, .flame::after { animation: none !important; } }

/* ---------- progress explainer ---------- */
.modal.wide { max-width: 620px; }
.ex-sec { border-top: 1px solid var(--line); padding-top: 14px; margin-top: 14px; }
.ex-t { font-weight: 600; margin-bottom: 8px; }
.ex-row { display: flex; gap: 10px; align-items: baseline; margin: 6px 0; }
.ex-row > div { display: flex; flex-direction: column; }
.ex-dot { width: 11px; height: 11px; border-radius: 50%; flex: none; transform: translateY(1px); }
.ex-ring { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.ex-ring .ring { width: 34px; height: 34px; }
.ex-flames { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; text-align: center; margin: 8px 0 10px; }
.ex-flames > div { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 13px; }
.ex-flames .flame { margin: 8px 0 6px; }
@media (max-width: 560px) { .ex-flames { grid-template-columns: repeat(3, 1fr); } }
.ember { position: absolute; bottom: 30%; width: 5px; height: 5px; border-radius: 50%; opacity: 0; animation: ember 2s ease-out infinite; box-shadow: 0 0 8px currentColor; }
@keyframes ember { 0% { opacity: 0; transform: translate(0, 0) scale(1); } 15% { opacity: 1; } 100% { opacity: 0; transform: translate(var(--dx), -170px) scale(.3); } }
.flame-stage.flying .ember { display: none; }

/* ---------- CPE ---------- */
.cpe-setup h3 { font-size: 21px; margin-bottom: 12px; }
.cpe-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.cpe-row .fl { margin: 0; }
.cpe-units-in { flex: 1; min-width: 220px; font-size: 19px; }
.cpe-steps { display: flex; flex-direction: column; gap: 10px; margin: 14px 0; }
.stepper { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.cpe-sum { margin: 6px 0 10px; }
.cpe-chips .chip { cursor: default; padding: 3px 10px; font-size: 13px; }
.cpe-parts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 18px; }
.cpe-parts > div { background: var(--bg2); border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; font-size: 15px; }
@media (max-width: 720px) { .cpe-parts { grid-template-columns: repeat(2, 1fr); } }
table.cpe-hist { width: 100%; border-collapse: collapse; font-size: 15px; }
table.cpe-hist td { padding: 8px 6px; border-top: 1px solid var(--line); }
.grade { display: inline-block; padding: 3px 10px; border-radius: 999px; font-weight: 600; font-size: 13px; color: #fff; }
.grade.ga { background: linear-gradient(135deg, #30d158, #0a9f4a); } .grade.gb { background: linear-gradient(135deg, #0a84ff, #5e5ce6); } .grade.gc { background: linear-gradient(135deg, #5e5ce6, #bf5af2); } .grade.g1 { background: #ff9f0a; } .grade.g0 { background: #8e8e93; }
.grade.big { font-size: 17px; padding: 7px 18px; margin-bottom: 10px; }
.cpe-page { min-height: 100vh; background: var(--bg2); }
.cpe-top { position: sticky; top: 0; z-index: 30; background: var(--navbg); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); border-bottom: 1px solid rgba(0, 0, 0, .08); }
.cpe-top-in { max-width: 760px; margin: 0 auto; padding: 10px 22px; display: flex; align-items: center; gap: 14px; }
.cpe-title { flex: 1; font-weight: 600; display: flex; flex-direction: column; line-height: 1.2; }
.cpe-title small { font-weight: 400; color: var(--ink2); font-size: 13px; }
.cpe-clock { font-variant-numeric: tabular-nums; color: var(--ink2); }
.cpe-body { padding-top: 22px; padding-bottom: 60px; }
.cpe-tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 22px; }
.cpe-tabs button { border: 1px solid var(--line); background: var(--card); border-radius: 14px; padding: 10px; cursor: pointer; display: flex; flex-direction: column; align-items: center; color: var(--ink); font-size: 14px; }
.cpe-tabs button span { color: var(--ink2); font-size: 13px; }
.cpe-tabs button.full { border-color: var(--mature); }
.cpe-tabs button.on { background: var(--blue); border-color: var(--blue); color: #fff; }
.cpe-tabs button.on span { color: rgba(255, 255, 255, .85); }
.cpe-head { margin-bottom: 16px; }
.cpe-hint { margin-top: 6px; }
.cpe-card { padding: 26px 26px 10px; }
ol.cpe-list { margin: 0; padding-left: 26px; }
ol.cpe-list > li { margin-bottom: 26px; padding-left: 4px; }
ol.cpe-list > li::marker { font-weight: 700; color: var(--ink2); }
.cpe-s { font-size: 18px; line-height: 1.9; }
.cpe-num { min-width: 4em; text-align: center; color: var(--blue); font-weight: 600; }
.cpe-opts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 10px; }
@media (max-width: 560px) { .cpe-opts { grid-template-columns: 1fr; } }
.cpe-opt { display: flex; gap: 10px; align-items: center; text-align: left; border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 12px; padding: 10px 14px; cursor: pointer; font-size: 16px; transition: border-color .15s, background .15s; }
@media (hover: hover) { .cpe-opt:hover { border-color: var(--blue); background: rgba(0, 113, 227, .06); } }
.cpe-opt.sel { border-color: var(--blue); background: var(--blue); color: #fff; }
.cpe-opt kbd { font-family: var(--font); font-size: 12px; border: 1px solid currentColor; border-radius: 6px; padding: 0 6px; opacity: .7; }
input.cpe-gap { display: inline-block; width: 9em; padding: 2px 8px; margin: 0 4px; font-size: 17px; border: 0; border-bottom: 2px solid var(--blue); border-radius: 6px 6px 0 0; background: rgba(0, 113, 227, .06); vertical-align: baseline; }
input.cpe-gap.wide { width: min(100%, 22em); }
input.cpe-gap:focus { outline: none; background: rgba(0, 113, 227, .12); }
li.cpe-wf { display: flex; gap: 16px; align-items: baseline; justify-content: space-between; }
.cpe-stem { font-weight: 700; letter-spacing: .06em; color: var(--ink2); white-space: nowrap; }
.cpe-stem.inline { margin-left: 10px; font-size: 13px; }
.cpe-s1 { font-size: 18px; margin-bottom: 6px; }
.cpe-key { display: inline-block; font-weight: 700; letter-spacing: .08em; border: 1.5px solid var(--ink); border-radius: 6px; padding: 1px 10px; margin: 4px 0 6px; font-size: 15px; }
.cpe-key.inline { display: inline-block; margin: 4px 8px; font-size: 12px; }
.cpe-wc.over { color: var(--no); font-weight: 600; }
.cpe-nav { margin-top: 22px; }
.cpe-res { padding-bottom: 40px; }
.cpe-bars { max-width: 520px; margin: 26px auto 10px; display: flex; flex-direction: column; gap: 10px; }
.cpe-bar { display: grid; grid-template-columns: 60px 1fr 50px; gap: 12px; align-items: center; font-size: 15px; }
.cpe-bar .track { height: 10px; background: var(--bg2); border-radius: 99px; overflow: hidden; }
.cpe-bar .track i { display: block; height: 100%; background: var(--grad); border-radius: 99px; }
.cpe-note { max-width: 620px; margin: 10px auto 0; }
.cpe-review .rv-q { line-height: 1.7; }

/* sign-in code field */
.code-input { font-size: 28px; letter-spacing: .35em; text-align: center; font-variant-numeric: tabular-nums; }
.or-line { display: flex; align-items: center; gap: 12px; margin: 26px 0 14px; color: var(--muted, #86868b); font-size: 14px; }
.or-line::before, .or-line::after { content: ''; flex: 1; height: 1px; background: var(--line, rgba(128,128,128,.25)); }

/* teacher / admin tables */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.people { width: 100%; }
table.people th { text-align: left; font-size: 12px; font-weight: 600; color: var(--ink2); padding: 8px 10px; border-bottom: 1px solid var(--line); }
table.people td { padding: 12px 10px; vertical-align: top; border-bottom: 1px solid var(--line); }
table.people select { font: inherit; font-size: 14px; padding: 5px 8px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); }
table.people input[type=checkbox] { width: 18px; height: 18px; }
.row-actions { white-space: nowrap; text-align: right; }
.row-actions .btn + .btn { margin-left: 6px; }
.pill.ok { background: rgba(48, 209, 88, .16); color: #1f8a3c; }
@media (max-width: 640px) { table.people th:nth-child(4), table.people td:nth-child(4) { display: none; } }

/* library */
.lib-card { display: flex; align-items: center; gap: 18px; margin-bottom: 16px; }
.lib-actions { gap: 10px; flex-shrink: 0; }
@media (max-width: 640px) { .lib-card { flex-direction: column; align-items: stretch; } }

/* course editor */
.save-status { margin-left: auto; }
.ed-topic { margin-top: 22px; }
.ed-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ed-title { flex: 1; min-width: 180px; font-size: 20px; font-weight: 600; }
.ed-word { border-top: 1px solid var(--line); padding: 14px 0; display: flex; flex-direction: column; gap: 8px; }
.ed-head { font-weight: 700; font-size: 17px; min-width: 160px; flex: 0 1 260px; }
.ed-word textarea, .ed-add textarea { width: 100%; font: inherit; font-size: 15px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); resize: vertical; box-sizing: border-box; }
.ed-alt { font: inherit; font-size: 13px; padding: 6px 8px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); max-width: 100%; }
.ed-note { font-size: 13px; color: #b25000; }
.ed-add { border-top: 1px solid var(--line); padding-top: 14px; margin-top: 6px; display: flex; flex-direction: column; gap: 10px; }
.icon-x { border: 0; background: transparent; color: var(--ink2); font-size: 24px; line-height: 1; cursor: pointer; padding: 2px 8px; border-radius: 8px; }
@media (hover: hover) { .icon-x:hover { background: var(--bg2); color: #d70015; } }

/* speaking task */
.speak-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.chip { border: 1px solid var(--line); background: var(--bg); color: var(--ink); border-radius: 980px; padding: 7px 14px; font: inherit; font-size: 15px; cursor: pointer; }
.chip.on { background: var(--link, #0071e3); border-color: transparent; color: #fff; }
.src-strip { display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap; padding: 8px 16px; font-size: 14px; background: var(--bg2); border-bottom: 1px solid var(--line); }

/* ---------- exam practice (exam.js) ---------- */
.xm-page { padding-bottom: 80px; }
.xm-top-in { max-width: 1200px; }
.xm-clock { font-size: 19px; font-weight: 600; color: var(--ink); min-width: 64px; text-align: right; }
.xm-clock.low { color: var(--no); }
.xm-status { min-width: 0; }
.xm-body { padding-top: 22px; }
.xm-tabs button { padding: 8px 6px; }
.xm-wide { max-width: 1200px; margin: 0 auto; padding: 0 22px; }
.xm-card { padding: 28px 30px; }
.xm-h { font-size: 22px; margin: 0 0 10px; letter-spacing: -.01em; }
.xm-p { font-size: 18px; line-height: 2.05; margin: 0 0 14px; }
.xm-gap { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; margin: 0 2px; }
.xm-gap > b, .xm-n { display: inline-grid; place-items: center; min-width: 26px; height: 26px; padding: 0 6px; border-radius: 8px; background: var(--blue); color: #fff; font-size: 13px; font-weight: 700; line-height: 1; }
.xm-in { width: 9.5em; padding: 4px 10px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--card); font-size: 17px; line-height: 1.3; }
.xm-in:focus { border-color: var(--blue); outline: none; }
.xm-in.wide { width: min(100%, 22em); }
.xm-sel { padding: 4px 8px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--card); font-size: 16px; max-width: 15em; }
.xm-word { font-size: 13px; }
.xm-optlist { display: grid; gap: 6px; font-size: 15px; }
.xm-optlist > div { display: flex; gap: 14px; flex-wrap: wrap; align-items: baseline; }
.xm-optlist b { min-width: 22px; color: var(--blue); }
.xm-optlist i { font-style: normal; font-weight: 600; color: var(--ink2); margin-right: 5px; }
.xm-kwt { display: flex; gap: 14px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.xm-kwt:last-child { border-bottom: 0; }
.xm-split { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.xm-text { max-height: calc(100vh - 150px); overflow-y: auto; position: sticky; top: 78px; }
.xm-text .xm-p { font-size: 17px; line-height: 1.6; }
.xm-qs, .xm-side { display: flex; flex-direction: column; gap: 14px; }
.xm-q { padding: 20px 22px; }
.xm-stem { font-size: 17px; line-height: 1.45; margin-bottom: 10px; }
.xm-mcopts { grid-template-columns: 1fr; }
.xm-mq .xm-stem { margin-bottom: 8px; }
.xm-letters { display: flex; gap: 8px; flex-wrap: wrap; }
.xm-letters button { width: 42px; height: 38px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: var(--ink); font-weight: 600; cursor: pointer; }
.xm-letters button.on { background: var(--blue); border-color: var(--blue); color: #fff; }
.xm-slot { margin: 6px 0 16px; padding: 12px 14px; border: 1.5px dashed var(--line); border-radius: 14px; }
.xm-slot.ok { border-color: rgba(48, 209, 88, .7); }
.xm-slot.no { border-color: rgba(255, 69, 58, .7); }
.xm-slot-text { font-size: 15px; line-height: 1.5; color: var(--ink2); margin-top: 6px; }
.xm-slot-text:empty { display: none; }
.xm-paras { display: flex; flex-direction: column; gap: 10px; }
.xm-para { display: flex; gap: 12px; background: var(--card); border-radius: 16px; padding: 14px 16px; font-size: 15px; line-height: 1.5; }
.xm-para > b { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--bg2); }
.xm-para.used { opacity: .5; }
.xm-section { margin-bottom: 18px; }
.xm-sec-h { display: flex; gap: 10px; align-items: center; font-weight: 600; margin-bottom: 4px; }
.xm-sec-h b { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--blue); color: #fff; }
.xm-last { display: flex; gap: 10px; align-items: baseline; margin-top: 6px; }
/* results */
.xm-bar { grid-template-columns: 60px 1fr 56px; }
.xm-toggle { font-size: 15px; color: var(--ink2); display: flex; gap: 8px; align-items: center; cursor: pointer; }
.xm-rv-part { margin-bottom: 22px; }
.xm-rv-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.xm-rv-head h3 { margin: 0; font-size: 21px; }
.xm-ctx { margin: 0 0 16px; padding: 16px 18px; background: var(--bg2); border-radius: 16px; }
.xm-ctx summary { cursor: pointer; color: var(--link); }
.xm-ctx .xm-p { font-size: 16px; line-height: 1.9; }
.xm-mark { display: inline-flex; gap: 5px; align-items: center; padding: 0 8px; border-radius: 8px; white-space: nowrap; }
.xm-mark b { font-size: 12px; opacity: .7; }
.xm-mark.ok { background: rgba(48, 209, 88, .18); }
.xm-mark.no { background: rgba(255, 69, 58, .14); }
.xm-mark s { opacity: .75; }
.xm-rv { border-top: 1px solid var(--line); padding: 16px 0; display: flex; flex-direction: column; gap: 8px; }
.xm-rv-top { display: flex; gap: 10px; align-items: center; }
.xm-rv.ok .xm-n { background: var(--ok); }
.xm-rv.no .xm-n { background: var(--no); }
.xm-rv.part .xm-n { background: var(--learn); }
.xm-score { font-weight: 600; font-variant-numeric: tabular-nums; }
.xm-rv-q { font-size: 16px; line-height: 1.5; }
.xm-why { font-size: 15px; line-height: 1.5; background: var(--bg2); border-radius: 12px; padding: 10px 14px; }
.xm-topics { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; margin-top: 10px; }
.xm-th { font-weight: 600; margin-bottom: 10px; }
.xm-topic { display: grid; grid-template-columns: minmax(0, 1fr) 70px 40px 40px; gap: 8px; align-items: center; font-size: 14px; margin-bottom: 8px; }
.xm-topic .track { height: 8px; background: var(--bg2); border-radius: 99px; overflow: hidden; }
.xm-topic .track i { display: block; height: 100%; border-radius: 99px; background: var(--mature); }
.xm-topic .track i.mid { background: var(--learn); }
.xm-topic .track i.low { background: var(--no); }
.xm-chart-box { margin-top: 8px; }
.xm-chart { width: 100%; height: auto; display: block; }
.xm-chart .grid { stroke: var(--line); stroke-width: 1; }
.xm-chart text { fill: var(--ink2); font-size: 12px; font-family: var(--font); }
@media (max-width: 860px) {
  .xm-split { grid-template-columns: 1fr; }
  .xm-text { max-height: none; position: static; }
  .xm-topics { grid-template-columns: 1fr; }
  .xm-card { padding: 22px 18px; }
  .xm-p { font-size: 17px; }
  .xm-tabs { grid-template-columns: repeat(4, 1fr) !important; }
}
.xm-skip td { opacity: .55; }

.linkbtn.forget-unit { margin-top: 14px; background: none; border: 0; color: var(--muted, #86868b); font: inherit; font-size: 14px; cursor: pointer; padding: 6px 10px; border-radius: 8px; }
@media (hover: hover) { .forget-unit:hover { color: #ff453a; background: rgba(255,69,58,.08); } }

/* ---------------------------------------------------------------- AI practice (practice.js) */
.px-ed { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.px-ed-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.px-sec { margin-top: 10px; border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px; }
.px-sec summary { cursor: pointer; font-weight: 600; }
.px-prev { margin-top: 10px; font-size: 15px; }
.px-prev mark { background: rgba(10, 132, 255, .16); color: inherit; border-radius: 5px; padding: 0 4px; }
.px-item { position: relative; padding: 10px 34px 10px 0; border-bottom: 1px solid var(--line); }
.px-item:last-child { border-bottom: 0; }
.px-item .icon-x { position: absolute; right: 0; top: 8px; }
.px-text .px-par { font-size: 18px; line-height: 2.1; margin: 0 0 14px; }
.px-gap { display: inline-block; width: auto; max-width: 100%; padding: 4px 10px; font-size: 16px; border-radius: 9px; margin: 0 2px; vertical-align: baseline; }
.px-bank { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 18px; }
.px-bank .chip { cursor: default; }
.px-ans { font-weight: 600; border-radius: 6px; padding: 1px 6px; }
.px-ans.ok { color: var(--ok); background: rgba(48, 209, 88, .12); }
.px-ans.no { color: var(--no); }
.px-first { font-size: 19px; line-height: 1.5; margin: 6px 0 14px; }
.px-key { display: inline-block; font-weight: 800; letter-spacing: .08em; font-size: 15px; border: 2px solid var(--ink); border-radius: 8px; padding: 3px 12px; margin-bottom: 14px; }
.px-second { font-size: 19px; line-height: 1.5; margin-bottom: 16px; }
.px-review p { margin: 10px 0; }

.ed-finish { margin-top: 22px; }

/* ---------------------------------------------------------------- exam papers tabs + writing (writing.js) */
.xm-tabs { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-bottom: 26px; }
.xm-tabs a, .xm-tabs span { padding: 7px 14px; border-radius: 980px; font-size: 14px; border: 1px solid var(--line); color: var(--ink); }
.xm-tabs a.on { background: var(--ink); color: var(--bg); border-color: var(--ink); text-decoration: none; }
@media (hover: hover) { .xm-tabs a:hover { text-decoration: none; border-color: var(--ink2); } }
.xm-tabs .off { color: var(--ink3); border-style: dashed; }
.wr-task p { margin: 0 0 10px; line-height: 1.55; }
.wr-text { width: 100%; min-height: 420px; font-size: 18px; line-height: 1.6; resize: vertical; font-family: Georgia, 'Times New Roman', serif; }
.wr-count { font-weight: 600; font-size: 15px; }
.wr-count.ok { color: var(--ok); } .wr-count.low { color: #c25e00; } .wr-count.high { color: var(--no); }
.wr-row { display: flex; align-items: center; gap: 14px; padding: 12px 4px; border-bottom: 1px solid var(--line); color: var(--ink); }
.wr-row:last-child { border-bottom: 0; } @media (hover: hover) { .wr-row:hover { text-decoration: none; background: var(--bg2); } }
.wr-score { min-width: 54px; font-variant-numeric: tabular-nums; }
.wr-score-card { display: grid; grid-template-columns: 160px 1fr; gap: 26px; align-items: start; }
.wr-total { text-align: center; } .wr-total b { font-size: 64px; letter-spacing: -.03em; } .wr-total span { font-size: 22px; color: var(--ink2); margin-left: 4px; }
.wr-bars { display: grid; gap: 14px; } .wr-bar .bar { margin: 6px 0; } .wr-bar .bar i { background: var(--blue); }
.wr-table { width: 100%; border-collapse: collapse; } .wr-table td { padding: 8px 10px 8px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.wr-model { font-family: Georgia, 'Times New Roman', serif; font-size: 17px; line-height: 1.6; margin: 0; }
.wr-mine { white-space: pre-wrap; font-family: Georgia, 'Times New Roman', serif; font-size: 17px; line-height: 1.7; }
.wr-err { background: rgba(255, 69, 58, .16); color: inherit; border-radius: 4px; padding: 0 2px; cursor: help; }
@media (max-width: 640px) { .wr-score-card { grid-template-columns: 1fr; } .wr-text { min-height: 320px; font-size: 17px; } }

/* ---------------------------------------------------------------- speaking (speaking.js) */
.sp-progress { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 26px; }
.sp-progress span { font-size: 13px; padding: 4px 10px; border-radius: 980px; background: var(--bg2); color: var(--ink2); }
.sp-progress span.on { background: var(--blue); color: #fff; } .sp-progress span.done { color: var(--ok); }
.sp-top { gap: 12px; align-items: center; }
.sp-rec { color: #ff3b30; font-weight: 700; font-size: 13px; letter-spacing: .06em; animation: sprec 1.2s infinite; }
@keyframes sprec { 50% { opacity: .35; } }
.sp-clock { font-size: 28px; font-variant-numeric: tabular-nums; } .sp-clock.over { color: var(--no); }
.sp-bar { margin: 12px 0 22px; } .sp-bar i { background: var(--blue); transition: width 1s linear; }
.sp-q { margin-bottom: 18px; }
.sp-pics { display: grid; gap: 12px; grid-template-columns: repeat(3, 1fr); }
.sp-pics.n2, .sp-pics.n4 { grid-template-columns: repeat(2, 1fr); }
.sp-pic { margin: 0; position: relative; }
.sp-pic img, .sp-ph { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 14px; display: block; background: var(--bg2); }
.sp-ph { display: flex; align-items: center; justify-content: center; text-align: center; padding: 10px; color: var(--ink2); font-size: 15px; }
.sp-letter { position: absolute; top: 8px; left: 8px; background: rgba(0,0,0,.7); color: #fff; border-radius: 8px; padding: 2px 9px; font-size: 14px; }
.sp-pic figcaption { font-size: 11px; color: var(--ink3); margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp-pic figcaption a { color: inherit; text-decoration: underline; }
.sp-mind { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 16px; }
.sp-mind-c { grid-column: 1 / -1; text-align: center; font-weight: 700; padding: 14px; border: 2px solid var(--blue); border-radius: 14px; }
.sp-mind-p { padding: 12px; border: 1px solid var(--line); border-radius: 12px; text-align: center; background: var(--card); }
.sp-card { border: 2px solid var(--ink); border-radius: 16px; padding: 22px 24px; background: var(--card); }
.sp-card-q { font-size: 22px; font-weight: 700; margin-bottom: 10px; line-height: 1.3; }
.sp-card ul { margin: 0; padding-left: 20px; font-size: 18px; } .sp-card li { margin: 4px 0; }
.sp-ai { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.sp-scores { display: grid; gap: 12px; margin-bottom: 10px; }
@media (max-width: 640px) { .sp-pics, .sp-pics.n2, .sp-pics.n4 { grid-template-columns: 1fr 1fr; } .sp-mind { grid-template-columns: 1fr 1fr; } .sp-card-q { font-size: 19px; } }


/* ---------- getting started (new teachers) ---------- */
.linkbtn { background: none; border: 0; padding: 4px 6px; font: inherit; color: var(--link); cursor: pointer; border-radius: 6px; }
.guide { margin-bottom: 22px; }
.guide-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.guide-step { display: flex; flex-direction: column; gap: 6px; padding: 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--bg); min-width: 0; }
.guide-step h3 { font-size: 17px; letter-spacing: -.01em; }
.guide-step p { margin: 0 0 6px; font-size: 14px; line-height: 1.4; }
.guide-num { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 14px; background: var(--bg2); color: var(--ink); }
.guide-step.done .guide-num { background: var(--mature); color: #fff; }
.guide-step.done { opacity: .75; }
@media (max-width: 760px) { .guide-steps { grid-template-columns: 1fr; } }

/* ---------- phones (kept last so it wins over the desktop rules above) ---------- */
.menu-btn, .nav-here, .menu-sheet, .menu-scrim, .subnav-back { display: none; }
@media (max-width: 760px) {
  /* phones: logo · where you are · flame · avatar · ☰ — the tabs move into the menu */
  .nav-in { gap: 10px; height: 52px; padding: 0 max(16px, env(safe-area-inset-right, 0px)) 0 max(16px, env(safe-area-inset-left, 0px)); }
  .nav-links, .brand .full, .brand .brand-name { display: none; }
  .brand-mark { width: 28px; height: 28px; border-radius: 8px; font-size: 14px; }
  .nav-here { display: block; flex: 1; min-width: 0; font-size: 17px; font-weight: 600; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .avatar { width: 32px; height: 32px; }
  .menu-btn { display: grid; align-content: center; gap: 5px; width: 40px; height: 40px; margin-right: -8px; padding: 0 9px; border: 0; background: transparent; cursor: pointer; border-radius: 10px; }
  .menu-btn span { display: block; height: 2px; border-radius: 2px; background: var(--ink); transition: transform .25s, opacity .2s; }
  body.menu-open .menu-btn span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  body.menu-open .menu-btn span:nth-child(2) { opacity: 0; }
  body.menu-open .menu-btn span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  .menu-sheet { display: block; position: absolute; left: 0; right: 0; top: 100%; background: var(--bg); border-bottom: 1px solid var(--line); box-shadow: 0 18px 40px rgba(0, 0, 0, .14);
    padding: 6px max(16px, env(safe-area-inset-right, 0px)) 14px max(16px, env(safe-area-inset-left, 0px)); max-height: calc(100dvh - 52px); overflow-y: auto;
    transform: translateY(-8px); opacity: 0; visibility: hidden; transition: opacity .2s, transform .2s, visibility 0s .2s; }
  body.menu-open .menu-sheet { transform: none; opacity: 1; visibility: visible; transition: opacity .2s, transform .2s; }
  .menu-scrim { display: block; position: fixed; inset: 0; z-index: 35; background: rgba(0, 0, 0, .28); opacity: 0; pointer-events: none; transition: opacity .2s; }
  body.menu-open .menu-scrim { opacity: 1; pointer-events: auto; }
  body.menu-open { overflow: hidden; }
  .menu-course { padding: 12px 14px; margin: 6px 0 8px; background: var(--bg2); border-radius: 14px; }
  .menu-course-t { font-size: 19px; font-weight: 700; letter-spacing: -.02em; }
  .menu-links a { display: flex; align-items: center; justify-content: space-between; padding: 0 4px; min-height: 50px; font-size: 19px; font-weight: 500; color: var(--ink); border-bottom: 1px solid var(--line); text-decoration: none; }
  .menu-links a:last-child { border-bottom: 0; }
  .menu-links a.on { color: var(--link); font-weight: 650; }
  .menu-links .chev { color: var(--ink2); font-size: 24px; }
  .src-strip { display: none; }

  /* unit / topic page */
  .subnav { top: 52px; }
  .subnav-in { height: 48px; gap: 8px; padding: 0 16px; }
  .subnav a.subnav-back { display: grid; place-items: center; width: 32px; height: 32px; margin-left: -8px; font-size: 30px; line-height: 1; color: var(--link); opacity: 1 !important; text-decoration: none; }
  .subnav-title { font-size: 17px; }
  .subnav a.subnav-link { display: none; }
  .hero { padding: 40px 16px 32px; }
  .hero-title { font-size: clamp(34px, 10vw, 48px); }
  .hero-sub { font-size: 19px; margin-top: 12px; }
  .hero-cta { margin-top: 22px; }
  .unit-eyebrow { font-size: 15px !important; }
  .unit-actions { display: grid !important; grid-template-columns: repeat(3, 1fr); gap: 8px; width: 100%; max-width: 420px; }
  .unit-actions > .btn.lg { padding-left: 6px; padding-right: 6px; font-size: 15px; min-height: 44px; white-space: normal; line-height: 1.15; }
  .unit-actions > .btn.lg:first-child { grid-column: 1 / -1; font-size: 17px; min-height: 50px; }
  .section { padding: 44px 0; }
  .container, .narrow { padding: 0 16px; }
  .h2 { font-size: clamp(28px, 8vw, 40px); }
  .lead { font-size: 18px; }

  /* word list: one card per word instead of a wide table */
  .tablewrap { overflow: visible; }
  table.words:not(.people), table.words:not(.people) tbody { display: block; }
  table.words:not(.people) thead { display: none; }
  table.words:not(.people) tr { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; padding: 16px 0; border-bottom: 1px solid var(--line); }
  table.words:not(.people) td { display: block; padding: 0; border: 0; min-width: 0; }
  table.words:not(.people) td.w { min-width: 0; grid-column: 1; }
  table.words:not(.people) td:last-child { grid-column: 2; grid-row: 1; }
  table.words:not(.people) td:nth-child(2), table.words:not(.people) td.ex { grid-column: 1 / -1; }
  table.words:not(.people) td:nth-child(2) { font-size: 16px; }
  table.words:not(.people) td.w .hw { font-size: 19px; margin-bottom: 6px; }
  table.words:not(.people) td.w .prons { margin-bottom: 4px; }
  table.words:not(.people) td.ex div { margin-bottom: 4px; font-size: 15px; }
  table.words:not(.people) td.w { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
  table.words:not(.people) td.w .hw { flex-basis: 100%; margin-bottom: 2px; }
  table.words:not(.people) td.w .prons { margin-bottom: 0; }
  table.words:not(.people) td.w > .row { display: contents; }
  /* games: two compact tiles per row */
  .game-tiles { grid-template-columns: 1fr 1fr; gap: 10px; }
  .game-tile { min-height: 132px; padding: 14px; border-radius: 18px; gap: 2px; }
  .game-tile .gi { font-size: 28px; top: 12px; left: 14px; }
  .game-tile h3 { font-size: 17px; }
  .game-tile p { font-size: 12px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .game-tile .rec { font-size: 11px; }
  /* today: four figures as a 2×2 grid */
  .figures { display: grid !important; grid-template-columns: 1fr 1fr; gap: 22px 16px; }
  .fig b { font-size: 38px; }
  .fig span { font-size: 14px; line-height: 1.3; display: block; }
  /* units / topics: slim rows instead of tall tiles */
  .tilegrid { grid-template-columns: 1fr; gap: 10px; }
  .unit-tile { min-height: 0; padding: 14px 16px; border-radius: 16px; display: grid; grid-template-columns: 44px 1fr; gap: 2px 12px; align-items: center; }
  .unit-tile .num { font-size: 26px; grid-row: 1 / span 2; }
  .unit-tile .ttl { font-size: 16px; }
  .unit-tile .foot { font-size: 12px; }
  .partlabel { font-size: 22px; margin: 34px 0 12px; }
  .partlabel small { font-size: 14px; }
  /* game and exam top bars: one line, nothing pushed off the top */
  .game-top-in, .cpe-top-in { padding: 8px 16px; gap: 10px; }
  .game-title, .cpe-title { min-width: 0; font-size: 15px; }
  .game-title, .game-title small, .cpe-title, .cpe-title small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .cpe-title small, .game-title small { font-size: 12px; }
  .hud { gap: 12px; font-size: 13px; }
  .hud b { font-size: 19px; }
  /* answer marks in games sit on their own line so the answer keeps its width */
  .game-page .opt.wrong, .game-page .opt.right.sel { flex-wrap: wrap; }
  .game-page .opt.wrong::after, .game-page .opt.right.sel::after { flex-basis: 100%; margin-left: 0; margin-top: 4px; }
  /* label + control rows (account, plan) stack instead of squeezing the label */
  .set-row { flex-direction: column; align-items: flex-start !important; }
}


/* ---------- sign-up: teacher or student ---------- */
.role-box { max-width: 640px; }
.role-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 30px; text-align: left; }
.role-card { display: flex; flex-direction: column; gap: 8px; padding: 22px; border-radius: 20px; border: 2px solid var(--line); background: var(--card); color: var(--ink); cursor: pointer; font: inherit; text-align: left; transition: border-color .2s, transform .15s; }
.role-card:disabled { opacity: .6; cursor: default; }
.role-card.busy { opacity: 1; border-color: var(--blue); }
.role-t { font-size: 21px; font-weight: 700; }
.role-d { color: var(--ink2); font-size: 15px; line-height: 1.45; }
.role-n { margin-top: auto; align-self: flex-start; padding: 4px 10px; border-radius: 980px; background: rgba(10, 132, 255, .12); color: var(--blue); font-size: 13px; font-weight: 600; }
@media (hover: hover) { .role-card:not(:disabled):hover { border-color: var(--blue); transform: translateY(-2px); } }
@media (max-width: 640px) { .role-cards { grid-template-columns: 1fr; } }
.trial-note { padding: 12px 16px; border-radius: 14px; background: rgba(10, 132, 255, .09); color: var(--ink); font-size: 15px; margin: 0 0 16px; }
.trial-note.over { background: rgba(255, 159, 10, .14); }

/* ---------- feedback ---------- */
.fb-btn { position: fixed; right: 18px; bottom: 18px; z-index: 40; border: 0; border-radius: 980px; padding: 10px 18px; background: var(--ink); color: var(--bg); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; box-shadow: var(--shadow); opacity: .9; }
@media (hover: hover) { .fb-btn:hover { opacity: 1; } }
@media (max-width: 760px) { .fb-btn { display: none; } }
.fb-modal textarea { margin-top: 6px; }
.fb-item { padding: 14px 0; border-top: 1px solid var(--line); }
.fb-item:first-child { border-top: 0; }
.fb-item.done { opacity: .55; }

/* ---------- messages ---------- */
.msg-badge { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; margin-left: 6px; border-radius: 9px; background: var(--red, #ff3b30); color: #fff; font-size: 11px; font-weight: 700; line-height: 1; vertical-align: 1px; }
.menu-btn { position: relative; }
body.has-unread .menu-btn::after { content: ''; position: absolute; top: 4px; right: 2px; width: 9px; height: 9px; border-radius: 50%; background: var(--red, #ff3b30); border: 2px solid var(--navbg, #fff); }
.msg-alert { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 10px 16px; background: #ff3b30; color: #fff !important; font-size: 15px; text-decoration: none; animation: msgPulse 2.4s ease-in-out infinite; }
.msg-alert b { text-decoration: underline; }
@keyframes msgPulse { 50% { background: #e0241b; } }
@media (prefers-reduced-motion: reduce) { .msg-alert { animation: none; } }
.msg-threads { padding: 6px; }
.msg-thread { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 14px; color: var(--ink); text-decoration: none; }
.msg-thread + .msg-thread { border-top: 1px solid var(--line); border-radius: 0; }
.msg-thread.unread b { color: var(--blue); }
.msg-thread .msg-last { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (hover: hover) { .msg-thread:hover { background: var(--bg2); } }
.avatar.sm { flex: none; width: 38px; height: 38px; font-size: 14px; cursor: default; }
.msg-card { display: flex; flex-direction: column; gap: 12px; }
.msg-head { padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.msg-feed { display: flex; flex-direction: column; gap: 10px; max-height: 58vh; min-height: 160px; overflow-y: auto; padding: 4px 2px; }
.msg { max-width: 80%; align-self: flex-start; }
.msg.mine { align-self: flex-end; text-align: right; }
.msg-b { display: inline-block; text-align: left; padding: 10px 14px; border-radius: 18px 18px 18px 6px; background: var(--bg2); white-space: pre-wrap; word-break: break-word; line-height: 1.45; }
.msg.mine .msg-b { background: var(--blue); color: #fff; border-radius: 18px 18px 6px 18px; }
.msg.mine .msg-b a { color: #fff; text-decoration: underline; }
.msg-t { font-size: 12px; color: var(--ink3); margin-top: 3px; padding: 0 6px; }
.msg-empty { text-align: center; margin: auto 0; }
@media (max-width: 640px) { .msg { max-width: 90%; } .msg-feed { max-height: 52vh; } }
/* students list on phones: one block per student, buttons on their own line */
@media (max-width: 640px) {
  table.people.stu, table.people.stu tbody { display: block; }
  table.people.stu thead { display: none; }
  table.people.stu tr { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
  table.people.stu td { display: block; padding: 0; border: 0; }
  table.people.stu td:first-child { flex: 1 1 100%; }
  table.people.stu td:nth-child(3)::after { content: ' words'; }
  table.people.stu td.row-actions { flex: 1 1 100%; text-align: left; white-space: normal; display: flex; flex-wrap: wrap; gap: 6px; }
  table.people.stu .row-actions .btn + .btn { margin-left: 0; }
}
