/* ক্যাম্পাস পথে — design system
   Mobile-first. Breakpoints: 700px (tablet), 960px (desktop).
   Colours are tokens; dark mode only swaps tokens. */

:root {
  --bg: #f6f5f0;
  --surface: #ffffff;
  --surface-2: #f0efe7;
  --ink: #15211c;
  --muted: #5d6a64;
  --line: #e3e3da;
  --brand: #0f5c45;
  --brand-2: #14805f;
  --brand-ink: #ffffff;
  --brand-soft: #e2f1e9;
  --accent: #f0a12a;
  --accent-soft: #fff2d9;
  --fun: #ef6c2f;
  --fun-2: #e2407a;
  --info: #2f62c9;
  --info-soft: #e6eefc;
  --good: #1b9a5d;
  --good-soft: #e1f5e9;
  --bad: #d44343;
  --bad-soft: #fde9e7;
  --shadow: 0 1px 2px rgba(16, 32, 25, .05), 0 8px 24px rgba(16, 32, 25, .06);
  --shadow-lg: 0 18px 50px rgba(16, 32, 25, .14);
  --r: 16px;
  --r-sm: 10px;
  --font: 'Hind Siliguri', 'Noto Sans Bengali', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --display: 'Baloo Da 2', 'Hind Siliguri', system-ui, sans-serif;
  --header-h: 60px;
  --bottom-h: 64px;
  color-scheme: light;
}
:root[data-theme='dark'] {
  --bg: #0e1613;
  --surface: #16211c;
  --surface-2: #1c2a24;
  --ink: #e7efea;
  --muted: #9cada5;
  --line: #2a3a33;
  --brand: #3dbb8a;
  --brand-2: #56d3a2;
  --brand-ink: #06231a;
  --brand-soft: #163a2c;
  --accent: #f4b549;
  --accent-soft: #3a2c13;
  --info: #7aa2f7;
  --info-soft: #1b2741;
  --good: #4cd18f;
  --good-soft: #143826;
  --bad: #f07272;
  --bad-soft: #3f1c1c;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
  --shadow-lg: 0 18px 50px rgba(0, 0, 0, .45);
  color-scheme: dark;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 12px); }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16.5px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(var(--bottom-h) + env(safe-area-inset-bottom, 0px));
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--display); line-height: 1.2; margin: 0 0 .4em; letter-spacing: -.01em; }
h1 { font-size: clamp(1.9rem, 6vw, 3rem); }
h2 { font-size: clamp(1.35rem, 3.6vw, 1.85rem); }
h3, .h3 { font-size: 1.15rem; }
p { margin: 0 0 .8em; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
[lang='en'] { font-family: 'Hind Siliguri', system-ui, sans-serif; }
#main { outline: none; min-height: 70vh; }
.skip-link { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--brand); color: var(--brand-ink); padding: 8px 14px; border-radius: 8px; }
.skip-link:focus { left: 8px; }
.hidden { display: none !important; }

