/* ===== Math Quiz — Global Styles ===== */
:root {
  --navy: #1A2332;
  --deep-blue: #002769;
  --brand-blue: #1F518B;
  --gold: #F49D0D;
  --ice: #E1E8FC;
  --mist: #EAECF2;
  --white: #FFFFFF;
  --bg: var(--mist);
  --panel: var(--white);
  --panel-border: rgba(26, 35, 50, 0.12);
  --text: var(--navy);
  --ink: var(--navy);
  --muted: rgba(26, 35, 50, 0.68);
  --accent: var(--gold);
  --accent-2: var(--brand-blue);
  --good: var(--brand-blue);
  --bad: var(--gold);
  --shadow: 0 18px 42px -22px rgba(0, 39, 105, 0.35);
  --radius: 18px;
  --header-bg: var(--navy);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

body {
  font-family: "Plus Jakarta Sans", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  background: linear-gradient(180deg, var(--white) 0%, var(--ice) 58%, var(--mist) 100%);
  background-attachment: fixed;
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

/* ===== Accessibility & micro-polish ===== */
/* this app is light-only — "only light" is the strongest opt-out so phones
   (Samsung Internet / MIUI / Chrome force-dark) cannot auto-invert it */
html { scroll-behavior: smooth; color-scheme: only light; background: var(--white); }
:root { color-scheme: only light; }
body { accent-color: var(--brand-blue); background-color: var(--white); }
/* Samsung Internet / SI ignore "color-scheme: only light" and apply their own
   inversion UNLESS the page ships real prefers-color-scheme:dark rules. So we
   declare a full "dark theme" that is actually our light palette — this makes
   the browser treat us as dark-aware and stop force-inverting. */
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: only light;
    --bg: #EAECF2; --panel: #FFFFFF; --panel-border: rgba(26,35,50,0.12);
    --text: #1A2332; --ink: #1A2332; --muted: rgba(26,35,50,0.68); --header-bg: #1A2332;
  }
  html { background: #FFFFFF; }
  body {
    background: linear-gradient(180deg, #FFFFFF 0%, #E1E8FC 58%, #EAECF2 100%);
    color: #1A2332;
  }
  .site-header { background: #1A2332; }
  .site-footer { background: #FFFFFF; color: #1A2332; }
  .panel, .stat, .pm-menu, .empty, .notfound { background: #FFFFFF; color: #1A2332; }
}

::selection { background: rgba(244, 157, 13, 0.30); color: var(--navy); }

/* visible keyboard focus — brand gold ring (mouse interaction stays clean) */
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 3px solid var(--gold) !important; outline-offset: 2px;
}

/* tactile press feedback */
.btn:active { transform: translateY(1px) scale(0.985); }
.card-share:active { transform: scale(0.92); }
.option:not(:disabled):active { transform: scale(0.99); }
.profile-btn:active { transform: scale(0.97); }
.card[tabindex]:active { transform: scale(0.99); }

/* honour users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .card { opacity: 1 !important; transform: none !important; }
}

/* skip-to-content link (revealed on keyboard focus) */
.skip-link {
  position: fixed; left: 14px; top: -64px; z-index: 100;
  background: var(--gold); color: var(--navy); font-weight: 800;
  padding: 11px 20px; border-radius: 0 0 12px 12px; font-size: 14px;
  box-shadow: 0 10px 24px -8px rgba(0,39,105,0.5); transition: top .2s ease;
}
.skip-link:focus { top: 0; }

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  width: 100%;
}

/* ===== Header (always dark) ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: linear-gradient(90deg, var(--navy), var(--deep-blue) 58%, var(--brand-blue));
  border-bottom: 1px solid rgba(225, 232, 252, 0.18);
  box-shadow: 0 14px 34px -28px rgba(0, 39, 105, 0.75);
}
.site-header .brand { color: #fff; }
.site-header .btn {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.16);
}
.site-header .btn:hover { background: rgba(255, 255, 255, 0.16); }
.site-header .btn.ghost { background: transparent; }
.site-header .btn.primary {
  background: var(--gold);
  border-color: rgba(244, 157, 13, 0.24); color: var(--navy);
}
.site-header .user-chip {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.16);
  color: #fff;
}
.site-header .user-chip .uname { color: #fff; }
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 20px;
  letter-spacing: 0.2px;
}
.brand .logo {
  width: 44px; height: 44px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: #fff; padding: 4px; overflow: hidden;
  box-shadow: 0 6px 18px rgba(0, 39, 105, 0.35);
  flex: 0 0 44px;
}
.brand .logo img { width: 100%; height: 100%; object-fit: contain; display: block; }
.brand .mind { color: var(--gold); }
.nav-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.btn {
  border: 1px solid var(--panel-border);
  background: var(--panel);
  color: var(--text);
  padding: 10px 18px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 14px;
  transition: transform .12s ease, background .2s ease, border-color .2s ease;
}
.btn:hover { transform: translateY(-1px); background: var(--ice); border-color: rgba(31,81,139,0.24); }
.btn.primary {
  background: var(--gold);
  border-color: transparent;
  color: var(--navy);
  box-shadow: 0 10px 22px rgba(244, 157, 13, 0.28);
}
.btn.primary:hover { box-shadow: 0 12px 26px rgba(244, 157, 13, 0.38); }
.btn.ghost { background: transparent; }
.btn.small { padding: 7px 14px; font-size: 13px; }

/* ===== Profile dropdown ===== */
.profile { position: relative; }
.profile-btn {
  display: flex; align-items: center; gap: 9px;
  padding: 5px 12px 5px 6px; border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.16);
  background: rgba(255,255,255,0.08); color: #fff;
  font-weight: 600; font-size: 14px; transition: background .18s;
}
.profile-btn:hover { background: rgba(255,255,255,0.16); }
.profile-btn .avatar {
  width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--brand-blue), var(--deep-blue));
  font-weight: 700; font-size: 13px; color: #fff;
  box-shadow: 0 0 0 2px rgba(244,157,13,0.85);
}
.profile-btn .caret { font-size: 11px; opacity: .8; transition: transform .2s; }
.profile.open .profile-btn .caret { transform: rotate(180deg); }

