/* =========================================================
   ExamMVP — playful, modern learning UI
   ========================================================= */

:root {
  --font-head: 'Google Sans', 'Noto Sans Thai', Roboto, Arial, sans-serif;
  --font-body: 'Google Sans Text', 'Noto Sans Thai', Roboto, Arial, sans-serif;

  /* Google palette */
  --g-blue: #4285f4;
  --g-red: #ea4335;
  --g-yellow: #fbbc04;
  --g-green: #34a853;

  --primary: #1a73e8;
  --primary-600: #1967d2;
  --primary-700: #185abc;
  --on-primary: #ffffff;
  --pink: #ea4335;
  --pink-700: #c5221f;
  --lime: #34a853;
  --lime-700: #188038;
  --cyan: #12b5cb;
  --amber: #fbbc04;
  --amber-700: #e37400;
  --green: #1e8e3e;
  --green-700: #137333;
  --red: #d93025;
  --red-700: #a50e0e;
  --gold: #fbbc04;
  --silver: #c7d0e2;
  --bronze: #e39a5c;

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --ease: cubic-bezier(.2, 0, 0, 1);
  --bounce: cubic-bezier(.34, 1.4, .64, 1);
  --header-h: 64px;

  --bg: #ffffff;
  --bg-2: #f8f9fa;
  --surface: #ffffff;
  --surface-solid: #ffffff;
  --surface-2: #f8f9fa;
  --text: #202124;
  --text-2: #3c4043;
  --muted: #5f6368;
  --border: #dadce0;
  --border-strong: #bdc1c6;
  --ring: rgba(26, 115, 232, .3);
  --shadow-sm: 0 1px 2px rgba(60, 64, 67, .3), 0 1px 3px 1px rgba(60, 64, 67, .15);
  --shadow: 0 1px 3px rgba(60, 64, 67, .3), 0 4px 8px 3px rgba(60, 64, 67, .15);
  --shadow-lg: 0 4px 4px rgba(60, 64, 67, .3), 0 8px 12px 6px rgba(60, 64, 67, .15);
  --blob-1: transparent;
  --blob-2: transparent;
  --blob-3: transparent;
  --primary-soft: #e8f0fe;
  --primary-ink: #1967d2;
  --tint-green: #e6f4ea; --ink-green: #137333;
  --tint-red: #fce8e6; --ink-red: #c5221f;
  --tint-yellow: #fef7e0; --ink-yellow: #b06000;
  --tint-cyan: #e4f7fb; --ink-cyan: #007b83;
  --tint-gray: #f1f3f4; --ink-gray: #5f6368;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #202124;
  --bg-2: #292a2d;
  --surface: #292a2d;
  --surface-solid: #2d2e31;
  --surface-2: #35363a;
  --text: #e8eaed;
  --text-2: #bdc1c6;
  --muted: #9aa0a6;
  --border: #3c4043;
  --border-strong: #5f6368;
  --primary: #8ab4f8;
  --primary-600: #aecbfa;
  --primary-700: #669df6;
  --on-primary: #202124;
  --ring: rgba(138, 180, 248, .35);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3), 0 1px 3px 1px rgba(0, 0, 0, .15);
  --shadow: 0 1px 3px rgba(0, 0, 0, .3), 0 4px 8px 3px rgba(0, 0, 0, .15);
  --shadow-lg: 0 4px 4px rgba(0, 0, 0, .3), 0 8px 12px 6px rgba(0, 0, 0, .15);
  --blob-1: rgba(66, 133, 244, .18);
  --blob-2: rgba(52, 168, 83, .10);
  --blob-3: rgba(251, 188, 4, .08);
  --primary-soft: rgba(138, 180, 248, .16);
  --primary-ink: #8ab4f8;
  --tint-green: rgba(129, 201, 149, .16); --ink-green: #81c995;
  --tint-red: rgba(242, 139, 130, .16); --ink-red: #f28b82;
  --tint-yellow: rgba(253, 214, 99, .16); --ink-yellow: #fdd663;
  --tint-cyan: rgba(120, 217, 236, .16); --ink-cyan: #78d9ec;
  --tint-gray: rgba(154, 160, 166, .16); --ink-gray: #bdc1c6;
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}
img, svg, video, iframe { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
p { margin: 0 0 1em; }
h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.3; margin: 0 0 .5em; letter-spacing: 0; font-weight: 600; }
h1 { font-size: clamp(2rem, 5vw, 3.4rem); }
h2 { font-size: clamp(1.5rem, 3.2vw, 2.2rem); }
h3 { font-size: 1.2rem; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--primary); color: #fff; }
:focus-visible { outline: 3px solid var(--ring); outline-offset: 2px; border-radius: 8px; }
.icon { width: 1.25em; height: 1.25em; flex-shrink: 0; display: inline-block; vertical-align: -0.22em; }
[hidden] { display: none !important; }
/* Visually-hidden native inputs stay anchored to their label (prevents page overflow inside scroll areas). */
.switch, .check, .avatar-picker label, .answer-pills label { position: relative; }
code { word-break: break-all; background: var(--surface-2); padding: 1px 6px; border-radius: 6px; font-size: .88em; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Animated background blobs */
.bg-blobs { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.bg-blobs span { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .9; animation: blob 22s var(--ease) infinite alternate; }
.bg-blobs span:nth-child(1) { width: 46vw; height: 46vw; background: var(--blob-1); top: -12vw; left: -10vw; }
.bg-blobs span:nth-child(2) { width: 38vw; height: 38vw; background: var(--blob-2); top: 20vh; right: -12vw; animation-delay: -6s; }
.bg-blobs span:nth-child(3) { width: 34vw; height: 34vw; background: var(--blob-3); bottom: -14vw; left: 25vw; animation-delay: -12s; }
.bg-grid { position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: .18;
  background-image: radial-gradient(circle at 1px 1px, var(--border-strong) 1px, transparent 0); background-size: 28px 28px;
  mask-image: linear-gradient(to bottom, #000 0%, transparent 70%); -webkit-mask-image: linear-gradient(to bottom, #000 0%, transparent 70%); }
@keyframes blob { to { transform: translate3d(6vw, 5vh, 0) scale(1.12); } }
/* Light theme = clean white page; the soft glow is kept for dark mode only. */
:root:not([data-theme="dark"]) .bg-blobs, :root:not([data-theme="dark"]) .bg-grid { display: none; }

/* ---------- Layout ---------- */
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.container-sm { max-width: 760px; }
.section { padding: 56px 0; }
.section-sm { padding: 32px 0; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.section-head h2 { margin: 0; }
.section-head p { margin: 4px 0 0; color: var(--muted); }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-head); font-weight: 600; font-size: .85rem; color: var(--primary); text-transform: uppercase; letter-spacing: .08em; }
.grid { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr); }
.grid-2 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); }
.flex { display: flex; }
.wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-1 { gap: 6px; } .gap-2 { gap: 12px; } .gap-3 { gap: 20px; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; } .mt-4 { margin-top: 40px; }
.mb-0 { margin-bottom: 0; } .mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; }
.text-center { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.tiny { font-size: .78rem; }
.bold { font-weight: 600; }
.nowrap { white-space: nowrap; }
.w-full { width: 100%; }
.grow { flex: 1 1 auto; min-width: 0; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.gradient-text { background: linear-gradient(90deg, var(--g-blue) 0%, var(--g-red) 36%, var(--g-yellow) 64%, var(--g-green) 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.divider { height: 1px; background: var(--border); margin: 20px 0; border: 0; }

/* ---------- Announcement ---------- */
.announce { background: linear-gradient(90deg, var(--primary), var(--pink)); color: #fff; font-size: .9rem; text-align: center; padding: 8px 44px 8px 16px; position: relative; font-weight: 500; }
.announce button { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); background: rgba(255,255,255,.18); border: 0; border-radius: 8px; width: 28px; height: 28px; display: grid; place-items: center; cursor: pointer; color: #fff; }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 50; height: var(--header-h); backdrop-filter: saturate(1.6) blur(16px); -webkit-backdrop-filter: saturate(1.6) blur(16px); background: color-mix(in srgb, var(--bg) 88%, transparent); border-bottom: 1px solid var(--border); }
.nav { height: 100%; display: flex; align-items: center; gap: 20px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-head); font-weight: 700; font-size: 1.35rem; letter-spacing: -.02em; }
.brand-logo { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: linear-gradient(135deg, var(--primary), var(--pink)); color: #fff; box-shadow: 0 6px 16px -4px var(--primary), inset 0 -3px 0 rgba(0,0,0,.18); transform: rotate(-6deg); transition: transform .4s var(--bounce); }
.brand:hover .brand-logo { transform: rotate(6deg) scale(1.08); }
.brand-logo svg { width: 22px; height: 22px; }
.brand b { color: var(--primary); }
.nav-links { display: flex; gap: 4px; margin-left: 12px; }
.nav-link { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 12px; font-weight: 500; color: var(--text-2); transition: background .2s, color .2s, transform .2s; }
.nav-link:hover { background: var(--primary-soft); color: var(--primary); transform: translateY(-1px); }
.nav-link.is-active { background: var(--primary-soft); color: var(--primary); }
.nav-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.icon-btn { width: 42px; height: 42px; display: inline-grid; place-items: center; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; transition: transform .25s var(--bounce), background .2s, border-color .2s; color: var(--text-2); }
.icon-btn:hover { transform: translateY(-2px) rotate(-4deg); border-color: var(--primary); color: var(--primary); }
.icon-btn:active { transform: scale(.92); }
.icon-btn .icon { width: 20px; height: 20px; }
.theme-toggle .i-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .i-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .i-moon { display: none; }
.sound-toggle .i-off { display: none; }
.sound-toggle.is-muted .i-on { display: none; }
.sound-toggle.is-muted .i-off { display: block; }
.xp-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: linear-gradient(135deg, rgba(255,200,61,.22), rgba(255,77,141,.16)); font-family: var(--font-head); font-weight: 600; font-size: .9rem; border: 1px solid rgba(255,182,39,.35); }
.streak-chip { display: inline-flex; align-items: center; gap: 4px; padding: 6px 10px; border-radius: 999px; background: rgba(255,77,94,.12); color: #ff6a3d; font-family: var(--font-head); font-weight: 600; font-size: .9rem; }

/* User menu */
.user-menu { position: relative; }
.user-menu > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; padding: 4px 10px 4px 4px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); transition: border-color .2s; }
.user-menu > summary::-webkit-details-marker { display: none; }
.user-menu > summary:hover { border-color: var(--primary); }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 1.25rem; background: linear-gradient(135deg, var(--primary-soft), rgba(255,77,141,.14)); border: 2px solid var(--surface-solid); box-shadow: 0 0 0 2px var(--primary-soft); flex-shrink: 0; line-height: 1; }
.avatar.has-img { overflow: hidden; background: var(--surface-2); }
.avatar.has-img img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }
.avatar-lg { width: 72px; height: 72px; font-size: 2.4rem; }
.avatar-xl { width: 96px; height: 96px; font-size: 3.2rem; }
.dropdown { position: absolute; right: 0; top: calc(100% + 10px); min-width: 240px; background: var(--surface-solid); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 8px; animation: pop .25s var(--bounce); z-index: 60; }
.dropdown a, .dropdown button { width: 100%; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; border: 0; background: none; cursor: pointer; text-align: left; font-weight: 500; color: var(--text-2); }
.dropdown a:hover, .dropdown button:hover { background: var(--primary-soft); color: var(--primary); }
.dropdown-head { padding: 10px 12px 12px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }

/* ---------- Bottom nav (mobile) ---------- */
.bottom-nav { display: none; }
@media (max-width: 860px) {
  .nav-links, .hide-mobile { display: none !important; }
  .bottom-nav { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 55; background: color-mix(in srgb, var(--surface-solid) 88%, transparent); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); border: 1px solid var(--border); border-radius: 22px; box-shadow: var(--shadow-lg); padding: 6px; }
  .bottom-nav a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px; border-radius: 16px; font-size: .7rem; font-weight: 600; color: var(--muted); transition: color .2s, background .2s, transform .25s var(--bounce); }
  .bottom-nav a .icon { width: 22px; height: 22px; }
  .bottom-nav a:active { transform: scale(.88); }
  .bottom-nav a.is-active { color: var(--primary); background: var(--primary-soft); }
  .bottom-nav a.is-active .icon { animation: wiggle .5s var(--bounce); }
  .bottom-nav .bn-main { position: relative; }
  .bottom-nav .bn-main span.bn-bubble { width: 48px; height: 48px; margin-top: -24px; border-radius: 16px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, var(--primary), var(--pink)); box-shadow: 0 8px 20px -6px var(--primary), inset 0 -3px 0 rgba(0,0,0,.2); transform: rotate(-8deg); }
  .bottom-nav .bn-main span.bn-bubble .icon { transform: rotate(8deg); }
  body { padding-bottom: calc(92px + env(safe-area-inset-bottom)); }
  .site-footer { padding-bottom: 20px; }
}
@media (min-width: 861px) { .show-mobile { display: none !important; } }