.container { width: min(1140px, 100% - 32px); margin-inline: auto; }
.container.narrow { width: min(780px, 100% - 32px); }
.section { margin-block: 40px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; margin-bottom: 18px; }
.section-head h2 { margin: 0; }
.section-head p { margin: 4px 0 0; color: var(--muted); }
.section-title { margin-top: 40px; }
.eyebrow { display: inline-block; font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--brand); margin-bottom: 6px; }
.eyebrow.light { color: #ffe1a6; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.lead { font-size: 1.12rem; color: var(--muted); max-width: 70ch; }
.tag { display: inline-block; font-size: .75rem; font-weight: 700; padding: 2px 10px; border-radius: 99px; background: var(--brand-soft); color: var(--brand); margin-bottom: 8px; }

/* ---------- buttons & controls ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 10px 20px; border-radius: 12px; border: 1.5px solid transparent;
  background: var(--brand); color: var(--brand-ink); font-weight: 700; text-decoration: none; cursor: pointer;
  transition: transform .12s ease, box-shadow .2s ease, background .2s ease; white-space: nowrap;
}
.btn:hover { box-shadow: 0 6px 18px rgba(15, 92, 69, .25); }
.btn:active { transform: translateY(1px) scale(.99); }
.btn:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { background: var(--surface-2); box-shadow: none; }
.btn.ghost.on { background: var(--accent-soft); border-color: var(--accent); }
.btn.light { background: rgba(255, 255, 255, .95); color: #0f3d2f; }
.btn.danger { background: transparent; color: var(--bad); border-color: var(--bad); }
.btn.big { min-height: 54px; padding: 12px 26px; font-size: 1.05rem; border-radius: 14px; }
.btn.small { min-height: 38px; padding: 6px 14px; font-size: .9rem; }
.btn.block { width: 100%; }
.btn.t-fun, .t-fun .btn { background: linear-gradient(135deg, var(--fun), var(--fun-2)); color: #fff; }
.btn.t-fun:hover { box-shadow: 0 6px 18px rgba(226, 64, 122, .3); }
.btn.t-practice { background: var(--info); color: #fff; }
.link-btn { background: none; border: 0; padding: 4px; color: var(--brand); font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.text-link { color: var(--brand); font-weight: 700; text-decoration: none; }
.text-link:hover { text-decoration: underline; }
.icon-btn {
  display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--surface); cursor: pointer; text-decoration: none; font-size: 1.1rem;
}
.icon-btn:hover { background: var(--surface-2); }
.icon-btn[aria-current] { border-color: var(--brand); background: var(--brand-soft); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; margin-inline: -16px; padding-inline: 16px; }
.chips.scroll::-webkit-scrollbar { display: none; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 6px 14px; border-radius: 99px;
  border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 600; font-size: .92rem;
  text-decoration: none; white-space: nowrap;
}
.chip.active, .chip[aria-pressed='true'] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip:disabled { opacity: .4; cursor: not-allowed; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; background: var(--surface-2); padding: 4px; border-radius: 12px; }
.seg label, .seg button { flex: 1 1 auto; position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; }
.seg span, .seg button {
  display: block; text-align: center; padding: 8px 10px; border-radius: 9px; font-weight: 600; font-size: .92rem; cursor: pointer;
  border: 0; background: transparent; min-height: 40px;
}
.seg input:checked + span, .seg button[aria-selected='true'] { background: var(--surface); box-shadow: var(--shadow); color: var(--brand); }
.seg input:focus-visible + span { outline: 3px solid var(--accent); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; box-shadow: var(--shadow); }
.notice { padding: 12px 16px; border-radius: 12px; background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); margin: 14px 0; }
.notice.good { background: var(--good-soft); border-color: color-mix(in srgb, var(--good) 35%, transparent); }
.notice.warn { background: var(--bad-soft); border-color: color-mix(in srgb, var(--bad) 35%, transparent); }
.empty { color: var(--muted); text-align: center; padding: 18px; margin: 0; }
.empty-box { text-align: center; padding: 34px 20px; border: 2px dashed var(--line); border-radius: var(--r); color: var(--muted); }
.empty-box .btn { margin: 4px; }
.skeleton { height: 54px; border-radius: 12px; margin-bottom: 8px; background: linear-gradient(90deg, var(--surface-2), var(--surface), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
.callout { display: flex; gap: 12px; align-items: flex-start; background: var(--accent-soft); border-left: 4px solid var(--accent); border-radius: 10px; padding: 12px 16px; margin: 16px 0; }
.callout p { margin: 0; }
.pill-link { display: inline-flex; align-items: center; min-height: 36px; padding: 4px 12px; border-radius: 99px; border: 1px solid var(--line); text-decoration: none; font-weight: 600; font-size: .88rem; }
.pill-link.strong { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.pill-link:hover { border-color: var(--brand); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.meter { display: block; height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.meter i { display: block; height: 100%; background: linear-gradient(90deg, var(--brand-2), var(--good)); border-radius: inherit; }
.meter.none i { background: transparent; }
.field { display: grid; gap: 8px; margin-bottom: 16px; }
.label { font-weight: 700; font-size: .95rem; }
input[type='search'], input:not([type]), select {
  width: 100%; min-height: 46px; padding: 10px 14px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface);
}
input:focus, select:focus { border-color: var(--brand); outline: none; }

/* ---------- header / footer / nav ---------- */
.site-header { position: sticky; top: 0; z-index: 40; background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; gap: 16px; min-height: var(--header-h); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; margin-right: auto; }
.brand-mark { display: block; width: 40px; height: 40px; flex: none; border-radius: 11px; box-shadow: 0 2px 8px rgba(11, 70, 53, .25); }
.brand-text { font-family: var(--display); font-weight: 800; font-size: 1.2rem; line-height: 1.05; margin: 0; }
.brand-text small { display: block; font-family: var(--font); font-size: .62rem; letter-spacing: .14em; color: var(--muted); font-weight: 600; }
.top-nav { display: none; gap: 2px; }
.top-nav a { padding: 8px 12px; border-radius: 10px; text-decoration: none; font-weight: 600; font-size: .95rem; color: var(--muted); }
.top-nav a:hover { color: var(--ink); background: var(--surface-2); }
.top-nav a[aria-current] { color: var(--brand); background: var(--brand-soft); }
.header-tools { display: flex; gap: 6px; }
.bottom-nav {
  position: fixed; inset: auto 0 0; z-index: 40; display: grid; grid-template-columns: repeat(5, 1fr);
  background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom, 0px); height: calc(var(--bottom-h) + env(safe-area-inset-bottom, 0px));
}
.bottom-nav a { display: grid; place-items: center; align-content: center; gap: 1px; text-decoration: none; font-size: .75rem; font-weight: 600; color: var(--muted); }
.bottom-nav a span { font-size: 1.25rem; line-height: 1; filter: grayscale(.6); }
.bottom-nav a[aria-current] { color: var(--brand); }
.bottom-nav a[aria-current] span { filter: none; transform: translateY(-1px); }
.site-footer { border-top: 1px solid var(--line); margin-top: 60px; padding: 32px 0 24px; background: var(--surface); }
.footer-inner { display: grid; gap: 20px; }
.footer-brand { margin: 0; font-family: var(--display); font-weight: 800; font-size: 1.35rem; line-height: 1.2; }
.footer-tagline { margin: 2px 0 18px; color: var(--muted); }
.dev-card, .dev-credit { display: flex; align-items: center; gap: 12px; }
.dev-card img, .dev-credit img { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; flex: none; border: 2px solid var(--brand); }
.dev-credit img { width: 44px; height: 44px; }
.dev-credit p { margin: 0; }
.dev-card div { display: grid; gap: 1px; line-height: 1.35; }
.dev-label { font-size: .8rem; color: var(--muted); }
.dev-name { font-weight: 700; color: var(--ink); text-decoration: none; }
.dev-name:hover { color: var(--brand); text-decoration: underline; }
.footer-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 16px; }
.footer-actions .live-pill { margin: 0; }
.wa-btn { background: #1fa855; color: #fff; }
.wa-btn:hover { background: #178a45; }
.footer-note { grid-column: 1 / -1; margin: 0; padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: .85rem; }
.live-pill { display: inline-flex; align-items: center; gap: 6px; margin: 12px 0 0; padding: 4px 12px; border-radius: 999px; background: var(--surface-2); color: var(--ink); font-weight: 600; font-size: .9rem; }
.live-pill[hidden] { display: none; }
.live-pill i { width: 8px; height: 8px; border-radius: 50%; background: #22a55a; box-shadow: 0 0 0 0 rgba(34,165,90,.6); animation: live 2s infinite; }
.hero .live-pill { background: rgba(0,0,0,.35); color: #fff; }
@keyframes live { 70% { box-shadow: 0 0 0 7px rgba(34,165,90,0); } 100% { box-shadow: 0 0 0 0 rgba(34,165,90,0); } }
@media (prefers-reduced-motion: reduce) { .live-pill i { animation: none; } }
.footer-links { display: flex; flex-wrap: wrap; gap: 10px 18px; align-content: start; }
.footer-links a { text-decoration: none; font-weight: 600; color: var(--muted); }
.footer-links a:hover { color: var(--brand); }
.crumbs { font-size: .88rem; color: var(--muted); margin-bottom: 10px; }
.crumbs a { color: var(--muted); }
.crumbs.light, .crumbs.light a { color: rgba(255, 255, 255, .85); }
.page-head { padding: 28px 0 14px; }
.page-head p { color: var(--muted); max-width: 64ch; font-size: 1.05rem; }

/* immersive play screen: hide chrome */
body[data-route='play'] .site-header, body[data-route='play'] .bottom-nav, body[data-route='play'] .site-footer { display: none; }
body[data-route='play'] { padding-bottom: env(safe-area-inset-bottom, 0px); }

/* ---------- search & toast ---------- */
#search-dialog { width: min(620px, 100% - 24px); max-height: 80vh; border: 1px solid var(--line); border-radius: 18px; padding: 14px; background: var(--surface); color: var(--ink); box-shadow: var(--shadow-lg); margin-top: 10vh; }
#search-dialog::backdrop { background: rgba(5, 15, 10, .5); backdrop-filter: blur(2px); }
.search-top { display: flex; gap: 8px; margin-bottom: 10px; }
.search-hit { display: grid; gap: 2px; padding: 10px 12px; border-radius: 12px; text-decoration: none; }
.search-hit:hover, .search-hit:focus { background: var(--surface-2); }
.search-hit .tag { justify-self: start; margin: 0; }
.search-hit small { color: var(--muted); }
#toast {
  position: fixed; left: 50%; bottom: calc(var(--bottom-h) + 16px + env(safe-area-inset-bottom, 0px)); z-index: 90; transform: translate(-50%, 20px);
  background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 12px; font-weight: 600; max-width: calc(100% - 32px);
  opacity: 0; pointer-events: none; transition: .25s ease; box-shadow: var(--shadow-lg); text-align: center;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#top-pop {
  position: fixed; left: 50%; top: calc(var(--header-h) + 10px); z-index: 95; transform: translate(-50%, -16px); width: min(460px, calc(100% - 24px));
  display: flex; gap: 10px; align-items: center; padding: 10px 14px; border-radius: 14px; cursor: pointer;
  background: linear-gradient(135deg, #fff7da, #ffe9a8); color: #4a3500; border: 1px solid #f1cf6b; box-shadow: var(--shadow-lg);
  font-size: .92rem; line-height: 1.4; opacity: 0; pointer-events: none; transition: .3s ease;
}
#top-pop > span:first-child { font-size: 1.5rem; }
#top-pop.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }

/* ---------- hero ---------- */
.hero { color: #fff; padding: 20px 0 30px; background: radial-gradient(900px 420px at 88% 10%, rgba(62, 180, 120, .22), transparent 65%), linear-gradient(165deg, #0f4332 0%, #0a2c21 100%); }
.hero-grid { display: grid; gap: 22px; }
.hero-photo { order: -1; position: relative; margin: 0; aspect-ratio: 1113 / 635; border-radius: 18px; overflow: hidden; background: #0d3b2c center / cover no-repeat; border: 1px solid rgba(255, 255, 255, .14); box-shadow: 0 18px 40px rgba(0, 0, 0, .35); }
.hero-photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.hero-photo figcaption { position: absolute; right: 8px; bottom: 8px; padding: 1px 7px; border-radius: 6px; background: rgba(0, 0, 0, .45); font-size: .7rem; }
.hero h1 { color: #fff; font-size: clamp(1.75rem, 7vw, 2.4rem); }
.hero p { font-size: clamp(1rem, 2.4vw, 1.15rem); max-width: 54ch; color: rgba(255, 255, 255, .88); }
.hero-cta { display: flex; flex-wrap: wrap; gap: 10px; margin: 22px 0 22px; }
.hero-cta .btn { flex: 1 1 180px; }
@media (min-width: 560px) { .hero-cta .btn { max-width: 250px; } }
.hero-stats { list-style: none; padding: 0; margin: 0; display: flex; gap: 10px; flex-wrap: wrap; }
.hero-stats li { background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .16); padding: 8px 14px; border-radius: 12px; display: flex; gap: 6px; align-items: baseline; }
.hero-stats b { font-family: var(--display); font-size: 1.25rem; }
.hero-stats span { font-size: .9rem; opacity: .85; }
@media (min-width: 900px) {
  .hero { padding: 64px 0 72px; }
  .hero.hero-sm { padding: 48px 0 72px; }
  .hero-grid { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: center; gap: 48px; }
  .hero-photo { order: 0; border-radius: 22px; box-shadow: 0 30px 60px rgba(0, 0, 0, .4); }
  .hero h1 { font-size: clamp(2.3rem, 3.8vw, 3.3rem); }
}
/* phones: the v2.2 look — edge-to-edge photo that fades into the green, text below it */
@media (max-width: 699px) {
  .hero, .hero.hero-sm { padding-top: 0; }
  .hero-grid { gap: 2px; }
  .hero-photo { margin-inline: -16px; border: 0; border-radius: 0; box-shadow: none; }
  .hero-photo img { filter: saturate(.9) contrast(1.05); }
  .hero-photo::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg, rgba(4, 22, 15, .25) 0%, rgba(4, 22, 15, 0) 30%, rgba(4, 22, 15, 0) 52%, #0d3b2c 100%); }
  .hero-photo figcaption { top: 8px; bottom: auto; z-index: 1; }
  .hero h1 { font-size: clamp(1.75rem, 8vw, 2.3rem); text-shadow: 0 2px 16px rgba(0, 0, 0, .3); }
}
.credit { color: inherit; font-size: .75rem; opacity: .85; text-decoration: none; }
.credit:hover { text-decoration: underline; }

/* ---------- home blocks ---------- */
.resume { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: -26px; position: relative; z-index: 2; background: var(--surface); border: 2px solid var(--accent); border-radius: var(--r); padding: 14px 18px; box-shadow: var(--shadow-lg); }
.resume > span { font-size: 1.8rem; }
.resume div { flex: 1 1 180px; display: grid; }
.resume small { color: var(--muted); }
.daily-row { display: grid; gap: 16px; }
.daily { background: linear-gradient(135deg, var(--brand), #0b4535); color: #fff; border: 0; position: relative; overflow: hidden; }
.daily::after { content: '🎯'; position: absolute; right: -10px; bottom: -24px; font-size: 7rem; opacity: .14; transform: rotate(-12deg); }
.daily .eyebrow { color: #ffd98a; }
.daily .muted { color: rgba(255, 255, 255, .8); }
.daily h2 { color: #fff; }
.daily .btn { background: #fff; color: #0b4535; }
.daily .btn.ghost { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .5); }
.daily-top { display: flex; justify-content: space-between; align-items: center; }
.streak { background: rgba(255, 255, 255, .15); padding: 4px 12px; border-radius: 99px; font-weight: 700; font-size: .9rem; }
.done-today { background: rgba(255, 255, 255, .14); padding: 8px 12px; border-radius: 10px; }
.tip-card { display: flex; flex-direction: column; justify-content: center; background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 30%, transparent); }
.tip-text { font-size: 1.12rem; font-weight: 600; }
.mode-cards { display: grid; gap: 16px; }
.mode-card { display: flex; flex-direction: column; gap: 6px; padding: 24px; border-radius: 20px; text-decoration: none; color: #fff; position: relative; overflow: hidden; box-shadow: var(--shadow); transition: transform .2s ease, box-shadow .2s ease; }
.mode-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.mode-card.t-fun { background: linear-gradient(140deg, #ff8a3d, #e2407a 70%, #a23ac8); }
.mode-card.t-exam { background: linear-gradient(140deg, #13795a, #0c4b39 70%, #0a3529); }
.mode-card h3 { font-size: 1.6rem; color: #fff; margin: 0; }
.mode-card p { color: rgba(255, 255, 255, .92); margin: 0; }
.mode-emoji { font-size: 2.6rem; line-height: 1; }
.mode-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 10px; }
.mode-tags span { background: rgba(255, 255, 255, .18); border-radius: 99px; padding: 3px 10px; font-size: .82rem; font-weight: 600; }
.mode-card .btn { align-self: flex-start; background: #fff; color: #222; margin-top: auto; }
.mini-modes { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.mini-modes a { flex: 1 1 260px; padding: 14px 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); text-decoration: none; }
.mini-modes a:hover { border-color: var(--brand); }
.topic-grid { display: grid; gap: 12px; grid-template-columns: 1fr; }
.topic-card { display: grid; grid-template-columns: auto 1fr; grid-template-areas: 'icon text' 'icon meta'; gap: 2px 14px; align-items: center; padding: 16px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); text-decoration: none; transition: border-color .15s, transform .15s; position: relative; overflow: hidden; }
.topic-card::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--tone, var(--brand)); }
.topic-card:hover { border-color: var(--tone, var(--brand)); transform: translateY(-2px); }
.topic-icon { grid-area: icon; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; font-size: 1.5rem; background: color-mix(in srgb, var(--tone, var(--brand)) 14%, transparent); }
.topic-text { grid-area: text; display: grid; }
.topic-text b { font-size: 1.05rem; }
.topic-text small { color: var(--muted); }
.topic-meta { grid-area: meta; display: flex; align-items: center; gap: 10px; font-size: .85rem; color: var(--muted); }
.topic-meta .meter { flex: 1; max-width: 120px; }
.cu-spot { background: var(--surface); border-block: 1px solid var(--line); padding: 8px 0 36px; }
.gallery { display: grid; grid-auto-flow: column; grid-auto-columns: 82%; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 8px; margin-inline: -16px; padding-inline: 16px; scrollbar-width: thin; }
.gallery figure { margin: 0; scroll-snap-align: start; border-radius: var(--r); overflow: hidden; position: relative; background: var(--surface-2); aspect-ratio: 4 / 3; }
.gallery img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.gallery figure:hover img { transform: scale(1.04); }
.gallery figcaption { position: absolute; inset: auto 0 0; padding: 30px 12px 10px; color: #fff; font-weight: 600; background: linear-gradient(transparent, rgba(0, 0, 0, .72)); display: flex; justify-content: space-between; align-items: flex-end; gap: 8px; flex-wrap: wrap; }
.cu-facts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 18px 0; }
.cu-facts div { background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: grid; }
.cu-facts small { color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; }
.cu-facts.lifted { margin-top: -34px; position: relative; z-index: 2; }
.cu-facts.lifted div { background: var(--surface); box-shadow: var(--shadow); }
.cu-links { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0; }
.uni-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.uni-strip a { display: grid; text-align: center; padding: 14px 6px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); text-decoration: none; }
.uni-strip a:hover { border-color: var(--brand); }
.uni-strip b { font-family: var(--display); font-size: 1.2rem; color: var(--brand); }
.uni-strip small { color: var(--muted); font-size: .78rem; }

/* ---------- posts ---------- */
.post-grid { display: grid; gap: 14px; }
.post-card { display: flex; gap: 14px; padding: 18px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); text-decoration: none; transition: transform .15s, border-color .15s; }
.post-card:hover { transform: translateY(-2px); border-color: var(--brand); }
.post-emoji { flex: none; display: grid; place-items: center; width: 52px; height: 52px; border-radius: 14px; background: var(--brand-soft); font-size: 1.6rem; }
.post-body { display: grid; gap: 3px; }
.post-body .tag { justify-self: start; margin: 0; }
.post-body b { font-family: var(--display); font-size: 1.15rem; line-height: 1.3; }
.post-body small { color: var(--muted); }
.post-meta { font-size: .8rem; color: var(--muted); }
.post-card.big { background: linear-gradient(140deg, var(--brand-soft), var(--surface)); flex-direction: column; }
.post-card.big .post-emoji { width: 64px; height: 64px; font-size: 2rem; background: var(--surface); }
.post-card.big b { font-size: 1.45rem; }
.quick-tips { display: grid; gap: 10px; }
.quick-tips p { margin: 0; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.prose { font-size: 1.06rem; }
.prose h2 { margin-top: 1.6em; }
.prose h3 { margin-top: 1.2em; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin-bottom: .35em; }
.prose code { background: var(--surface-2); padding: 1px 6px; border-radius: 6px; font-size: .92em; }
.post > .post-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: -4px; }
.post-cta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 16px; margin: 18px 0; border-radius: 14px; background: var(--surface); border: 1.5px solid color-mix(in srgb, var(--tone, var(--brand)) 45%, var(--line)); }
.post-cta > span { font-size: 1.8rem; }
.post-cta > div { flex: 1 1 200px; display: grid; }
.post-cta small { color: var(--muted); }
.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 36px; }
.post-nav a { display: grid; padding: 14px; border-radius: 12px; border: 1px solid var(--line); text-decoration: none; background: var(--surface); }
.post-nav a.right { text-align: right; }
.post-nav small { color: var(--muted); }

/* ---------- universities ---------- */
.uni-grid, .update-grid { display: grid; gap: 14px; }
.uni-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; display: grid; gap: 6px; }
.uni-top { display: flex; gap: 12px; align-items: center; text-decoration: none; }
.uni-top b { display: block; }
.uni-top small { color: var(--muted); font-size: .82rem; }
.uni-top > span:nth-child(2) { flex: 1; min-width: 0; }
.uni-go { font-size: 1.6rem; line-height: 1; color: var(--muted); }
.uni-top:hover .uni-go { color: var(--brand); }
.uni-badge { flex: none; display: grid; place-items: center; min-width: 54px; height: 54px; padding: 0 6px; border-radius: 14px; background: var(--brand-soft); color: var(--brand); font-family: var(--display); font-weight: 800; font-size: 1rem; }
.uni-links { display: flex; flex-wrap: wrap; gap: 6px; }
.uni-card p { margin: 0; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.dir { width: 100%; border-collapse: collapse; font-size: .92rem; min-width: 560px; }
.dir th, .dir td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.dir th { background: var(--surface-2); font-size: .82rem; text-transform: uppercase; letter-spacing: .04em; }
.dir tr:last-child td { border-bottom: 0; }
.dir td a { text-decoration: none; }
.update-grid .card { display: grid; gap: 6px; align-content: start; }
.update-grid .card .tag { justify-self: start; }
.checklist { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.checklist label { display: flex; gap: 12px; align-items: center; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; cursor: pointer; }
.checklist input { width: 22px; height: 22px; accent-color: var(--brand); flex: none; }
.checklist input:checked + span { text-decoration: line-through; color: var(--muted); }
.profile { display: grid; gap: 20px; margin-top: 20px; }
.toc { display: flex; gap: 8px; overflow-x: auto; position: sticky; top: var(--header-h); background: var(--bg); padding: 10px 0; z-index: 5; }
.toc a { padding: 6px 14px; border-radius: 99px; border: 1px solid var(--line); text-decoration: none; font-weight: 600; font-size: .9rem; white-space: nowrap; background: var(--surface); }
.profile section { padding-bottom: 10px; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; margin: 14px 0; }
.facts div { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; }
.facts dt { font-size: .78rem; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.facts dd { margin: 2px 0 0; font-weight: 600; }
.story { display: grid; gap: 14px; margin-top: 28px; }
.story-block { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 22px; }
.story-block p { font-size: 1.05rem; }
.subject-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; margin-top: 12px; }
.subject-grid article { background: var(--bg); border-radius: 12px; padding: 12px 14px; }
.subject-grid h3 { font-size: 1rem; margin-bottom: 4px; }
.subject-grid p { font-size: .9rem; color: var(--muted); margin: 0; }

/* ---------- start / setup ---------- */
.mode-tabs { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 6px; background: var(--surface-2); border-radius: 14px; padding: 5px; margin-bottom: 22px; }
.mode-tabs a { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 46px; border-radius: 10px; text-decoration: none; font-weight: 700; color: var(--muted); font-size: .95rem; }
.mode-tabs a.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.mode-tabs a.active.t-fun { color: var(--fun-2); }
.mode-tabs a.active.t-exam { color: var(--brand); }
.mode-tabs a.active.t-practice { color: var(--info); }
.setup { display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; }
.setup > * { min-width: 0; }
.step { display: flex; align-items: center; gap: 10px; font-size: 1.2rem; }
.step span { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--brand); color: var(--brand-ink); font-size: .95rem; }
.picks { display: grid; gap: 8px; }
.pick-group { margin: 22px 0 10px; font-size: 1.05rem; color: var(--muted); }
.pick { position: relative; display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 14px; border: 2px solid var(--line); background: var(--surface); cursor: pointer; transition: border-color .15s, background .15s; }
.pick input { position: absolute; opacity: 0; pointer-events: none; }
.pick:hover { border-color: color-mix(in srgb, var(--tone, var(--brand)) 60%, var(--line)); }
.pick.is-checked { border-color: var(--tone, var(--brand)); background: color-mix(in srgb, var(--tone, var(--brand)) 9%, var(--surface)); }
.pick.is-checked::after { content: '✓'; position: absolute; top: -8px; right: -8px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--tone, var(--brand)); color: #fff; font-size: .8rem; font-weight: 800; }
.pick:has(input:focus-visible) { outline: 3px solid var(--accent); }
.pick:has(input:disabled) { opacity: .45; cursor: not-allowed; }
.pick-icon { font-size: 1.5rem; width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; background: color-mix(in srgb, var(--tone, var(--brand)) 13%, transparent); }
.pick-text { display: grid; }
.pick-text small { color: var(--muted); font-size: .85rem; }
.pick-count { text-align: right; font-weight: 700; display: grid; font-size: .95rem; }
.pick-count small { color: var(--good); font-size: .75rem; }
.avatars { display: flex; flex-wrap: wrap; gap: 6px; }
.avatars label { position: relative; }
.avatars input { position: absolute; opacity: 0; inset: 0; }
.avatars span { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; border: 2px solid var(--line); font-size: 1.3rem; cursor: pointer; background: var(--surface); }
.avatars input:checked + span { border-color: var(--brand); background: var(--brand-soft); transform: scale(1.06); }
.avatars input:focus-visible + span { outline: 3px solid var(--accent); }

/* ---------- play ---------- */
.play { min-height: 100vh; min-height: 100dvh; padding-bottom: 32px; }
.play-top { position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); padding-top: env(safe-area-inset-top, 0px); }
.play-top-inner { display: flex; align-items: center; gap: 10px; min-height: 58px; }
.play-title { flex: 1; display: grid; min-width: 0; line-height: 1.25; }
.play-title small { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.timer-chip { display: inline-flex; align-items: center; gap: 4px; padding: 6px 12px; border-radius: 99px; background: var(--surface); border: 1.5px solid var(--line); font-variant-numeric: tabular-nums; font-size: 1rem; white-space: nowrap; }
.timer-chip.urgent { border-color: var(--bad); color: var(--bad); background: var(--bad-soft); animation: pulse 1s infinite; }
@keyframes pulse { 50% { transform: scale(1.06); } }
.bar { height: 5px; background: var(--surface-2); }
.bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--brand-2), var(--good)); transition: width .35s ease; }
.q-timer { height: 4px; }
.q-timer span { background: linear-gradient(90deg, var(--fun), var(--fun-2)); transition: width .2s linear; width: 100%; }
.q-timer.frozen span { background: #67c6f5; }
.play-grid { display: grid; gap: 20px; padding-top: 18px; }
.play-main { max-width: 760px; width: 100%; margin-inline: auto; }
.hud { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 10px; }
.hud div { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 8px; text-align: center; display: grid; }
.hud small { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; }
.hud b { font-family: var(--display); font-size: 1.4rem; line-height: 1.1; }
.hud b.hot { color: var(--fun-2); }
.lifelines { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.lifelines .chip:last-child { margin-left: auto; }
.qcard { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 20px; box-shadow: var(--shadow); }
.q-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: .82rem; color: var(--muted); margin-bottom: 10px; font-weight: 600; }
.q-meta .src { margin-left: auto; font-weight: 500; }
.q-text { font-family: var(--font); font-weight: 600; font-size: clamp(1.18rem, 3.6vw, 1.45rem); line-height: 1.5; margin-bottom: 18px; }
.opts { display: grid; gap: 10px; }
.opt {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 58px; padding: 10px 14px; border-radius: 14px;
  border: 2px solid var(--line); background: var(--surface); text-align: left; cursor: pointer; font-size: 1.05rem; transition: border-color .12s, background .12s, transform .08s;
}
.opt:hover:not(:disabled) { border-color: var(--brand-2); background: var(--brand-soft); }
.opt:active:not(:disabled) { transform: scale(.99); }
.opt .key { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--surface-2); font-weight: 800; font-size: .95rem; }
.opt .txt { flex: 1; }
.opt i { font-style: normal; font-weight: 800; font-size: 1.2rem; }
.opt.chosen { border-color: var(--brand); background: var(--brand-soft); }
.opt.chosen .key { background: var(--brand); color: var(--brand-ink); }
.opt.right { border-color: var(--good); background: var(--good-soft); }
.opt.right .key { background: var(--good); color: #fff; }
.opt.right i { color: var(--good); }
.opt.wrong { border-color: var(--bad); background: var(--bad-soft); }
.opt.wrong .key { background: var(--bad); color: #fff; }
.opt.wrong i { color: var(--bad); }
.opt.gone { opacity: .25; text-decoration: line-through; }
.opt:disabled { cursor: default; }
.play-exam .opt.chosen { box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 20%, transparent); }
.feedback { margin-top: 16px; padding: 14px 16px; border-radius: 14px; border-left: 5px solid; animation: rise .25s ease; }
.feedback.good { background: var(--good-soft); border-color: var(--good); }
.feedback.bad { background: var(--bad-soft); border-color: var(--bad); }
.feedback > b { display: block; font-size: 1.08rem; margin-bottom: 6px; }
.explain p { margin: 0 0 6px; }
.bn-note { color: var(--muted); }
.bn-note b { color: var(--ink); }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }
.play-nav { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.play-nav .btn.big { flex: 1; }
.play-exam .play-nav { display: grid; grid-template-columns: 1fr auto 1fr; }
.play-nav .hint { flex: 1; }
.end-btn { display: block; margin: 18px auto 0; color: var(--muted); font-weight: 500; font-size: .9rem; }
.palette { position: fixed; inset: auto 0 0; z-index: 60; background: var(--surface); border-radius: 22px 22px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom, 0px)); box-shadow: var(--shadow-lg); max-height: 75vh; overflow-y: auto; transform: translateY(105%); transition: transform .25s ease; }
body.palette-open .palette { transform: none; }
body.palette-open::after { content: ''; position: fixed; inset: 0; background: rgba(0, 0, 0, .4); z-index: 55; }
.palette-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.palette-stats { display: flex; gap: 14px; flex-wrap: wrap; font-size: .85rem; color: var(--muted); margin-bottom: 12px; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: var(--surface-2); border: 1px solid var(--line); margin-right: 5px; vertical-align: -1px; }
.dot.ans { background: var(--brand); border-color: var(--brand); }
.dot.flag { background: var(--accent); border-color: var(--accent); }
.palette-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 6px; margin-bottom: 14px; }
.palette-grid button { aspect-ratio: 1; min-height: 44px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--surface); font-weight: 700; cursor: pointer; position: relative; }
.palette-grid button.ans { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.palette-grid button.flag::after { content: ''; position: absolute; top: 3px; right: 3px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.palette-grid button.here { outline: 3px solid var(--accent); outline-offset: 1px; }
.shake { animation: shake .35s ease; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.confetti { position: fixed; top: -40px; z-index: 99; pointer-events: none; animation: fall 2.2s cubic-bezier(.3, .6, .5, 1) forwards; }
@keyframes fall { to { transform: translateY(110vh) rotate(540deg); opacity: .2; } }

/* ---------- result ---------- */
.result-hero { display: grid; gap: 18px; justify-items: center; text-align: center; padding: 26px 18px; }
.ring { --size: 168px; width: var(--size); height: var(--size); border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--tone) calc(var(--p) * 1%), var(--surface-2) 0); position: relative; }
.ring::before { content: ''; position: absolute; inset: 14px; border-radius: 50%; background: var(--surface); }
.ring div { position: relative; display: grid; }
.ring b { font-family: var(--display); font-size: 2.3rem; line-height: 1; }
.ring small { color: var(--muted); }
.result-stats { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.result-stats div { min-width: 72px; padding: 8px 12px; border-radius: 12px; background: var(--surface-2); display: grid; }
.result-stats b { font-family: var(--display); font-size: 1.2rem; }
.result-stats small { color: var(--muted); font-size: .8rem; }
.result-actions { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 10px; }
@media (max-width: 559px) { .result-actions { display: grid; grid-template-columns: 1fr 1fr; } .result-actions > :first-child:not(:only-child) { grid-column: 1 / -1; } .result-actions .link-btn { grid-column: 1 / -1; } }
.bars { display: grid; gap: 10px; }
.bar-row { display: grid; grid-template-columns: minmax(110px, 1fr) 2fr auto auto; gap: 10px; align-items: center; font-size: .93rem; }
.reviews { display: grid; gap: 12px; }
.reviews[data-filter='wrong'] .review:not(.wrong), .reviews[data-filter='skipped'] .review:not(.skipped),
.reviews[data-filter='right'] .review:not(.right), .reviews[data-filter='flag'] .review:not([data-flag]) { display: none; }
.review { background: var(--surface); border: 1px solid var(--line); border-left: 5px solid var(--line); border-radius: 14px; padding: 16px; }
.review.right { border-left-color: var(--good); }
.review.wrong { border-left-color: var(--bad); }
.review.skipped { border-left-color: var(--accent); }
.review h3 { font-family: var(--font); font-weight: 600; font-size: 1.05rem; }
.review-opts { list-style: none; padding: 0; margin: 0 0 8px; display: grid; gap: 6px; }
.review-opts li { display: flex; gap: 10px; align-items: center; padding: 6px 10px; border-radius: 10px; background: var(--bg); }
.review-opts li.right { background: var(--good-soft); font-weight: 700; }
.review-opts li.wrong { background: var(--bad-soft); }
.review-opts .key { font-weight: 800; width: 22px; }
.review details summary { cursor: pointer; font-weight: 700; color: var(--brand); padding: 4px 0; }
.review details p { margin: 6px 0; }

/* ---------- leaderboard ---------- */
.lb .seg { margin-bottom: 12px; }
.lb-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.lb-list li { display: grid; grid-template-columns: 36px 40px 1fr auto; gap: 10px; align-items: center; padding: 10px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.lb-list li.me { border-color: var(--accent); background: var(--accent-soft); }
.lb-rank { font-weight: 800; text-align: center; font-size: 1.1rem; }
.lb-avatar { font-size: 1.5rem; text-align: center; }
.lb-name { display: grid; min-width: 0; }
.lb-name b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lb-name em { font-style: normal; color: var(--fun-2); font-size: .85rem; }
.lb-name small { color: var(--muted); font-size: .8rem; }
.lb-score { font-family: var(--display); font-weight: 800; font-size: 1.2rem; color: var(--brand); }

/* ---------- progress ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; display: grid; }
.stat b { font-family: var(--display); font-size: 1.7rem; line-height: 1.1; }
.stat small { color: var(--muted); }
.mistake-card { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.big-num { font-family: var(--display); font-size: 2.4rem; color: var(--bad); line-height: 1; }
.mistake-card span { flex: 1 1 160px; }
.history { display: grid; gap: 8px; }
.history-row { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; text-decoration: none; }
.history-row:hover { border-color: var(--brand); }
.history-row span:nth-child(2) { display: grid; min-width: 0; }
.history-row small { color: var(--muted); font-size: .82rem; }
.h-icon { font-size: 1.4rem; }
.h-score { font-weight: 800; font-family: var(--display); }

/* ---------- responsive ---------- */
.only-mobile { display: inline-grid; }
@media (min-width: 700px) {
  body { font-size: 17px; }
  .daily-row { grid-template-columns: 1.3fr 1fr; }
  .mode-cards { grid-template-columns: 1fr 1fr; }
  .topic-grid { grid-template-columns: repeat(2, 1fr); }
  .post-grid { grid-template-columns: repeat(2, 1fr); }
  .post-card.big { grid-row: span 2; }
  .uni-grid, .update-grid { grid-template-columns: repeat(2, 1fr); }
  .gallery { grid-auto-columns: 46%; }
  .cu-facts { grid-template-columns: repeat(4, 1fr); }
  .uni-strip { grid-template-columns: repeat(8, 1fr); }
  .stat-grid { grid-template-columns: repeat(4, 1fr); }
  .picks { grid-template-columns: repeat(2, 1fr); }
  .footer-inner { grid-template-columns: 1.4fr 1fr; align-items: start; }
  .qcard { padding: 28px; }
  .opts { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 960px) {
  body { padding-bottom: 0; }
  .bottom-nav { display: none; }
  .top-nav { display: flex; }
  .brand { margin-right: 12px; }
  .header-tools { margin-left: auto; }
  #toast { bottom: 24px; }
  .section { margin-block: 56px; }
  .topic-grid { grid-template-columns: repeat(3, 1fr); }
  .post-grid { grid-template-columns: repeat(3, 1fr); }
  .uni-grid { grid-template-columns: repeat(3, 1fr); }
  .update-grid { grid-template-columns: repeat(4, 1fr); }
  .gallery { grid-auto-flow: row; grid-template-columns: repeat(3, 1fr); overflow: visible; margin: 0; padding: 0; }
  .gallery figure.wide { grid-column: span 2; grid-row: span 2; aspect-ratio: auto; }
  .sticky { position: sticky; top: calc(var(--header-h) + 16px); }
  .play-grid.with-palette { grid-template-columns: 1fr 300px; align-items: start; }
  .palette { position: sticky; top: 84px; inset: auto; transform: none; border-radius: var(--r); border: 1px solid var(--line); box-shadow: var(--shadow); max-height: calc(100vh - 110px); z-index: 1; }
  .only-mobile { display: none; }
  body.palette-open::after { display: none; }
  .profile { grid-template-columns: 200px 1fr; align-items: start; }
  .toc { flex-direction: column; top: calc(var(--header-h) + 16px); }
  .result-hero { grid-template-columns: auto 1fr; text-align: left; justify-items: start; padding: 28px 32px; }
  .result-hero .ring { grid-row: span 4; --size: 190px; }
  .result-stats, .result-actions { justify-content: flex-start; }
}
@media (hover: none) {
  .opt:hover:not(:disabled) { border-color: var(--line); background: var(--surface); }
  .opt.chosen:hover { border-color: var(--brand); background: var(--brand-soft); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
@media print {
  .site-header, .bottom-nav, .site-footer, .play-top, .play-nav, .palette { display: none !important; }
}

@media (min-width: 960px) {
  .with-palette .play-main { max-width: none; margin: 0; }
}

/* exam: clear a chosen answer */
.clear-btn { display: block; margin: 12px 0 0 auto; font-size: .88rem; color: var(--muted); }

/* older browsers without color-mix(): keep surfaces solid */
@supports not (background: color-mix(in srgb, red 50%, blue)) {
  .site-header, .play-top { background: var(--bg); }
  .bottom-nav { background: var(--surface); }
  .topic-icon, .pick-icon { background: var(--surface-2); }
  .pick.is-checked { background: var(--brand-soft); }
  .notice { border-color: var(--line); }
}

/* jump links land below the sticky header + section tabs */
.profile section { scroll-margin-top: calc(var(--header-h) + 64px); }
@media (min-width: 960px) { .profile section { scroll-margin-top: calc(var(--header-h) + 16px); } }

/* phones */
@media (max-width: 699px) {
  .cu-facts.lifted { margin-top: 16px; }
}

/* show only on desktop / hide the empty hint slot */
@media (max-width: 959px) { .desktop-only { display: none !important; } }
.play-nav .hint:empty { flex: 1; }
.review .answer-line { margin: 2px 0 8px; font-weight: 600; color: var(--good); }
.review .explain { background: var(--bg); border-radius: 10px; padding: 10px 12px; }
.review .explain p { margin: 0 0 4px; }
.review .explain p:last-child { margin-bottom: 0; }

/* score page */
.section-tight { margin-block: 22px 30px; }
.section-tight > .h3 { margin-bottom: 12px; }
.my-name { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; font-size: 1.05rem; }
.my-name > span { font-size: 1.4rem; }
.section-tight .history { margin-top: 12px; }
.feedback-card { padding: 20px; }
.feedback-card p { margin: 0 0 14px; color: var(--muted); }

/* setup: name → topic → count, one start bar */
.setup-name, .setup-count { padding: 18px; }
.setup-name .label { display: block; margin: 10px 0 6px; }
.setup-name input { width: 100%; }
.setup-name .avatars { margin-top: 12px; flex-wrap: nowrap; overflow-x: auto; padding: 4px 2px 6px; scrollbar-width: none; }
.setup-name .avatars::-webkit-scrollbar { display: none; }
.setup-name .avatars span { width: 40px; height: 40px; }
.field-error { margin: 8px 0 0; color: var(--bad); font-weight: 600; font-size: .9rem; }
#player-name[aria-invalid='true'] { border-color: var(--bad); box-shadow: 0 0 0 3px color-mix(in srgb, var(--bad) 25%, transparent); }
.setup-count .seg { margin-top: 10px; }
.start-bar {
  position: sticky; bottom: calc(var(--bottom-h) + 10px + env(safe-area-inset-bottom, 0px)); z-index: 30;
  display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 16px; border-radius: 16px;
  background: color-mix(in srgb, var(--surface) 96%, transparent); border: 1px solid var(--line); box-shadow: var(--shadow-lg);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.start-summary { flex: 1; min-width: 0; font-weight: 600; font-size: .9rem; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.start-bar .btn { flex: none; }
@media (min-width: 960px) {
  .setup { grid-template-columns: minmax(0, 1fr) 360px; grid-template-areas: 'topic name' 'topic count' 'topic .' 'bar bar'; align-items: start; }
  .setup-topic { grid-area: topic; }
  .setup-name { grid-area: name; }
  .setup-count { grid-area: count; }
  .start-bar { grid-area: bar; bottom: 16px; }
}

/* vocabulary list */
.vocab-tools { display: grid; gap: 12px; margin-bottom: 18px; }
.vocab-tools input { width: 100%; }
.chips.letters { gap: 6px; margin: 0; }
.chips.letters .chip { min-width: 38px; justify-content: center; padding-inline: 8px; }
.vocab-list { display: grid; gap: 10px; }
.vocab-item { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 16px; }
.vocab-item h3 { margin: 0; font-size: 1.1rem; }
.vocab-item h3 small { margin-left: 6px; font-size: .75rem; font-weight: 600; color: var(--muted); text-transform: lowercase; }
.vocab-bn { margin: 4px 0 0; }
.vocab-rel { margin: 6px 0 0; display: flex; flex-wrap: wrap; gap: 4px 14px; color: var(--muted); font-size: .88rem; }
.vocab-rel b { color: var(--ink); font-weight: 700; }
@media (min-width: 700px) { .vocab-list { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .vocab-list { grid-template-columns: repeat(3, 1fr); } }

/* ---------- roll number + my rank ---------- */
.hint { margin: 6px 0 0; font-size: .85rem; color: var(--muted); }
.tag-preview { margin: 6px 0 0; font-size: .9rem; min-height: 1.2em; }
#player-roll { max-width: 180px; letter-spacing: .08em; }
.rank-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 12px; margin: 10px 0 14px; }
.rank-card { display: grid; gap: 2px; padding: 14px 16px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--tone, var(--brand)); }
.rank-card.t-fun { --tone: var(--fun, #e8590c); }
.rank-card .rank-mode { font-weight: 700; font-size: .9rem; }
.rank-card > b { font-family: var(--display); font-size: 2rem; line-height: 1.1; }
.rank-card > small { color: var(--muted); }
.rank-card dl { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; margin: 10px 0 0; }
.rank-card dl div { display: grid; }
.rank-card dt { font-size: .75rem; color: var(--muted); }
.rank-card dd { margin: 0; font-weight: 700; }

/* ---------- university rankings ---------- */
.rank-table { display: grid; gap: 8px; }
.rank-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.rank-row span { display: grid; gap: 2px; min-width: 0; }
.rank-row small { color: var(--muted); font-size: .8rem; }
.rank-row strong { font-family: var(--display); font-size: 1.25rem; color: var(--brand); white-space: nowrap; }
.rank-row.unranked strong { font-size: .95rem; color: var(--muted); }
