/* สอบครู.com — สไตล์หลัก */
:root {
  --accent: #1E66E0;
  --accent-dark: #174FAF;
  --accent-soft: #E6EEFF;
  --navy: #12357A;
  --ink: #24324D;
  --ink-strong: #172033;
  --muted: #4A5468;
  --muted-2: #5A6378;
  --line: #E4E9F2;
  --line-2: #EDF0F6;
  --bg: #F7F9FC;
  --card: #FFFFFF;
  --yellow: #FFD54A;
  --yellow-soft: #FFF4CC;
  --yellow-ink: #5C4500;
  --green: #12805C;
  --green-ink: #0F6B4B;
  --green-soft: #E3F6EE;
  --orange: #D2691E;
  --orange-ink: #A1420A;
  --orange-soft: #FFF1E6;
  --danger: #B42318;
  --radius: 16px;
  --shadow: 0 6px 24px rgba(23, 32, 51, .06);
  --font: 'Anuphan', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-q: 'IBM Plex Sans Thai Looped', 'Anuphan', sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; font-family: var(--font); font-size: 17px; line-height: 1.6; color: var(--ink); background: var(--bg); }
img, svg { max-width: 100%; }
a { color: var(--accent); }
a:hover { color: var(--accent-dark); }
h1, h2, h3 { color: var(--navy); line-height: 1.25; margin: 0; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid #9DBDF7; outline-offset: 2px; border-radius: 6px; }
.skip { position: absolute; left: -999px; top: 8px; background: #fff; padding: 8px 14px; z-index: 100; }
.skip:focus { left: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { max-width: 1240px; margin: 0 auto; padding-left: 24px; padding-right: 24px; }
.narrow { max-width: 860px; }
@media (max-width: 600px) { .wrap { padding-left: 16px; padding-right: 16px; } body { font-size: 16px; } }

/* header */
.site-header { position: sticky; top: 0; z-index: 30; background: #fff; border-bottom: 1px solid var(--line); }
.header-in { display: flex; align-items: center; gap: 10px 28px; padding-top: 10px; padding-bottom: 10px; flex-wrap: wrap; }
.logo { display: inline-flex; align-items: center; gap: 10px; color: var(--accent); text-decoration: none; }
.logo span { font-size: 24px; font-weight: 700; color: var(--accent); letter-spacing: -.01em; }
.logo b { color: var(--ink); font-weight: 700; }
.main-nav { display: flex; gap: 4px 22px; font-weight: 600; font-size: 16px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.main-nav::-webkit-scrollbar { display: none; }
.main-nav a { color: var(--muted); text-decoration: none; white-space: nowrap; padding: 6px 0; border-bottom: 3px solid transparent; }
.main-nav a:hover { color: var(--accent); }
.main-nav a[aria-current="page"] { color: var(--accent); border-bottom-color: var(--accent); }
.auth-slot { display: flex; align-items: center; gap: 10px; margin-left: auto; }
@media (max-width: 800px) { .main-nav { order: 3; flex-basis: 100%; } }
.streak-chip { display: inline-flex; align-items: center; gap: 4px; padding: 6px 10px; border-radius: 999px; background: var(--orange-soft); color: var(--orange-ink); font-weight: 700; font-size: 15px; text-decoration: none; }
.avatar { flex-shrink: 0; width: 40px; height: 40px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; text-decoration: none; }
.avatar.sm { width: 30px; height: 30px; font-size: 13px; }
.avatar.md { width: 38px; height: 38px; font-size: 15px; }
.avatar.lg { width: 112px; height: 112px; font-size: 44px; border: 5px solid #fff; box-shadow: 0 0 0 3px var(--yellow); }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 20px; border-radius: 10px; border: 1px solid transparent; font-weight: 700; font-size: 16px; text-decoration: none; cursor: pointer; transition: background .15s, transform .05s; line-height: 1.3; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); color: #fff; }
.btn-yellow { background: var(--yellow); color: var(--ink-strong); }
.btn-yellow:hover { background: #F5C82E; color: var(--ink-strong); }
.btn-ghost { background: #fff; border-color: #CBD2E1; color: var(--ink); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-white { background: #fff; color: var(--navy); }
.btn-danger { background: #fff; border-color: #F1B5AE; color: var(--danger); }
.btn-sm { min-height: 40px; padding: 8px 14px; font-size: 15px; }
.btn-lg { padding: 15px 28px; font-size: 18px; border-radius: 12px; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.link-btn { background: none; border: 0; color: var(--accent); font-weight: 600; cursor: pointer; padding: 4px 2px; }

/* cards & chips */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.card.shadow { box-shadow: var(--shadow); border: 0; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: #fff; color: var(--muted); font-size: 14px; font-weight: 600; cursor: pointer; min-height: 36px; text-decoration: none; }
.chip[aria-pressed="true"], .chip.on { border-color: var(--accent); background: var(--accent-soft); color: var(--navy); }
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 6px; font-size: 12px; font-weight: 700; background: #F1F4FA; color: var(--muted); }
.tag.blue { background: var(--accent-soft); color: var(--navy); }
.tag.green { background: var(--green-soft); color: var(--green-ink); }
.tag.orange { background: var(--orange-soft); color: var(--orange-ink); }
.tag.yellow { background: var(--yellow-soft); color: var(--yellow-ink); }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 12px; border-radius: 999px; font-size: 14px; font-weight: 700; }
.badge-teacher { background: var(--green-soft); color: var(--green-ink); }
.badge-helper { background: var(--yellow-soft); color: var(--yellow-ink); }
.muted { color: var(--muted-2); }
.small { font-size: 14px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; }
.section { padding-top: 64px; }
.section-title { font-size: clamp(26px, 3.4vw, 38px); }
.eyebrow { font-size: 18px; font-weight: 600; color: var(--muted-2); }
.tablist { display: inline-flex; flex-wrap: wrap; gap: 4px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 4px; }
.tablist button { padding: 8px 18px; border-radius: 8px; border: 0; background: transparent; font-weight: 700; color: var(--muted); cursor: pointer; min-height: 40px; }
.tablist button[aria-selected="true"] { background: var(--accent); color: #fff; }
.empty { border: 1.5px dashed #CBD2E1; border-radius: var(--radius); padding: 36px; text-align: center; background: #fff; color: var(--muted-2); }
.skeleton { background: linear-gradient(90deg, #EEF1F6 25%, #F6F8FB 50%, #EEF1F6 75%); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 12px; min-height: 80px; }
@keyframes sk { to { background-position: -200% 0; } }

/* forms */
label.field { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 15px; }
.input, select.input, textarea.input { width: 100%; padding: 11px 14px; border-radius: 10px; border: 1px solid #CBD2E1; background: #fff; font-weight: 400; min-height: 44px; }
textarea.input { resize: vertical; min-height: 110px; }
.input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px #D7E4FF; }
.switch { position: relative; display: inline-block; width: 42px; height: 24px; border-radius: 999px; background: #CBD2E1; transition: background .2s; flex-shrink: 0; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: left .2s; }
[aria-pressed="true"] .switch, [aria-checked="true"] .switch { background: var(--accent); }
[aria-pressed="true"] .switch::after, [aria-checked="true"] .switch::after { left: 21px; }

/* toast & modal */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 120px); background: var(--ink-strong); color: #fff; padding: 12px 20px; border-radius: 12px; font-weight: 600; z-index: 200; transition: transform .25s, opacity .25s, visibility .25s; max-width: calc(100% - 32px); opacity: 0; visibility: hidden; }
.toast.show { transform: translate(-50%, 0); opacity: 1; visibility: visible; }
dialog.modal { border: 0; border-radius: 20px; padding: 0; width: min(560px, calc(100% - 32px)); box-shadow: 0 30px 80px rgba(0,0,0,.25); }
dialog.modal::backdrop { background: rgba(23, 32, 51, .45); }
.modal-body { padding: 26px; display: flex; flex-direction: column; gap: 14px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }

/* promo + hero */
.promo { background: var(--ink-strong); color: #fff; font-size: 15px; }
.promo .wrap { display: flex; justify-content: center; align-items: center; gap: 8px 16px; padding-top: 8px; padding-bottom: 8px; flex-wrap: wrap; text-align: center; }
.promo a { background: var(--yellow); color: var(--ink-strong); padding: 3px 14px; border-radius: 999px; font-weight: 700; font-size: 14px; text-decoration: none; }
.hero { background: radial-gradient(70% 90% at 50% 0%, #DCE7FF 0%, var(--bg) 72%); }
.hero-in { max-width: 900px; margin: 0 auto; padding: 64px 24px 56px; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.hero-lead { font-size: 24px; font-weight: 600; color: var(--muted-2); }
.hero h1 { font-size: clamp(38px, 6vw, 68px); min-height: 1.3em; line-height: 1.3; }
.caret { color: var(--accent); font-weight: 400; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.search-wrap { position: relative; width: 100%; max-width: 640px; margin-top: 46px; }
.mascot { position: absolute; right: 54px; top: -66px; z-index: 0; display: flex; align-items: flex-start; gap: 6px; }
.mascot .bubble { margin-top: 6px; background: #fff; border: 1.5px solid var(--ink-strong); border-radius: 12px 12px 2px 12px; padding: 3px 10px; font-size: 13px; font-weight: 700; color: var(--ink-strong); white-space: nowrap; }
.mascot svg { transition: transform .3s; }
.search-wrap:focus-within .mascot svg { transform: translateY(-8px) rotate(-4deg); }
.search { position: relative; z-index: 1; display: flex; align-items: center; gap: 10px; background: #fff; border: 1.5px solid #CBD2E1; border-radius: 999px; padding: 6px 8px 6px 22px; box-shadow: 0 10px 30px rgba(30, 102, 224, .12); }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 17px; min-height: 44px; }
.search-results { position: absolute; z-index: 5; left: 0; right: 0; top: calc(100% + 8px); background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 16px 40px rgba(23,32,51,.14); text-align: left; overflow: hidden; }
.search-results a { display: flex; justify-content: space-between; gap: 10px; padding: 12px 18px; text-decoration: none; color: var(--ink); border-bottom: 1px solid var(--line-2); }
.search-results a:hover, .search-results a:focus { background: var(--accent-soft); }
.ai-toggle { flex-shrink: 0; display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 999px; border: 0; background: #F4F6FA; font-size: 14px; font-weight: 600; color: var(--muted); cursor: pointer; min-height: 44px; }
.ai-toggle[aria-pressed="true"] { background: var(--accent-soft); color: var(--navy); }
.popular { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 14px; font-size: 15px; }
.popular a { padding: 4px 12px; border-radius: 999px; background: #fff; border: 1px solid var(--line); color: var(--muted); text-decoration: none; }
@media (max-width: 600px) { .mascot { right: 18px; } .mascot .bubble { display: none; } .ai-toggle .lbl { display: none; } }

/* category tabs */
.cat-card { background: #fff; border-radius: 20px; box-shadow: var(--shadow); padding: 26px 26px 30px; display: flex; flex-direction: column; gap: 22px; }
.cat-tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; }
.cat-tab { flex: 0 0 auto; width: 128px; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 10px 6px 0; border: 0; background: transparent; cursor: pointer; text-align: center; color: var(--muted); }
.cat-tab .ic { width: 58px; height: 58px; border-radius: 16px; display: flex; align-items: center; justify-content: center; background: #F4F6FA; color: #6B7590; transition: transform .2s; }
.cat-tab:hover .ic { transform: translateY(-3px); }
.cat-tab .nm { font-size: 15px; font-weight: 600; line-height: 1.35; }
.cat-tab .bar { margin-top: 4px; width: 80%; height: 4px; border-radius: 999px; background: transparent; }
.cat-tab[aria-selected="true"] { color: var(--navy); }
.cat-tab[aria-selected="true"] .ic { background: var(--accent-soft); color: var(--accent); }
.cat-tab[aria-selected="true"] .bar { background: var(--accent); }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.tile { min-height: 120px; border-radius: 14px; padding: 18px; display: flex; flex-direction: column; gap: 4px; text-decoration: none; transition: transform .15s, box-shadow .15s; }
.tile:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(23,32,51,.1); }
.tile .sub { font-size: 13px; font-weight: 600; opacity: .85; }
.tile .ttl { font-size: 19px; font-weight: 700; line-height: 1.35; }
.tile .go { margin-top: auto; font-size: 14px; font-weight: 600; }
.t0 { background: #E6EEFF; color: var(--navy); } .t1 { background: #FFF4CC; color: #5C4500; } .t2 { background: #E3F6EE; color: #0F5A40; } .t3 { background: #F0EAFF; color: #3F2A8A; }

/* banner */
.banner-row { display: flex; flex-wrap: wrap; gap: 20px; }
.banner { flex: 999 1 560px; min-width: 0; position: relative; overflow: hidden; border-radius: 20px; background: var(--accent); color: #fff; padding: 40px; display: flex; flex-wrap: wrap; gap: 24px; align-items: center; justify-content: space-between; min-height: 300px; }
.banner h2 { color: #fff; font-size: clamp(26px, 3.4vw, 40px); }
.banner p { color: #E1EAFF; }
.omr-card { flex: 0 1 230px; background: #fff; border-radius: 16px; padding: 18px; display: flex; flex-direction: column; gap: 10px; transform: rotate(3deg); box-shadow: 0 16px 36px rgba(0,0,0,.2); color: var(--muted); font-size: 13px; }
.omr-row { display: flex; gap: 10px; align-items: center; }
.omr-row i { width: 18px; height: 18px; border-radius: 50%; border: 2px solid #9AA6C0; display: inline-block; }
.omr-row i.f { background: var(--ink-strong); border-color: var(--ink-strong); }
.omr-row i.y { background: var(--yellow); border-color: #C9A21E; }
.countdown-card { flex: 1 1 320px; min-width: 0; background: #fff; border-radius: 20px; padding: 28px; display: flex; flex-direction: column; gap: 14px; box-shadow: var(--shadow); }
.cd-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; text-align: center; }
.cd-grid div { background: #EEF3FF; border-radius: 12px; padding: 10px 4px; }
.cd-grid b { display: block; font-size: 30px; color: var(--navy); line-height: 1.1; font-variant-numeric: tabular-nums; }
.cd-grid span { font-size: 13px; color: var(--muted); }

/* features / steps */
.feature .ic { width: 60px; height: 60px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: flex; align-items: center; justify-content: center; }
.step { display: flex; gap: 16px; }
.step .n { flex-shrink: 0; width: 40px; height: 40px; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 700; display: flex; align-items: center; justify-content: center; }

/* set cards carousel */
.hscroll { display: flex; gap: 16px; overflow-x: auto; padding-bottom: 10px; scroll-snap-type: x proximity; }
.hscroll > * { scroll-snap-align: start; }
.set-card { flex: 0 0 260px; background: #fff; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; text-decoration: none; color: var(--ink); display: flex; flex-direction: column; transition: transform .15s, box-shadow .15s; }
.set-card:hover { transform: translateY(-3px); box-shadow: 0 12px 28px rgba(23,32,51,.1); color: var(--ink); }
.set-cover { height: 110px; padding: 16px; display: flex; flex-direction: column; justify-content: flex-end; color: #fff; }
.set-cover .sec { font-size: 13px; font-weight: 700; opacity: .9; }
.set-cover .subj { font-size: 22px; font-weight: 700; line-height: 1.2; }
.set-body { padding: 14px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.set-body .ttl { font-size: 16px; font-weight: 700; line-height: 1.4; }
.price-free { margin-top: auto; align-self: flex-end; font-weight: 700; color: var(--green-ink); }
.price-member { margin-top: auto; align-self: flex-end; font-weight: 700; color: var(--accent); }
.set-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.set-grid .set-card { flex: none; }

/* pricing */
.plan { position: relative; background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 30px; display: flex; flex-direction: column; gap: 14px; }
.plan.best { border: 2px solid var(--accent); }
.plan .flag { position: absolute; top: 18px; right: 18px; font-size: 13px; font-weight: 700; padding: 3px 12px; border-radius: 999px; background: var(--accent); color: #fff; }
.plan .art { height: 120px; border-radius: 14px; display: flex; align-items: center; justify-content: center; }
.plan ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; font-size: 15px; }
.plan li { display: flex; gap: 8px; }
.plan li::before { content: '✓'; color: var(--accent); font-weight: 700; }
.plan .btn { margin-top: auto; }

/* announcements */
.ann-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 16px; padding: 14px 0; border-top: 1px solid var(--line-2); }

/* footer */
.site-footer { background: #fff; border-top: 1px solid var(--line); margin-top: 72px; }
.footer-grid { padding-top: 48px; padding-bottom: 24px; display: grid; grid-template-columns: 2fr repeat(3, 1fr); gap: 28px; font-size: 15px; }
.footer-grid nav { display: flex; flex-direction: column; gap: 6px; }
.footer-grid nav b { color: var(--navy); }
.footer-grid nav a { color: var(--muted); text-decoration: none; }
.footer-grid nav a:hover { color: var(--accent); }
.footer-brand { display: flex; flex-direction: column; gap: 10px; color: var(--muted); }
.footer-note { padding-top: 16px; padding-bottom: 32px; border-top: 1px solid var(--line-2); font-size: 14px; color: var(--muted-2); }
@media (max-width: 800px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-brand { grid-column: 1 / -1; } }

/* page header band */
.band { background: radial-gradient(70% 120% at 20% 0%, #DCE7FF 0%, var(--bg) 70%); }
.band-in { padding-top: 36px; padding-bottom: 24px; display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
.band h1 { font-size: clamp(28px, 4vw, 44px); }
.band.dark { background: var(--navy); color: #fff; position: relative; overflow: hidden; }
.band.dark h1 { color: #fff; }
.band.dark p { color: #C9D6F2; }
.crumbs { font-size: 14px; color: var(--muted-2); display: flex; gap: 6px; flex-wrap: wrap; }
.crumbs a { color: var(--muted-2); }

/* layout two-col */
.two-col { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; padding-top: 16px; }
.two-col > .main { flex: 999 1 620px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.two-col > aside { flex: 1 1 300px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }

/* question UI */
.q-card { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 26px; display: flex; flex-direction: column; gap: 16px; }
.q-stem { font-family: var(--font-q); font-size: 19px; line-height: 1.75; font-weight: 500; white-space: pre-line; color: var(--ink-strong); }
.q-choices { display: flex; flex-direction: column; gap: 10px; font-family: var(--font-q); font-size: 17px; }
.choice { text-align: left; display: flex; gap: 14px; align-items: flex-start; padding: 13px 16px; border-radius: 14px; border: 2px solid #D5DAE6; background: #fff; cursor: pointer; min-height: 52px; color: var(--ink-strong); line-height: 1.6; transition: border-color .12s, background .12s; }
.choice:hover:not([disabled]) { border-color: #9DBDF7; }
.choice .b { flex-shrink: 0; width: 30px; height: 30px; border-radius: 50%; border: 2px solid #8A96B3; display: flex; align-items: center; justify-content: center; font-family: var(--font); font-size: 15px; font-weight: 700; margin-top: -1px; }
.choice[aria-pressed="true"] { border-color: var(--accent); background: #EEF3FF; }
.choice[aria-pressed="true"] .b { background: var(--accent); border-color: var(--accent); color: #fff; }
.choice.right { border-color: var(--green); background: #EAF7F1; }
.choice.right .b { background: var(--green); border-color: var(--green); color: #fff; }
.choice.wrong { border-color: #E07A3B; background: #FFF3EA; }
.choice.wrong .b { background: #E07A3B; border-color: #E07A3B; color: #fff; }
.choice[disabled] { cursor: default; }
.explain { border-radius: 14px; background: #F2FAF6; padding: 16px 18px; font-size: 16px; color: #24324D; display: flex; flex-direction: column; gap: 8px; }
.explain.bad { background: #FFF6EE; }
.explain h3 { font-size: 17px; color: var(--green-ink); }
.explain.bad h3 { color: var(--orange-ink); }
.hint-box { background: #FFF8DB; border: 1px solid #F2DC86; border-radius: 14px; padding: 14px 18px; color: #4A3A00; }
.open-card .answer-guide { background: #F7F9FC; border-radius: 12px; padding: 16px; white-space: pre-line; }

/* exam runner */
.exam-top { background: var(--ink-strong); color: #fff; position: sticky; top: 0; z-index: 40; }
body:has(.exam-top) .site-header { position: static; }
.exam-top .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px 20px; padding-top: 10px; padding-bottom: 10px; }
.timer { display: flex; align-items: center; gap: 8px; background: #24304A; padding: 8px 14px; border-radius: 12px; font-variant-numeric: tabular-nums; font-size: 20px; font-weight: 700; }
.timer.low { background: #7A1E12; }
.navgrid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.navgrid button { height: 40px; border-radius: 10px; border: 1px solid #D5DAE6; background: #F1F3F8; color: var(--muted); font-weight: 600; cursor: pointer; font-size: 15px; padding: 0; }
.navgrid button.ans { background: var(--accent); border-color: var(--accent); color: #fff; }
.navgrid button.flag { border: 2.5px solid #E0A800; }
.navgrid button.cur { box-shadow: 0 0 0 3px var(--ink-strong); }
.progress { height: 6px; background: #E9ECF4; border-radius: 999px; overflow: hidden; }
.progress > div { height: 100%; background: var(--accent); transition: width .2s; }
.subj-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.subj-pills span { padding: 7px 14px; border-radius: 999px; background: #fff; border: 1px solid var(--line); font-size: 14px; color: var(--muted); }
.subj-pills span.on { background: var(--accent); color: #fff; border-color: var(--accent); }

/* result */
.meter { position: relative; padding-top: 22px; }
.meter .track { height: 14px; background: #E9ECF4; border-radius: 999px; overflow: hidden; }
.meter .fill { height: 100%; border-radius: 999px; }
.meter .line { position: absolute; left: 60%; top: 0; bottom: -4px; width: 2px; background: var(--ink-strong); }
.meter .lbl { position: absolute; left: 60%; top: -2px; transform: translateX(-50%); font-size: 13px; font-weight: 600; white-space: nowrap; }
.big-score { font-size: 48px; font-weight: 700; line-height: 1; color: var(--ink-strong); }
.kv { display: flex; justify-content: space-between; gap: 12px; }
.review-item { border-top: 1px solid var(--line-2); padding-top: 18px; }

/* board */
.thread { display: flex; gap: 14px; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; }
.vote { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; cursor: pointer; border: 1px solid var(--line); background: var(--bg); color: var(--muted); }
.vote[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.thread-title { font-size: 18px; font-weight: 700; color: var(--ink-strong); text-decoration: none; line-height: 1.4; }
.thread-title:hover { color: var(--accent); }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.post { display: flex; gap: 12px; }
.post-body { white-space: pre-line; overflow-wrap: anywhere; }
.pinned { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; padding: 18px 20px; border-radius: 16px; background: var(--ink-strong); color: #fff; text-decoration: none; }
.pinned:hover { color: #fff; }
.dist-row { position: relative; overflow: hidden; border-radius: 10px; padding: 10px 14px; border: 1.5px solid var(--line); background: #fff; }
.dist-row .fill { position: absolute; inset: 0 auto 0 0; background: #F1F4FA; }
.dist-row.right { border-color: var(--green); }
.dist-row.right .fill { background: #DDF3E8; }
.dist-row > span { position: relative; display: flex; gap: 10px; align-items: center; }

/* leaderboard */
.podium { display: flex; justify-content: center; align-items: flex-end; gap: 14px; }
.podium .p { flex: 0 1 200px; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.podium .ped { margin-top: 6px; width: 100%; border-radius: 14px 14px 0 0; display: flex; justify-content: center; padding-top: 10px; font-size: 34px; font-weight: 700; }
.lb-row { display: flex; align-items: center; gap: 14px; padding: 12px 18px; border-bottom: 1px solid var(--line-2); }
.lb-row .rk { width: 32px; text-align: center; font-weight: 700; color: var(--muted-2); font-size: 17px; }
.me-bar { position: sticky; bottom: 12px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 14px 18px; border-radius: 16px; background: var(--ink-strong); color: #fff; box-shadow: 0 12px 30px rgba(23,32,51,.25); }
.league { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; text-align: center; font-size: 12px; font-weight: 600; color: var(--muted-2); }
.league span { display: block; margin: 0 auto 4px; width: 34px; height: 34px; border-radius: 50%; }
.league .on { color: var(--navy); }
.league .on span { outline: 3px solid var(--accent); outline-offset: 2px; }
.share-card { aspect-ratio: 1 / 1; border-radius: 16px; background: var(--navy); color: #fff; padding: 22px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }

/* profile */
.cover { height: 170px; background: var(--accent); position: relative; overflow: hidden; }
.profile-head { margin-top: -70px; position: relative; background: #fff; border-radius: 20px; padding: 24px 28px; display: flex; flex-wrap: wrap; align-items: flex-end; gap: 18px 24px; box-shadow: 0 10px 30px rgba(23,32,51,.08); }
.stat-tile { border-radius: 16px; padding: 18px 20px; display: flex; align-items: center; gap: 14px; }
.stat-tile b { display: block; font-size: 28px; line-height: 1.1; }
.heat { display: grid; grid-template-rows: repeat(7, 14px); grid-auto-flow: column; grid-auto-columns: 14px; gap: 4px; }
.heat span { width: 14px; height: 14px; border-radius: 4px; background: #EEF1F6; }
.badge-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.badge-grid div { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; font-size: 12px; font-weight: 600; }
.badge-grid .c { width: 56px; height: 56px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.badge-grid .locked .c { background: #F4F6FA; color: #B3BCCD; border: 1.5px dashed #CBD2E1; }
.badge-grid .locked { color: var(--muted-2); }

/* admin */
.admin-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.table { width: 100%; border-collapse: collapse; font-size: 15px; }
.table th, .table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
.table th { font-size: 13px; color: var(--muted-2); font-weight: 700; }
.table-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: 14px; }

/* prose */
.prose { display: flex; flex-direction: column; gap: 14px; }
.prose h2 { margin-top: 18px; font-size: 24px; }
.prose ul, .prose ol { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 6px; }
.prose table { border-collapse: collapse; width: 100%; background: #fff; }
.prose th, .prose td { border: 1px solid var(--line); padding: 10px 12px; text-align: left; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ===== มินิเกมดวลความเร็ว ===== */
.game-lobby { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 860px) { .game-lobby { grid-template-columns: 1fr; } }
.game-start { align-items: stretch; gap: 16px; }
.game-hero { display: flex; justify-content: center; }
.game-rules { margin: 0; padding-left: 20px; display: grid; gap: 6px; color: var(--ink); }
.seg { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.seg-btn { border: 2px solid var(--line); background: #fff; border-radius: 999px; padding: 8px 16px; font: inherit; font-weight: 600; cursor: pointer; color: var(--ink); }
.seg-btn[aria-pressed="true"] { border-color: var(--accent); background: #EEF3FF; color: var(--navy); }
.btn-lg { padding: 16px 28px; font-size: 20px; border-radius: 16px; }
.game-lb { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.game-lb li { display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; background: #F7F9FC; }
.game-lb li:nth-child(1) { background: #FFF6D6; }
.game-lb .rk { font-weight: 700; color: var(--navy); text-align: center; }
.game-lb a { color: var(--ink-strong); text-decoration: none; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.game-count { min-height: 340px; display: flex; align-items: center; justify-content: center; }
.game-count span { font-size: 140px; font-weight: 800; color: var(--accent); animation: pop .7s ease-out infinite; }
@keyframes pop { 0% { transform: scale(.6); opacity: 0; } 30% { transform: scale(1.1); opacity: 1; } 100% { transform: scale(1); opacity: .9; } }
.game-play { max-width: 760px; margin: 0 auto; display: grid; gap: 14px; }
.game-hud { position: sticky; top: 8px; z-index: 5; display: flex; align-items: center; gap: 14px; background: var(--ink-strong); color: #fff; border-radius: 16px; padding: 12px 16px; }
.g-time { flex: 1; display: flex; align-items: center; gap: 10px; }
.g-time b { font-size: 26px; min-width: 34px; text-align: right; }
.g-bar { flex: 1; height: 12px; background: rgba(255,255,255,.18); border-radius: 999px; overflow: hidden; }
.g-bar span { display: block; height: 100%; width: 100%; background: #FFD54A; border-radius: 999px; transition: width .1s linear; }
.g-bar span.hot { background: #FF7A59; }
.g-score { display: flex; flex-direction: column; align-items: center; line-height: 1.1; }
.g-score .muted { color: #C9D6F2; }
.g-score b { font-size: 26px; }
.g-combo { background: #FFD54A; color: #172033; border-radius: 999px; padding: 6px 12px; font-weight: 700; animation: pop .35s ease-out; }
.game-card .q-stem { font-size: 20px; }
.game-choices .choice { min-height: 58px; font-size: 18px; }
.shake { animation: shake .35s; }
@keyframes shake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }
.g-float { position: absolute; transform: translate(-50%, 0); color: var(--green); font-weight: 800; font-size: 26px; pointer-events: none; animation: floatup .9s ease-out forwards; z-index: 50; }
@keyframes floatup { to { transform: translate(-50%, -60px); opacity: 0; } }
.game-end { align-items: stretch; text-align: center; gap: 16px; max-width: 640px; margin: 0 auto; }
.g-final { display: flex; flex-direction: column; align-items: center; }
.g-final b { font-size: 84px; line-height: 1; color: var(--navy); }
.stat-row { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; }
.stat-row > div { background: #F7F9FC; border-radius: 14px; padding: 12px 18px; min-width: 104px; display: flex; flex-direction: column; }
.stat-row b { font-size: 26px; color: var(--ink-strong); }
.stat-row span { font-size: 13px; color: var(--muted); }
.explain { background: #F2F7FF; border-radius: 12px; padding: 12px 14px; line-height: 1.7; white-space: pre-line; }

/* ===== ภารกิจประจำวัน ===== */
.missions { display: grid; gap: 10px; }
.mission { display: grid; grid-template-columns: 28px 1fr auto; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 12px; background: #F7F9FC; text-decoration: none; color: var(--ink-strong); }
.mission .ck { width: 26px; height: 26px; border-radius: 50%; border: 2px solid #B9C3DA; display: flex; align-items: center; justify-content: center; font-size: 14px; color: #fff; }
.mission.done .ck { background: var(--green); border-color: var(--green); }
.mission.done .tt { text-decoration: line-through; color: var(--muted); }
.mission .pg { font-size: 13px; color: var(--muted); font-weight: 600; }
.mission-bar { height: 10px; background: #E9ECF4; border-radius: 999px; overflow: hidden; }
.mission-bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), #6EA8FF); border-radius: 999px; }
.home-play { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 20px; }
@media (max-width: 860px) { .home-play { grid-template-columns: 1fr; } }
.game-promo { position: relative; overflow: hidden; border-radius: 20px; padding: 28px; background: #172033; color: #fff; display: flex; flex-direction: column; gap: 12px; min-height: 240px; }
.game-promo h2 { color: #fff; font-size: clamp(24px, 3vw, 32px); }
.game-promo p { color: #C9D6F2; max-width: 440px; }
.game-promo .bolt { position: absolute; right: -10px; bottom: -20px; opacity: .9; }

/* confetti */
.confetti { position: fixed; top: -12px; width: 10px; height: 14px; z-index: 300; pointer-events: none; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(105vh) rotate(720deg); } }
@media (max-width: 640px) { .hide-sm { display: none !important; } }
.game-promo, .game-promo:hover { text-decoration: none; }
body.in-game .game-band { display: none; }
body.in-game .site-header { position: static; }

/* ===== ลูกเล่นหน้าทำข้อสอบ ===== */
.exam-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.exam-tools .tool { border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 6px 12px; font: inherit; font-weight: 600; font-size: 14px; color: var(--ink); cursor: pointer; }
.exam-tools .tool[aria-pressed="true"] { background: #EEF3FF; border-color: var(--accent); color: var(--navy); }
.tool-tip { flex-basis: 100%; }
#qcard { --qscale: 1; }
#qcard .q-stem { font-size: calc(19px * var(--qscale)); }
#qcard .q-choices { font-size: calc(17px * var(--qscale)); }
.choice-row { display: flex; gap: 8px; align-items: stretch; }
.choice-row .choice { flex: 1; }
.strike { flex: 0 0 40px; border: 1px dashed #C5CCDB; background: #fff; border-radius: 12px; color: #9AA4BC; cursor: pointer; font-size: 16px; }
.strike:hover { color: #E07A3B; border-color: #E07A3B; }
.choice-row.struck .choice { opacity: .45; }
.choice-row.struck .choice .ct { text-decoration: line-through; text-decoration-thickness: 2px; }
.choice-row.struck .strike { color: #E07A3B; border-style: solid; border-color: #E07A3B; }
.pace { font-size: 13px; font-weight: 700; padding: 6px 10px; border-radius: 999px; background: #24304A; color: #C9F2DD; }
.pace.slow { background: #7A1E12; color: #FFE1D6; }
.pace.fast { background: #12573F; color: #D7FBEA; }
.navgrid button { border-radius: 50%; aspect-ratio: 1; height: auto; position: relative; }
.navgrid button.unsure::after { content: ''; position: absolute; top: -2px; right: -2px; width: 10px; height: 10px; border-radius: 50%; background: #FF7A59; border: 2px solid #fff; }
.scratch { position: fixed; right: 16px; bottom: 16px; width: min(380px, calc(100vw - 32px)); background: #FFFBEA; border: 1px solid #F0DC8A; border-radius: 16px; box-shadow: 0 16px 40px rgba(23,32,51,.2); padding: 12px; z-index: 60; display: flex; flex-direction: column; gap: 8px; }
.scratch textarea { min-height: 200px; border: 0; background: repeating-linear-gradient(#FFFBEA 0 27px, #EADFAF 27px 28px); font: 16px/28px var(--font); resize: vertical; outline: none; padding: 0 4px; }
body.focus-mode .site-header, body.focus-mode .site-footer, body.focus-mode aside:not(.spad) { display: none !important; }
body.focus-mode .two-col { max-width: 860px; margin-left: auto; margin-right: auto; }

/* ===== วิเคราะห์ผล ===== */
.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; }
.stat-cards .card { display: flex; flex-direction: column; gap: 2px; }
.stat-cards b { font-size: 30px; color: var(--navy); line-height: 1.2; }
.hbar { height: 10px; background: #E9ECF4; border-radius: 999px; overflow: hidden; }
.hbar span { display: block; height: 100%; border-radius: 999px; }
.topic-row { display: grid; grid-template-columns: minmax(0, 1fr) 90px 44px; gap: 10px; align-items: center; text-decoration: none; color: var(--ink-strong); padding: 6px 0; }
.topic-row .muted.small { display: none; }
.topic-row.wide { grid-template-columns: minmax(0, 1.4fr) minmax(60px, 1fr) 44px 110px 70px; }
.topic-row.wide .muted.small { display: inline; }
.topic-row .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topic-row .up { color: var(--green); } .topic-row .down { color: #C2410C; }
@media (max-width: 640px) { .topic-row.wide { grid-template-columns: minmax(0, 1fr) 70px 44px; } .topic-row.wide .small { display: none !important; } }
.hist { display: grid; gap: 6px; }
.hist-row { display: grid; grid-template-columns: 74px minmax(0, 1fr) auto auto auto; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 12px; background: #F7F9FC; text-decoration: none; color: var(--ink-strong); }
.hist-row .ht { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.hist-row .pill.ok { background: #E3F6EE; color: var(--green); } .hist-row .pill.no { background: #FFF0E6; color: #B4501A; }
@media (max-width: 640px) { .hist-row { grid-template-columns: 1fr auto; } .hist-row .hd, .hist-row .hp { display: none; } }
.trend { width: 100%; height: auto; margin-top: 8px; }
.subj-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.subj-card { background: #F7F9FC; border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 6px; }
.plan-step { display: grid; grid-template-columns: 30px 1fr; gap: 10px; }
.plan-step > b { width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; }
.locked-card { position: relative; overflow: hidden; min-height: 200px; margin-top: 20px; }
.two-col .locked-card, aside .locked-card { margin-top: 0; }
.lock-blur { filter: blur(5px); opacity: .5; }
.fake-bars { display: grid; gap: 14px; padding: 10px; }
.fake-bars i { display: block; height: 16px; border-radius: 999px; background: linear-gradient(90deg, #1E66E0, #9DBDF7); }
.lock-msg { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center; padding: 16px; background: rgba(255,255,255,.55); }
.lock-ic { font-size: 28px; }
.btn-line { background: #06C755; color: #fff; border: 0; }
.btn-line:hover { background: #05B04B; color: #fff; }
.share-box { display: flex; gap: 8px; }
.share-box .input { flex: 1; min-width: 0; }

/* ===== การ์ดจำ ===== */
.deck-pick { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.deck-stats { display: flex; gap: 16px; justify-content: center; margin-bottom: 12px; color: var(--muted); flex-wrap: wrap; }
.deck-stats b { color: var(--ink-strong); }
.flash { perspective: 1200px; cursor: pointer; outline: none; }
.flash-in { position: relative; min-height: 300px; transition: transform .5s; transform-style: preserve-3d; }
.flash.flipped .flash-in { transform: rotateY(180deg); }
.face { position: absolute; inset: 0; backface-visibility: hidden; border-radius: 20px; padding: 26px; display: flex; flex-direction: column; gap: 12px; justify-content: center; background: #fff; border: 1px solid var(--line); box-shadow: 0 12px 30px rgba(23,32,51,.08); overflow: auto; }
.face.back { transform: rotateY(180deg); background: #F2F7FF; border-color: #C9DAFB; }
.face .ans { font-size: 24px; font-weight: 700; color: var(--navy); }
.flash:focus-visible .face { box-shadow: 0 0 0 3px var(--accent); }
.flash-btns { justify-content: center; margin-top: 14px; }
.flash-btns .btn { min-width: 140px; }

/* ===== ด่านผจญภัย ===== */
.star-total { background: rgba(255,255,255,.1); border-radius: 16px; padding: 10px 16px; color: #fff; }
.star-total b { font-size: 26px; color: #FFD54A; }
.world { margin-bottom: 32px; }
.path { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
.node { position: relative; border: 2px solid var(--line); background: #fff; border-radius: 18px; padding: 14px; display: flex; flex-direction: column; gap: 4px; align-items: center; text-align: center; font: inherit; color: var(--ink-strong); cursor: pointer; transition: transform .15s, box-shadow .15s; }
.node.open:hover { transform: translateY(-3px); box-shadow: 0 10px 22px rgba(23,32,51,.12); }
.node .num { width: 44px; height: 44px; border-radius: 50%; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 18px; }
.node.done .num { background: var(--green); }
.node.locked { opacity: .55; cursor: not-allowed; background: #F4F6FA; }
.node.locked .num { background: #B9C3DA; }
.node .nm { font-weight: 700; line-height: 1.35; }
.stars .st, .big-stars .st { color: #D5DAE6; font-size: 18px; }
.stars .st.on, .big-stars .st.on { color: #F5B800; }
.big-stars { text-align: center; } .big-stars .st { font-size: 54px; }
.quest-play { max-width: 760px; margin: 0 auto; display: grid; gap: 14px; }
.quest-dots { display: flex; gap: 6px; } .quest-dots i { width: 12px; height: 12px; border-radius: 50%; background: #D5DAE6; } .quest-dots i.past { background: var(--accent); } .quest-dots i.now { background: #FFD54A; box-shadow: 0 0 0 3px #FFF1B8; }
.quest-end { text-align: center; align-items: center; max-width: 620px; margin: 0 auto; }

/* ===== ห้องสอบสด ===== */
.live-clock { font-size: clamp(40px, 7vw, 64px); font-weight: 800; color: var(--navy); font-variant-numeric: tabular-nums; }
.live-on { align-self: center; background: #FFE4DB; color: #B4361A; animation: blink 1.4s infinite; }
@keyframes blink { 50% { opacity: .55; } }
.live-lb li { grid-template-columns: 34px 1fr auto 64px; }
.live-lb b small { color: var(--muted); font-weight: 600; }

/* ===== สนามฝึก ===== */
.play-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.play-card { border-radius: 20px; padding: 22px; min-height: 180px; display: flex; flex-direction: column; gap: 8px; text-decoration: none; color: var(--ink-strong); background: #fff; border: 1px solid var(--line); transition: transform .15s, box-shadow .15s; }
.play-card:hover { transform: translateY(-3px); box-shadow: 0 14px 30px rgba(23,32,51,.12); }
.play-card .pill { align-self: flex-start; }
.play-card h2 { font-size: 24px; }
.play-card p { color: var(--muted); }
.play-card.live { background: #1C1530; color: #fff; border: 0; } .play-card.live p { color: #D7CCF5; } .play-card.live h2 { color: #fff; }
.play-card.speed { background: #172033; border: 0; } .play-card.speed h2 { color: #fff; } .play-card.speed p { color: #C9D6F2; }

/* ===== ระดับ ===== */
.level-card { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; margin-top: 16px; padding: 16px 18px; border-radius: 18px; background: linear-gradient(120deg, #12357A, #1E66E0); color: #fff; }
.level-card .small.muted { color: #C9D6F2; }
.level-card .btn-ghost { background: rgba(255,255,255,.12); color: #fff; border-color: rgba(255,255,255,.3); }
.lv-badge { width: 72px; height: 72px; border-radius: 22px; background: #FFD54A; color: #172033; display: flex; align-items: baseline; justify-content: center; padding-top: 14px; font-size: 32px; font-weight: 800; box-shadow: inset 0 -4px 0 rgba(0,0,0,.12); }
.lv-badge small { font-size: 14px; margin-right: 2px; }
.lv-bar { height: 10px; background: rgba(255,255,255,.2); border-radius: 999px; overflow: hidden; }
.lv-bar span { display: block; height: 100%; background: #FFD54A; border-radius: 999px; }

/* ===== แถบเมนูล่างบนมือถือ ===== */
.tabbar { display: none; }
@media (max-width: 760px) {
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: rgba(255,255,255,.97); backdrop-filter: blur(8px); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; font-weight: 600; color: var(--muted); text-decoration: none; padding: 4px 0; border-radius: 10px; }
  .tabbar a[aria-current="page"] { color: var(--accent); background: #EEF3FF; }
  body { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  body.in-game .tabbar, body:has(.exam-top) .tabbar { display: none; }
  body:has(.exam-top) { padding-bottom: 0; }
  .main-nav { overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .main-nav::-webkit-scrollbar { display: none; }
  .scratch { bottom: 12px; }
  .choice { min-height: 56px; }
  .btn { min-height: 44px; }
}

/* ---------- ห้องฝึกเจาะรายเรื่อง ---------- */
.drill-wrap { display: grid; grid-template-columns: 280px 1fr; gap: 24px; align-items: start; }
.drill-topics { position: sticky; top: 84px; display: flex; flex-direction: column; gap: 4px; max-height: calc(100vh - 110px); overflow: auto; }
.drill-select { display: none; }
.drill-topic { display: flex; justify-content: space-between; gap: 8px; width: 100%; text-align: left; padding: 9px 12px; border-radius: 10px; border: 0; background: transparent; color: var(--ink); font-weight: 600; cursor: pointer; min-height: 40px; }
.drill-topic:hover:not(:disabled) { background: var(--accent-soft); }
.drill-topic.on { background: var(--accent); color: #fff; }
.drill-topic.on .small { color: #DCE7FF; }
.drill-topic:disabled { cursor: default; color: var(--muted); }
.drill-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.drill-tile { position: relative; display: flex; flex-direction: column; gap: 4px; align-items: flex-start; text-align: left; padding: 16px; border-radius: 14px; border: 1px solid var(--line); background: #fff; cursor: pointer; transition: transform .15s, box-shadow .15s; min-height: 108px; }
.drill-tile:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(23,32,51,.09); }
.drill-tile .tile-no { font-size: 20px; font-weight: 700; color: var(--ink-strong); }
.drill-tile .tile-st { margin-top: auto; font-weight: 700; color: var(--accent); }
.drill-tile.pass { border-color: #9FD9BE; background: var(--green-soft); }
.drill-tile.pass .tile-st { color: var(--green-ink); }
.drill-tile.next { border: 2px solid var(--accent); }
.drill-tile.locked .tile-st { color: var(--muted); }
.tile-flag { position: absolute; top: -10px; right: 12px; background: var(--accent); color: #fff; font-size: 12px; font-weight: 700; padding: 2px 10px; border-radius: 999px; }
.lv-bar { display: flex; height: 10px; border-radius: 999px; overflow: hidden; background: var(--line-2); }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; }
.lv-chip { display: inline-block; font-size: 13px; font-weight: 700; padding: 3px 10px; border-radius: 999px; margin-left: 6px; vertical-align: 2px; }
.lv-chip.l1 { background: #E3F6EE; color: #0F6B4B; }
.lv-chip.l2 { background: #FFF1D6; color: #8A5A00; }
.lv-chip.l3 { background: #FDE4E1; color: #A3271C; }
.drill-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; background: linear-gradient(120deg, #12357A, #1E66E0); color: #fff; border: 0; margin-bottom: 20px; }
.drill-cta p { color: #DCE7FF; }
@media (max-width: 860px) {
  .drill-wrap { grid-template-columns: 1fr; }
  .drill-topics { position: static; max-height: none; }
  .drill-topic-list { display: none; }
  .drill-select { display: block; }
}

.consent { position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 60; max-width: 720px; margin: 0 auto; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 12px 32px rgba(23,32,51,.16); padding: 14px 16px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; justify-content: space-between; }
.consent p { margin: 0; font-size: 14px; flex: 1 1 260px; }
@media (max-width: 720px) { .consent { bottom: 76px; } }

/* ---------- คลิปอธิบายแบบเคลื่อนไหว ---------- */
.xp { position: relative; overflow: hidden; border-radius: 20px; padding: 18px; margin-bottom: 20px; color: var(--ink-strong);
  background: radial-gradient(circle at 12% 18%, rgba(255,255,255,.55) 0 14px, transparent 15px), radial-gradient(circle at 88% 30%, rgba(255,255,255,.4) 0 22px, transparent 23px),
  repeating-linear-gradient(135deg, rgba(255,255,255,.18) 0 10px, transparent 10px 22px), linear-gradient(135deg, #E6EEFF, #FFF3D1 60%, #FFE3EA); border: 2px solid var(--ink-strong); box-shadow: 5px 5px 0 var(--ink-strong); }
.xp-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; font-size: 17px; }
.xp-badge { background: var(--ink-strong); color: #FFD54A; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.xp-stage { min-height: 150px; display: flex; flex-direction: column; justify-content: center; gap: 12px; background: rgba(255,255,255,.75); border: 2px dashed #9AA8C7; border-radius: 16px; padding: 16px; }
.xp-row { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; align-items: center; }
.xp-p { animation: xpPop .45s cubic-bezier(.2,1.6,.4,1) both; animation-delay: var(--d); }
@keyframes xpPop { from { opacity: 0; transform: translateY(12px) scale(.6); } to { opacity: 1; transform: none; } }
.xp-num, .xp-hi, .xp-ans, .xp-muted { font-size: 26px; font-weight: 700; min-width: 54px; text-align: center; padding: 8px 12px; border-radius: 14px; background: #fff; border: 2px solid var(--ink-strong); box-shadow: 3px 3px 0 var(--ink-strong); }
.xp-hi { background: #FFD54A; }
.xp-ans { background: #FF7A9A; color: #fff; animation: xpPop .45s cubic-bezier(.2,1.6,.4,1) both, xpWiggle 1.2s .6s ease-in-out 2; animation-delay: var(--d), calc(var(--d) + .6s); }
@keyframes xpWiggle { 0%,100% { transform: rotate(0); } 25% { transform: rotate(-4deg) scale(1.06); } 75% { transform: rotate(4deg) scale(1.06); } }
.xp-muted { opacity: .35; box-shadow: none; }
.xp-diff { font-weight: 700; color: #0F6B4B; background: #D8F5E8; border: 2px solid #3BB27F; border-radius: 999px; padding: 4px 12px; font-size: 16px; }
.xp-op { font-size: 26px; font-weight: 700; color: #5B6B8C; }
.xp-tag { font-weight: 700; background: #fff; border: 2px solid var(--ink-strong); border-radius: 12px; padding: 6px 12px; font-size: 16px; }
.xp-emoji { font-size: 38px; line-height: 1; }
.xp-bar { width: min(100%, 460px); height: 38px; background: #fff; border: 2px solid var(--ink-strong); border-radius: 12px; position: relative; overflow: hidden; }
.xp-bar span { position: absolute; inset: 0 auto 0 0; width: 0; animation: xpFill 1s .3s ease-out forwards; animation-delay: calc(var(--d) + .2s); }
.xp-bar b { position: relative; z-index: 1; display: block; line-height: 34px; padding-left: 12px; }
@keyframes xpFill { to { width: var(--w); } }
.xp-blocks { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.xp-blocks div { display: flex; flex-wrap: wrap; gap: 5px; justify-content: center; max-width: 380px; }
.xp-blocks i { width: 26px; height: 26px; border-radius: 6px; border: 2px solid var(--ink-strong); animation: xpPop .35s cubic-bezier(.2,1.6,.4,1) both; animation-delay: calc(var(--d) + var(--k) * .07s); }
.xp-blocks small { font-weight: 700; }
.xp-bar.blue span, .xp-blocks.blue i { background: #8DB4FF; }
.xp-bar.green span, .xp-blocks.green i { background: #7FD8AE; }
.xp-bar.yellow span, .xp-blocks.yellow i { background: #FFD54A; }
.xp-bar.pink span, .xp-blocks.pink i { background: #FF9AAE; }
.xp-talk { display: flex; align-items: flex-end; gap: 10px; margin-top: 12px; }
.xp-bot { flex: 0 0 auto; transform-origin: bottom center; }
.xp-bot.hop { animation: xpHop .5s ease-out; }
@keyframes xpHop { 30% { transform: translateY(-10px) rotate(-6deg); } 60% { transform: translateY(0) rotate(4deg); } }
.xp-say { flex: 1; margin: 0; background: #fff; border: 2px solid var(--ink-strong); border-radius: 16px 16px 16px 4px; padding: 10px 14px; font-weight: 600; font-size: 16px; }
.xp-say.pop { animation: xpPop .35s ease-out both; }
.xp-ctrl { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.xp-btn { width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--ink-strong); background: #fff; font-weight: 700; cursor: pointer; font-size: 13px; }
.xp-play { background: #FFD54A; width: 48px; height: 48px; font-size: 16px; }
.xp-dots { display: flex; gap: 6px; margin-left: auto; }
.xp-dots span { width: 10px; height: 10px; border-radius: 50%; background: #fff; border: 2px solid var(--ink-strong); cursor: pointer; }
.xp-dots span.on { background: var(--ink-strong); }
@media (prefers-reduced-motion: reduce) { .xp *, .xp *::before { animation: none !important; } .xp-bar span { width: var(--w); } }

/* ---------- สรุปเนื้อหาแบบมีสีสัน ---------- */
.notes { border: 2px solid var(--ink-strong); box-shadow: 5px 5px 0 var(--ink-strong); border-radius: 20px; background: #fff; }
.notes .nb { border-radius: 14px; padding: 12px 14px 14px; margin-top: 12px; border-left: 6px solid; }
.notes .nb:nth-of-type(4n+1) { background: #EEF3FF; border-color: #5B8DEF; }
.notes .nb:nth-of-type(4n+2) { background: #FFF6D6; border-color: #F2B13A; }
.notes .nb:nth-of-type(4n+3) { background: #E8F8EF; border-color: #3BB27F; }
.notes .nb:nth-of-type(4n+4) { background: #FFEDF1; border-color: #FF7A9A; }
.notes .nb h3 { display: flex; gap: 8px; align-items: center; }
.notes .nb ul { list-style: none; padding-left: 0 !important; }
.notes .nb li { position: relative; padding-left: 26px; }
.notes .nb li::before { content: '✓'; position: absolute; left: 0; top: 0; width: 19px; height: 19px; border-radius: 50%; background: var(--ink-strong); color: #FFD54A; font-size: 12px; font-weight: 700; display: grid; place-items: center; }
.notes-head { display: flex; align-items: center; gap: 12px; }
.notes-head svg { flex: 0 0 auto; }

.admin-badge { position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px; background: #E2574C; color: #fff; font-size: 12px; font-weight: 700; display: grid; place-items: center; }

/* ---------- กระดาษทดแบบเขียนด้วยปากกา ---------- */
.spad { --pa: #4F6BED; position: fixed; z-index: 70; right: 12px; top: 84px; bottom: 12px; width: 400px; max-width: calc(100vw - 24px); display: flex; flex-direction: column; background: #fff; border: 1px solid #DCE2F0; border-radius: 20px; box-shadow: 0 24px 60px rgba(31,42,68,.18), 0 2px 6px rgba(31,42,68,.06); overflow: hidden; animation: spadIn .22s ease-out; }
@keyframes spadIn { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.spad.big { left: 12px; width: auto !important; top: 12px; height: auto !important; }
.spad-grip { position: absolute; left: 0; top: 0; bottom: 0; width: 14px; cursor: ew-resize; z-index: 2; touch-action: none; display: grid; place-items: center; }
.spad-grip span { width: 4px; height: 44px; border-radius: 4px; background: #CBD3E6; }
.spad-bar { display: flex; align-items: center; gap: 8px; padding: 10px 12px 10px 18px; background: linear-gradient(135deg, #F3F5FF, #EEF7F6); border-bottom: 1px solid #E3E8F4; }
.spad-title { flex: 1; font-size: 15px; color: #1F2A44; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.spad-page { font-weight: 600; color: var(--pa); }
.spad-tabs { display: flex; background: #E7EBF6; border-radius: 12px; padding: 3px; }
.spad-tabs button { border: 0; background: transparent; padding: 5px 10px; font-weight: 700; font-size: 13px; color: #55607A; border-radius: 9px; cursor: pointer; }
.spad-tabs button[aria-selected="true"] { background: #fff; color: #1F2A44; box-shadow: 0 1px 3px rgba(31,42,68,.15); }
.spad-ic { width: 34px; height: 34px; border-radius: 11px; border: 1px solid #DCE2F0; background: #fff; color: #55607A; font-weight: 700; cursor: pointer; }
.spad-tools { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 8px 12px 8px 18px; background: #FBFCFF; border-bottom: 1px solid #EEF1F8; }
.spad-t { min-width: 36px; height: 36px; border-radius: 11px; border: 1px solid #E1E6F2; background: #fff; cursor: pointer; font-size: 16px; color: #55607A; transition: background .15s, box-shadow .15s; }
.spad-t.on { background: #EEF1FF; border-color: var(--pa); box-shadow: inset 0 0 0 1px var(--pa); }
.spad-c { width: 26px; height: 26px; border-radius: 50%; border: 2px solid #fff; background: var(--c); box-shadow: 0 0 0 1px #DCE2F0; cursor: pointer; transition: transform .12s; }
.spad-c.on { transform: scale(1.12); box-shadow: 0 0 0 2px var(--c); }
.spad-sep { width: 1px; height: 22px; background: #E6EAF4; margin: 0 2px; }
.spad-size { display: flex; align-items: center; gap: 8px; padding: 0 8px; height: 36px; border: 1px solid #E1E6F2; border-radius: 11px; background: #fff; }
.spad-size input { width: 110px; accent-color: var(--pa); }
.spad-dot { display: inline-block; border-radius: 50%; border: 1px solid #C9D1E4; flex: 0 0 auto; }
.spad-num { font-size: 12px; color: #55607A; min-width: 22px; text-align: right; font-variant-numeric: tabular-nums; }
.spad-body { position: relative; flex: 1; min-height: 140px; background-color: #FFFFFF; }
.spad-body[data-paper="dots"] { background-image: radial-gradient(#C9D2E6 1.2px, transparent 1.3px); background-size: 22px 22px; }
.spad-body[data-paper="grid"] { background-image: linear-gradient(#EDF0F7 1px, transparent 1px), linear-gradient(90deg, #EDF0F7 1px, transparent 1px); background-size: 22px 22px; }
.spad-body[data-paper="lines"] { background-image: linear-gradient(transparent 27px, #E3E8F4 28px); background-size: 100% 28px; }
.spad-cv { position: absolute; inset: 0; touch-action: none; cursor: crosshair; }
.spad-text { position: absolute; inset: 0; width: 100%; border: 0; padding: 10px 14px 10px 18px; background: transparent; font: 17px/28px var(--font); color: #1F2A44; resize: none; outline: none; }
.spad-hint { padding: 6px 12px 6px 18px; color: #8390AA; background: #FBFCFF; border-top: 1px solid #EEF1F8; }
@media (min-width: 1200px) { body.spad-open main { padding-right: calc(var(--spad-w, 400px) + 24px); } }
@media (max-width: 900px) {
  .spad { top: auto; left: 8px; right: 8px; width: auto; max-width: none; height: 36vh; bottom: 8px; animation-name: spadUp; }
  .spad.big { top: 8px; }
  .spad-grip { left: 0; right: 0; top: 0; bottom: auto; width: auto; height: 16px; cursor: ns-resize; }
  .spad-grip span { width: 44px; height: 4px; }
  .spad-bar { padding-top: 16px; padding-left: 12px; }
  .spad-tools, .spad-hint { padding-left: 12px; }
  .spad-text { padding-left: 14px; }
  body.spad-open main { padding-bottom: calc(var(--spad-h, 36vh) + 24px); }
  @keyframes spadUp { from { transform: translateY(32px); opacity: 0; } to { transform: none; opacity: 1; } }
}

/* ---------- เขียนทับบนข้อสอบ ---------- */
.ink-host { position: relative; }
.ink-cv { position: absolute; left: 0; top: 0; width: 100%; pointer-events: none; z-index: 5; border-radius: inherit; }
.ink-cv.on { pointer-events: auto; touch-action: none; cursor: crosshair; }
body.ink-on .ink-host { outline: 2px dashed #9AA8F0; outline-offset: 4px; }
.ink-bar { position: fixed; z-index: 75; left: 50%; bottom: 16px; transform: translateX(-50%); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: center; max-width: calc(100vw - 24px); padding: 8px 10px; background: rgba(255,255,255,.96); backdrop-filter: blur(8px); border: 1px solid #DCE2F0; border-radius: 18px; box-shadow: 0 16px 40px rgba(31,42,68,.2); animation: inkUp .2s ease-out; }
.ink-t { min-width: 38px; height: 38px; border-radius: 12px; border: 1px solid #E1E6F2; background: #fff; font-size: 17px; cursor: pointer; }
.ink-t.on { background: #EEF1FF; border-color: #4F6BED; box-shadow: inset 0 0 0 1px #4F6BED; }
.ink-c { width: 26px; height: 26px; border-radius: 50%; border: 2px solid #fff; background: var(--c); box-shadow: 0 0 0 1px #DCE2F0; cursor: pointer; }
.ink-c.on { transform: scale(1.12); box-shadow: 0 0 0 2px var(--c); }
.ink-sep { width: 1px; height: 24px; background: #E6EAF4; }
.ink-size { display: flex; align-items: center; gap: 6px; height: 38px; padding: 0 8px; border: 1px solid #E1E6F2; border-radius: 12px; background: #fff; }
.ink-size input { width: 100px; accent-color: #4F6BED; }
.ink-size b { font-size: 12px; color: #55607A; min-width: 22px; font-variant-numeric: tabular-nums; }
.ink-done { height: 38px; padding: 0 14px; border: 0; border-radius: 12px; background: #4F6BED; color: #fff; font-weight: 700; cursor: pointer; }
body.ink-on main { padding-bottom: 110px; }
@keyframes inkUp { from { transform: translate(-50%, 24px); opacity: 0; } to { transform: translateX(-50%); opacity: 1; } }
.spad[hidden], .ink-bar[hidden] { display: none !important; }

/* ---------- ปุ่มเครื่องมือทำข้อสอบแบบเด่น ---------- */
.exam-tools .tool-big { position: relative; display: inline-flex; align-items: center; gap: 10px; padding: 9px 16px 9px 10px; border-radius: 14px; border: 1.5px solid transparent; text-align: left; box-shadow: 0 2px 8px rgba(31,42,68,.08); transition: transform .12s, box-shadow .12s; }
.exam-tools .tool-big:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(31,42,68,.12); }
.tool-big .ti { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; font-size: 19px; background: #fff; }
.tool-big .tx { display: flex; flex-direction: column; line-height: 1.2; }
.tool-big .tx b { font-size: 15px; }
.tool-big .tx small { font-size: 12px; font-weight: 500; opacity: .75; }
.tb-ink { background: #FFF1EE; color: #A3341F !important; border-color: #FFD3C8 !important; }
.tb-pad { background: #EEF1FF; color: #2A3EB1 !important; border-color: #D3DAFF !important; }
.tb-focus { background: #EAF7F2; color: #146B4D !important; border-color: #C5EBDC !important; }
.exam-tools .tool-big[aria-pressed="true"] { border-color: currentColor !important; box-shadow: 0 0 0 3px rgba(79,107,237,.15); }
.exam-tools .tool-big[aria-pressed="true"] .ti { background: currentColor; }
.exam-tools .tool-big[aria-pressed="true"] .ti { filter: none; color: #fff; }
.tool-big.is-new::after { content: 'ใหม่'; position: absolute; top: -8px; right: -6px; background: #E5484D; color: #fff; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 999px; animation: newPulse 1.6s ease-in-out infinite; }
@keyframes newPulse { 50% { transform: scale(1.12); } }
.font-tools { display: inline-flex; gap: 6px; margin-left: auto; }
@media (max-width: 640px) { .exam-tools .tool-big { flex: 1 1 calc(50% - 8px); padding-right: 10px; } .tool-big .tx small { display: none; } .font-tools { margin-left: 0; } }
.focus-dock { display: none; position: fixed; z-index: 72; right: 16px; bottom: 16px; flex-direction: column; gap: 8px; }
body.focus-mode .focus-dock { display: flex; }
body.focus-mode.ink-on .focus-dock, body.focus-mode.spad-open .focus-dock { display: none; }
.focus-dock button { display: flex; align-items: center; gap: 8px; padding: 10px 16px 10px 10px; border-radius: 16px; border: 1px solid #DCE2F0; background: rgba(255,255,255,.97); box-shadow: 0 10px 28px rgba(31,42,68,.18); font: inherit; font-weight: 700; font-size: 14px; color: #1F2A44; cursor: pointer; }
.focus-dock button span { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; background: #EEF1FF; }
.focus-dock #fd-ink span { background: #FFF1EE; }
.focus-dock #fd-exit { font-weight: 600; color: #55607A; }
.ink-tip { flex-basis: 100%; text-align: center; font-size: 12.5px; color: #55607A; order: -1; }
body.ink-on, body.pen-drawing, .spad { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
body.ink-on .ink-host::before { content: '✍️ โหมดเขียน · แตะตัวเลือกเพื่อตอบได้เลย'; position: absolute; top: -14px; left: 16px; z-index: 6; background: #4F6BED; color: #fff; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; }

/* ---------- ป้อบอัพสอนใช้งาน ---------- */
.coach { position: fixed; inset: 0; z-index: 120; background: rgba(23,32,51,.45); backdrop-filter: blur(3px); display: grid; place-items: center; padding: 16px; animation: coachFade .2s ease-out; }
@keyframes coachFade { from { opacity: 0; } }
.coach-card { width: min(440px, 100%); background: #fff; border-radius: 24px; overflow: hidden; box-shadow: 0 30px 80px rgba(23,32,51,.35); animation: coachPop .28s cubic-bezier(.2,.9,.3,1.2); }
@keyframes coachPop { from { transform: translateY(16px) scale(.96); opacity: 0; } }
.coach-stage { position: relative; height: 200px; background: linear-gradient(135deg, #EEF1FF, #EAF7F2); display: grid; place-items: center; overflow: hidden; }
.coach-body { padding: 18px 22px 20px; }
.coach-step { font-size: 12px; font-weight: 700; color: #4F6BED; }
.coach-body h3 { margin: 4px 0 6px; font-size: 20px; color: #1F2A44; }
.coach-body p { margin: 0; color: #55607A; line-height: 1.6; font-size: 15px; }
.coach-dots { display: flex; gap: 6px; justify-content: center; margin: 14px 0 12px; }
.coach-dots i { width: 7px; height: 7px; border-radius: 99px; background: #D5DBEA; transition: width .2s; }
.coach-dots i.on { width: 22px; background: #4F6BED; }
.coach-btns { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.coach-btns > div { display: flex; gap: 8px; }
.coach-btns button { font: inherit; font-weight: 700; border-radius: 12px; padding: 10px 16px; cursor: pointer; border: 1px solid #DCE2F0; background: #fff; color: #55607A; }
.coach-btns .coach-next { background: #4F6BED; border-color: #4F6BED; color: #fff; }
.coach-btns .coach-skip { border: 0; background: none; padding-left: 0; }
/* ฉากจำลอง */
.cs-card { width: 230px; padding: 14px; background: #fff; border-radius: 14px; box-shadow: 0 8px 24px rgba(31,42,68,.12); display: flex; flex-direction: column; gap: 7px; position: relative; }
.cs-l { display: block; height: 8px; border-radius: 4px; background: #CBD3E6; }
.cs-l.w80 { width: 80%; } .cs-l.w60 { width: 60%; }
.cs-ch { height: 24px; border: 1.5px solid #DCE2F0; border-radius: 8px; font-size: 12px; font-weight: 700; color: #8390AA; padding-left: 8px; display: flex; align-items: center; }
.cs-draw { position: absolute; left: 14px; top: 8px; width: 200px; height: 60px; fill: none; stroke: #E5484D; stroke-width: 3; stroke-linecap: round; }
.cs-draw path, .cs-draw ellipse { stroke-dasharray: 260; stroke-dashoffset: 260; animation: csDraw 3.2s ease-in-out infinite; }
.cs-draw ellipse { animation-delay: .9s; }
@keyframes csDraw { 0% { stroke-dashoffset: 260; } 45%, 85% { stroke-dashoffset: 0; } 100% { stroke-dashoffset: 0; opacity: 0; } }
.cs-pen { position: absolute; font-size: 26px; left: calc(50% - 100px); top: 54px; animation: csPen 3.2s ease-in-out infinite; }
@keyframes csPen { 0% { transform: translate(0,0); } 30% { transform: translate(130px,-4px); } 45% { transform: translate(40px,40px); } 70% { transform: translate(60px,48px); } 100% { transform: translate(0,0); } }
.cs-pick { animation: csPick 2.4s ease-in-out infinite; }
@keyframes csPick { 0%, 40% { background: #fff; border-color: #DCE2F0; color: #8390AA; } 50%, 90% { background: #EAF0FF; border-color: #2F6FED; color: #2F6FED; } 100% { background: #fff; } }
.cs-tap { position: absolute; width: 26px; height: 26px; border-radius: 50%; background: rgba(79,107,237,.35); border: 2px solid #4F6BED; left: calc(50% + 10px); top: 104px; animation: csTap 2.4s ease-in-out infinite; }
@keyframes csTap { 0% { transform: translate(40px,40px) scale(1); opacity: 0; } 25% { opacity: 1; transform: translate(0,0) scale(1); } 40% { transform: scale(.7); } 50% { transform: scale(1.5); opacity: 0; } 100% { opacity: 0; } }
.cs-scroll { animation: csScroll 2.6s ease-in-out infinite; }
@keyframes csScroll { 0%, 20% { transform: translateY(20px); } 70%, 100% { transform: translateY(-30px); } }
.cs-two { position: absolute; left: calc(50% + 70px); top: 120px; display: flex; gap: 10px; animation: csTwo 2.6s ease-in-out infinite; }
.cs-two b { width: 24px; height: 24px; border-radius: 50%; background: rgba(229,72,77,.3); border: 2px solid #E5484D; }
@keyframes csTwo { 0%, 20% { transform: translateY(20px); opacity: .9; } 70% { transform: translateY(-40px); opacity: .9; } 100% { transform: translateY(-40px); opacity: 0; } }
.cs-bar { display: flex; align-items: center; gap: 6px; background: #fff; padding: 8px; border-radius: 14px; box-shadow: 0 8px 24px rgba(31,42,68,.14); }
.cs-bar span { width: 30px; height: 30px; border: 1px solid #E1E6F2; border-radius: 9px; display: grid; place-items: center; font-size: 15px; }
.cs-bar i { width: 18px; height: 18px; border-radius: 50%; background: var(--c); }
.cs-bar em { font-style: normal; font-size: 12px; font-weight: 700; color: #fff; background: #4F6BED; border-radius: 9px; padding: 8px 10px; }
.cs-tap2 { left: calc(50% + 92px); top: 92px; }
.cs-page { width: 250px; height: 170px; background: #fff; border-radius: 14px; box-shadow: 0 8px 24px rgba(31,42,68,.12); position: relative; overflow: hidden; }
.cs-q { padding: 14px; display: flex; flex-direction: column; gap: 7px; }
.cs-pad { position: absolute; left: 6px; right: 6px; bottom: 6px; background: #FBFCFF; border: 1px solid #DCE2F0; border-radius: 12px; background-image: radial-gradient(#C9D2E6 1px, transparent 1.2px); background-size: 12px 12px; }
.cs-grow { animation: csGrow 2.8s ease-in-out infinite; }
@keyframes csGrow { 0%, 15% { height: 60px; } 55%, 85% { height: 120px; } 100% { height: 60px; } }
.cs-grip { position: absolute; top: 4px; left: 50%; width: 34px; height: 4px; margin-left: -17px; border-radius: 4px; background: #4F6BED; box-shadow: 0 0 0 6px rgba(79,107,237,.18); }
.cs-pad svg { position: absolute; left: 10px; bottom: 6px; width: 200px; height: 40px; fill: none; stroke: #1F2A44; stroke-width: 2.5; stroke-linecap: round; }
.cs-slider { position: absolute; top: 42px; display: flex; align-items: center; gap: 10px; background: #fff; padding: 8px 12px; border-radius: 12px; box-shadow: 0 6px 18px rgba(31,42,68,.12); }
.cs-dot { width: 8px; height: 8px; border-radius: 50%; background: #1F2A44; animation: csDot 2.6s ease-in-out infinite; }
@keyframes csDot { 50% { width: 20px; height: 20px; } }
.cs-track { width: 130px; height: 6px; border-radius: 6px; background: #DCE2F0; position: relative; }
.cs-track b { position: absolute; top: -6px; width: 18px; height: 18px; border-radius: 50%; background: #4F6BED; animation: csKnob 2.6s ease-in-out infinite; }
@keyframes csKnob { 0% { left: 4px; } 50% { left: 108px; } 100% { left: 4px; } }
.cs-thick { position: absolute; bottom: 36px; width: 200px; height: 40px; fill: none; stroke: #1F2A44; stroke-linecap: round; animation: csThick 2.6s ease-in-out infinite; }
@keyframes csThick { 0% { stroke-width: 2; } 50% { stroke-width: 9; } 100% { stroke-width: 2; } }
.cs-flip { position: relative; width: 170px; height: 130px; perspective: 600px; }
.cs-sheet { position: absolute; inset: 0; background: #fff; border-radius: 12px; box-shadow: 0 8px 24px rgba(31,42,68,.12); padding: 10px 12px; font-weight: 700; color: #4F6BED; font-size: 14px; backface-visibility: hidden; }
.cs-sheet svg { display: block; width: 120px; height: 40px; margin-top: 18px; fill: none; stroke: #1F2A44; stroke-width: 2.5; stroke-linecap: round; }
.cs-sheet.a { animation: csFlipA 3.4s ease-in-out infinite; }
.cs-sheet.b { animation: csFlipB 3.4s ease-in-out infinite; }
@keyframes csFlipA { 0%, 30% { transform: rotateY(0); } 45%, 80% { transform: rotateY(-180deg); } 95%, 100% { transform: rotateY(0); } }
@keyframes csFlipB { 0%, 30% { transform: rotateY(180deg); } 45%, 80% { transform: rotateY(0); } 95%, 100% { transform: rotateY(180deg); } }
@media (prefers-reduced-motion: reduce) { .coach-stage * { animation: none !important; } .cs-draw path, .cs-draw ellipse { stroke-dashoffset: 0; } }