/* ---------- Buttons ---------- */
.btn {
  --b: var(--primary); --b2: var(--primary-600); --bs: var(--primary-700); --bt: #fff;
  position: relative; overflow: hidden; isolation: isolate;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; min-height: 48px;
  font-family: var(--font-head); font-weight: 600; font-size: 1rem; line-height: 1.2; letter-spacing: .01em;
  color: var(--bt); background: linear-gradient(180deg, var(--b) 0%, var(--b2) 100%);
  border: 0; border-radius: 16px; cursor: pointer; user-select: none; white-space: nowrap;
  box-shadow: 0 5px 0 var(--bs), 0 10px 22px -8px var(--bs);
  transform: translateY(0);
  transition: transform .18s var(--bounce), box-shadow .18s var(--ease), filter .2s;
}
.btn::after { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.35) 50%, transparent 70%); transform: translateX(-120%); transition: transform .7s var(--ease); }
.btn:hover { transform: translateY(-2px); box-shadow: 0 7px 0 var(--bs), 0 16px 28px -10px var(--bs); filter: saturate(1.1); }
.btn:hover::after { transform: translateX(120%); }
.btn:active, .btn.is-pressed { transform: translateY(4px); box-shadow: 0 1px 0 var(--bs), 0 4px 10px -6px var(--bs); transition-duration: .06s; }
.btn:disabled, .btn.is-disabled { opacity: .55; cursor: not-allowed; transform: none; filter: grayscale(.4); }
.btn .icon { width: 20px; height: 20px; }
.btn-pink { --b: #ff5c97; --b2: var(--pink); --bs: var(--pink-700); }
.btn-lime { --b: #c6f75c; --b2: var(--lime); --bs: var(--lime-700); --bt: #1a2a00; }
.btn-green { --b: #2bd47b; --b2: var(--green); --bs: var(--green-700); }
.btn-amber { --b: #ffc552; --b2: var(--amber); --bs: var(--amber-700); --bt: #3a2500; }
.btn-red { --b: #ff6b79; --b2: var(--red); --bs: var(--red-700); }
.btn-dark { --b: #2a2257; --b2: #1c1640; --bs: #0b0820; }
.btn-ghost { --bt: var(--text); background: var(--surface); box-shadow: 0 4px 0 var(--border-strong); border: 1px solid var(--border-strong); }
.btn-ghost:hover { box-shadow: 0 6px 0 var(--border-strong); color: var(--primary); border-color: var(--primary); }
.btn-ghost:active { box-shadow: 0 1px 0 var(--border-strong); }
.btn-ghost::after { background: linear-gradient(110deg, transparent 30%, var(--primary-soft) 50%, transparent 70%); }
.btn-link { background: none; box-shadow: none; color: var(--primary); padding: 6px 8px; min-height: 0; }
.btn-link:hover, .btn-link:active { box-shadow: none; transform: none; text-decoration: underline; }
.btn-sm { padding: 8px 14px; min-height: 38px; font-size: .9rem; border-radius: 12px; box-shadow: 0 4px 0 var(--bs); }
.btn-sm:hover { box-shadow: 0 5px 0 var(--bs); }
.btn-sm:active { box-shadow: 0 1px 0 var(--bs); transform: translateY(3px); }
.btn-sm .icon { width: 17px; height: 17px; }
.btn-xs { padding: 5px 10px; min-height: 30px; font-size: .82rem; border-radius: 10px; box-shadow: 0 3px 0 var(--bs); }
.btn-lg { padding: 16px 28px; min-height: 58px; font-size: 1.12rem; border-radius: 18px; }
.btn-block { width: 100%; }
.btn-icon { padding: 0; width: 44px; min-height: 44px; }
.btn.btn-ghost.btn-sm, .btn.btn-ghost.btn-xs { box-shadow: 0 3px 0 var(--border-strong); }
.ripple { position: absolute; border-radius: 50%; transform: scale(0); background: rgba(255,255,255,.55); animation: ripple .6s var(--ease); pointer-events: none; z-index: 0; }
@keyframes ripple { to { transform: scale(4); opacity: 0; } }
.btn.is-loading { color: transparent !important; pointer-events: none; }
.btn.is-loading::before { content: ''; position: absolute; width: 22px; height: 22px; border-radius: 50%; border: 3px solid rgba(255,255,255,.45); border-top-color: #fff; animation: spin .7s linear infinite; }

/* ---------- Cards ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 24px; box-shadow: var(--shadow-sm); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.card-tight { padding: 16px; }
.card-solid { background: var(--surface-solid); }
.card-hover { transition: transform .35s var(--bounce), box-shadow .3s var(--ease), border-color .3s; }
.card-hover:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); border-color: color-mix(in srgb, var(--primary) 40%, transparent); }
.card-title { display: flex; align-items: center; gap: 10px; font-family: var(--font-head); font-size: 1.1rem; font-weight: 600; margin: 0 0 14px; }
.card-title .icon { color: var(--primary); }

/* ---------- Badges & chips ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: .78rem; font-weight: 600; font-family: var(--font-head); background: var(--primary-soft); color: var(--primary); white-space: nowrap; }
.badge .icon { width: 14px; height: 14px; }
.badge-free { background: var(--lime); color: #233600; box-shadow: 0 3px 0 var(--lime-700); }
.badge-hot { background: linear-gradient(135deg, var(--pink), var(--amber)); color: #fff; }
.badge-green { background: rgba(24,196,106,.14); color: var(--green); }
.badge-amber { background: rgba(255,182,39,.18); color: #c98500; }
.badge-red { background: rgba(255,77,94,.14); color: var(--red); }
.badge-cyan { background: rgba(25,211,240,.16); color: #0b98ae; }
.badge-muted { background: var(--border); color: var(--muted); }
.badge-preview { background: rgba(25,211,240,.16); color: #0b98ae; }
:root[data-theme="dark"] .badge-cyan, :root[data-theme="dark"] .badge-preview { color: var(--cyan); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 10px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface); font-weight: 500; white-space: nowrap; cursor: pointer; transition: transform .25s var(--bounce), background .2s, color .2s, border-color .2s; }
.chip:hover { transform: translateY(-2px); border-color: var(--primary); }
.chip:active { transform: scale(.94); }
.chip.is-active { background: var(--text); color: var(--bg); border-color: var(--text); }
.chip .count { font-size: .75rem; opacity: .7; }

/* ---------- Hero ---------- */
.hero { padding: 48px 0 32px; position: relative; }
.hero-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 40px; align-items: center; }
.hero h1 { margin-bottom: 16px; }
.hero h1 .line { display: block; }
.hero-sub { font-size: 1.12rem; color: var(--text-2); max-width: 560px; margin-bottom: 28px; }
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 28px; }
.hero-pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px 6px 6px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); font-size: .9rem; font-weight: 500; margin-bottom: 18px; box-shadow: var(--shadow-sm); }
.hero-pill b { background: var(--lime); color: #233600; padding: 2px 10px; border-radius: 999px; font-family: var(--font-head); font-size: .8rem; }
.hero-stats { display: flex; gap: 28px; flex-wrap: wrap; }
.hero-stat strong { display: block; font-family: var(--font-head); font-size: 1.8rem; font-weight: 700; line-height: 1.1; }
.hero-stat span { color: var(--muted); font-size: .9rem; }
.hero-visual { position: relative; min-height: 440px; }
.mock-card { position: absolute; background: var(--surface-solid); border: 1px solid var(--border); border-radius: 22px; box-shadow: var(--shadow-lg); padding: 18px; }
.mock-quiz { top: 30px; left: 6%; right: 6%; animation: floaty 6s ease-in-out infinite; }
.mock-quiz .mq-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; font-size: .85rem; color: var(--muted); }
.mock-quiz .mq-bar { height: 8px; border-radius: 99px; background: var(--border); overflow: hidden; margin-bottom: 14px; }
.mock-quiz .mq-bar i { display: block; height: 100%; width: 60%; background: linear-gradient(90deg, var(--lime), var(--green)); border-radius: inherit; animation: grow 3s var(--ease) infinite alternate; }
.mock-quiz .mq-q { font-family: var(--font-head); font-weight: 600; margin-bottom: 12px; }
.mock-choice { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; border: 2px solid var(--border); margin-bottom: 8px; font-size: .92rem; }
.mock-choice i { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: var(--surface-2); font-style: normal; font-weight: 700; font-family: var(--font-head); font-size: .8rem; }
.mock-choice.ok { border-color: var(--green); background: rgba(24,196,106,.1); animation: pulse-ok 2.4s ease-in-out infinite; }
.mock-choice.ok i { background: var(--green); color: #fff; }
.mock-xp { bottom: 40px; left: -2%; display: flex; align-items: center; gap: 12px; animation: floaty 5s ease-in-out infinite -2s; }
.mock-xp .big { font-family: var(--font-head); font-size: 1.6rem; font-weight: 700; color: var(--amber); }
.mock-rank { bottom: 0; right: 0; width: 230px; animation: floaty 7s ease-in-out infinite -4s; }
.mock-rank .row { display: flex; align-items: center; gap: 10px; padding: 6px 0; font-size: .9rem; }
.mock-rank .row b { font-family: var(--font-head); width: 22px; }
.sticker { position: absolute; font-size: 2.4rem; filter: drop-shadow(0 8px 12px rgba(0,0,0,.18)); animation: floaty 5s ease-in-out infinite; user-select: none; }
.sticker.s1 { top: -6px; right: 4%; animation-delay: -1s; }
.sticker.s2 { top: 46%; right: -2%; animation-delay: -3s; font-size: 2rem; }
.sticker.s3 { bottom: 34%; left: -4%; animation-delay: -2s; font-size: 2rem; }
@keyframes floaty { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-12px) rotate(1.5deg); } }
@keyframes grow { from { width: 30%; } to { width: 85%; } }
@keyframes pulse-ok { 0%, 100% { box-shadow: 0 0 0 0 rgba(24,196,106,.35); } 50% { box-shadow: 0 0 0 8px rgba(24,196,106,0); } }
@media (max-width: 960px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr); }
  .hero-visual { min-height: 380px; max-width: 520px; margin: 0 auto; width: 100%; }
}
@media (max-width: 520px) {
  .hero { padding-top: 28px; }
  .hero-visual { min-height: 360px; }
  .mock-rank { width: 200px; }
  .hero-cta .btn { flex: 1 1 auto; }
}

/* ---------- Category cards ---------- */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 170px), 1fr)); gap: 14px; }
.cat-card { --c: var(--primary); position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 6px; padding: 18px; border-radius: 20px; background: var(--surface); border: 1px solid var(--border); transition: transform .35s var(--bounce), box-shadow .3s, border-color .3s; }
.cat-card::before { content: ''; position: absolute; width: 120px; height: 120px; right: -40px; top: -40px; border-radius: 50%; background: var(--c); opacity: .14; transition: transform .5s var(--bounce); }
.cat-card:hover { transform: translateY(-6px) rotate(-1deg); border-color: var(--c); box-shadow: 0 18px 34px -16px var(--c); }
.cat-card:hover::before { transform: scale(1.6); }
.cat-card .cat-icon { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; font-size: 1.7rem; background: color-mix(in srgb, var(--c) 16%, transparent); transition: transform .4s var(--bounce); }
.cat-card:hover .cat-icon { transform: scale(1.12) rotate(-8deg); }
.cat-card strong { font-family: var(--font-head); font-weight: 600; font-size: 1.02rem; line-height: 1.3; }
.cat-card span { font-size: .82rem; color: var(--muted); }

/* ---------- Course cards ---------- */
.course-card { --c: var(--primary); position: relative; display: flex; flex-direction: column; background: var(--surface-solid); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-sm); transition: transform .4s var(--bounce), box-shadow .3s var(--ease), border-color .3s; }
.course-card:hover { transform: translateY(-8px); box-shadow: 0 26px 50px -22px color-mix(in srgb, var(--c) 70%, #000); border-color: color-mix(in srgb, var(--c) 45%, transparent); }
.cc-cover { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: radial-gradient(circle at 20% 20%, color-mix(in srgb, var(--c) 55%, #fff) 0%, transparent 55%), linear-gradient(135deg, var(--c) 0%, color-mix(in srgb, var(--c) 55%, #120c3a) 100%); display: grid; place-items: center; }
.cc-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.course-card:hover .cc-cover img { transform: scale(1.06); }
.cc-cover .cc-emoji { font-size: 4rem; filter: drop-shadow(0 10px 18px rgba(0,0,0,.3)); transition: transform .5s var(--bounce); }
.course-card:hover .cc-emoji { transform: scale(1.15) rotate(-8deg); }
.cc-cover::after { content: ''; position: absolute; inset: 0; background: radial-gradient(circle at 80% 110%, rgba(255,255,255,.25), transparent 40%); pointer-events: none; }
.cc-cover .cc-dots { position: absolute; inset: 0; opacity: .25; background-image: radial-gradient(circle at 1px 1px, #fff 1px, transparent 0); background-size: 18px 18px; }
.cc-badges { position: absolute; top: 12px; left: 12px; display: flex; gap: 6px; z-index: 2; flex-wrap: wrap; }
.cc-play { position: absolute; right: 12px; bottom: 12px; width: 44px; height: 44px; border-radius: 50%; background: #fff; color: var(--primary); display: grid; place-items: center; box-shadow: 0 8px 20px rgba(0,0,0,.25); transform: scale(0) rotate(-90deg); transition: transform .4s var(--bounce); z-index: 2; }
.course-card:hover .cc-play { transform: scale(1) rotate(0); }
.cc-body { padding: 16px 18px 6px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.cc-cat { font-size: .8rem; font-weight: 600; color: var(--c); display: inline-flex; align-items: center; gap: 6px; }
.cc-title { font-family: var(--font-head); font-size: 1.12rem; font-weight: 600; line-height: 1.35; margin: 0; }
.cc-sub { font-size: .9rem; color: var(--muted); margin: 0; }
.cc-meta { display: flex; gap: 14px; flex-wrap: wrap; font-size: .82rem; color: var(--muted); margin-top: 6px; }
.cc-meta span { display: inline-flex; align-items: center; gap: 4px; }
.cc-meta .icon { width: 15px; height: 15px; }
.cc-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 18px 18px; }
.price { font-family: var(--font-head); font-weight: 700; font-size: 1.35rem; line-height: 1; }
.price-free { color: var(--green); }
.price-old { font-size: .9rem; color: var(--muted); text-decoration: line-through; margin-left: 6px; font-weight: 500; }
.cc-progress { padding: 0 18px 4px; }

/* ---------- Progress ---------- */
.progress { height: 10px; border-radius: 999px; background: var(--border); overflow: hidden; position: relative; }
.progress > i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--primary), var(--pink)); width: 0; transition: width 1.2s var(--ease); position: relative; }
.progress > i::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255,255,255,.45), transparent); animation: shimmer 2s infinite; }
.progress-lime > i { background: linear-gradient(90deg, var(--lime), var(--green)); }
.progress-sm { height: 6px; }
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

/* ---------- Forms ---------- */
.field { margin-bottom: 16px; }
.label { display: block; font-weight: 600; font-size: .92rem; margin-bottom: 6px; color: var(--text-2); }
.hint { font-size: .8rem; color: var(--muted); margin-top: 4px; }
.input, .select, .textarea { width: 100%; padding: 12px 14px; min-height: 48px; border-radius: 14px; border: 2px solid var(--border-strong); background: var(--surface-solid); color: var(--text); transition: border-color .2s, box-shadow .2s, transform .2s; font-size: 16px; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px var(--ring); }
.textarea { min-height: 110px; resize: vertical; line-height: 1.6; }
.select { appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23736e98' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 40px; }
.input-icon { position: relative; }
.input-icon .icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.input-icon .input { padding-left: 44px; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 0 16px; }
.check { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; font-size: .95rem; user-select: none; }
.check input { position: absolute; opacity: 0; pointer-events: none; }
.check .box { width: 24px; height: 24px; flex-shrink: 0; border-radius: 8px; border: 2px solid var(--border-strong); background: var(--surface-solid); display: grid; place-items: center; transition: all .25s var(--bounce); margin-top: 1px; }
.check .box svg { width: 14px; height: 14px; color: #fff; transform: scale(0); transition: transform .25s var(--bounce); }
.check input:checked + .box { background: var(--primary); border-color: var(--primary); transform: rotate(-6deg); }
.check input:checked + .box svg { transform: scale(1); }
.check input:focus-visible + .box { box-shadow: 0 0 0 4px var(--ring); }
.switch { display: inline-flex; align-items: center; gap: 12px; cursor: pointer; user-select: none; font-weight: 500; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch .track { width: 52px; height: 30px; border-radius: 999px; background: var(--border-strong); position: relative; transition: background .25s; flex-shrink: 0; }
.switch .track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.25); transition: transform .35s var(--bounce); }
.switch input:checked + .track { background: linear-gradient(90deg, var(--green), var(--lime)); }
.switch input:checked + .track::after { transform: translateX(22px); }
.switch input:focus-visible + .track { box-shadow: 0 0 0 4px var(--ring); }
.avatar-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 8px; }
.avatar-picker label { cursor: pointer; }
.avatar-picker input { position: absolute; opacity: 0; pointer-events: none; }
.avatar-picker span { display: grid; place-items: center; height: 52px; font-size: 1.6rem; border-radius: 14px; border: 2px solid var(--border); background: var(--surface-solid); transition: transform .25s var(--bounce), border-color .2s, background .2s; }
.avatar-picker span:hover { transform: translateY(-3px) rotate(-6deg); }
.avatar-picker input:checked + span { border-color: var(--primary); background: var(--primary-soft); transform: scale(1.08); box-shadow: 0 6px 16px -6px var(--primary); }
.dropzone { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; padding: 26px 16px; border: 2px dashed var(--border-strong); border-radius: 18px; background: var(--surface-2); cursor: pointer; transition: border-color .2s, background .2s, transform .2s; }
.dropzone:hover, .dropzone.is-over { border-color: var(--primary); background: var(--primary-soft); transform: scale(1.01); }
.dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dropzone .icon { width: 34px; height: 34px; color: var(--primary); }
.dropzone img.preview { max-height: 180px; border-radius: 12px; margin-top: 6px; }

/* ---------- Auth ---------- */
.auth-wrap { min-height: calc(100vh - var(--header-h) - 120px); display: grid; place-items: center; padding: 40px 16px; }
.auth-card { width: 100%; max-width: 460px; }
.auth-card .auth-emoji { font-size: 3rem; text-align: center; animation: bounce-in .8s var(--bounce); }
.auth-card h1 { font-size: 1.8rem; text-align: center; margin-bottom: 4px; }
.auth-card .sub { text-align: center; color: var(--muted); margin-bottom: 24px; }
.auth-foot { text-align: center; margin-top: 18px; color: var(--muted); }
.auth-foot a, .link { color: var(--primary); font-weight: 600; }
.link:hover { text-decoration: underline; }
.perks { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-bottom: 20px; }

/* ---------- Course detail ---------- */
.course-hero { --c: var(--primary); position: relative; padding: 36px 0; }
.course-layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; grid-template-areas: "info side" "body side"; gap: 8px 32px; align-items: start; }
.cl-info { grid-area: info; }
.cl-side { grid-area: side; position: sticky; top: calc(var(--header-h) + 16px); }
.cl-body { grid-area: body; }
.cl-body > .card { margin-bottom: 24px; }
.course-hero h1 { font-size: clamp(1.8rem, 4vw, 2.7rem); }
.breadcrumb { display: flex; align-items: center; gap: 6px; font-size: .88rem; color: var(--muted); margin-bottom: 14px; flex-wrap: wrap; }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb .icon { width: 14px; height: 14px; }
.course-meta { display: flex; flex-wrap: wrap; gap: 10px 22px; margin: 18px 0; color: var(--text-2); font-size: .95rem; }
.course-meta span { display: inline-flex; align-items: center; gap: 6px; }
.course-meta .icon { color: var(--primary); }
.buy-card { padding: 0; overflow: hidden; }
.buy-card .cc-cover { aspect-ratio: 16/10; }
.buy-card .buy-body { padding: 22px; }
.buy-card .price { font-size: 2.1rem; }
.buy-list { list-style: none; padding: 0; margin: 18px 0 0; display: grid; gap: 10px; font-size: .94rem; }
.buy-list li { display: flex; align-items: center; gap: 10px; }
.buy-list .icon { color: var(--green); }
.prose { color: var(--text-2); white-space: normal; }
.prose p { margin-bottom: .9em; }
.curriculum { display: grid; gap: 8px; }
.cur-item { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 14px; background: var(--surface-solid); border: 1px solid var(--border); transition: transform .25s var(--bounce), border-color .2s, background .2s; }
a.cur-item:hover { transform: translateX(4px); border-color: var(--primary); }
.cur-item.is-current { border-color: var(--primary); background: var(--primary-soft); box-shadow: inset 4px 0 0 var(--primary); }
.cur-num { width: 34px; height: 34px; flex-shrink: 0; border-radius: 11px; display: grid; place-items: center; font-family: var(--font-head); font-weight: 600; background: var(--surface-2); color: var(--text-2); font-size: .9rem; }
.cur-item.is-done .cur-num { background: var(--green); color: #fff; }
.cur-item.is-locked { opacity: .75; }
.cur-item.is-locked .cur-num { background: var(--border); color: var(--muted); }
.cur-title { flex: 1; min-width: 0; font-weight: 500; line-height: 1.35; }
.cur-title small { display: flex; gap: 10px; color: var(--muted); font-size: .78rem; margin-top: 2px; flex-wrap: wrap; }
.cur-title small span { display: inline-flex; align-items: center; gap: 3px; }
.cur-title small .icon { width: 12px; height: 12px; }
@media (max-width: 960px) {
  .course-layout { grid-template-columns: minmax(0, 1fr); grid-template-areas: "info" "side" "body"; gap: 20px; }
  .cl-side { position: static; }
}

/* ---------- Learn page ---------- */
.learn-wrap { padding: 20px 0 48px; }
.learn-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 24px; align-items: start; }
.learn-side { position: sticky; top: calc(var(--header-h) + 16px); display: grid; gap: 16px; max-height: calc(100vh - var(--header-h) - 32px); overflow: auto; padding-bottom: 6px; scrollbar-width: thin; }
.player { position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius-lg); overflow: hidden; background: #000; box-shadow: var(--shadow-lg); }
.player iframe, .player video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.player-placeholder { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 20px; color: #fff; background: radial-gradient(circle at 30% 20%, rgba(109,74,255,.6), transparent 60%), radial-gradient(circle at 80% 80%, rgba(255,77,141,.5), transparent 55%), #120c33; }
.player-placeholder .pp-icon { width: 76px; height: 76px; border-radius: 50%; background: rgba(255,255,255,.14); display: grid; place-items: center; margin: 0 auto 14px; backdrop-filter: blur(6px); animation: pulse-ring 2s infinite; }
.player-placeholder .pp-icon .icon { width: 32px; height: 32px; }
.player-placeholder h3 { margin-bottom: 6px; }
.player-placeholder p { opacity: .8; margin-bottom: 16px; }
@keyframes pulse-ring { 0% { box-shadow: 0 0 0 0 rgba(255,255,255,.35); } 100% { box-shadow: 0 0 0 22px rgba(255,255,255,0); } }
.lesson-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin: 20px 0 6px; flex-wrap: wrap; }
.lesson-head h1 { font-size: clamp(1.35rem, 3vw, 1.9rem); margin: 4px 0 0; }
.lesson-nav { display: flex; gap: 10px; flex-wrap: wrap; }
.tabs { display: flex; gap: 6px; padding: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; margin: 20px 0 16px; overflow-x: auto; scrollbar-width: none; position: relative; }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex: 1 0 auto; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 16px; border-radius: 13px; border: 0; background: none; cursor: pointer; font-family: var(--font-head); font-weight: 600; color: var(--muted); white-space: nowrap; transition: color .2s, background .25s, transform .2s var(--bounce); }
.tab:hover { color: var(--text); }
.tab:active { transform: scale(.95); }
.tab.is-active { background: var(--surface-solid); color: var(--primary); box-shadow: var(--shadow-sm); }
.tab .count { background: var(--primary-soft); color: var(--primary); padding: 0 8px; border-radius: 99px; font-size: .78rem; }
.tab-panel { display: none; animation: fade-up .35s var(--ease); }
.tab-panel.is-active { display: block; }
@media (max-width: 1024px) {
  .learn-grid { grid-template-columns: minmax(0, 1fr); }
  .learn-side { position: static; max-height: none; overflow: visible; }
}
@media (max-width: 600px) {
  .learn-wrap { padding-top: 0; }
  .learn-wrap > .container { padding: 0; }
  .player { border-radius: 0; }
  .learn-main > :not(.player) { margin-left: 16px; margin-right: 16px; }
  .learn-side { padding: 0 16px; }
}