.profile-menu {
  position: absolute; right: 0; top: calc(100% + 12px); min-width: 250px;
  background: #fff; border: 1px solid var(--panel-border); border-radius: 18px;
  box-shadow: 0 28px 60px -18px rgba(20,40,90,0.45), 0 0 0 1px rgba(20,40,90,0.03);
  padding: 10px;
  opacity: 0; visibility: hidden; transform: translateY(-8px) scale(.97);
  transform-origin: top right;
  transition: opacity .18s ease, transform .18s ease, visibility .18s; z-index: 40;
}
.profile.open .profile-menu { opacity: 1; visibility: visible; transform: none; }
.pm-head {
  display: flex; align-items: center; gap: 12px; padding: 14px;
  background: linear-gradient(135deg, var(--navy), var(--deep-blue));
  border-radius: 12px; margin-bottom: 8px;
}
.pm-head .avatar.lg {
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--gold), #E08600); color: var(--navy);
  font-weight: 800; font-size: 15px; flex: 0 0 44px;
  box-shadow: 0 0 0 2px rgba(255,255,255,0.35);
}
.pm-id { min-width: 0; }
.pm-head strong { display: block; font-size: 14.5px; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pm-head small { color: rgba(225,232,252,0.75); font-size: 12px; }
.pm-item {
  display: flex; align-items: center; gap: 11px; width: 100%; text-align: left;
  padding: 8px 9px; border-radius: 11px;
  border: 0; background: none; font-family: inherit; font-size: 14px; font-weight: 600;
  color: var(--ink); cursor: pointer; transition: background .15s;
}
.pm-item:hover { background: rgba(31,81,139,0.08); }
.pm-ic {
  flex: 0 0 32px; width: 32px; height: 32px; border-radius: 9px;
  display: grid; place-items: center;
  background: rgba(31,81,139,0.10); color: var(--brand-blue); transition: .15s;
}
.pm-ic svg { width: 15px; height: 15px; }
.pm-item:hover .pm-ic { background: var(--brand-blue); color: #fff; }
.pm-sep { height: 1px; background: var(--panel-border); margin: 7px 10px; }
.pm-item.danger { color: #A8631E; }
.pm-item.danger .pm-ic { background: rgba(244,157,13,0.16); color: #A8631E; }
.pm-item.danger:hover { background: rgba(244,157,13,0.14); }
.pm-item.danger:hover .pm-ic { background: #E08600; color: #fff; }

/* ===== Hero ===== */
.hero { text-align: center; padding: 54px 20px 18px; }
.hero h1 {
  font-size: clamp(30px, 5vw, 46px);
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: -0.5px;
}
.hero h1 .grad {
  background: linear-gradient(120deg, var(--brand-blue), var(--gold));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p { color: var(--muted); margin-top: 14px; font-size: 17px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 18px; border-radius: 999px;
  background: rgba(244, 157, 13, 0.12); border: 1px solid rgba(244, 157, 13, 0.30);
  color: var(--deep-blue); font-size: 12.5px; font-weight: 700; margin-bottom: 20px;
  letter-spacing: .3px; text-transform: uppercase;
}
.hero-stats { display: flex; justify-content: center; gap: 42px; margin-top: 28px; flex-wrap: wrap; }
.hero-stats .stat { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.hero-stats .stat b {
  font-size: 28px; font-weight: 800;
  background: linear-gradient(120deg, var(--brand-blue), var(--gold));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-stats .stat span { font-size: 12.5px; color: var(--muted); font-weight: 600; }

/* ===== Cards Grid ===== */
.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  padding: 30px 0 70px;
}
.card {
  --ac: #1F66B0;
  --ct: #fff;            /* text colour on the coloured card */
  position: relative;
  border-radius: 20px;
  padding: 24px;
  min-height: 212px;
  color: var(--ct);
  display: flex;
  flex-direction: column;
  background: linear-gradient(155deg, color-mix(in srgb, var(--ac) 84%, #fff), var(--ac));
  box-shadow: 0 16px 34px -18px color-mix(in srgb, var(--ac) 55%, rgba(0,39,105,0.35));
  overflow: hidden;
  transition: transform .2s ease, box-shadow .2s ease;
  cursor: pointer;
  border: 1px solid rgba(255,255,255,0.16);
  opacity: 0; animation: cardIn .5s ease forwards;
}
.card::after {
  content: ""; position: absolute; inset: 0; border-radius: 20px; z-index: 0;
  background: radial-gradient(130% 90% at 100% 0%, rgba(255,255,255,0.22), transparent 52%);
  pointer-events: none;
}
.card:hover { transform: translateY(-7px); box-shadow: 0 28px 52px -20px color-mix(in srgb, var(--ac) 65%, rgba(0,39,105,0.45)); }
@keyframes cardIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.card-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; position: relative; z-index: 1; }
.card .icon {
  width: 52px; height: 52px;
  border-radius: 14px;
  display: grid; place-items: center;
  background: rgba(255,255,255,0.20);
  color: var(--ct);
  border: 1px solid rgba(255,255,255,0.28);
}
.card .icon svg { width: 28px; height: 28px; }
.quiz-top .pill svg { width: 16px; height: 16px; vertical-align: -3px; margin-right: 4px; }
.card-meta {
  font-size: 11.5px; font-weight: 700; letter-spacing: .3px;
  padding: 6px 12px; border-radius: 999px;
  background: rgba(255,255,255,0.20);
  color: var(--ct);
  border: 1px solid rgba(255,255,255,0.26);
}
.card h3 { font-size: 22px; font-weight: 800; position: relative; z-index: 1; }
.card p { margin-top: 7px; margin-bottom: 22px; font-size: 14px; opacity: 0.92; line-height: 1.45; position: relative; z-index: 1; }
.card-cta {
  margin-top: auto; align-self: center;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 12px 28px; border-radius: 999px;
  background: rgba(255,255,255,0.22); border: 1px solid rgba(255,255,255,0.30); color: var(--ct);
  font-size: 14px; font-weight: 800; letter-spacing: .2px;
  position: relative; z-index: 1;
  transition: background .2s ease, transform .2s ease;
}
.card:hover .card-cta { background: rgba(255,255,255,0.34); transform: translateY(-2px); }
.card-cta .cta-arrow {
  width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center; font-size: 15px;
  background: rgba(255,255,255,0.26); border: 1px solid rgba(255,255,255,0.34);
  transition: transform .2s ease, background .2s ease;
}
.card:hover .cta-arrow { transform: translateX(3px); background: rgba(255,255,255,0.42); }

/* card themes — fully coloured, brand palette, each hue clearly distinct */
.card.addition       { --ac: #1F66B0; } /* royal blue   */
.card.subtraction    { --ac: #F4A81E; --ct: #1A2332; } /* gold (light) */
.card.multiplication { --ac: #173A7A; } /* deep navy    */
.card.division       { --ac: #0FA6CC; --ct: #0E2A3A; } /* bright cyan (light) */
.card.comparison     { --ac: #0C7A6E; } /* deep teal    */
.card.measurement    { --ac: #A85F14; } /* bronze       */

/* light cards (gold / cyan): dark text + dark-tinted controls for contrast */
.card.subtraction .icon, .card.lvl-hard .icon, .card.division .icon, .card.lvl-beginner .icon,
.card.subtraction .card-meta, .card.lvl-hard .card-meta, .card.division .card-meta, .card.lvl-beginner .card-meta,
.card.subtraction .card-cta, .card.lvl-hard .card-cta, .card.division .card-cta, .card.lvl-beginner .card-cta,
.card.subtraction .card-share, .card.lvl-hard .card-share, .card.division .card-share, .card.lvl-beginner .card-share {
  background: rgba(14,30,50,0.12); border-color: rgba(14,30,50,0.22); color: var(--navy);
}

/* emoji icon (level cards) */
.card .icon.emoji { font-size: 26px; line-height: 1; }

/* level card themes (difficulty heat — fully coloured, each step distinct) */
.card.lvl-beginner { --ac: #0FA6CC; --ct: #0E2A3A; } /* bright cyan (light) */
.card.lvl-easy     { --ac: #0C7A6E; } /* teal        */
.card.lvl-medium   { --ac: #1F66B0; } /* royal blue  */
.card.lvl-hard     { --ac: #F4A81E; --ct: #1A2332; } /* gold (light)*/
.card.lvl-expert   { --ac: #A85F14; } /* bronze      */
.card.lvl-master   { --ac: #173A7A; } /* deep navy   */

/* hero back pill (levels page) */
.back-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 16px; border-radius: 999px;
  background: var(--panel); border: 1px solid var(--panel-border);
  color: var(--ink); font-size: 13px; font-weight: 700; margin-bottom: 18px;
}
.back-pill:hover { background: var(--mist); }

/* quiz level pill accent */
.quiz-top .pill.level-pill { color: var(--accent-2); }

.locked-note {
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  margin: -10px 0 10px;
}

/* ===== Modal (auth) ===== */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(4, 10, 22, 0.7);
  backdrop-filter: blur(4px);
  display: none;
  place-items: center;
  z-index: 50;
  padding: 20px;
}
.modal-backdrop.open { display: grid; }
.modal {
  width: 100%; max-width: 400px;
  background: linear-gradient(180deg, var(--navy), var(--deep-blue));
  border: 1px solid rgba(225,232,252,0.18);
  border-radius: 20px;
  padding: 28px;
  box-shadow: 0 30px 60px rgba(0,0,0,0.5);
  animation: pop .2s ease;
  color: var(--white);
}
@keyframes pop { from { transform: scale(.95); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal h2 { font-size: 24px; margin-bottom: 6px; }
.modal .sub { color: rgba(225,232,252,0.78); font-size: 14px; margin-bottom: 20px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: rgba(225,232,252,0.78); margin-bottom: 6px; }
.field input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(225,232,252,0.22);
  background: rgba(255,255,255,0.05);
  color: var(--white);
  font-size: 15px;
  outline: none;
}
.field input:focus { border-color: var(--accent); }
.modal .btn.primary { width: 100%; margin-top: 6px; padding: 13px; }
.modal .switch { text-align: center; margin-top: 16px; color: rgba(225,232,252,0.78); font-size: 14px; }
.modal .switch a { color: var(--gold); font-weight: 600; cursor: pointer; }
.form-error { color: var(--bad); font-size: 13px; min-height: 18px; margin-top: 2px; }
.modal-close {
  position: absolute; top: 16px; right: 18px;
  background: none; border: none; color: rgba(225,232,252,0.78);
  font-size: 24px; line-height: 1;
}
.modal-wrap { position: relative; }

/* ===== Quiz page ===== */
.quiz-wrap { max-width: 1040px; margin: 0 auto; padding: 28px 24px 130px; }
.quiz-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.round-label { font-size: 13px; font-weight: 800; letter-spacing: .6px; text-transform: uppercase; color: var(--qc, var(--accent-2)); flex: 1; }
.q-progress { display: flex; flex-direction: column; align-items: center; gap: 9px; }
.q-count { font-size: 16px; font-weight: 700; color: var(--ink); }
.dots { display: flex; gap: 10px; }
.dot { width: 15px; height: 15px; border-radius: 50%; background: rgba(20,40,90,0.16); transition: .2s; }
.dot.cur { background: var(--navy); box-shadow: 0 0 0 3px rgba(31,81,139,0.22); }  /* current → navy + ring */
.dot.ok { background: var(--gold); }            /* correct → gold */
.dot.bad { background: var(--brand-blue); }     /* wrong → brand blue */
.head-right { display: flex; align-items: center; gap: 10px; justify-content: flex-end; flex: 1; }

.pill.streak {
  padding: 9px 16px; border-radius: 999px; background: var(--panel); border: 1px solid var(--panel-border);
  font-size: 16px; font-weight: 800; color: var(--muted); transition: .2s;
}
.pill.streak.hot { color: var(--deep-blue); border-color: rgba(244,157,13,.4); background: rgba(244,157,13,.12); }
.pill.streak.bump { animation: streakBump .35s ease; }
@keyframes streakBump { 0% { transform: scale(1); } 40% { transform: scale(1.3); } 100% { transform: scale(1); } }

.pill.timer {
  padding: 9px 20px; border-radius: 999px; background: var(--panel); border: 1px solid var(--panel-border);
  font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; min-width: 82px; text-align: center;
}
.pill.timer::before { content: "⏱ "; }
.pill.timer.warn {
  color: var(--navy); background: var(--gold); border-color: var(--gold);
}

.confetti-piece {
  position: fixed; top: -14px; width: 9px; height: 15px; border-radius: 2px;
  z-index: 80; opacity: .95; pointer-events: none;
  animation: confettiFall 3s linear forwards;
}
@keyframes confettiFall {
  0% { transform: translateY(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(108vh) rotate(620deg); opacity: 1; }
}
/* question banner */
.question-banner {
  border-radius: 20px; padding: 30px 36px; margin-bottom: 20px;
  min-height: 148px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--qc, var(--brand-blue)), var(--deep-blue));
  box-shadow: 0 22px 48px -18px rgba(0,39,105,0.58);
  border: 1px solid rgba(255,255,255,0.06);
}
.question-banner h2 { color: #fff; text-align: center; font-weight: 800; font-size: 36px; line-height: 1.2; letter-spacing: .3px; }
.question-banner h2.long { font-size: 26px; font-weight: 700; }

/* options */
.options { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.option {
  display: flex; align-items: center; gap: 16px; text-align: left;
  padding: 18px 22px; border-radius: 16px;
  border: 2px solid var(--panel-border); background: #fff; color: var(--ink);
  box-shadow: 0 10px 26px -18px rgba(20,40,90,0.5);
  transition: transform .12s ease, background .2s, border-color .2s, box-shadow .2s, opacity .2s;
}
.opt-letter {
  flex: 0 0 42px; width: 42px; height: 42px; border-radius: 50%;
  display: grid; place-items: center; font-size: 17px; font-weight: 800;
  background: color-mix(in srgb, var(--qc, var(--brand-blue)) 14%, var(--ice));
  color: var(--qc, var(--accent)); transition: .2s;
}
.opt-text { font-size: 24px; font-weight: 800; flex: 1; }
.opt-check { margin-left: auto; color: var(--good); font-weight: 800; font-size: 20px; opacity: 0; transition: opacity .2s; }
.option:hover:not(:disabled) { transform: translateY(-2px); border-color: var(--qc, var(--accent)); box-shadow: 0 12px 26px -14px var(--qc, rgba(44,108,255,.55)); }
.option:hover:not(:disabled) .opt-letter { background: var(--qc, var(--accent)); color: #fff; }
.options.answered .option:not(.correct):not(.wrong) { opacity: .5; }
.option.correct { background: rgba(26,138,74,0.10); border-color: var(--good); }
.option.correct .opt-letter { background: var(--good); color: #fff; }
.option.correct .opt-check { opacity: 1; }
.option.wrong { background: rgba(214,69,53,0.08); border-color: var(--bad); }
.option.wrong .opt-letter { background: var(--bad); color: var(--navy); }
.option:disabled { cursor: default; }

/* feedback bar — pinned to bottom of viewport, always visible */
.feedback {
  position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%) translateY(12px);
  width: min(1000px, calc(100% - 28px)); z-index: 35;
  display: none; align-items: center; gap: 16px;
  padding: 14px 18px; border-radius: 16px; background: #fff;
  border: 1px solid var(--panel-border);
  box-shadow: 0 20px 50px -16px rgba(14,26,46,0.45), 0 0 0 1px rgba(20,40,90,0.04);
}
.feedback.show { display: flex; animation: fbIn .25s ease forwards; }
@keyframes fbIn { from { opacity: 0; transform: translateX(-50%) translateY(20px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }
.fb-icon {
  flex: 0 0 40px; width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center; font-size: 19px; font-weight: 800; color: #fff;
}
.feedback.correct .fb-icon { background: var(--good); }
.feedback.wrong .fb-icon { background: var(--bad); color: var(--navy); }
.fb-text { display: flex; flex-direction: column; gap: 3px; }
.fb-text strong { font-size: 15px; }
.feedback.correct .fb-text strong { color: var(--good); }
.feedback.wrong .fb-text strong { color: var(--bad); }
.fb-text em { color: var(--muted); font-size: 13.5px; }
.feedback .btn { white-space: nowrap; margin-left: auto; }

@media (max-width: 640px) {
  .question-banner h2 { font-size: 23px; }
  .question-banner h2.long { font-size: 19px; }
  .options { grid-template-columns: 1fr; }
  .feedback { flex-direction: row; flex-wrap: wrap; gap: 10px; padding: 12px 14px; bottom: 10px; }
  .feedback .btn { margin-left: 0; width: 100%; }
  .fb-text { flex: 1; }
}

/* ===== Result card (finish screen) ===== */
.result-card {
  max-width: 540px; margin: 10px auto 0; text-align: center;
  background: linear-gradient(180deg, var(--white), var(--ice));
  border: 1px solid var(--panel-border); border-radius: 26px;
  padding: 40px 36px 34px;
  box-shadow: 0 30px 70px -28px rgba(20,40,90,0.40);
  animation: pop .3s ease;
}
.result-ring {
  width: 150px; height: 150px; border-radius: 50%; margin: 0 auto 8px;
  display: grid; place-items: center; position: relative;
  background: conic-gradient(var(--qc, var(--brand-blue)) calc(var(--p,0) * 1%), var(--mist) 0);
}
.result-ring::after {
  content: ""; position: absolute; inset: 12px; border-radius: 50%;
  background: #fff; box-shadow: inset 0 2px 8px rgba(20,40,90,0.06);
}
.result-ring .ring-emoji { position: relative; z-index: 1; font-size: 52px; line-height: 1; }
.result-card .big { font-size: 30px; font-weight: 800; margin-top: 12px; }
.result-card .big .slash { color: var(--muted); font-weight: 700; }
.result-card h2 { font-size: 24px; font-weight: 800; margin: 4px 0 4px; }
.result-card .sub { color: var(--muted); font-size: 14px; margin-bottom: 20px; }
.result-stats {
  display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin-bottom: 24px;
}
.rs-chip {
  display: flex; flex-direction: column; gap: 2px; align-items: center;
  background: var(--mist); border: 1px solid var(--panel-border);
  border-radius: 14px; padding: 12px 18px; min-width: 92px;
}
.rs-chip b { font-size: 19px; font-weight: 800; color: var(--text); }
.rs-chip span { font-size: 11.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }
.result-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.result-note { color: var(--muted); font-size: 13px; margin: 14px 0 0; }

/* ===== Tables (results / leaderboard) ===== */
.page-title { font-size: 32px; font-weight: 800; margin: 36px 0 6px; }
.page-sub { color: var(--muted); margin-bottom: 26px; }
.panel {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 18px;
  padding: 8px 4px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
table { width: 100%; border-collapse: collapse; }
th, td { padding: 14px 18px; text-align: left; font-size: 15px; }
th { color: var(--muted); font-weight: 600; font-size: 13px; text-transform: uppercase; letter-spacing: 0.5px; }
tbody tr { border-top: 1px solid var(--panel-border); }
tbody tr:hover { background: rgba(20,40,90,0.03); }
.rank { font-weight: 800; }
.rank.gold { color: var(--gold); }
.rank.silver { color: var(--brand-blue); }
.rank.bronze { color: var(--deep-blue); }
.badge {
  display: inline-block; padding: 4px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 700;
}
.badge.green { background: rgba(31,81,139,0.14); color: var(--brand-blue); }
.badge.yellow { background: rgba(244,157,13,0.16); color: var(--deep-blue); }
.badge.red { background: rgba(26,35,50,0.12); color: var(--navy); }
.empty { text-align: center; color: var(--muted); padding: 40px 20px; }

/* results header (title + clear button) */
.results-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 36px 0 22px; }
.results-head .page-title { margin: 0 0 4px; }
.results-head .page-sub { margin: 0; }
.btn.danger-ghost {
  border: 1px solid rgba(244,157,13,0.34); background: rgba(244,157,13,0.12); color: var(--deep-blue);
  box-shadow: none;
}
.btn.danger-ghost:hover { background: rgba(244,157,13,0.20); transform: translateY(-1px); }

/* stat cards (light colored) */
.stat-cards { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin-bottom: 22px; }
.stat-card {
  border: 1px solid var(--panel-border);
  border-radius: 16px; padding: 18px 16px; text-align: center;
  display: flex; flex-direction: column; gap: 6px; box-shadow: var(--shadow);
}
.sc-label { font-size: 12px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .5px; }
.sc-value { font-size: 26px; font-weight: 800; }
/* per-card light tints */
.stat-card.sc-blue   { background: linear-gradient(180deg,var(--white),var(--ice)); border-color:rgba(31,81,139,0.20); }
.stat-card.sc-blue   .sc-value { color: var(--brand-blue); }
.stat-card.sc-violet { background: linear-gradient(180deg,var(--ice),var(--mist)); border-color:rgba(0,39,105,0.16); }
.stat-card.sc-violet .sc-value { color: var(--deep-blue); }
.stat-card.sc-green  { background: linear-gradient(180deg,var(--white),var(--mist)); border-color:rgba(31,81,139,0.18); }
.stat-card.sc-green  .sc-value { color: var(--brand-blue); }
.stat-card.sc-amber  { background: linear-gradient(180deg,rgba(244,157,13,0.18),var(--white)); border-color:rgba(244,157,13,0.30); }
.stat-card.sc-amber  .sc-value { color: var(--deep-blue); }
.stat-card.sc-teal   { background: linear-gradient(180deg,var(--ice),var(--white)); border-color:rgba(31,81,139,0.18); }
.stat-card.sc-teal   .sc-value { color: var(--navy); }

/* chart */
.chart-panel { padding: 22px 24px; margin-bottom: 22px; }
.panel-title { font-size: 16px; font-weight: 700; margin-bottom: 18px; }
.bar-row { display: flex; align-items: center; gap: 14px; margin-bottom: 13px; }
.bar-label { flex: 0 0 150px; font-size: 13.5px; font-weight: 600; display: flex; align-items: center; gap: 7px; }
.bar-track { flex: 1; height: 12px; border-radius: 999px; background: rgba(20,40,90,0.08); overflow: hidden; }
.bar-fill { display: block; height: 100%; border-radius: 999px; width: 0; transition: width .6s cubic-bezier(.2,.8,.2,1); background: linear-gradient(90deg,var(--brand-blue),var(--gold)); }
.bar-val { flex: 0 0 44px; text-align: right; font-size: 13.5px; font-weight: 700; }
.bar-fill.addition { background: linear-gradient(90deg,var(--brand-blue),var(--deep-blue)); }
.bar-fill.subtraction { background: linear-gradient(90deg,var(--gold),var(--deep-blue)); }
.bar-fill.multiplication { background: linear-gradient(90deg,var(--navy),var(--brand-blue)); }
.bar-fill.division { background: linear-gradient(90deg,var(--ice),var(--brand-blue)); }
.bar-fill.comparison { background: linear-gradient(90deg,var(--deep-blue),var(--navy)); }
.bar-fill.measurement { background: linear-gradient(90deg,var(--mist),var(--gold)); }

@media (max-width: 720px) {
  .stat-cards { grid-template-columns: repeat(3, 1fr); }
  .bar-label { flex-basis: 110px; font-size: 12.5px; }
}
@media (max-width: 480px) {
  .stat-cards { grid-template-columns: repeat(2, 1fr); }
  .bar-label { flex-basis: 92px; font-size: 12px; }
}

/* ===== Leaderboard podium ===== */
.podium { display: flex; align-items: flex-end; justify-content: center; gap: 16px; margin: 14px 0 28px; }
.pod { display: flex; flex-direction: column; align-items: center; flex: 1; max-width: 200px; animation: podIn .5s ease both; }
.pod-2 { animation-delay: .05s; } .pod-1 { animation-delay: .12s; } .pod-3 { animation-delay: .19s; }
@keyframes podIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.pod-medal { font-size: 26px; margin-bottom: 4px; }
.pod-1 .pod-medal { font-size: 32px; }
.pod-avatar {
  width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--brand-blue), var(--deep-blue)); color: #fff;
  font-weight: 800; font-size: 18px; box-shadow: 0 10px 22px -8px rgba(0,39,105,.5);
  border: 3px solid #fff;
}
.pod-1 .pod-avatar { width: 68px; height: 68px; font-size: 22px; }
.pod.me .pod-avatar { box-shadow: 0 0 0 3px var(--accent), 0 10px 22px -8px rgba(0,39,105,.5); }
.pod-name { margin-top: 9px; font-weight: 700; font-size: 14px; text-align: center; }
.pod-name small { color: var(--muted); font-weight: 600; }
.pod-points { font-size: 13px; color: var(--muted); font-weight: 600; margin-bottom: 10px; }
.pod-bar {
  width: 100%; border-radius: 14px 14px 0 0; display: grid; place-items: center;
  color: #fff; font-weight: 800; font-size: 22px; box-shadow: var(--shadow);
}
.pod-1 .pod-bar { height: 110px; background: linear-gradient(180deg, var(--gold), var(--deep-blue)); }
.pod-2 .pod-bar { height: 84px;  background: linear-gradient(180deg, var(--ice), var(--brand-blue)); }
.pod-3 .pod-bar { height: 64px;  background: linear-gradient(180deg, var(--mist), var(--navy)); }
.pod-rank { opacity: .95; }
@media (max-width: 560px) {
  .podium { gap: 8px; }
  .pod-avatar { width: 46px; height: 46px; font-size: 15px; }
  .pod-1 .pod-avatar { width: 56px; height: 56px; }
  .pod-name { font-size: 12px; }
}

.me-row { background: rgba(31,81,139,0.10); }

.btn.big { padding: 14px 26px; font-size: 15px; border-radius: 13px; }

/* per-card share / host icon */
.ct-right { display: flex; align-items: center; gap: 9px; }
.card-share {
  width: 36px; height: 36px; border-radius: 11px; padding: 0;
  border: 1px solid rgba(255,255,255,0.28);
  background: rgba(255,255,255,0.20);
  color: var(--ct); display: grid; place-items: center; cursor: pointer; transition: .18s;
}
.card-share svg { width: 18px; height: 18px; }
.card-share:hover { background: rgba(255,255,255,0.34); transform: translateY(-1px); }

/* ===== Host lobby ===== */
.host-wrap { max-width: 1200px; width: 100%; margin: 0 auto; padding: 22px 24px 36px; }
.host-head { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; }
.host-head .back-pill { margin-bottom: 0; }
.host-grid { display: grid; grid-template-columns: 1fr 1.15fr; gap: 28px; align-items: stretch; }

.join-card {
  background: linear-gradient(150deg, var(--navy), var(--deep-blue)); color: #fff;
  border-radius: 24px; padding: 34px 30px; text-align: center;
  box-shadow: 0 28px 60px -26px rgba(0,39,105,0.72);
}
.join-kicker { display: inline-block; font-size: 11.5px; font-weight: 800; letter-spacing: 2px; text-transform: uppercase; color: var(--gold); margin-bottom: 12px; }
.qr-box { background: #fff; border-radius: 16px; padding: 10px; width: max-content; margin: 0 auto 14px; box-shadow: 0 10px 26px -10px rgba(0,0,0,0.4); }
.qr-box img { display: block; width: 220px; height: 220px; image-rendering: pixelated; }
.qr-fallback { font-size: 12px; word-break: break-all; color: var(--deep-blue); }
.room-code { margin-bottom: 12px; }
.rc-label { display: block; font-size: 11px; color: rgba(225,232,252,0.74); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 3px; }
.room-code strong { font-size: 42px; font-weight: 800; letter-spacing: 4px; color: #fff; }
.join-hint { color: rgba(225,232,252,0.78); font-size: 13px; margin-bottom: 16px; }
.join-hint b { color: #fff; }
.join-card .btn.big { padding: 12px 22px; }

.participants {
  background: #fff; border: 1px solid var(--panel-border); border-radius: 22px;
  padding: 26px 24px; box-shadow: var(--shadow); min-height: 380px;
}
.pt-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.pt-head h3 { font-size: 20px; font-weight: 800; }
.pt-count { background: var(--accent); color: var(--navy); font-weight: 800; font-size: 14px; min-width: 30px; height: 30px; border-radius: 999px; display: grid; place-items: center; padding: 0 8px; }
.pt-list { display: flex; flex-direction: column; gap: 10px; }
.pt-item { display: flex; align-items: center; gap: 13px; padding: 13px 14px; border-radius: 13px; background: var(--mist); animation: fbIn .25s ease; }
.pt-avatar { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 15px; }
.pt-name { font-weight: 700; font-size: 16px; flex: 1; }
.pt-rank { flex: 0 0 22px; text-align: center; font-weight: 800; font-size: 13px; color: var(--muted); }
.pt-score { font-weight: 800; font-size: 14px; color: var(--deep-blue); background: rgba(31,81,139,0.12); border-radius: 999px; padding: 4px 12px; min-width: 56px; text-align: center; font-variant-numeric: tabular-nums; }
.pt-item.done { background: rgba(31,81,139,0.10); }
.pt-item.done .pt-score { color: var(--brand-blue); background: rgba(244,157,13,0.16); }
.pt-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 3px rgba(26,138,74,0.18); }
.pt-empty { color: var(--muted); text-align: center; padding: 40px 16px; font-size: 14px; }

/* ===== Host game control + final standings ===== */
.host-game { max-width: 860px; margin: 0 auto; width: 100%; }
.hg-top { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 16px; flex-wrap: wrap; }
.hg-progress { font-size: 14px; font-weight: 800; letter-spacing: .6px; text-transform: uppercase; color: var(--accent-2); }
.hg-answered { font-size: 15px; font-weight: 800; color: var(--deep-blue); background: rgba(31,81,139,0.12); border-radius: 999px; padding: 7px 16px; font-variant-numeric: tabular-nums; }
.option.ho { cursor: default; pointer-events: none; }
.hg-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 22px; flex-wrap: wrap; }
.hg-hint { color: var(--muted); font-size: 13.5px; font-weight: 600; }
.hg-bar .btn { white-space: nowrap; }

.end-card {
  max-width: 620px; margin: 10px auto 0; text-align: center;
  background: linear-gradient(180deg, var(--white), var(--ice));
  border: 1px solid var(--panel-border); border-radius: 26px;
  padding: 34px 30px 30px; box-shadow: 0 30px 70px -28px rgba(20,40,90,0.40);
  animation: pop .3s ease;
}
.end-title { font-size: 28px; font-weight: 800; margin: 6px 0 18px; }
.ls-board { display: flex; flex-direction: column; gap: 9px; text-align: left; }
.ls-board.big { margin-bottom: 22px; }
.ls-row {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px; border-radius: 13px;
  background: var(--mist); border: 1px solid var(--panel-border);
}
.ls-row.top { background: rgba(244,157,13,0.10); border-color: rgba(244,157,13,0.28); }
.ls-row.me { background: rgba(31,81,139,0.12); border-color: rgba(31,81,139,0.30); }
.ls-rank { flex: 0 0 32px; text-align: center; font-size: 18px; font-weight: 800; color: var(--muted); }
.ls-avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 13px; }
.ls-name { flex: 1; font-weight: 700; font-size: 15px; }
.ls-score { font-weight: 800; font-size: 15px; color: var(--deep-blue); background: rgba(31,81,139,0.12); border-radius: 999px; padding: 5px 14px; font-variant-numeric: tabular-nums; }

/* ===== Join page ===== */
.join-wrap { min-height: calc(100vh - 70px); display: grid; place-items: center; padding: 30px 20px; }
.join-panel {
  width: 100%; max-width: 420px; text-align: center;
  background: #fff; border: 1px solid var(--panel-border); border-radius: 24px;
  padding: 38px 32px; box-shadow: 0 30px 70px -30px rgba(20,40,90,0.45);
}
.spin-logo {
  width: 84px; height: 84px; margin: 0 auto 12px; border-radius: 50%;
  background: #fff; padding: 8px; box-shadow: 0 14px 30px -12px rgba(20,40,90,0.4);
  display: grid; place-items: center;
}
.spin-logo img { width: 100%; height: 100%; object-fit: contain; }
.spin-name { font-size: 19px; font-weight: 800; color: var(--navy); margin-bottom: 14px; }
.spin-name span { color: var(--gold); }

.join-panel h1 { font-size: 26px; font-weight: 800; margin: 6px 0 8px; }
.join-room { color: var(--muted); font-size: 14px; margin-bottom: 22px; }
.join-room strong { color: var(--ink); letter-spacing: 2px; }
.join-field input {
  width: 100%; padding: 15px 18px; border-radius: 13px; border: 1.5px solid var(--panel-border);
  font-size: 17px; font-family: inherit; outline: none; text-align: center; font-weight: 700; margin-bottom: 14px;
}
.join-field input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(44,108,255,0.12); }
.join-panel .btn.big { width: 100%; }
.join-done { margin-bottom: 20px; }
.join-check { width: 60px; height: 60px; border-radius: 50%; background: var(--good); color: #fff; font-size: 30px; font-weight: 800; display: grid; place-items: center; margin: 0 auto 14px; }
.join-done h2 { font-size: 22px; font-weight: 800; }
.join-done p { color: var(--muted); font-size: 14px; margin-top: 6px; }

@media (max-width: 760px) {
  .host-grid { grid-template-columns: 1fr; }
}

.site-footer { border-top: 1px solid var(--panel-border); margin-top: auto; }
.footer-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 24px 20px; color: var(--muted); font-size: 13px; font-weight: 500;
}
.footer-inner .dot-list { color: var(--muted); }
@media (max-width: 560px) {
  .footer-inner { flex-direction: column; gap: 8px; text-align: center; }
  .hero-stats { gap: 28px; }
}

.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--deep-blue); border: 1px solid rgba(225,232,252,0.18); color: #fff;
  padding: 12px 20px; border-radius: 12px; box-shadow: var(--shadow);
  opacity: 0; pointer-events: none; transition: all .3s ease; z-index: 60;
  font-size: 14px; font-weight: 600;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ===== Responsive ===== */
@media (max-width: 860px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
}

/* tablets / large phones */
@media (max-width: 760px) {
  .header-inner { padding: 12px 16px; }
  .container { padding: 0 16px; }
  .hero { padding: 34px 16px 12px; }
  .quiz-wrap { padding: 18px 16px 130px; }
  /* quiz head stacks: progress on top, label + controls below */
  .quiz-head { flex-wrap: wrap; gap: 12px; }
  .round-label { order: 2; flex: 1 1 auto; text-align: left; }
  .q-progress { order: 1; flex: 1 1 100%; }
  .head-right { order: 3; flex: 0 0 auto; }
  /* tables scroll sideways instead of overflowing */
  .panel { overflow-x: auto; }
  table { min-width: 540px; }
}

/* phones */
@media (max-width: 560px) {
  .grid { grid-template-columns: 1fr; gap: 16px; padding: 22px 0 56px; }
  .card { min-height: 0; padding: 20px; }
  .brand { font-size: 18px; }
  .brand .logo { width: 38px; height: 38px; flex-basis: 38px; }
  .brand span.full { display: none; }
  .nav-actions { gap: 7px; }
  .btn { padding: 9px 14px; font-size: 13px; }
  .profile-btn .uname { display: none; }
  .page-title { font-size: 26px; }
  .results-head { margin: 24px 0 18px; }
  .question-banner { padding: 22px 18px; }
  .opt-text { font-size: 21px; }
  .option { padding: 15px 16px; gap: 12px; }
  .result-card { padding: 30px 22px 26px; }
  .result-ring { width: 124px; height: 124px; }
  .result-ring .ring-emoji { font-size: 42px; }
}

/* ===== Achievements (results page) ===== */
.ach-panel { padding: 22px 24px; margin-bottom: 22px; }
.ach-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.ach-head .panel-title { margin: 0; }
.ach-count { font-size: 13px; font-weight: 700; color: var(--deep-blue); background: rgba(244,157,13,0.16); padding: 5px 12px; border-radius: 999px; }
.ach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 12px; }
.ach { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--panel-border); background: var(--mist); transition: transform .15s ease, box-shadow .15s ease; }
.ach.got { background: linear-gradient(135deg, rgba(244,157,13,0.16), rgba(31,81,139,0.10)); border-color: rgba(244,157,13,0.36); box-shadow: 0 8px 22px -14px rgba(0,39,105,0.45); }
.ach.got:hover { transform: translateY(-2px); }
.ach.locked { opacity: 0.62; filter: grayscale(0.35); }
.ach-icon { font-size: 24px; flex: 0 0 auto; width: 42px; height: 42px; display: grid; place-items: center; border-radius: 11px; background: rgba(255,255,255,0.72); }
.ach.locked .ach-icon { background: rgba(20,40,90,0.06); }
.ach-text { display: flex; flex-direction: column; line-height: 1.28; min-width: 0; }
.ach-text b { font-size: 14.5px; color: var(--ink); }
.ach-text small { font-size: 12px; color: var(--muted); }

/* ===== Leaderboard sample note + tag ===== */
.lb-note { color: var(--muted); font-size: 14px; margin: -8px 0 18px; }
.lb-note a { color: var(--brand-blue); font-weight: 700; }
.lb-sample { font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); background: rgba(20,40,90,0.08); padding: 2px 8px; border-radius: 999px; vertical-align: middle; }

/* ===== "How it works" (home) ===== */
.how { padding: 6px 0 72px; }
.how-title { font-size: 24px; font-weight: 800; text-align: center; margin-bottom: 26px; }
.how-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.how-step { background: var(--panel); border: 1px solid var(--panel-border); border-radius: 18px; padding: 26px 22px; box-shadow: var(--shadow); }
.how-num { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; font-weight: 800; font-size: 18px; color: #fff; background: linear-gradient(135deg, var(--brand-blue), var(--deep-blue)); margin-bottom: 14px; }
.how-step h3 { font-size: 17px; font-weight: 800; margin-bottom: 7px; }
.how-step p { color: var(--muted); font-size: 14px; line-height: 1.5; }
@media (max-width: 760px) { .how-steps { grid-template-columns: 1fr; } }

/* ===== Active nav state ===== */
.site-header .btn.active { background: rgba(244,157,13,0.20); border-color: rgba(244,157,13,0.45); color: #fff; }

/* ===== Onboarding hint (home) ===== */
.welcome-hint {
  display: flex; align-items: center; gap: 14px; justify-content: space-between;
  background: linear-gradient(135deg, rgba(244,157,13,0.16), rgba(31,81,139,0.10));
  border: 1px solid rgba(244,157,13,0.34); border-radius: 14px;
  padding: 12px 16px; margin: 8px 0 -8px; color: var(--ink); font-size: 14.5px; font-weight: 600;
  animation: fbIn .35s ease;
}
.welcome-hint .wh-close {
  flex: 0 0 auto; width: 30px; height: 30px; border-radius: 50%; border: 0;
  background: rgba(20,40,90,0.08); color: var(--ink); font-size: 20px; line-height: 1; font-weight: 700;
  display: grid; place-items: center; transition: background .15s;
}
.welcome-hint .wh-close:hover { background: rgba(20,40,90,0.16); }

/* ===== Rich empty states ===== */
.empty-rich { padding: 48px 24px; }
.empty-rich .empty-icon { font-size: 46px; display: block; margin-bottom: 10px; }
.empty-rich h3 { font-size: 20px; font-weight: 800; color: var(--ink); margin-bottom: 6px; }
.empty-rich p { color: var(--muted); font-size: 14.5px; max-width: 420px; margin: 0 auto 20px; line-height: 1.5; }

/* ===== 404 page ===== */
.notfound { text-align: center; padding: 70px 20px; }
.notfound .nf-code {
  display: inline-block; font-size: clamp(64px, 14vw, 120px); font-weight: 800; line-height: 1; letter-spacing: -2px;
  background: linear-gradient(120deg, var(--brand-blue), var(--gold));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.notfound h1 { font-size: 28px; font-weight: 800; margin: 8px 0; }
.notfound p { color: var(--muted); font-size: 16px; max-width: 460px; margin: 0 auto 26px; line-height: 1.5; }
.nf-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