/* ---------- Quiz ---------- */
.quiz { position: relative; }
.quiz-intro { text-align: center; padding: 32px 20px; }
.quiz-intro .qi-emoji { font-size: 3.4rem; margin-bottom: 6px; display: inline-block; animation: wiggle 2.4s ease-in-out infinite; }
.quiz-intro h3 { font-size: 1.5rem; }
.quiz-intro .qi-stats { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin: 14px 0 22px; }
.quiz-top { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.quiz-top .progress { flex: 1; height: 14px; }
.quiz-top .progress > i { background: linear-gradient(90deg, var(--lime), var(--green)); }
.quiz-count { font-family: var(--font-head); font-weight: 600; font-size: .95rem; white-space: nowrap; color: var(--muted); }
.quiz-timer { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-head); font-weight: 600; font-size: .9rem; padding: 4px 10px; border-radius: 99px; background: var(--surface-2); font-variant-numeric: tabular-nums; }
.q-step { display: none; }
.q-step.is-active { display: block; animation: slide-in .4s var(--ease); }
.q-step.is-back { animation-name: slide-in-back; }
.q-text { font-family: var(--font-head); font-size: clamp(1.15rem, 2.6vw, 1.4rem); font-weight: 600; line-height: 1.45; margin-bottom: 18px; white-space: pre-line; }
.q-text .q-no { display: inline-grid; place-items: center; min-width: 34px; height: 34px; padding: 0 8px; border-radius: 10px; background: var(--primary); color: #fff; font-size: .95rem; margin-right: 10px; vertical-align: 3px; box-shadow: 0 3px 0 var(--primary-700); }
.choices { display: grid; gap: 12px; }
.choice { position: relative; display: flex; align-items: center; gap: 14px; padding: 14px 16px; min-height: 60px; border-radius: 16px; border: 2px solid var(--border-strong); background: var(--surface-solid); cursor: pointer; text-align: left; width: 100%; box-shadow: 0 4px 0 var(--border-strong); transition: transform .18s var(--bounce), box-shadow .18s, border-color .2s, background .2s; font-size: 1rem; line-height: 1.45; }
.choice:hover { border-color: color-mix(in srgb, var(--primary) 55%, transparent); transform: translateY(-2px); box-shadow: 0 6px 0 var(--border-strong); }
.choice:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--border-strong); }
.choice-key { width: 36px; height: 36px; flex-shrink: 0; border-radius: 11px; display: grid; place-items: center; font-family: var(--font-head); font-weight: 700; border: 2px solid var(--border-strong); color: var(--muted); transition: all .2s var(--bounce); }
.choice-text { flex: 1; white-space: pre-line; }
.choice-mark { width: 28px; height: 28px; border-radius: 50%; display: none; place-items: center; color: #fff; flex-shrink: 0; }
.choice-mark .icon { width: 16px; height: 16px; }
.choice-mark .m-bad, .choice.is-wrong .choice-mark .m-ok { display: none; }
.choice.is-wrong .choice-mark .m-bad { display: inline-block; }
.choice.is-selected { border-color: var(--primary); background: var(--primary-soft); box-shadow: 0 4px 0 var(--primary); }
.choice.is-selected .choice-key { background: var(--primary); border-color: var(--primary); color: #fff; transform: rotate(-8deg) scale(1.05); }
.choice.is-correct { border-color: var(--green); background: rgba(24,196,106,.12); box-shadow: 0 4px 0 var(--green-700); }
.choice.is-correct .choice-key { background: var(--green); border-color: var(--green); color: #fff; }
.choice.is-correct .choice-mark { display: grid; background: var(--green); animation: pop .4s var(--bounce); }
.choice.is-wrong { border-color: var(--red); background: rgba(255,77,94,.1); box-shadow: 0 4px 0 var(--red-700); animation: shake .45s; }
.choice.is-wrong .choice-key { background: var(--red); border-color: var(--red); color: #fff; }
.choice.is-wrong .choice-mark { display: grid; background: var(--red); }
.choices.is-locked .choice { cursor: default; }
.choices.is-locked .choice:hover { transform: none; }
.quiz-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 22px; }
.quiz-dots { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin-top: 18px; }
.quiz-dots button { width: 30px; height: 30px; border-radius: 9px; border: 2px solid var(--border-strong); background: var(--surface-solid); font-size: .78rem; font-weight: 700; font-family: var(--font-head); cursor: pointer; color: var(--muted); transition: all .2s var(--bounce); }
.quiz-dots button.is-answered { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); }
.quiz-dots button.is-current { transform: scale(1.15); border-color: var(--text); color: var(--text); }
.quiz-dots button.is-correct { background: var(--green); border-color: var(--green); color: #fff; }
.quiz-dots button.is-wrong { background: var(--red); border-color: var(--red); color: #fff; }
.explain { margin-top: 14px; padding: 14px 16px; border-radius: 14px; background: rgba(25,211,240,.1); border: 1px dashed rgba(25,211,240,.5); font-size: .95rem; display: flex; gap: 10px; }
.explain .icon { color: #0b98ae; margin-top: 3px; }
.quiz-result { text-align: center; padding: 10px 0 6px; }
.score-ring { width: 180px; height: 180px; margin: 0 auto 14px; position: relative; }
.score-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.score-ring circle { fill: none; stroke-width: 14; stroke-linecap: round; }
.score-ring .bg { stroke: var(--border); }
.score-ring .fg { stroke: url(#ringGrad); stroke-dasharray: 471; stroke-dashoffset: 471; transition: stroke-dashoffset 1.4s var(--ease); }
.score-ring .val { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.score-ring .val strong { font-family: var(--font-head); font-size: 2.6rem; font-weight: 700; line-height: 1; }
.score-ring .val span { color: var(--muted); font-size: .9rem; }
.result-title { font-size: 1.6rem; margin-bottom: 4px; }
.result-chips { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin: 16px 0 22px; }
.result-chip { display: flex; flex-direction: column; align-items: center; min-width: 96px; padding: 10px 14px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--border); }
.result-chip strong { font-family: var(--font-head); font-size: 1.4rem; line-height: 1.2; }
.result-chip span { font-size: .78rem; color: var(--muted); }
.result-chip.xp strong { color: var(--amber); }
.xp-float { position: fixed; z-index: 120; pointer-events: none; font-family: var(--font-head); font-weight: 700; font-size: 1.6rem; color: var(--amber); text-shadow: 0 3px 0 rgba(0,0,0,.15); animation: xp-up 1.4s var(--ease) forwards; }
@keyframes xp-up { 0% { opacity: 0; transform: translateY(10px) scale(.6); } 20% { opacity: 1; transform: translateY(0) scale(1.15); } 100% { opacity: 0; transform: translateY(-80px) scale(1); } }
@keyframes slide-in { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: none; } }
@keyframes slide-in-back { from { opacity: 0; transform: translateX(-40px); } to { opacity: 1; transform: none; } }

/* ---------- Docs ---------- */
.doc-list { display: grid; gap: 10px; }
.doc-item { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 16px; background: var(--surface-solid); border: 1px solid var(--border); transition: transform .25s var(--bounce), border-color .2s; }
.doc-item:hover { transform: translateY(-2px); border-color: var(--primary); }
.doc-icon { width: 46px; height: 52px; flex-shrink: 0; border-radius: 10px; display: grid; place-items: center; font-family: var(--font-head); font-weight: 700; font-size: .72rem; text-transform: uppercase; color: #fff; background: var(--primary); position: relative; box-shadow: 0 4px 0 rgba(0,0,0,.15); }
.doc-icon::before { content: ''; position: absolute; top: 0; right: 0; border-width: 0 12px 12px 0; border-style: solid; border-color: var(--surface-solid) var(--surface-solid) rgba(255,255,255,.45) rgba(255,255,255,.45); border-radius: 0 0 0 4px; }
.doc-icon.pdf { background: #ef4444; } .doc-icon.doc, .doc-icon.docx { background: #2563eb; } .doc-icon.xls, .doc-icon.xlsx { background: #16a34a; }
.doc-icon.ppt, .doc-icon.pptx { background: #ea580c; } .doc-icon.zip { background: #7c3aed; } .doc-icon.jpg, .doc-icon.jpeg, .doc-icon.png { background: #0891b2; } .doc-icon.mp3 { background: #db2777; }
.doc-info { flex: 1; min-width: 0; }
.doc-info strong { display: block; font-weight: 600; line-height: 1.35; }
.doc-info small { color: var(--muted); font-size: .8rem; }

/* ---------- Leaderboard ---------- */
.podium { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr) minmax(0, 1fr); align-items: end; gap: 12px; max-width: 640px; margin: 10px auto 28px; }
.podium-col { display: flex; flex-direction: column; align-items: center; text-align: center; min-width: 0; }
.podium-col .avatar { width: 66px; height: 66px; font-size: 2.1rem; border-width: 3px; margin-bottom: 8px; position: relative; }
.podium-col.p1 .avatar { width: 88px; height: 88px; font-size: 2.9rem; box-shadow: 0 0 0 4px var(--gold), 0 12px 30px -8px var(--gold); }
.podium-col.p2 .avatar { box-shadow: 0 0 0 4px var(--silver); }
.podium-col.p3 .avatar { box-shadow: 0 0 0 4px var(--bronze); }
.podium-crown { font-size: 1.9rem; margin-bottom: -8px; animation: floaty 3s ease-in-out infinite; }
.podium-name { font-family: var(--font-head); font-weight: 600; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.podium-xp { font-size: .85rem; color: var(--muted); margin-bottom: 8px; }
.podium-block { width: 100%; border-radius: 18px 18px 8px 8px; display: grid; place-items: center; font-family: var(--font-head); font-weight: 800; font-size: 2rem; color: rgba(0,0,0,.35); position: relative; overflow: hidden; }
.podium-block::after { content: ''; position: absolute; inset: 0; background: linear-gradient(115deg, transparent 35%, rgba(255,255,255,.45) 50%, transparent 65%); animation: shimmer 3.2s infinite; }
.p1 .podium-block { height: 150px; background: linear-gradient(180deg, #ffe07a, var(--gold)); box-shadow: 0 6px 0 #d9a514; }
.p2 .podium-block { height: 110px; background: linear-gradient(180deg, #e9eef8, var(--silver)); box-shadow: 0 6px 0 #9fa9bf; }
.p3 .podium-block { height: 84px; background: linear-gradient(180deg, #f3bd8d, var(--bronze)); box-shadow: 0 6px 0 #b8703a; }
.lb-list { display: grid; gap: 8px; }
.lb-row { display: flex; align-items: center; gap: 14px; padding: 10px 16px; border-radius: 16px; background: var(--surface-solid); border: 1px solid var(--border); transition: transform .25s var(--bounce), border-color .2s; }
.lb-row:hover { transform: translateX(4px); border-color: var(--primary); }
.lb-row.is-me { border: 2px solid var(--primary); background: var(--primary-soft); }
.lb-pos { width: 34px; font-family: var(--font-head); font-weight: 700; font-size: 1.05rem; text-align: center; color: var(--muted); }
.lb-name { flex: 1; min-width: 0; }
.lb-name strong { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-name small { color: var(--muted); font-size: .78rem; }
.lb-xp { font-family: var(--font-head); font-weight: 700; white-space: nowrap; }
.lb-xp small { font-weight: 500; color: var(--muted); font-size: .78rem; }
.mini-board .lb-row { padding: 8px 10px; gap: 10px; border-radius: 12px; }
.mini-board .avatar { width: 30px; height: 30px; font-size: 1rem; }
.mini-board .lb-pos { width: 24px; font-size: .9rem; }
.me-bar { position: sticky; bottom: 12px; z-index: 5; margin-top: 16px; }
@media (max-width: 860px) { .me-bar { bottom: calc(100px + env(safe-area-inset-bottom)); } }

/* ---------- Dashboard ---------- */
.level-card { position: relative; overflow: hidden; border-radius: var(--radius-xl); padding: 28px; color: #fff; background: radial-gradient(circle at 85% 20%, rgba(255,255,255,.22), transparent 40%), linear-gradient(135deg, #6d4aff 0%, #9b4dff 45%, #ff4d8d 100%); box-shadow: 0 30px 60px -28px #6d4aff; }
.level-card::after { content: ''; position: absolute; width: 260px; height: 260px; right: -80px; bottom: -120px; border-radius: 50%; background: rgba(255,255,255,.12); }
.level-card .lv-top { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; position: relative; z-index: 1; }
.level-card .lv-icon { width: 78px; height: 78px; border-radius: 24px; background: rgba(255,255,255,.18); display: grid; place-items: center; font-size: 2.6rem; backdrop-filter: blur(6px); animation: floaty 4s ease-in-out infinite; }
.level-card h2 { margin: 0; font-size: 1.7rem; }
.level-card .lv-sub { opacity: .9; }
.level-card .progress { background: rgba(255,255,255,.22); height: 14px; margin: 18px 0 8px; position: relative; z-index: 1; }
.level-card .progress > i { background: linear-gradient(90deg, var(--lime), #fff59d); }
.level-card .lv-foot { display: flex; justify-content: space-between; font-size: .9rem; opacity: .95; position: relative; z-index: 1; flex-wrap: wrap; gap: 6px; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 160px), 1fr)); gap: 14px; }
.stat { padding: 18px; border-radius: 20px; background: var(--surface); border: 1px solid var(--border); display: flex; flex-direction: column; gap: 4px; transition: transform .3s var(--bounce); }
.stat:hover { transform: translateY(-4px) rotate(-1deg); }
.stat .stat-icon { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; font-size: 1.3rem; background: var(--primary-soft); margin-bottom: 6px; }
.stat strong { font-family: var(--font-head); font-size: 1.7rem; font-weight: 700; line-height: 1.1; }
.stat span { color: var(--muted); font-size: .86rem; }
.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 120px), 1fr)); gap: 12px; }
.badge-item { text-align: center; padding: 16px 10px; border-radius: 18px; background: var(--surface-solid); border: 1px solid var(--border); transition: transform .3s var(--bounce); }
.badge-item:hover { transform: translateY(-4px) scale(1.03); }
.badge-item .b-icon { font-size: 2.2rem; line-height: 1; margin-bottom: 8px; display: inline-block; }
.badge-item strong { display: block; font-family: var(--font-head); font-size: .92rem; font-weight: 600; }
.badge-item small { color: var(--muted); font-size: .74rem; line-height: 1.3; display: block; }
.badge-item.is-locked { opacity: .5; }
.badge-item.is-locked .b-icon { filter: grayscale(1); }
.badge-item.is-earned .b-icon { animation: wiggle 3s ease-in-out infinite; }
.activity { display: grid; gap: 4px; }
.activity-row { display: flex; align-items: center; gap: 12px; padding: 10px 4px; border-bottom: 1px dashed var(--border); font-size: .93rem; }
.activity-row:last-child { border-bottom: 0; }
.activity-row .xp-plus { margin-left: auto; font-family: var(--font-head); font-weight: 700; color: var(--green); white-space: nowrap; }

.profile-hero .avatar-xl { margin: 0 auto; box-shadow: 0 0 0 4px var(--primary-soft), 0 14px 30px -12px var(--primary); }
.photo-row { display: flex; align-items: center; gap: 16px; }
.lb-title { color: var(--pink); font-weight: 600; }
.level-card .lv-avatar { border-color: rgba(255,255,255,.6); box-shadow: 0 0 0 3px rgba(255,255,255,.25); }
.level-path { display: grid; gap: 8px; }
.lp-item { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface-solid); opacity: .6; }
.lp-item.is-reached { opacity: 1; }
.lp-item.is-current { border: 2px solid var(--primary); background: var(--primary-soft); opacity: 1; }
.lp-icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-size: 1.4rem; background: var(--surface-2); flex-shrink: 0; }
.lp-item:not(.is-reached) .lp-icon { filter: grayscale(1); }

/* ---------- Checkout ---------- */
.checkout-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; align-items: start; }
.qr-box { background: #fff; color: #111; border-radius: 24px; padding: 22px; text-align: center; box-shadow: var(--shadow-lg); max-width: 340px; margin: 0 auto; }
.qr-box .pp-head { background: #113566; color: #fff; margin: -22px -22px 18px; padding: 12px; border-radius: 24px 24px 0 0; font-family: var(--font-head); font-weight: 700; letter-spacing: .04em; }
.qr-box .qr { display: grid; place-items: center; min-height: 240px; }
.qr-box .qr img, .qr-box .qr canvas { width: 240px !important; height: 240px !important; }
.qr-box .amount { font-family: var(--font-head); font-size: 2rem; font-weight: 700; color: #113566; margin-top: 10px; }
.steps { list-style: none; counter-reset: s; padding: 0; margin: 0; display: grid; gap: 12px; }
.steps li { counter-increment: s; display: flex; gap: 12px; align-items: flex-start; }
.steps li::before { content: counter(s); width: 30px; height: 30px; flex-shrink: 0; border-radius: 10px; display: grid; place-items: center; background: var(--primary); color: #fff; font-family: var(--font-head); font-weight: 700; box-shadow: 0 3px 0 var(--primary-700); }
@media (max-width: 860px) { .checkout-grid { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Tables (admin + orders) ---------- */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface-solid); }
.table { width: 100%; border-collapse: collapse; font-size: .93rem; }
.table th, .table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table th { font-family: var(--font-head); font-weight: 600; font-size: .85rem; color: var(--muted); background: var(--surface-2); white-space: nowrap; }
.table tr:last-child td { border-bottom: 0; }
.table tr:hover td { background: color-mix(in srgb, var(--primary-soft) 50%, transparent); }
.table .actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }

/* ---------- Admin ---------- */
.admin-wrap { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 24px; padding: 24px 0 48px; align-items: start; }
.admin-side { position: sticky; top: calc(var(--header-h) + 16px); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 10px; display: grid; gap: 2px; }
.admin-side a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; font-weight: 500; color: var(--text-2); transition: background .2s, color .2s, transform .2s; }
.admin-side a:hover { background: var(--primary-soft); color: var(--primary); transform: translateX(3px); }
.admin-side a.is-active { background: var(--primary); color: #fff; box-shadow: 0 4px 0 var(--primary-700); }
.admin-side .side-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 10px 12px 4px; font-weight: 600; }
.admin-side .pill { margin-left: auto; background: var(--red); color: #fff; font-size: .72rem; padding: 0 7px; border-radius: 99px; font-weight: 700; }
.admin-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.admin-head h1 { font-size: 1.7rem; margin: 0; }
.kpi-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 190px), 1fr)); }
.kpi { padding: 18px; border-radius: 20px; background: var(--surface); border: 1px solid var(--border); position: relative; overflow: hidden; }
.kpi .kpi-icon { position: absolute; right: 14px; top: 14px; font-size: 1.6rem; opacity: .9; }
.kpi span { color: var(--muted); font-size: .86rem; }
.kpi strong { display: block; font-family: var(--font-head); font-size: 1.8rem; line-height: 1.2; margin-top: 4px; }
.bars { display: flex; align-items: flex-end; gap: 6px; height: 160px; padding-top: 10px; }
.bars .bar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; min-width: 0; }
.bars .bar i { width: 100%; max-width: 28px; border-radius: 8px 8px 4px 4px; background: linear-gradient(180deg, var(--pink), var(--primary)); min-height: 4px; transition: height 1s var(--ease); }
.bars .bar.alt i { background: linear-gradient(180deg, var(--lime), var(--green)); }
.bars .bar small { font-size: .68rem; color: var(--muted); }
.q-admin { border: 1px solid var(--border); border-radius: 16px; background: var(--surface-solid); margin-bottom: 10px; }
.q-admin > summary { list-style: none; cursor: pointer; display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; }
.q-admin > summary::-webkit-details-marker { display: none; }
.q-admin[open] > summary { border-bottom: 1px solid var(--border); }
.q-admin .q-body { padding: 16px; }
.answer-pills { display: flex; gap: 8px; flex-wrap: wrap; }
.answer-pills label { cursor: pointer; }
.answer-pills input { position: absolute; opacity: 0; }
.answer-pills span { display: inline-grid; place-items: center; width: 46px; height: 42px; border-radius: 12px; border: 2px solid var(--border-strong); font-family: var(--font-head); font-weight: 700; transition: all .2s var(--bounce); }
.answer-pills input:checked + span { background: var(--green); border-color: var(--green); color: #fff; transform: scale(1.08); }
@media (max-width: 960px) {
  .admin-wrap { grid-template-columns: minmax(0, 1fr); padding-top: 12px; }
  .admin-side { position: static; display: flex; overflow-x: auto; scrollbar-width: none; padding: 6px; }
  .admin-side::-webkit-scrollbar { display: none; }
  .admin-side a { white-space: nowrap; }
  .admin-side .side-label { display: none; }
}

/* ---------- Misc components ---------- */
.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty .e-emoji { font-size: 3rem; margin-bottom: 8px; display: inline-block; animation: floaty 4s ease-in-out infinite; }
.alert { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 16px; border: 1px solid var(--border); background: var(--surface-solid); margin-bottom: 16px; }
.alert .icon { margin-top: 2px; }
.alert-info { border-color: rgba(25,211,240,.4); background: rgba(25,211,240,.08); }
.alert-info .icon { color: #0b98ae; }
.alert-warn { border-color: rgba(255,182,39,.5); background: rgba(255,182,39,.1); }
.alert-warn .icon { color: var(--amber-700); }
.alert-success { border-color: rgba(24,196,106,.4); background: rgba(24,196,106,.08); }
.alert-success .icon { color: var(--green); }
.alert-error { border-color: rgba(255,77,94,.4); background: rgba(255,77,94,.08); }
.alert-error .icon { color: var(--red); }
.feature { display: flex; flex-direction: column; gap: 8px; }
.feature .f-icon { width: 56px; height: 56px; border-radius: 18px; display: grid; place-items: center; font-size: 1.7rem; margin-bottom: 6px; transition: transform .4s var(--bounce); }
.feature:hover .f-icon { transform: rotate(-10deg) scale(1.1); }
.feature h3 { margin: 0; }
.feature p { margin: 0; color: var(--muted); font-size: .95rem; }
.cta-band { position: relative; overflow: hidden; border-radius: var(--radius-xl); padding: 44px 28px; text-align: center; color: #fff; background: radial-gradient(circle at 15% 20%, rgba(255,255,255,.2), transparent 40%), linear-gradient(120deg, #4320c9, #6d4aff 40%, #ff4d8d); box-shadow: 0 40px 70px -35px #6d4aff; }
.cta-band h2 { color: #fff; }
.cta-band p { opacity: .9; max-width: 560px; margin: 0 auto 24px; }
.cta-band .sticker { opacity: .9; }
.faq details { border: 1px solid var(--border); border-radius: 16px; background: var(--surface-solid); margin-bottom: 10px; transition: border-color .2s; }
.faq details[open] { border-color: var(--primary); }
.faq summary { list-style: none; cursor: pointer; padding: 16px 18px; font-family: var(--font-head); font-weight: 600; display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary .icon { transition: transform .3s var(--bounce); color: var(--primary); }
.faq details[open] summary .icon { transform: rotate(180deg); }
.faq .faq-a { padding: 0 18px 16px; color: var(--text-2); }
.pager { display: flex; gap: 6px; justify-content: center; margin-top: 18px; flex-wrap: wrap; }
.pager a, .pager span { min-width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-solid); font-weight: 600; padding: 0 10px; }
.pager .is-current { background: var(--primary); color: #fff; border-color: var(--primary); }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; }
.toolbar .input-icon { flex: 1 1 240px; }
.toolbar .select { width: auto; min-width: 150px; flex: 0 1 auto; }

main { min-height: calc(100vh - var(--header-h) - 200px); }

/* ---------- Footer ---------- */
.site-footer { margin-top: 40px; border-top: 1px solid var(--border); padding: 40px 0 28px; background: var(--bg-2); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 28px; }
.footer-grid h4 { font-size: .95rem; margin-bottom: 12px; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; color: var(--muted); font-size: .93rem; }
.footer-grid a:hover { color: var(--primary); }
.socials { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.footer-bottom { margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--border); display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: .85rem; color: var(--muted); }
@media (max-width: 860px) { .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .footer-grid > :first-child { grid-column: 1 / -1; } }

/* ---------- Toasts ---------- */
.toast-stack { position: fixed; top: calc(var(--header-h) + 12px); right: 16px; z-index: 200; display: grid; gap: 10px; width: min(380px, calc(100vw - 32px)); pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; border-radius: 18px; background: var(--surface-solid); border: 1px solid var(--border); box-shadow: var(--shadow-lg); animation: toast-in .5s var(--bounce); position: relative; overflow: hidden; }
.toast::after { content: ''; position: absolute; left: 0; bottom: 0; height: 3px; background: currentColor; animation: toast-timer 4.5s linear forwards; opacity: .5; }
.toast .t-icon { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; flex-shrink: 0; color: #fff; }
.toast .t-icon .icon { width: 18px; height: 18px; }
.toast .t-msg { flex: 1; font-size: .95rem; font-weight: 500; padding-top: 5px; color: var(--text); }
.toast.success { color: var(--green); } .toast.success .t-icon { background: var(--green); }
.toast.error { color: var(--red); } .toast.error .t-icon { background: var(--red); }
.toast.info { color: var(--primary); } .toast.info .t-icon { background: var(--primary); }
.toast.warn { color: var(--amber); } .toast.warn .t-icon { background: var(--amber); }
.toast.is-leaving { animation: toast-out .35s var(--ease) forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateX(40px) scale(.9); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateX(40px) scale(.9); } }
@keyframes toast-timer { from { width: 100%; } to { width: 0; } }
@media (max-width: 600px) { .toast-stack { left: 16px; right: 16px; width: auto; top: 12px; } }

/* ---------- Modal ---------- */
.modal-backdrop { position: fixed; inset: 0; z-index: 150; background: rgba(10, 6, 30, .55); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); display: grid; place-items: center; padding: 16px; animation: fade .25s; }
.modal { width: 100%; max-width: 420px; background: var(--surface-solid); border-radius: 26px; padding: 28px 24px 22px; text-align: center; box-shadow: var(--shadow-lg); border: 1px solid var(--border); animation: bounce-in .5s var(--bounce); }
.modal .m-emoji { font-size: 3rem; line-height: 1; margin-bottom: 10px; display: inline-block; animation: wiggle 1.5s ease-in-out infinite; }
.modal h3 { font-size: 1.35rem; }
.modal p { color: var(--muted); }
.modal .m-actions { display: flex; gap: 10px; margin-top: 18px; }
.modal .m-actions .btn { flex: 1; }
.modal.levelup { max-width: 380px; background: radial-gradient(circle at 50% 0%, rgba(255,200,61,.35), transparent 60%), var(--surface-solid); }
.modal.levelup .m-emoji { font-size: 4.4rem; animation: bounce-in .8s var(--bounce), floaty 3s ease-in-out .8s infinite; }

/* ---------- Animations ---------- */
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes fade-up { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes pop { 0% { transform: scale(.6); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@keyframes bounce-in { 0% { transform: scale(.4) translateY(30px); opacity: 0; } 60% { transform: scale(1.06); opacity: 1; } 100% { transform: scale(1); } }
@keyframes wiggle { 0%, 100% { transform: rotate(0); } 15% { transform: rotate(-12deg); } 30% { transform: rotate(10deg); } 45% { transform: rotate(-6deg); } 60% { transform: rotate(4deg); } 75% { transform: rotate(0); } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-8px); } 40% { transform: translateX(8px); } 60% { transform: translateX(-5px); } 80% { transform: translateX(5px); } }
@keyframes spin { to { transform: rotate(360deg); } }
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .7s var(--ease), transform .7s var(--ease); transition-delay: var(--d, 0s); }
.reveal.is-in { opacity: 1; transform: none; }
#confetti { position: fixed; inset: 0; pointer-events: none; z-index: 300; width: 100%; height: 100%; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
}

/* ---------- Installer ---------- */
.install-wrap { max-width: 720px; margin: 0 auto; padding: 40px 16px 60px; }
.checklist { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.checklist li { display: flex; align-items: center; gap: 10px; font-size: .95rem; }
.checklist .ok { color: var(--green); }
.checklist .bad { color: var(--red); }


/* =========================================================
   Google look — clean white surfaces, Google colours, pill buttons
   ========================================================= */
body { line-height: 1.6; }
.site-header { background: var(--bg); backdrop-filter: none; -webkit-backdrop-filter: none; }
.announce { background: var(--primary); color: var(--on-primary); }
.announce button { background: rgba(255,255,255,.2); color: inherit; }

/* Logo: letters in Google's colours */
.brand { font-weight: 600; letter-spacing: -.02em; }
.brand-logo { background: var(--primary); box-shadow: none; transform: none; border-radius: 12px; }
.brand:hover .brand-logo { transform: scale(1.06); }
.g-logo b { font-weight: 600; }
.g-logo .c1 { color: var(--g-blue); } .g-logo .c2 { color: var(--g-red); } .g-logo .c3 { color: var(--g-yellow); }
.g-logo .c4 { color: var(--g-blue); } .g-logo .c5 { color: var(--g-green); } .g-logo .c6 { color: var(--g-red); }

/* Navigation */
.nav-link { border-radius: 999px; font-weight: 500; color: var(--text-2); }
.nav-link:hover { background: var(--bg-2); color: var(--text); transform: none; }
.nav-link.is-active { background: var(--primary-soft); color: var(--primary-ink); }
.icon-btn { border-radius: 999px; background: transparent; border-color: transparent; color: var(--muted); }
.icon-btn:hover { background: var(--bg-2); border-color: transparent; color: var(--text); transform: none; }
.xp-chip { background: var(--tint-yellow); color: var(--ink-yellow); border: 0; font-weight: 500; }
.streak-chip { background: var(--tint-red); color: var(--ink-red); font-weight: 500; }
.avatar { background: var(--primary-soft); box-shadow: none; border-color: var(--surface-solid); }
.user-menu > summary { background: transparent; border-color: var(--border); }
.dropdown { border-radius: 12px; }
.dropdown a:hover, .dropdown button:hover { background: var(--bg-2); color: var(--text); }

/* Buttons — Material style pills, keep sound + ripple */
.btn {
  --b: var(--primary); --bt: var(--on-primary);
  background: var(--b); color: var(--bt);
  border-radius: 999px; box-shadow: none; font-weight: 500; letter-spacing: .01em;
  padding: 10px 24px; min-height: 44px;
  transition: box-shadow .2s var(--ease), filter .2s, transform .15s var(--ease);
}
.btn::after { display: none; }
.btn:hover, .btn-sm:hover, .btn-xs:hover { transform: none; box-shadow: var(--shadow-sm); filter: brightness(1.05); }
.btn:active, .btn.is-pressed, .btn-sm:active, .btn-xs:active { transform: scale(.96); box-shadow: none; }
.btn-sm, .btn-xs, .btn.btn-ghost.btn-sm, .btn.btn-ghost.btn-xs { box-shadow: none; border-radius: 999px; }
.btn-lg { border-radius: 999px; padding: 14px 32px; min-height: 54px; }
.btn-pink { --b: var(--g-red); --bt: #fff; }
.btn-red { --b: var(--red); --bt: #fff; }
.btn-lime, .btn-green { --b: var(--green); --bt: #fff; }
.btn-amber { --b: var(--g-yellow); --bt: #202124; }
.btn-dark { --b: #202124; --bt: #fff; }
:root[data-theme="dark"] .btn-dark { --b: #e8eaed; --bt: #202124; }
.btn-ghost { background: transparent; color: var(--primary); border: 1px solid var(--border); box-shadow: none; }
.btn-ghost:hover { background: var(--primary-soft); color: var(--primary-ink); border-color: var(--border); box-shadow: none; filter: none; }
.btn-ghost:active { box-shadow: none; }
.ripple { background: rgba(255,255,255,.45); }
.btn-ghost .ripple { background: rgba(26,115,232,.18); }

/* Surfaces */
.card { background: var(--surface-solid); border-radius: var(--radius-lg); box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
.card-hover:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--border); }
.course-card { border-radius: var(--radius-lg); box-shadow: none; }
.course-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--border); }
.cat-card { background: var(--surface-solid); border-radius: var(--radius-lg); }
.cat-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.cat-card::before { opacity: .10; }
.stat, .kpi { background: var(--surface-solid); border-radius: var(--radius-lg); }
.stat:hover { transform: translateY(-2px); }
.stat .stat-icon { background: var(--primary-soft); border-radius: 50%; }
.mock-card { border-radius: 16px; box-shadow: var(--shadow-lg); }
.tabs { background: var(--bg-2); border-color: var(--border); border-radius: 999px; }
.tab { border-radius: 999px; font-weight: 500; }
.tab.is-active { background: var(--surface-solid); color: var(--primary-ink); box-shadow: var(--shadow-sm); }

/* Badges & chips (Google tonal colours) */
.badge { background: var(--primary-soft); color: var(--primary-ink); font-weight: 500; }
.badge-free, .badge-green { background: var(--tint-green); color: var(--ink-green); box-shadow: none; }
.badge-hot, .badge-red { background: var(--tint-red); color: var(--ink-red); }
.badge-amber { background: var(--tint-yellow); color: var(--ink-yellow); }
.badge-cyan, .badge-preview { background: var(--tint-cyan); color: var(--ink-cyan); }
.badge-muted { background: var(--tint-gray); color: var(--ink-gray); }
.chip { border-radius: 8px; border-color: var(--border); background: var(--surface-solid); color: var(--text-2); font-weight: 500; }
.chip:hover { background: var(--bg-2); border-color: var(--border); transform: none; }
.chip.is-active { background: var(--primary-soft); color: var(--primary-ink); border-color: transparent; }
.hero-pill { box-shadow: none; }
.hero-pill b { background: var(--primary); color: var(--on-primary); font-weight: 500; }
.eyebrow { color: var(--primary); letter-spacing: .06em; font-weight: 500; }

/* Forms */
.input, .select, .textarea { border-width: 1px; border-radius: 8px; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.check input:checked + .box { background: var(--primary); border-color: var(--primary); transform: none; }
.switch input:checked + .track { background: var(--primary); }
.avatar-picker input:checked + span { border-color: var(--primary); background: var(--primary-soft); box-shadow: none; }
.dropzone { border-color: var(--border-strong); background: var(--bg-2); border-radius: 12px; }

/* Progress */
.progress { background: var(--tint-gray); }
.progress > i { background: var(--primary); }
.progress > i::after { display: none; }
.progress-lime > i { background: var(--green); }

/* Quiz */
.q-text .q-no { background: var(--primary); color: var(--on-primary); border-radius: 999px; box-shadow: none; }
.quiz-top .progress > i { background: var(--primary); }
.choice { border-width: 1px; border-color: var(--border); border-radius: 12px; box-shadow: none; }
.choice:hover { border-color: var(--border-strong); background: var(--bg-2); transform: none; box-shadow: none; }
.choice:active { transform: scale(.99); box-shadow: none; }
.choice-key { border-radius: 50%; border-width: 1px; border-color: var(--border-strong); }
.choice.is-selected { border: 2px solid var(--primary); background: var(--primary-soft); box-shadow: none; }
.choice.is-selected .choice-key { background: var(--primary); border-color: var(--primary); color: var(--on-primary); transform: none; }
.choice.is-correct { border: 2px solid var(--green); background: var(--tint-green); box-shadow: none; }
.choice.is-wrong { border: 2px solid var(--red); background: var(--tint-red); box-shadow: none; }
.quiz-dots button { border-radius: 50%; border-width: 1px; }
.quiz-dots button.is-answered { background: var(--primary-soft); border-color: var(--primary); color: var(--primary-ink); }
.explain { background: var(--tint-cyan); border: 0; }
.explain .icon { color: var(--ink-cyan); }
.result-chip { background: var(--bg-2); }
.result-chip.xp strong { color: var(--ink-yellow); }
.cur-item { border-radius: 12px; }
.cur-item.is-current { background: var(--primary-soft); box-shadow: inset 3px 0 0 var(--primary); }
.cur-item.is-done .cur-num { background: var(--green); }
.cur-num { border-radius: 50%; }

/* Hero & feature blocks */
.player-placeholder { background: radial-gradient(circle at 25% 20%, rgba(66,133,244,.55), transparent 60%), radial-gradient(circle at 80% 85%, rgba(52,168,83,.35), transparent 55%), #202124; }
.level-card { background: radial-gradient(circle at 85% 15%, rgba(255,255,255,.18), transparent 40%), linear-gradient(135deg, #1967d2 0%, #4285f4 60%, #5e97f6 100%); box-shadow: var(--shadow); }
.level-card .progress { background: rgba(255,255,255,.25); }
.level-card .progress > i { background: #fff; }
.cta-band { background: radial-gradient(circle at 15% 20%, rgba(255,255,255,.18), transparent 40%), linear-gradient(120deg, #1967d2, #4285f4); box-shadow: var(--shadow); }
.mock-choice.ok { border-color: var(--green); background: var(--tint-green); }
.mock-choice.ok i { background: var(--green); }
.mock-quiz .mq-bar i { background: var(--primary); }
.mock-xp .big { color: var(--ink-yellow); }

/* Lists, tables, admin */
.lb-row { border-radius: 12px; }
.lb-row.is-me { border: 2px solid var(--primary); background: var(--primary-soft); }
.lb-title { color: var(--g-red); }
.steps li::before { background: var(--primary); color: var(--on-primary); border-radius: 50%; box-shadow: none; }
.admin-side { background: var(--surface-solid); }
.admin-side a { border-radius: 999px; }
.admin-side a.is-active { background: var(--primary-soft); color: var(--primary-ink); box-shadow: none; font-weight: 600; }
.admin-side .pill { background: var(--red); }
.table th { background: var(--bg-2); color: var(--muted); font-weight: 500; }
.bars .bar i { background: var(--g-blue); }
.bars .bar.alt i { background: var(--g-green); }
.toast { border-radius: 12px; }
.modal { border-radius: 28px; }
.modal.levelup { background: radial-gradient(circle at 50% 0%, rgba(251,188,4,.25), transparent 60%), var(--surface-solid); }
.faq details { border-radius: 12px; }
.faq details[open] { border-color: var(--primary); }
.alert { border-radius: 12px; }
.alert-info { background: var(--primary-soft); border-color: transparent; } .alert-info .icon { color: var(--primary); }
.alert-success { background: var(--tint-green); border-color: transparent; }
.alert-warn { background: var(--tint-yellow); border-color: transparent; }
.alert-error { background: var(--tint-red); border-color: transparent; }
.site-footer { background: var(--bg-2); }
@media (max-width: 860px) {
  .bottom-nav { border-radius: 999px; background: var(--surface-solid); box-shadow: var(--shadow-lg); }
  .bottom-nav a { border-radius: 999px; }
  .bottom-nav a.is-active { color: var(--primary-ink); background: var(--primary-soft); }
  .bottom-nav .bn-main span.bn-bubble { background: var(--primary); box-shadow: var(--shadow); transform: none; border-radius: 50%; }
  .bottom-nav .bn-main span.bn-bubble .icon { transform: none; color: var(--on-primary); }
}

/* 3D icon images (generated) */
.img-icon { display: inline-block; object-fit: contain; vertical-align: middle; }
.f-icon img, .cat-icon img { width: 100%; height: 100%; object-fit: contain; }
.feature .f-icon { width: 72px; height: 72px; background: none !important; }
.cat-card .cat-icon { width: 60px; height: 60px; background: none; }
.sticker img { width: 64px; height: 64px; }
.cc-emoji img { width: 96px; height: 96px; }
.qi-emoji img, .e-emoji img { width: 84px; height: 84px; }

.img-icon.icon-sm { width: 1.35em; height: 1.35em; vertical-align: -0.3em; }
.img-icon.icon-title { width: 1.1em; height: 1.1em; vertical-align: -0.12em; }
.emoji-icon.icon-sm { font-size: 1em; }
.cat-icon, .f-icon { display: grid; place-items: center; }
.cat-card .cat-icon { font-size: 2rem; }
.feature .f-icon { font-size: 2.6rem; }
.cc-emoji { display: grid; place-items: center; }
.sticker .img-icon { width: 64px; height: 64px; }
.qi-emoji .img-icon { width: 88px; height: 88px; }
.icon-field { display: flex; gap: 10px; align-items: center; }
.icon-preview { width: 56px; height: 56px; flex-shrink: 0; border-radius: 12px; border: 1px solid var(--border); background: var(--bg-2); display: grid; place-items: center; font-size: 1.8rem; }
.icon-preview .img-icon { width: 46px; height: 46px; }
.icon-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(56px, 1fr)); gap: 8px; margin-top: 10px; }
.icon-picker button { aspect-ratio: 1; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-solid); cursor: pointer; padding: 6px; transition: transform .2s var(--bounce), border-color .2s, background .2s; }
.icon-picker button img { width: 100%; height: 100%; object-fit: contain; }
.icon-picker button:hover { transform: translateY(-2px); border-color: var(--border-strong); }
.icon-picker button.is-active { border: 2px solid var(--primary); background: var(--primary-soft); }


/* ---------- Share ---------- */
.share-sheet { max-width: 440px; text-align: left; }
.share-sheet h3 { text-align: center; }
.share-title { text-align: center; color: var(--muted); font-size: .92rem; margin-bottom: 16px; }
.share-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 16px; }
.share-grid a { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: .82rem; color: var(--text-2); padding: 8px 4px; border-radius: 12px; transition: background .2s, transform .2s var(--bounce); }
.share-grid a:hover { background: var(--bg-2); transform: translateY(-2px); }
.share-ico { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 1.3rem; font-family: Arial, sans-serif; }
.share-copy { display: flex; gap: 8px; }
.share-copy .input { min-height: 40px; font-size: .85rem; }
.share-banner { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 16px 18px; margin-bottom: 18px; border-radius: 16px; background: linear-gradient(120deg, var(--primary-soft), var(--tint-green)); border: 1px solid var(--border); }
.share-banner strong { font-size: 1.05rem; }
.share-banner p { color: var(--text-2); font-size: .92rem; }
.learn-main > .share-banner { margin-top: 0; }

/* ---------- Certificate card ---------- */
.cert-card .card-title { margin-bottom: 10px; }
.cert-ico { width: 34px; height: 34px; display: inline-grid; place-items: center; font-size: 1.5rem; flex-shrink: 0; }
.cert-ico .img-icon { width: 34px; height: 34px; }
.cert-checks { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 6px; font-size: .92rem; color: var(--muted); }
.cert-checks li { display: flex; align-items: center; gap: 8px; }
.cert-checks li.ok { color: var(--ink-green); }
.cert-mini { display: flex; gap: 14px; align-items: center; }
.cert-mini .cert-ico, .cert-mini .cert-ico .img-icon { width: 52px; height: 52px; }

/* ---------- Certificate page (A4 landscape) ---------- */
.cert-page { background: var(--bg-2); padding: 16px 16px 40px; }
.cert-toolbar { max-width: 1100px; margin: 0 auto 16px; display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.cert-stage { max-width: 1100px; margin: 0 auto; container-type: inline-size; }
.certificate { position: relative; aspect-ratio: 297 / 210; background: #fff; color: #202124; border-radius: 6px; box-shadow: var(--shadow-lg); overflow: hidden; font-family: 'Noto Sans Thai', sans-serif; }
.cert-stripe { position: absolute; left: 0; right: 0; top: 0; height: 1.4cqw; display: flex; }
.cert-stripe i { flex: 1; } .cert-stripe i:nth-child(1) { background: #4285f4; } .cert-stripe i:nth-child(2) { background: #ea4335; } .cert-stripe i:nth-child(3) { background: #fbbc04; } .cert-stripe i:nth-child(4) { background: #34a853; }
.cert-inner { position: absolute; inset: 3cqw; border: .25cqw solid #dadce0; border-radius: 1cqw; padding: 2.4cqw 4cqw; display: flex; flex-direction: column; align-items: center; text-align: center; }
.cert-head { display: flex; align-items: center; gap: 1cqw; align-self: flex-start; }
.cert-logo { width: 3.6cqw; height: 3.6cqw; border-radius: .9cqw; background: #1a73e8; color: #fff; display: grid; place-items: center; }
.cert-logo svg { width: 2.2cqw; height: 2.2cqw; }
.cert-brand { font-size: 2.2cqw; font-weight: 600; }
.cert-brand .c1, .cert-brand .c4 { color: #4285f4; } .cert-brand .c2, .cert-brand .c6 { color: #ea4335; } .cert-brand .c3 { color: #fbbc04; } .cert-brand .c5 { color: #34a853; }
.cert-seal { position: absolute; top: 2cqw; right: 3cqw; width: 9cqw; height: 9cqw; font-size: 7cqw; }
.cert-seal .img-icon { width: 100%; height: 100%; }
.cert-title { font-family: 'Noto Serif Thai', 'Noto Sans Thai', serif; font-size: 5.4cqw; font-weight: 700; margin: .4cqw 0 0; color: #1a73e8; line-height: 1.2; }
.cert-sub { font-size: 1.2cqw; letter-spacing: .5cqw; color: #5f6368; margin-bottom: 1.6cqw; }
.cert-line { font-size: 1.7cqw; color: #3c4043; margin: .3cqw 0; }
.cert-name { font-family: 'Noto Serif Thai', 'Noto Sans Thai', serif; font-size: 4.4cqw; font-weight: 700; color: #202124; margin: .6cqw 0 1cqw; padding: 0 3cqw .6cqw; border-bottom: .2cqw solid #fbbc04; line-height: 1.3; }
.cert-course { font-size: 2.7cqw; font-weight: 600; color: #1967d2; margin: .4cqw 0 .8cqw; line-height: 1.35; max-width: 80%; }
.cert-foot { margin-top: auto; width: 100%; display: flex; justify-content: space-between; align-items: flex-end; }
.cert-sign { text-align: center; min-width: 26cqw; }
.cert-sign-line { font-family: 'Noto Serif Thai', serif; font-size: 2cqw; border-bottom: .15cqw solid #5f6368; padding-bottom: .4cqw; min-height: 3cqw; }
.cert-sign-title { font-size: 1.25cqw; color: #5f6368; margin-top: .5cqw; }
.cert-verify { display: flex; align-items: center; gap: 1.2cqw; text-align: left; font-size: 1.15cqw; color: #5f6368; }
.cert-verify .tiny { font-size: 1.15cqw; line-height: 1.5; }
.cert-qr, .cert-qr img, .cert-qr canvas { width: 8cqw !important; height: 8cqw !important; }
@media print {
  @page { size: A4 landscape; margin: 0; }
  html, body.cert-page { background: #fff !important; padding: 0 !important; }
  .no-print, .toast-stack, .modal-backdrop, #confetti { display: none !important; }
  .cert-stage { max-width: none; width: 297mm; }
  .certificate { width: 297mm; height: 210mm; aspect-ratio: auto; box-shadow: none; border-radius: 0; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

.stat .stat-icon { width: 48px; height: 48px; background: none; }
.stat .stat-icon .img-icon { width: 46px; height: 46px; }
.empty .e-emoji .img-icon { width: 88px; height: 88px; }
@media (max-width: 420px) {
  .nav { gap: 8px; }
  .brand { font-size: 1.15rem; gap: 8px; }
  .brand-logo { width: 34px; height: 34px; }
  .nav-actions { gap: 2px; }
  .icon-btn { width: 38px; height: 38px; }
  .nav-actions .btn-sm { padding: 8px 14px; }
}

.icon-picker-box { max-height: 380px; overflow-y: auto; border: 1px solid var(--border); border-radius: 12px; padding: 4px 12px 12px; margin-top: 10px; background: var(--bg-2); }
.icon-group-title { position: sticky; top: 0; z-index: 1; background: var(--bg-2); padding: 10px 0 6px; font-weight: 600; font-size: .9rem; }
.icon-picker-box .icon-picker { grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); margin-top: 0; }
.icon-picker-box .icon-picker button { aspect-ratio: auto; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 4px 6px; }
.icon-picker-box .icon-picker button img { width: 48px; height: 48px; }
.icon-picker-box .icon-picker button span { font-size: .7rem; line-height: 1.2; color: var(--muted); text-align: center; }

/* Share-to-save */
.share-discount { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 14px; border-radius: 12px; background: var(--tint-green); border: 1px dashed var(--g-green); margin-bottom: 14px; }
.share-discount strong { display: block; color: var(--ink-green); }
.share-discount small { color: var(--text-2); font-size: .82rem; line-height: 1.4; display: block; }
.share-discount .sd-ico { width: 44px; height: 44px; flex-shrink: 0; display: grid; place-items: center; font-size: 1.6rem; }
.share-discount .sd-ico .img-icon { width: 44px; height: 44px; }
.share-discount.is-unlocked { border-style: solid; }
.card .share-discount { margin-bottom: 0; }

/* Cartoon avatars */
.avatar.is-toon { background: var(--primary-soft); }
.avatar.is-toon img { object-fit: contain; transform: scale(1.08) translateY(4%); }
.avatar-picker-box { max-height: 330px; overflow-y: auto; border: 1px solid var(--border); border-radius: 12px; padding: 4px 12px 12px; background: var(--bg-2); }
.avatar-picker.is-toons { grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); }
.avatar-picker.is-toons span { height: 64px; padding: 4px; border-radius: 50%; aspect-ratio: 1; width: 64px; margin: 0 auto; background: var(--surface-solid); }
.avatar-picker.is-toons span img { width: 100%; height: 100%; object-fit: contain; }
.avatar-picker.is-toons input:checked + span { background: var(--primary-soft); }
@media (max-width: 480px) { .avatar-picker-box { padding: 4px 8px 10px; } .avatar-picker.is-toons { grid-template-columns: repeat(auto-fill, minmax(54px, 1fr)); gap: 6px; } .avatar-picker.is-toons span { width: 54px; height: 54px; padding: 3px; } }

/* ---------- Live leaderboard ---------- */
.live-pill { display: inline-flex; align-items: center; gap: 8px; font-size: .8rem; font-weight: 600; color: #137333; background: #e6f4ea; border-radius: 999px; padding: 4px 12px; margin-top: 4px; }
.live-pill i { width: 8px; height: 8px; border-radius: 50%; background: #34a853; box-shadow: 0 0 0 0 rgba(52,168,83,.6); animation: livePulse 1.8s infinite; }
.live-pill.is-flash { animation: liveFlash .9s ease; }
@keyframes livePulse { 0% { box-shadow: 0 0 0 0 rgba(52,168,83,.55); } 70% { box-shadow: 0 0 0 9px rgba(52,168,83,0); } 100% { box-shadow: 0 0 0 0 rgba(52,168,83,0); } }
@keyframes liveFlash { 0%, 100% { transform: none; } 30% { transform: scale(1.08); background: #ceead6; } }
.live-board [data-uid].is-bumped { animation: rowBump 1.6s ease; }
.live-board [data-uid].is-new { animation: rowIn .6s ease both; }
@keyframes rowBump { 0% { background: #fef7e0; box-shadow: 0 0 0 3px #fbbc04; } 100% { box-shadow: 0 0 0 0 transparent; } }
@keyframes rowIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------- Rich questions, mock exams, notebook ---------- */
.q-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 10px; min-height: 28px; }
.q-star { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border); background: var(--surface-solid); color: var(--muted); border-radius: 999px; padding: 4px 12px; font: inherit; font-size: .82rem; cursor: pointer; transition: all .2s var(--bounce); }
.q-star .icon { width: 16px; height: 16px; }
.q-star:hover { border-color: #fbbc04; color: #b06000; }
.q-star.is-on { background: #fef7e0; border-color: #fbbc04; color: #b06000; }
.q-star.is-on .icon { fill: #fbbc04; stroke: #e37400; }
.q-text { display: flex; align-items: flex-start; gap: 0; }
.q-text .q-body { flex: 1; white-space: normal; min-width: 0; overflow-wrap: anywhere; }
.q-figure { margin: 0 0 16px; text-align: center; }
.q-figure img { max-width: 100%; max-height: 420px; border-radius: 12px; border: 1px solid var(--border); background: #fff; }
.choice-text { white-space: normal; min-width: 0; overflow-wrap: anywhere; display: flex; flex-direction: column; gap: 6px; }
.choice.has-img .choice-text img { max-width: 100%; max-height: 180px; border-radius: 10px; border: 1px solid var(--border); background: #fff; align-self: flex-start; }
.explain { display: flex; gap: 10px; align-items: flex-start; }
.explain .ex-body { margin-top: 2px; }
.explain .ex-img { display: block; max-width: 100%; max-height: 360px; margin-top: 10px; border-radius: 10px; border: 1px solid var(--border); background: #fff; }
.katex { font-size: 1.08em; }
.katex-display { margin: .6em 0; overflow-x: auto; overflow-y: hidden; padding: 2px 0; }
.quiz-timer.is-countdown { background: #e8f0fe; color: #1967d2; }
.quiz-timer.is-warn { background: #fce8e6; color: #c5221f; animation: livePulse 1.2s infinite; }
.big-badge { font-size: .95rem; padding: 6px 14px; }
.r-notebook { background: #fef7e0; border-radius: 12px; padding: 10px 14px; margin: 12px auto 0; max-width: 520px; }
.r-topics { max-width: 520px; margin: 0 auto; text-align: left; }
.topic-row { display: grid; grid-template-columns: minmax(0, 1fr) 140px auto; gap: 10px; align-items: center; padding: 6px 0; border-bottom: 1px dashed var(--border); font-size: .92rem; }
.mock-banner { background: linear-gradient(135deg, #e8f0fe, #fce8e6 55%, #fef7e0); }
.mock-banner .pp-icon .img-icon { width: 72px; height: 72px; }
.attempt-list { display: grid; gap: 6px; margin-top: 10px; }
.attempt-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 12px; align-items: center; padding: 8px 10px; border-radius: 10px; color: inherit; text-decoration: none; }
.attempt-row:hover { background: var(--surface-2); }
.spark { width: 100%; height: auto; display: block; margin-top: 8px; overflow: visible; }
.spark-line { fill: none; stroke: #1a73e8; stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.spark-fill { fill: rgba(26, 115, 232, .08); stroke: none; }
.spark-mid { stroke: var(--border); stroke-dasharray: 4 4; stroke-width: 1; }
.spark-dot { fill: #fff; stroke: #1a73e8; stroke-width: 2; }
.spark-dot.is-last { fill: #1a73e8; }
/* admin question editor */
.q-form .math-preview { margin-top: 8px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); border: 1px dashed var(--border-strong); }
.img-field { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.img-thumb { width: 120px; height: 80px; object-fit: contain; border-radius: 10px; border: 1px solid var(--border); background: #fff; }
.img-thumb.sm { width: 54px; height: 40px; }
.file-btn { position: relative; cursor: pointer; }
.file-btn.has-file { border-color: var(--green, #34a853); color: #137333; }
.choice-edit { display: grid; gap: 8px; margin-bottom: 14px; }
.choice-edit-row { display: flex; align-items: center; gap: 8px; }
.choice-edit-row .input { flex: 1; min-width: 0; }
.ce-key { position: relative; cursor: pointer; flex-shrink: 0; }
.ce-key input { position: absolute; opacity: 0; pointer-events: none; }
.ce-key span { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; border: 2px solid var(--border-strong); color: var(--muted); transition: all .2s var(--bounce); }
.ce-key input:checked + span { background: #34a853; border-color: #34a853; color: #fff; box-shadow: 0 0 0 4px rgba(52,168,83,.18); }
.seg { display: flex; flex-wrap: wrap; gap: 8px; }
.seg label { position: relative; cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: inline-block; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--border-strong); font-size: .9rem; transition: all .2s; }
.seg input:checked + span { background: #e8f0fe; border-color: #1a73e8; color: #1967d2; font-weight: 600; }
.help-box summary { cursor: pointer; font-weight: 600; color: #1967d2; display: inline-flex; align-items: center; gap: 6px; }
.help-box[open] > div { margin-top: 10px; padding: 12px 14px; background: var(--surface-2); border-radius: 12px; }
@media (max-width: 560px) { .choice-edit-row { flex-wrap: wrap; } .choice-edit-row .input { flex-basis: calc(100% - 100px); } .topic-row { grid-template-columns: minmax(0, 1fr) 80px auto; } }
.nb-cta { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.nb-list { display: grid; gap: 12px; }
.nb-q { font-size: 1.02rem; line-height: 1.6; overflow-wrap: anywhere; }
.nb-img { max-width: 100%; max-height: 260px; border-radius: 10px; border: 1px solid var(--border); margin-top: 8px; background: #fff; }
.nb-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 10px; }
.nb-answer { flex-basis: 100%; }
.nb-choice { padding: 6px 10px; border-radius: 10px; margin-top: 4px; overflow-wrap: anywhere; }
.nb-choice img { max-height: 90px; vertical-align: middle; border-radius: 8px; border: 1px solid var(--border); }
.nb-choice.is-correct { background: #e6f4ea; color: #0d652d; font-weight: 600; }
.nb-choice.is-wrong { background: #fce8e6; color: #a50e0e; }
.box-dots { display: inline-flex; gap: 4px; }
.box-dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--border); }
.box-dots i.on { background: #fbbc04; }
.box-dots i.done { background: #34a853; }
.hd-q.is-ok { border-left: 4px solid #34a853; }
.hd-q.is-bad { border-left: 4px solid #ea4335; }
.pager .gap { padding: 0 4px; color: var(--muted); }

/* ---------- Exams, readiness, plan, focus ---------- */
.exam-search { max-width: 560px; margin: 16px auto 0; }
.group-icon .img-icon { width: 40px; height: 40px; }
.exam-card .exam-meta { display: flex; flex-wrap: wrap; gap: 4px; margin-top: auto; }
.exam-card .exam-meta b { font-weight: 600; }
.upcoming-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 10px; }
.upcoming-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; border: 1px solid var(--border); color: inherit; text-decoration: none; background: var(--surface-solid); }
.upcoming-item:hover { border-color: #1a73e8; }
.upcoming-item .cat-icon .img-icon { width: 42px; height: 42px; }
.upcoming-item strong { display: block; font-size: .95rem; }
.upcoming-item small { color: var(--muted); }
.days-left { text-align: center; line-height: 1; color: #c5221f; }
.days-left b { font-size: 1.5rem; display: block; }
.exam-hero { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.exam-hero-icon .img-icon { width: 88px; height: 88px; }
.countdown-box { text-align: center; min-width: 120px; padding: 14px 18px; border-radius: 18px; background: linear-gradient(135deg, #fce8e6, #fef7e0); }
.countdown-box b { display: block; font-family: var(--font-head); font-size: 2.6rem; line-height: 1; color: #c5221f; }
.countdown-box span { font-size: .85rem; color: #5f6368; }
.countdown-box.big b { font-size: 3.4rem; }
.ready-gauge { position: relative; max-width: 240px; margin: 0 auto 6px; }
.ready-gauge svg { width: 100%; display: block; }
.ready-gauge .g-bg, .ready-gauge .g-fg { fill: none; stroke-width: 12; stroke-linecap: round; }
.ready-gauge .g-bg { stroke: var(--border); }
.ready-gauge .g-fg { stroke: #1a73e8; transition: stroke-dasharray 1.2s var(--ease); }
.ready-val { position: absolute; inset: auto 0 0 0; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.ready-val b { font-family: var(--font-head); font-size: 2rem; line-height: 1; }
.ready-parts { display: grid; gap: 6px; margin-top: 12px; }
.rp { display: grid; grid-template-columns: 130px minmax(0, 1fr) 44px; gap: 8px; align-items: center; font-size: .85rem; }
.rp b { text-align: right; }
.ready-tips { margin: 12px 0 0; padding-left: 18px; color: var(--text); }
.ready-tips li { margin-bottom: 4px; }
.plan-hero { display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(0, 320px); gap: 20px; align-items: center; }
@media (max-width: 900px) { .plan-hero { grid-template-columns: 1fr; text-align: left; } .plan-hero .countdown-box { justify-self: start; } }
.todo { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.todo a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; border: 1px solid var(--border); color: inherit; text-decoration: none; }
.todo a:hover { border-color: #1a73e8; background: #f8fbff; }
.todo .todo-ico { font-size: 1.4rem; }
.todo strong { display: block; }
.todo small { color: var(--muted); }
.plan-days { display: grid; gap: 6px; }
.plan-day { display: flex; gap: 10px; align-items: center; padding: 6px 8px; border-radius: 10px; }
.plan-day.is-today { background: #e8f0fe; }
.plan-day.is-final .pd-date { background: #fce8e6; color: #c5221f; }
.pd-date { width: 46px; flex-shrink: 0; text-align: center; border-radius: 10px; background: var(--surface-2); padding: 4px 0; line-height: 1.1; }
.pd-date b { display: block; font-size: 1.1rem; }
.pd-date small { font-size: .7rem; color: var(--muted); }
.reminder-list { display: grid; gap: 8px; }
.reminder { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; border: 1px solid var(--border); }
.reminder.is-off { opacity: .55; }
.rm-time { font-family: var(--font-head); font-size: 1.3rem; color: #1967d2; min-width: 64px; }
.focus-card { text-align: center; }
.focus-ring { position: relative; width: min(280px, 80vw); margin: 0 auto 16px; }
.focus-ring svg { width: 100%; transform: rotate(-90deg); }
.focus-ring circle { fill: none; stroke-width: 12; stroke-linecap: round; }
.focus-ring .f-bg { stroke: var(--border); }
.focus-ring .f-fg { stroke: #34a853; stroke-dasharray: 100; stroke-dashoffset: 100; transition: stroke-dashoffset 1s linear; }
.focus-time { position: absolute; inset: 0; display: grid; place-content: center; gap: 4px; }
.focus-time b { font-family: var(--font-head); font-size: clamp(2.6rem, 9vw, 3.6rem); font-variant-numeric: tabular-nums; line-height: 1; }
.focus-time span { color: var(--muted); font-size: .9rem; }
.focus-chip { position: fixed; right: 16px; bottom: 96px; z-index: 60; background: #1a73e8; color: #fff; border-radius: 999px; padding: 8px 14px; font-weight: 600; box-shadow: 0 8px 24px -8px rgba(26,115,232,.7); text-decoration: none; font-variant-numeric: tabular-nums; }
@media (min-width: 861px) { .focus-chip { bottom: 24px; } }
.bars .bar.is-today small { color: #1a73e8; font-weight: 700; }

/* ---------- Checkout & receipts ---------- */
.price-table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.price-table td { padding: 6px 0; border-bottom: 1px dashed var(--border); }
.price-table td:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.price-table .is-discount td { color: #137333; }
.price-table .is-total td { font-weight: 700; font-size: 1.1rem; border-bottom: 0; }
.print-body { background: #f1f3f4; padding: 20px 12px 60px; }
.receipt-toolbar { max-width: 800px; margin: 0 auto 12px; display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.receipt-paper { max-width: 800px; margin: 0 auto; background: #fff; color: #202124; padding: 40px 44px; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,.12), 0 8px 24px -12px rgba(0,0,0,.2); font-size: 14px; }
.rc-head { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; border-bottom: 2px solid #1a73e8; padding-bottom: 16px; }
.rc-logo { font-size: 1.6rem; margin-bottom: 4px; }
.rc-title { text-align: right; }
.rc-title h1 { font-size: 1.35rem; margin: 0 0 2px; color: #1a73e8; }
.rc-meta { margin-left: auto; margin-top: 8px; border-collapse: collapse; font-size: 13px; }
.rc-meta th { text-align: left; color: #5f6368; font-weight: 500; padding: 2px 12px 2px 0; }
.rc-meta td { text-align: right; font-weight: 600; }
.rc-buyer { padding: 14px 0; border-bottom: 1px solid #dadce0; }
.rc-items { width: 100%; border-collapse: collapse; margin-top: 14px; }
.rc-items th { background: #f8f9fa; text-align: left; padding: 8px; font-weight: 600; border-bottom: 1px solid #dadce0; }
.rc-items td { padding: 8px; border-bottom: 1px solid #f1f3f4; vertical-align: top; }
.rc-items .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rc-items tfoot td { border: 0; padding: 4px 8px; }
.rc-items .rc-total td { font-size: 1.15rem; font-weight: 700; border-top: 2px solid #202124; padding-top: 10px; }
.rc-foot { margin-top: 24px; }
.rc-sign { margin: 36px 0 16px auto; width: 240px; text-align: center; }
.rc-sign-line { border-bottom: 1px solid #5f6368; height: 40px; margin-bottom: 6px; }
.receipt-billing { max-width: 800px; margin: 16px auto 0; }
@media print {
  .no-print, .toast-stack, .focus-chip { display: none !important; }
  .print-body { background: #fff; padding: 0; }
  .receipt-paper { box-shadow: none; border-radius: 0; max-width: none; padding: 0; }
  @page { size: A4; margin: 16mm; }
}
@media (max-width: 600px) { .receipt-paper { padding: 22px 16px; } .rc-title { text-align: left; } .rc-meta { margin-left: 0; } }
.order-filter { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.order-filter .input-icon { flex: 1 1 260px; }
.order-filter label { display: flex; align-items: center; gap: 6px; }
.order-filter .input[type=date] { width: auto; }
.slip-item { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--border); }
.slip-item img { width: 110px; max-height: 180px; object-fit: cover; border-radius: 10px; border: 1px solid var(--border); }
.slip-item code { font-size: .78rem; word-break: break-all; }
.timeline { display: grid; gap: 12px; }
.tl-item { display: flex; gap: 10px; align-items: flex-start; }
.tl-ico { width: 30px; height: 30px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; flex-shrink: 0; }
.revoke-box { display: grid; gap: 8px; padding: 12px; border: 1px dashed #ea4335; border-radius: 12px; background: #fff8f7; }
.stars { color: #fbbc04; letter-spacing: 1px; white-space: nowrap; }
.stars .s-empty { color: #dadce0; }
.stars .s-half { background: linear-gradient(90deg, #fbbc04 50%, #dadce0 50%); -webkit-background-clip: text; background-clip: text; color: transparent; }
/* plans & reviews */
.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 18px; max-width: 1000px; margin: 0 auto; }
.plan-card { position: relative; display: flex; flex-direction: column; gap: 6px; }
.plan-card.is-featured { border: 2px solid #ea4335; box-shadow: 0 16px 40px -18px rgba(234,67,53,.5); }
.plan-card h2 { font-size: 1.3rem; margin: 0; }
.plan-ribbon { position: absolute; top: -12px; right: 16px; background: #ea4335; color: #fff; font-size: .8rem; font-weight: 700; padding: 4px 12px; border-radius: 999px; }
.plan-price .price { font-size: 2rem; }
.plan-price small { color: var(--muted); }
.plan-card .btn { margin-top: auto; }
.plan-offer { display: block; padding: 10px 12px; border-radius: 12px; background: #fef7e0; color: #5f370e; font-size: .88rem; text-decoration: none; border: 1px dashed #fbbc04; }
.hero-rating { display: inline-flex; align-items: center; gap: 6px; margin: 4px 0 8px; color: inherit; text-decoration: none; }
.hero-rating b { color: #b06000; }
.hero-rating span { color: var(--muted); font-size: .9rem; }
.cc-rating { display: flex; align-items: center; gap: 4px; font-size: .82rem; margin-top: -4px; }
.cc-rating b { color: #b06000; }
.cc-rating span { color: var(--muted); }
.review-summary { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 20px; align-items: center; margin-bottom: 14px; }
.rs-score { text-align: center; display: flex; flex-direction: column; align-items: center; }
.rs-score b { font-family: var(--font-head); font-size: 2.6rem; line-height: 1; }
.rs-score .stars { font-size: 1.1rem; }
.rs-row { display: grid; grid-template-columns: 34px minmax(0, 1fr) 30px; gap: 8px; align-items: center; font-size: .82rem; }
.rs-row .progress > i { background: #fbbc04; }
.review-form { padding: 12px; border-radius: 14px; background: var(--surface-2); margin-bottom: 14px; display: grid; gap: 8px; }
.star-input { display: inline-flex; flex-direction: row-reverse; justify-content: flex-end; gap: 2px; }
.star-input input { position: absolute; opacity: 0; pointer-events: none; }
.star-input label { font-size: 1.9rem; color: #dadce0; cursor: pointer; transition: transform .15s, color .15s; line-height: 1; }
.star-input label:hover, .star-input label:hover ~ label, .star-input input:checked ~ label { color: #fbbc04; }
.star-input label:active { transform: scale(1.2); }
.review-list { display: grid; gap: 14px; }
.review { display: flex; gap: 12px; align-items: flex-start; }
.review p { overflow-wrap: anywhere; }
.review-reply { margin-top: 8px; padding: 8px 12px; background: #e8f0fe; border-radius: 10px; font-size: .9rem; }

/* ---------- Social login, bell, support ---------- */
.social-login { display: grid; gap: 10px; margin: 6px 0 4px; }
.social-btn { display: flex; align-items: center; justify-content: center; gap: 10px; font-weight: 600; }
.social-btn svg { width: 20px; height: 20px; }
.social-line { background: #06c755 !important; border-color: #06c755 !important; color: #fff !important; }
.social-google { background: #fff !important; color: #3c4043 !important; border: 1px solid #dadce0 !important; box-shadow: none !important; }
.social-facebook { background: #1877f2 !important; border-color: #1877f2 !important; color: #fff !important; }
.or-line { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .85rem; margin: 6px 0; }
.or-line::before, .or-line::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.connections { display: grid; gap: 8px; }
.conn-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 12px; }
.social-dot::before { content: ''; display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; background: #5f6368; }
.social-dot.social-line::before { background: #06c755; }
.social-dot.social-google::before { background: #4285f4; }
.social-dot.social-facebook::before { background: #1877f2; }
.bell-menu { position: relative; }
.bell-menu > summary { list-style: none; position: relative; cursor: pointer; }
.bell-menu > summary::-webkit-details-marker { display: none; }
.bell-dot { position: absolute; top: 2px; right: 0; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: #ea4335; color: #fff; font-size: .68rem; font-weight: 700; display: grid; place-items: center; border: 2px solid var(--surface-solid, #fff); }
.bell-drop { width: min(360px, 92vw); right: -60px; }
.bell-list { max-height: 420px; overflow-y: auto; }
.notif { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; color: inherit; text-decoration: none; border-bottom: 1px solid var(--border); }
.notif:hover { background: var(--surface-2); }
.notif.is-unread { background: #e8f0fe; }
.notif-ico { font-size: 1.3rem; width: 28px; text-align: center; flex-shrink: 0; }
.notif-list { padding: 0; overflow: hidden; }
.d-block { display: block; }
.ticket-row { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.ticket-row:hover { border-color: #1a73e8; }
.thread { display: grid; gap: 14px; }
.msg { display: flex; gap: 10px; align-items: flex-start; }
.msg-bubble { background: var(--surface-solid); border: 1px solid var(--border); border-radius: 4px 16px 16px 16px; padding: 10px 14px; max-width: 100%; min-width: 0; }
.msg.is-staff { flex-direction: row-reverse; }
.msg.is-staff .msg-bubble { background: #e8f0fe; border-color: #c6dafc; border-radius: 16px 4px 16px 16px; }
.msg-body { overflow-wrap: anywhere; margin-top: 4px; }
.msg-img { max-width: 240px; max-height: 240px; border-radius: 10px; margin-top: 8px; border: 1px solid var(--border); }

.report-q { display: inline-block; margin-top: 8px; color: var(--muted); }
/* affiliate & partners */
.aff-hero { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; background: linear-gradient(135deg, #e8f0fe, #fef7e0 60%, #e6f4ea); }
.aff-hero-art .img-icon { width: 140px; height: 140px; }
.aff-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-top: 14px; }
.aff-steps div { display: flex; align-items: center; gap: 8px; background: rgba(255,255,255,.75); border-radius: 12px; padding: 8px 10px; font-size: .9rem; }
.aff-steps b { width: 28px; height: 28px; border-radius: 50%; background: #1a73e8; color: #fff; display: grid; place-items: center; flex-shrink: 0; }
.aff-links { display: grid; gap: 8px; max-height: 420px; overflow-y: auto; }
.aff-link-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px; border: 1px solid var(--border); border-radius: 12px; }
.aff-link-row .input { flex: 1 1 240px; }
.input-sm { padding: 6px 10px; font-size: .85rem; min-height: 34px; }
.inst-logo { width: 64px; height: 64px; border-radius: 16px; object-fit: cover; border: 1px solid var(--border); background: #fff; }
.inst-logo.sm { width: 40px; height: 40px; border-radius: 10px; }

/* ======================================================
   YouTube-style browsing
   ====================================================== */
.yt-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 24px; max-width: 1680px; margin: 0 auto; padding: 16px 20px 40px; }
.yt-side { position: sticky; top: 76px; align-self: start; display: flex; flex-direction: column; gap: 2px; max-height: calc(100vh - 90px); overflow-y: auto; }
.yt-side a { display: flex; align-items: center; gap: 16px; padding: 9px 12px; border-radius: 10px; color: var(--text); text-decoration: none; font-size: .93rem; }
.yt-side a:hover { background: var(--surface-2); }
.yt-side a.is-active { background: var(--surface-2); font-weight: 600; }
.yt-side a .icon { width: 22px; height: 22px; }
.yt-side hr { border: 0; border-top: 1px solid var(--border); margin: 8px 0; width: 100%; }
.yt-main { min-width: 0; }
@media (max-width: 1100px) { .yt-layout { grid-template-columns: 72px minmax(0, 1fr); } .yt-side a { flex-direction: column; gap: 4px; font-size: .64rem; padding: 10px 2px; text-align: center; } .yt-side hr, .yt-side a:nth-child(n+9) { display: none; } }
@media (max-width: 760px) { .yt-layout { grid-template-columns: minmax(0, 1fr); padding: 8px 12px 30px; } .yt-side { display: none; } }
.yt-welcome { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; padding: 16px 20px; border-radius: 18px; background: linear-gradient(135deg, #e8f0fe, #fef7e0 55%, #e6f4ea); margin-bottom: 14px; }
.yt-welcome h1 { font-size: clamp(1.25rem, 3vw, 1.7rem); margin: 0 0 4px; }
.yt-chips { display: flex; gap: 10px; overflow-x: auto; padding: 4px 0 14px; position: sticky; top: 64px; z-index: 4; background: var(--bg, #fff); scrollbar-width: none; }
.yt-chips::-webkit-scrollbar { display: none; }
.yt-chips .chip { flex-shrink: 0; white-space: nowrap; border-radius: 10px; background: var(--surface-2); border: 0; }
.yt-chips .chip.is-active { background: #0f0f0f; color: #fff; }
.yt-section { margin: 26px 0; }
.yt-h { display: flex; align-items: center; gap: 10px; font-size: 1.2rem; margin: 0 0 14px; }
.yt-h .link { margin-left: auto; font-weight: 500; }
.vgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 24px 16px; }
.vrow { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(260px, 300px); gap: 16px; overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x mandatory; }
.vrow .vcard { scroll-snap-align: start; }
.vcard { min-width: 0; }
.vthumb { --c: #1a73e8; position: relative; display: block; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; background: color-mix(in srgb, var(--c) 18%, #f1f3f4); }
.vthumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .35s var(--ease); }
.vcard:hover .vthumb img { transform: scale(1.04); }
.vthumb-ph { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 14px; text-align: center; background: linear-gradient(135deg, color-mix(in srgb, var(--c) 30%, #fff), color-mix(in srgb, var(--c) 10%, #fff)); }
.vthumb-ph .ph-icon .img-icon { width: 64px; height: 64px; }
.vthumb-ph .ph-icon .emoji-icon { font-size: 2.6rem; }
.vthumb-ph .ph-title { font-weight: 700; font-size: .95rem; color: #202124; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.vdur { position: absolute; right: 8px; bottom: 8px; background: rgba(0,0,0,.8); color: #fff; font-size: .75rem; font-weight: 600; padding: 2px 6px; border-radius: 6px; font-variant-numeric: tabular-nums; }
.vtag { position: absolute; left: 8px; top: 8px; display: inline-flex; align-items: center; gap: 4px; font-size: .72rem; font-weight: 700; padding: 3px 8px; border-radius: 6px; }
.vtag .icon { width: 12px; height: 12px; }
.vtag-free { background: #34a853; color: #fff; }
.vtag-lock { background: rgba(0,0,0,.72); color: #fff; }
.vtag-mock { background: #ea4335; color: #fff; }
.vprog { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(255,255,255,.4); }
.vprog i { display: block; height: 100%; background: #ea4335; }
.vmeta { display: flex; gap: 12px; margin-top: 10px; }
.vtext { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.vtitle { color: var(--text); text-decoration: none; font-weight: 600; font-size: .98rem; line-height: 1.4; }
.vchan, .vstats { color: var(--muted); font-size: .84rem; text-decoration: none; }
.vchan:hover { color: var(--text); }
.verified { display: inline-grid; place-items: center; width: 14px; height: 14px; border-radius: 50%; background: #606060; color: #fff; font-size: 9px; vertical-align: 1px; }
.ch-avatar { width: 36px; height: 36px; border-radius: 50%; overflow: hidden; display: inline-grid; place-items: center; background: linear-gradient(135deg, #4285f4, #34a853); color: #fff; font-weight: 700; flex-shrink: 0; border: 1px solid var(--border); }
.ch-avatar img { width: 100%; height: 100%; object-fit: cover; background: #fff; }
.ch-avatar.xl { width: 88px; height: 88px; font-size: 2rem; }
.ch-avatar.xxl { width: 120px; height: 120px; font-size: 2.6rem; }
@media (max-width: 600px) { .ch-avatar.xxl { width: 80px; height: 80px; } }
.follow-btn { display: inline-flex; align-items: center; gap: 6px; border: 0; border-radius: 999px; padding: 8px 16px; font: inherit; font-weight: 600; font-size: .88rem; cursor: pointer; background: #0f0f0f; color: #fff; transition: transform .15s, background .2s; }
.follow-btn .icon { width: 16px; height: 16px; }
.follow-btn:hover { transform: translateY(-1px); }
.follow-btn.is-on { background: var(--surface-2); color: var(--text); }
.srow { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(150px, 190px); gap: 12px; overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x mandatory; }
.sgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.scard { scroll-snap-align: start; color: var(--text); text-decoration: none; display: flex; flex-direction: column; gap: 6px; }
.scard-media { aspect-ratio: 9 / 16; border-radius: 12px; overflow: hidden; background: linear-gradient(160deg, #ea4335, #fbbc04); display: block; }
.scard-media img { width: 100%; height: 100%; object-fit: cover; }
.scard-ph { display: grid; place-items: center; height: 100%; color: #fff; }
.scard-ph .icon { width: 40px; height: 40px; }
.scard strong { font-size: .9rem; line-height: 1.35; }
.scard small { color: var(--muted); }
.shorts-logo { color: #ea4335; display: inline-flex; }
.chan-row { display: grid; grid-auto-flow: column; grid-auto-columns: 170px; gap: 14px; overflow-x: auto; padding-bottom: 6px; }
.chan-card { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; padding: 14px 10px; border-radius: 16px; border: 1px solid var(--border); background: var(--surface-solid); }
.chan-card a { display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--text); text-decoration: none; }
.feed-sentinel { display: grid; place-items: center; padding: 24px; }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--border); border-top-color: #1a73e8; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.chan-banner { height: clamp(100px, 16vw, 200px); border-radius: 16px; background: linear-gradient(120deg, #4285f4, #34a853 40%, #fbbc04 70%, #ea4335) center / cover no-repeat; }
.chan-head { display: flex; gap: 20px; align-items: center; padding: 18px 4px; flex-wrap: wrap; }
.chan-head h1 { font-size: clamp(1.5rem, 3.4vw, 2.2rem); margin: 0 0 4px; }
.chan-tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--border); margin-bottom: 16px; overflow-x: auto; }
.chan-tabs a { padding: 10px 16px; color: var(--muted); text-decoration: none; font-weight: 600; border-bottom: 3px solid transparent; white-space: nowrap; }
.chan-tabs a.is-active { color: var(--text); border-bottom-color: var(--text); }
.watch-channel { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 6px 0; }
.watch-channel a { color: var(--text); text-decoration: none; }
.thumb-preview { width: 100%; max-width: 320px; aspect-ratio: 16/9; object-fit: cover; border-radius: 10px; border: 1px solid var(--border); display: block; margin-bottom: 8px; }
.flip { transform: rotate(180deg); }

/* ======================================================
   Shorts (vertical swipe player)
   ====================================================== */
.page-shorts .site-footer { display: none; }
.shorts-page { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 0; max-width: 1680px; margin: 0 auto; }
.shorts-page .yt-side { padding: 16px 0 0 16px; }
@media (max-width: 1100px) { .shorts-page { grid-template-columns: 72px minmax(0, 1fr); } }
@media (max-width: 760px) { .shorts-page { grid-template-columns: minmax(0, 1fr); } }
.shorts-wrap { position: relative; height: calc(100dvh - 64px); }
@media (max-width: 860px) { .shorts-wrap { height: calc(100dvh - 64px - 74px - env(safe-area-inset-bottom)); } }
.shorts-feed { height: 100%; overflow-y: auto; scroll-snap-type: y mandatory; overscroll-behavior: contain; scrollbar-width: none; }
.shorts-feed::-webkit-scrollbar { display: none; }
.short { height: 100%; scroll-snap-align: start; scroll-snap-stop: always; display: grid; place-items: center; padding: 10px 0; }
.short-stage { position: relative; height: 100%; aspect-ratio: 9 / 16; max-width: 100%; border-radius: 16px; overflow: hidden; background: #000; box-shadow: 0 10px 40px -20px rgba(0,0,0,.6); }
@media (max-width: 600px) { .short { padding: 0; } .short-stage { border-radius: 0; width: 100%; aspect-ratio: auto; } }
.short-video, .short-yt, .short-yt iframe { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border: 0; }
.short-yt { background: #000 center / cover no-repeat; }
.short-yt iframe { pointer-events: none; }
.short-tap { position: absolute; inset: 0; background: transparent; border: 0; cursor: pointer; z-index: 1; }
.short-paused { position: absolute; inset: 0; display: none; place-items: center; z-index: 1; pointer-events: none; }
.short-paused .icon { width: 64px; height: 64px; color: rgba(255,255,255,.85); filter: drop-shadow(0 2px 8px rgba(0,0,0,.4)); }
.short.is-paused .short-paused { display: grid; }
.short-empty { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 8px; color: #fff; text-align: center; }
.short-empty .icon { width: 48px; height: 48px; }
.short-info { position: absolute; left: 0; right: 64px; bottom: 0; padding: 60px 14px 16px; color: #fff; z-index: 2; background: linear-gradient(transparent, rgba(0,0,0,.75)); }
.short-ch { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.short-ch a { color: #fff; text-decoration: none; }
.short-ch .follow-btn { background: #fff; color: #0f0f0f; padding: 6px 12px; font-size: .8rem; }
.short-ch .follow-btn.is-on { background: rgba(255,255,255,.25); color: #fff; }
.short-title { font-size: 1rem; margin: 0 0 4px; color: #fff; }
.short-desc { font-size: .85rem; margin: 0 0 8px; opacity: .9; }
.short-cta { display: inline-flex; align-items: center; gap: 6px; background: rgba(255,255,255,.18); backdrop-filter: blur(6px); color: #fff; text-decoration: none; padding: 7px 12px; border-radius: 999px; font-size: .82rem; font-weight: 600; }
.short-cta .icon { width: 14px; height: 14px; }
.short-rail { position: absolute; right: 8px; bottom: 90px; display: flex; flex-direction: column; align-items: center; gap: 14px; z-index: 3; }
.rail-btn { display: flex; flex-direction: column; align-items: center; gap: 4px; background: none; border: 0; color: #fff; cursor: pointer; font: inherit; }
.rail-ico { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: rgba(0,0,0,.4); backdrop-filter: blur(4px); font-size: 1.3rem; transition: transform .15s var(--bounce); }
.rail-ico .icon { width: 24px; height: 24px; }
.rail-btn:active .rail-ico { transform: scale(.88); }
.rail-btn small { font-size: .72rem; text-shadow: 0 1px 3px rgba(0,0,0,.6); }
.rail-btn.is-on .rail-ico { background: #ea4335; }
.rail-btn.is-on .icon { fill: #fff; }
.rail-quiz .rail-ico { background: #fbbc04; }
.rail-views { color: #fff; font-size: .72rem; display: flex; flex-direction: column; align-items: center; gap: 2px; opacity: .85; }
.rail-views .icon { width: 16px; height: 16px; }
.short .i-sound { display: none; }
.short:not(.is-muted) .i-sound { display: block; }
.short:not(.is-muted) .i-muted { display: none; }
.short-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(255,255,255,.25); z-index: 3; }
.short-progress i { display: block; height: 100%; width: 0; background: #fff; }
.short-quiz { position: absolute; left: 8px; right: 8px; bottom: 8px; max-height: 70%; overflow-y: auto; background: #fff; color: #202124; border-radius: 16px; padding: 14px; z-index: 5; box-shadow: 0 -8px 30px rgba(0,0,0,.35); animation: rowIn .3s ease; }
.sq-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.sq-q { font-weight: 600; margin-bottom: 8px; line-height: 1.5; }
.sq-img { max-width: 100%; border-radius: 8px; margin-bottom: 8px; }
.sq-choices { display: grid; gap: 8px; }
.sq-choice { display: flex; align-items: center; gap: 10px; text-align: left; padding: 10px 12px; border: 2px solid #dadce0; border-radius: 12px; background: #fff; cursor: pointer; font: inherit; }
.sq-choice b { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: #f1f3f4; flex-shrink: 0; }
.sq-choice img { max-height: 60px; display: block; }
.sq-choice.is-correct { border-color: #34a853; background: #e6f4ea; }
.sq-choice.is-wrong { border-color: #ea4335; background: #fce8e6; }
.sq-result { margin-top: 10px; }
.shorts-nav { position: absolute; right: 24px; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; gap: 12px; }
@media (max-width: 760px) { .shorts-nav { display: none; } }
.page-shorts .bottom-nav { background: #0f0f0f; border-color: #0f0f0f; }
.page-shorts .bottom-nav a { color: #c7c7c7; }
.page-shorts .bottom-nav a.is-active { color: #fff; }
.vtag-quiz { background: #1a73e8; color: #fff; }
.nav-link { white-space: nowrap; }
@media (max-width: 1240px) { .nav-links .nav-link:nth-child(n+5) { display: none; } }
@media (max-width: 1000px) { .nav-links .nav-link:nth-child(n+4) { display: none; } }
.page-shorts .bottom-nav a.is-active { background: rgba(255,255,255,.16); color: #fff; }

/* ---------- Clip protection ---------- */
.player.protected { position: relative; }
.player-wm { position: absolute; z-index: 4; pointer-events: none; user-select: none; color: rgba(255,255,255,.55); font-size: clamp(.7rem, 1.6vw, .95rem); font-weight: 600; text-shadow: 0 1px 2px rgba(0,0,0,.6); white-space: nowrap; transition: left 1.2s ease, top 1.2s ease; transform: rotate(-8deg); }
.player-fs { position: absolute; right: 10px; top: 10px; z-index: 5; width: 36px; height: 36px; border-radius: 10px; border: 0; background: rgba(0,0,0,.45); color: #fff; display: grid; place-items: center; cursor: pointer; opacity: .75; }
.player-fs:hover { opacity: 1; }
.player:fullscreen { display: grid; place-items: center; background: #000; border-radius: 0; }
.player:fullscreen video, .player:fullscreen iframe { width: 100%; height: 100%; }

/* ---------- Live tutoring ---------- */
.live-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 18px; }
.live-card { display: flex; flex-direction: column; gap: 6px; color: var(--text); text-decoration: none; }
.live-cover { position: relative; aspect-ratio: 16/9; border-radius: 14px; background: linear-gradient(135deg, #ea4335, #fbbc04) center / cover no-repeat; display: flex; flex-direction: column; justify-content: space-between; padding: 10px; }
.live-when { align-self: flex-start; background: rgba(0,0,0,.65); color: #fff; font-size: .78rem; padding: 3px 8px; border-radius: 6px; }
.live-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: #ea4335; box-shadow: 0 0 0 0 rgba(234,67,53,.6); animation: livePulse 1.6s infinite; }
.live-dot.is-off { background: #9aa0a6; animation: none; }
.live-gate { padding: 32px 20px; }
.live-countdown { display: block; font-family: var(--font-head); font-size: 2.4rem; font-variant-numeric: tabular-nums; margin-top: 8px; }
.live-room { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 16px; max-width: 1600px; margin: 0 auto; padding: 14px 16px 40px; }
@media (max-width: 1000px) { .live-room { grid-template-columns: minmax(0, 1fr); } }
.live-stage-tabs { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.live-viewers { display: inline-flex; align-items: center; gap: 6px; font-size: .88rem; font-weight: 600; }
.live-stage { position: relative; aspect-ratio: 16/9; background: #000; border-radius: 14px; overflow: hidden; }
.stage-pane { position: absolute; inset: 0; display: none; }
.stage-pane.is-active { display: block; }
.stage-pane iframe, .stage-pane video { width: 100%; height: 100%; border: 0; display: block; background: #000; }
.stage-empty { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 10px; color: #fff; text-align: center; padding: 20px; }
.stage-empty .icon { width: 48px; height: 48px; }
.board-wrap { position: absolute; inset: 0; background: #fff; }
.board-wrap canvas { width: 100%; height: 100%; display: block; touch-action: none; cursor: crosshair; background: #fff center / contain no-repeat; }
.board-tools { position: absolute; left: 10px; bottom: 10px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; background: rgba(255,255,255,.95); padding: 6px 8px; border-radius: 12px; box-shadow: 0 4px 16px rgba(0,0,0,.15); z-index: 6; }
.swatch { width: 24px; height: 24px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px #dadce0; cursor: pointer; }
.swatch.is-on { box-shadow: 0 0 0 2px #202124; }
.board-tools .is-on { background: #e8f0fe; }
.live-wm { position: absolute; z-index: 4; pointer-events: none; color: rgba(255,255,255,.5); font-weight: 600; font-size: .85rem; text-shadow: 0 1px 2px rgba(0,0,0,.6); transition: left 1.2s ease, top 1.2s ease; white-space: nowrap; }
.live-reactions { position: absolute; inset: 0; pointer-events: none; z-index: 5; overflow: hidden; }
.react-float { position: absolute; bottom: 8%; font-size: 1.9rem; animation: reactUp 2.6s ease-out forwards; }
@keyframes reactUp { 0% { transform: translateY(0) scale(.6); opacity: 0; } 15% { opacity: 1; transform: translateY(-20px) scale(1.1); } 100% { transform: translateY(-260px) translateX(-30px) scale(1); opacity: 0; } }
.live-timer { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); background: #ea4335; color: #fff; font-family: var(--font-head); font-size: 1.4rem; font-weight: 700; padding: 6px 16px; border-radius: 999px; z-index: 6; font-variant-numeric: tabular-nums; box-shadow: 0 6px 20px rgba(234,67,53,.4); }
.live-announce { position: absolute; top: 60px; left: 50%; transform: translateX(-50%); background: rgba(26,115,232,.95); color: #fff; padding: 10px 18px; border-radius: 12px; z-index: 6; font-weight: 600; max-width: 90%; text-align: center; animation: rowIn .3s ease; }
.live-pinned { margin-top: 8px; padding: 8px 12px; background: #fef7e0; border-radius: 10px; font-size: .9rem; }
.live-titlebar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 10px 0; }
.live-titlebar h1 { font-size: clamp(1.1rem, 2.6vw, 1.5rem); margin: 0; }
.react-bar { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.react-btn { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface-solid); font-size: 1.2rem; cursor: pointer; transition: transform .15s var(--bounce); }
.react-btn:active { transform: scale(1.3); }
[data-hand].is-on { background: #fef7e0; border-color: #fbbc04; }
.host-panel { border: 1px dashed #1a73e8; }
.live-side { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 14px; background: var(--surface-solid); min-height: 520px; max-height: calc(100vh - 100px); position: sticky; top: 76px; overflow: hidden; }
@media (max-width: 1000px) { .live-side { position: static; max-height: 70vh; } }
.live-tabs { display: flex; border-bottom: 1px solid var(--border); }
.live-tabs button { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 12px 6px; background: none; border: 0; border-bottom: 3px solid transparent; font: inherit; font-weight: 600; font-size: .88rem; color: var(--muted); cursor: pointer; position: relative; }
.live-tabs button.is-active { color: #1a73e8; border-bottom-color: #1a73e8; }
.live-tabs .icon { width: 16px; height: 16px; }
.ltab-dot { position: absolute; top: 8px; right: 12px; width: 8px; height: 8px; border-radius: 50%; background: #ea4335; }
.ltab-pane { display: none; flex: 1; flex-direction: column; min-height: 0; padding: 10px; gap: 8px; overflow-y: auto; }
.ltab-pane.is-active { display: flex; }
.chat-list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; min-height: 200px; }
.chat-msg { display: flex; gap: 8px; align-items: flex-start; font-size: .9rem; position: relative; }
.chat-msg .avatar { width: 28px; height: 28px; font-size: .9rem; flex-shrink: 0; }
.chat-msg.is-host b { color: #1a73e8; }
.chat-msg.is-me { background: #f8fbff; border-radius: 8px; }
.chat-text { overflow-wrap: anywhere; }
.host-tag { font-size: .65rem; background: #1a73e8; color: #fff; padding: 1px 6px; border-radius: 6px; vertical-align: 1px; }
.chat-mod { display: none; gap: 2px; }
.chat-msg:hover .chat-mod, .qa-item:hover .chat-mod { display: inline-flex; }
.chat-mod button { border: 0; background: none; cursor: pointer; font-size: .9rem; }
.chat-form { display: flex; gap: 6px; }
.chat-form .input { flex: 1; }
.qa-list { display: grid; gap: 8px; }
.qa-item { display: flex; gap: 10px; align-items: flex-start; padding: 8px; border: 1px solid var(--border); border-radius: 10px; font-size: .9rem; }
.qa-item.is-answered { opacity: .6; }
.qa-vote { display: flex; flex-direction: column; align-items: center; border: 1px solid var(--border); background: var(--surface-2); border-radius: 8px; padding: 4px 8px; cursor: pointer; font: inherit; font-size: .75rem; }
.qa-vote.is-on { background: #e8f0fe; border-color: #1a73e8; color: #1967d2; }
.poll-q { margin-bottom: 8px; }
.poll-opt-btn { position: relative; display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 10px 12px; border: 2px solid var(--border); border-radius: 12px; background: var(--surface-solid); margin-bottom: 6px; cursor: pointer; font: inherit; overflow: hidden; }
.poll-opt-btn:disabled { cursor: default; }
.poll-opt-btn > * { position: relative; }
.po-fill { position: absolute !important; left: 0; top: 0; bottom: 0; background: #e8f0fe; transition: width .6s ease; }
.poll-opt-btn.is-mine { border-color: #1a73e8; }
.poll-opt-btn.is-correct { border-color: #34a853; }
.poll-opt-btn.is-correct .po-fill { background: #e6f4ea; }
.poll-opt-btn.is-wrong { border-color: #ea4335; }
.poll-form { display: grid; gap: 6px; padding-top: 10px; border-top: 1px dashed var(--border); margin-top: 6px; }
.poll-opt { display: flex; gap: 6px; align-items: center; }
.poll-opt .input { flex: 1; }
