/* Tutor High Q — extra: PDF/print, challenge game-show, gachapon, chapter games, decoration */

/* ================= PDF / print dialog ================= */
.dlg .box.pdbox{max-width:520px}
.pdl{display:block;font-family:var(--font-d);font-weight:500;font-size:14.5px;color:var(--ink-soft);margin:14px 0 2px}
.dlg select{width:100%;font:inherit;padding:10px 12px;border-radius:12px;border:2px solid var(--line);background:#fff;margin-top:6px;color:var(--ink)}
.pdck{display:grid;grid-template-columns:1fr 1fr;gap:6px 14px;margin-top:6px}
.pdck label{display:flex;gap:8px;align-items:center;font-size:15.5px}
.pdck input{width:20px;height:20px;accent-color:var(--ink)}

/* ================= print preview (screen) ================= */
body.has-print{overflow:hidden}
#printdoc{position:fixed;inset:0;z-index:300;background:#52627f;overflow:auto;-webkit-overflow-scrolling:touch;padding-bottom:40px;
  --pink:#10244A;--pgold:#F4B71C}
.pdtb{position:sticky;top:0;z-index:5;display:flex;gap:10px;align-items:center;flex-wrap:wrap;background:var(--ink);padding:10px 16px;padding-top:calc(10px + env(safe-area-inset-top));box-shadow:0 2px 0 rgba(0,0,0,.25)}
.pdtb .tip{color:#cdd7ea;font-size:13.5px;line-height:1.4;flex:1;min-width:220px}
.pdsheet{width:210mm;max-width:calc(100% - 16px);margin:18px auto;background:#fff;box-shadow:0 10px 40px rgba(0,0,0,.4);background-image:var(--wm);background-repeat:repeat}
.pdt{width:100%;border-collapse:collapse;table-layout:fixed}
.pdt td{padding:0;vertical-align:top}
td.ph{padding:9mm 12mm 0}
td.pft{padding:0 12mm 6mm}
td.pc{padding:0 12mm;font-family:Sarabun,Prompt,sans-serif;font-size:11.5pt;line-height:1.55;color:#10244A}
.pdt tbody tr:first-child td.pc{padding-top:5mm}
.pdt tbody tr:last-child td.pc{padding-bottom:5mm}

/* header */
.phead{display:flex;align-items:center;gap:3.5mm;padding-bottom:3mm;border-bottom:.9mm solid #10244A;position:relative}
.phead::after{content:"";position:absolute;left:0;bottom:-1.9mm;width:28mm;height:.9mm;background:#F4B71C}
.phead img{width:11mm;height:11mm;border-radius:2.4mm;flex:none}
.pbrand{display:flex;flex-direction:column;line-height:1.25}
.pbrand b{font-family:Prompt,Sarabun,sans-serif;font-weight:600;font-size:11pt;color:#10244A}
.pbrand span{font-size:8pt;color:#4A5F82}
.phead .pdti{margin-left:auto;text-align:right;display:flex;flex-direction:column;line-height:1.25;max-width:90mm}
.phead .pdti b{font-family:Prompt,Sarabun,sans-serif;font-weight:600;font-size:11pt;color:#10244A}
.phead .pdti span{font-size:8.5pt;color:#4A5F82}
.pname{display:grid;grid-template-columns:auto 1fr auto auto auto auto;gap:0 2.5mm;align-items:end;margin-top:4.5mm;font-size:9.5pt;color:#4A5F82}
.pname span{font-family:Prompt,Sarabun,sans-serif;font-weight:500;white-space:nowrap}
.pname b{font-family:Prompt,Sarabun,sans-serif;font-weight:600;color:#10244A;border-bottom:.3mm dotted #10244A;min-height:6.5mm;padding:0 1mm;white-space:nowrap}
.pname b.mono{font-family:ui-monospace,Menlo,monospace;font-size:8.5pt;font-weight:500;padding-top:.6mm}
.pname b:nth-child(2){min-width:60mm}
.pname b:nth-child(4){min-width:22mm;border-bottom-style:solid;border-bottom-color:#B7C4D8}
.pname b:nth-child(6){border-bottom-style:solid;border-bottom-color:#B7C4D8}

/* footer */
.pfix{display:none}
.pfix .pfoot{margin:0}
.pfoot{border-top:.3mm solid #B7C4D8;padding-top:2mm;font-size:7.4pt;line-height:1.4;color:#4A5F82;text-align:center}
.pfoot .pf2{margin-top:.6mm}
.pfoot .pf2 b{color:#10244A;font-weight:600}

/* title block */
.ptitle{position:relative;margin:2mm 0 4mm;padding:3.5mm 4mm 3.5mm 7mm;border-radius:2.5mm;background:#EEF3FB;border:.3mm solid #C8D6EC;overflow:hidden}
.ptitle::before{content:"";position:absolute;left:0;top:0;bottom:0;width:2.6mm;background:linear-gradient(#10244A,#10244A 60%,#F4B71C 60%)}
.ptitle::after{content:"∑ ∫ π √";position:absolute;right:3mm;top:1.5mm;font-family:Prompt,sans-serif;font-weight:600;font-size:15pt;letter-spacing:2mm;color:#10244A;opacity:.07}
.ptitle .tg{display:inline-block;font-family:Prompt,Sarabun,sans-serif;font-weight:600;font-size:8.5pt;color:#fff;background:#10244A;padding:.2mm 2.6mm;border-radius:99px}
.ptitle h2{font-family:Prompt,Sarabun,sans-serif;font-weight:600;font-size:15pt;line-height:1.3;margin:1.5mm 0 0;color:#10244A}
.ptitle p{margin:.5mm 0 0;font-size:9.5pt;color:#4A5F82}
.psec{margin:3mm 0 2mm;padding:2mm 3.5mm;border-radius:2mm;background:#10244A;color:#fff}
.psec h3{font-family:Prompt,Sarabun,sans-serif;font-weight:600;font-size:11.5pt;color:#fff;margin:0}
.psec p{margin:.4mm 0 0;font-size:9pt;color:#cdd7ea}

/* cover */
.pcover{position:relative;min-height:190mm;display:flex;flex-direction:column;justify-content:center;padding:12mm 4mm;
  background:linear-gradient(#e6edf8 1px,transparent 1px) 0 0/6mm 6mm,linear-gradient(90deg,#e6edf8 1px,transparent 1px) 0 0/6mm 6mm}
.pcover .tg{align-self:flex-start;font-family:Prompt,sans-serif;font-weight:600;font-size:10pt;color:#fff;background:#10244A;padding:.5mm 4mm;border-radius:99px}
.pcover .glyph{font-family:Prompt,sans-serif;font-weight:700;font-size:80pt;line-height:1.1;color:#10244A;opacity:.12;margin:6mm 0 -14mm}
.pcover h2{font-family:Prompt,sans-serif;font-weight:500;font-size:18pt;color:#4A5F82}
.pcover h1{font-family:Prompt,sans-serif;font-weight:700;font-size:30pt;line-height:1.2;color:#10244A;margin:1mm 0 3mm;border-bottom:1.2mm solid #F4B71C;padding-bottom:3mm}
.pcover p{font-size:12pt;color:#4A5F82;margin:0 0 6mm}
.pcover .ptoc{margin:2mm 0 0;padding:0;list-style:none;columns:1;font-size:11pt}
.pcover .ptoc li{padding:1.4mm 0;border-bottom:.25mm dotted #9FB0CB}
.pcover .ptoc b{font-family:Prompt,sans-serif;font-weight:600;color:#10244A;margin-right:2mm}
.pcover.mini{min-height:0;padding:4mm;margin-bottom:3mm;border:.4mm solid #C8D6EC;border-radius:3mm}
.pcover.mini h2{font-size:17pt;font-weight:700;color:#10244A}
.pcover.mini p{margin:1mm 0 0}

/* question */
.pq{display:grid;grid-template-columns:9mm 1fr;gap:0 2.5mm;margin:0 0 3mm;padding:3mm 0 0;border-top:.25mm dashed #C0CCE0}
.pdt tbody tr:first-child .pq{border-top:0}
.pqh{display:flex;flex-direction:column;align-items:center;gap:1.4mm}
.pq .no{width:8.6mm;height:8.6mm;border-radius:50%;background:#10244A;color:#fff;font-family:Prompt,sans-serif;font-weight:600;font-size:10.5pt;display:grid;place-items:center;flex:none}
.plv{font-family:Prompt,sans-serif;font-size:6.5pt;font-weight:600;padding:.1mm 1.6mm;border-radius:99px;border:.25mm solid}
.plv.e{color:#157A47;border-color:#157A47}.plv.m{color:#C98E00;border-color:#C98E00}.plv.h{color:#B53A28;border-color:#B53A28}
.pqt p{margin:0 0 1.2mm}
.pqt .katex{font-size:1.04em}
.pqt .katex-display{margin:2mm 0}
.pch{display:grid;grid-template-columns:1fr 1fr;gap:1.2mm 6mm;margin-top:2mm}
.pch.col{grid-template-columns:1fr}
.pch div{display:flex;gap:2mm;align-items:baseline;break-inside:avoid}
.pch b{font-family:Prompt,sans-serif;font-weight:600;color:#10244A;min-width:5mm}
.pnum{margin-top:2.5mm;font-family:Prompt,sans-serif;font-weight:500;font-size:10.5pt;color:#4A5F82;display:flex;align-items:flex-end;gap:2mm}
.pnum i{display:inline-block;width:46mm;border-bottom:.35mm solid #10244A;height:6mm}
.work{margin-top:2.5mm;position:relative;border:.3mm dashed #A9B8D2;border-radius:2mm;background-image:radial-gradient(#C3CFE2 .26mm,transparent .3mm);background-size:5mm 5mm;background-position:2.5mm 2.5mm}
.work span{position:absolute;right:2mm;top:.8mm;font-size:7pt;color:#9AA9C2;font-family:Prompt,sans-serif}
.pq figure.fig{margin:2mm 0}.pq figure.fig svg{max-width:62mm;height:auto}
.pq img.fi{max-width:70mm}

/* answer keys */
.pkey{width:100%;border-collapse:collapse;margin:1mm 0 3mm;table-layout:fixed;font-size:10pt}
.pkey td{border:.25mm solid #C8D6EC;padding:1.2mm 2mm;text-align:center}
.pkey td:nth-child(odd){background:#EEF3FB;font-family:Prompt,sans-serif;font-weight:600;width:8%}
.psol{margin:0 0 3mm;padding:2.5mm 3mm;border:.3mm solid #D3DEEB;border-left:1.6mm solid #1C9F5E;border-radius:2mm;background:#FAFCFE}
.psh{display:flex;gap:3mm;align-items:center;font-family:Prompt,sans-serif;margin-bottom:1mm}
.psh .no{width:7mm;height:7mm;border-radius:50%;background:#1C9F5E;color:#fff;display:grid;place-items:center;font-weight:600;font-size:9.5pt}
.psol .md{font-size:10.5pt;line-height:1.5}
.plines i{display:block;height:8.2mm;border-bottom:.3mm solid #B7C4D8}

/* lesson content inside print */
.pc.md h4{font-size:13pt;margin:5mm 0 1.5mm;padding-top:0}
.pc.md h4::before{height:5mm;width:1.4mm}
.pc.md h5{font-size:11.5pt;margin:3mm 0 1mm}
.pc.md p{margin:1.6mm 0}
.pc.md ul,.pc.md ol{margin:1.4mm 0 2.4mm}
.pc.md table{display:table;font-size:10pt;margin:2.5mm auto;overflow:visible}
.pc.md th,.pc.md td{padding:1mm 3mm}
.pc.md .co{margin:3mm 0;padding:2.5mm 3.5mm 2mm;border-width:.4mm;border-radius:2.5mm}
.pc.md .co>.ct{font-size:10.5pt}
.pc.md .katex-display{margin:2mm 0;overflow:visible}
.pc.md figure.fig{margin:2.5mm auto}
.pc.md figure.fig svg{max-width:96mm;height:auto}
.pc.md img.fi{max-width:96mm}

/* ================= actual print ================= */
@page{size:A4;margin:0 0 9mm 0;@bottom-right{content:"หน้า " counter(page) " / " counter(pages);font-family:Prompt,sans-serif;font-size:8pt;color:#4A5F82;padding-right:12mm;vertical-align:top;padding-top:.5mm}}
@media print{
  html,body{background:#fff!important;background-image:none!important;overflow:visible!important;height:auto!important}
  body.has-print>*:not(#printdoc){display:none!important}
  body.has-print{overflow:visible}
  #printdoc{position:static!important;inset:auto;background:#fff;overflow:visible;padding:0;z-index:auto}
  .pdtb{display:none!important}
  .pdsheet{width:auto!important;max-width:none!important;margin:0!important;box-shadow:none!important}
  .pfix{display:block;position:fixed;left:12mm;right:12mm;bottom:0;z-index:2;background:#fff}
  .pdt tfoot .pfoot{visibility:hidden}
  .pdt thead{display:table-header-group}
  .pdt tfoot{display:table-footer-group}
  .pdt tbody tr{break-inside:avoid}
  .pdt tbody tr.brk{break-before:page}
  .pdt tbody tr.cover{break-after:page}
  .ptitle,.psec,h4,.pc.md h4,h5{break-after:avoid}
  *{-webkit-print-color-adjust:exact;print-color-adjust:exact}
  .pc.md .co{break-inside:avoid}
}
@media (max-width:830px) and (not print){
  td.ph{padding:14px 14px 0}td.pft{padding:0 14px 12px}td.pc{padding:0 14px;font-size:15px}
  .pname{grid-template-columns:auto 1fr;row-gap:6px}.pname b:nth-child(2){min-width:0}
  .phead{flex-wrap:wrap}.phead .pdti{margin-left:0;max-width:none;text-align:left;width:100%}
}

/* ================= ชาเลนจ์ เกมโชว์ ================= */
:root{--gs-gold:#F4B71C;--gs-gold2:#FFD966;--gs-cy:#5BE3FF;--gs-ok:#22D083;--gs-bad:#FF4D61;--cut:22px}
.gs-stage{position:relative;overflow:hidden;color:#fff;isolation:isolate;min-height:calc(100vh - 64px);padding:20px clamp(12px,3vw,34px) 34px;
  background:radial-gradient(120% 85% at 50% -12%,#32309C 0%,#171A64 36%,#080F2A 78%)}
.gs-stage::before{content:"";position:absolute;inset:0;z-index:-1;background:radial-gradient(rgba(255,255,255,.07) 1.2px,transparent 1.6px) 0 0/26px 26px;mask-image:linear-gradient(#000 0%,transparent 85%);-webkit-mask-image:linear-gradient(#000 0%,transparent 85%)}
.gs-bg{position:absolute;inset:0;z-index:-1;pointer-events:none;overflow:hidden}
.gs-beam{position:absolute;top:-8%;width:46vmax;height:130%;background:linear-gradient(180deg,rgba(130,170,255,.30),rgba(130,170,255,.04) 70%,transparent);clip-path:polygon(47% 0,53% 0,100% 100%,0 100%);transform-origin:50% 0;opacity:.55;mix-blend-mode:screen}
.gs-beam.b1{left:-8%;animation:gsSweep 9s ease-in-out infinite alternate}
.gs-beam.b2{right:-8%;animation:gsSweep 11s ease-in-out -4s infinite alternate-reverse;background:linear-gradient(180deg,rgba(255,200,90,.26),rgba(255,200,90,.03) 70%,transparent)}
.gs-beam.b3{left:30%;width:34vmax;animation:gsSweep 13s ease-in-out -2s infinite alternate;opacity:.3}
@keyframes gsSweep{from{transform:rotate(-24deg)}to{transform:rotate(24deg)}}
.gs-sym{position:absolute;font-family:Prompt,Georgia,serif;font-weight:600;color:#fff;opacity:.07;line-height:1;animation:gsFloat 14s ease-in-out infinite alternate}
.gs-sym.s0{left:4%;top:12%;font-size:120px}.gs-sym.s1{left:84%;top:8%;font-size:150px;animation-delay:-3s}.gs-sym.s2{left:12%;top:68%;font-size:140px;animation-delay:-6s}.gs-sym.s3{left:88%;top:62%;font-size:130px;animation-delay:-2s}
.gs-sym.s4{left:46%;top:84%;font-size:110px;animation-delay:-8s}.gs-sym.s5{left:70%;top:30%;font-size:90px;animation-delay:-5s}.gs-sym.s6{left:24%;top:30%;font-size:80px;animation-delay:-9s}.gs-sym.s7{left:60%;top:76%;font-size:100px;animation-delay:-1s}.gs-sym.s8{left:2%;top:44%;font-size:90px;animation-delay:-7s}.gs-sym.s9{left:94%;top:40%;font-size:80px;animation-delay:-4s}
@keyframes gsFloat{from{transform:translateY(-10px) rotate(-6deg)}to{transform:translateY(14px) rotate(6deg)}}

/* intro */
.gs-intro{max-width:880px;margin:0 auto;text-align:center;padding-top:clamp(4px,3vw,26px)}
.gs-kick{display:inline-flex;align-items:center;gap:8px;font-family:var(--font-d);font-weight:600;font-size:15px;color:#101F44;background:linear-gradient(90deg,var(--gs-gold),var(--gs-gold2));padding:6px 18px;border-radius:99px;box-shadow:0 0 0 3px rgba(244,183,28,.25),0 0 26px rgba(244,183,28,.45)}
.gs-title h1{font-family:Prompt,sans-serif;font-weight:700;color:#fff;font-size:clamp(40px,8vw,86px);line-height:1.08;margin:16px 0 8px;letter-spacing:-.5px;text-shadow:0 4px 0 rgba(0,0,0,.35),0 0 40px rgba(110,140,255,.5)}
.gs-title h1 b{color:var(--gs-gold);font-size:1.28em;padding:0 .08em;text-shadow:0 4px 0 #8a5e00,0 0 36px rgba(244,183,28,.8);display:inline-block;transform:translateY(.04em)}
.gs-sub{margin:0 auto;max-width:34em;font-size:clamp(16px,2.2vw,20px);color:#C9D6FF}
.gs-rules{display:grid;grid-template-columns:repeat(3,1fr);gap:14px;margin:30px 0 22px;text-align:left}
.gs-rules>div{background:rgba(255,255,255,.07);border:1px solid rgba(255,255,255,.16);border-radius:18px;padding:16px 16px 14px;backdrop-filter:blur(3px)}
.gs-rules i{display:grid;place-items:center;width:42px;height:42px;border-radius:12px;background:rgba(244,183,28,.18);color:var(--gs-gold);margin-bottom:8px}
.gs-rules i svg{width:24px;height:24px}.gs-rules i.hr{background:rgba(255,77,97,.2);color:#FF6B7C}
.gs-rules b{display:block;font-family:var(--font-d);font-weight:600;font-size:17px;margin-bottom:2px}
.gs-rules span{font-size:14.5px;color:#BCCBF5;line-height:1.5}
.gs-setup{display:grid;grid-template-columns:1fr 1fr;gap:12px;text-align:left;max-width:760px;margin:0 auto}
.gs-setup label{display:block}.gs-setup label[hidden]{display:none}
.gs-setup label span{display:block;font-family:var(--font-d);font-size:14px;color:#BCCBF5;margin-bottom:4px}
.gs-setup select{width:100%;font:inherit;font-size:16px;color:#fff;background:rgba(8,15,42,.7);border:2px solid rgba(255,255,255,.2);border-radius:12px;padding:11px 12px}
.gs-setup select option{color:#10244A;background:#fff}
.gs-cta{display:flex;gap:14px;align-items:center;justify-content:center;margin:26px 0 12px;flex-wrap:wrap}
.gs-go{--c:18px;font-family:Prompt,sans-serif;font-weight:700;font-size:clamp(20px,3vw,28px);color:#101F44;border:0;cursor:pointer;display:inline-flex;align-items:center;gap:12px;padding:16px 46px;min-height:66px;
  background:linear-gradient(180deg,#FFE08A,#F4B71C 55%,#D99A00);clip-path:polygon(var(--c) 0,calc(100% - var(--c)) 0,100% 50%,calc(100% - var(--c)) 100%,var(--c) 100%,0 50%);filter:drop-shadow(0 0 18px rgba(244,183,28,.65));animation:gsGlow 1.8s ease-in-out infinite}
.gs-go svg{width:26px;height:26px}.gs-go:active{transform:scale(.97)}.gs-go[disabled]{opacity:.6;animation:none}
@keyframes gsGlow{50%{filter:drop-shadow(0 0 30px rgba(244,183,28,.95))}}
.gs-snd,.gs-ic{display:grid;place-items:center;width:46px;height:46px;border-radius:50%;border:2px solid rgba(255,255,255,.28);background:rgba(255,255,255,.08);color:#fff;cursor:pointer;text-decoration:none}
.gs-snd svg,.gs-ic svg{width:22px;height:22px}.gs-ic[data-off="1"]{opacity:.45}
.gs-best{color:#9FB2E8;font-size:15px;margin:0}.gs-best b{color:var(--gs-gold)}

/* countdown */
.gs-count{min-height:60vh;display:grid;place-content:center;text-align:center}
.gs-cn{font-family:Prompt,sans-serif;font-weight:700;font-size:min(34vw,260px);line-height:1;color:var(--gs-gold);text-shadow:0 6px 0 #8a5e00,0 0 60px rgba(244,183,28,.8);animation:gsPop .8s ease-out}
.gs-cn.pop{animation:gsPop .8s ease-out}.gs-cn.go{font-size:min(20vw,150px);color:#fff;text-shadow:0 0 50px var(--gs-cy)}
.gs-count p{margin:0;color:#9FB2E8;font-size:20px}
@keyframes gsPop{0%{transform:scale(.4);opacity:0}25%{transform:scale(1.15);opacity:1}100%{transform:scale(1)}}

/* play */
.gs-play{max-width:1120px;margin:0 auto}
.gs-top{display:grid;grid-template-columns:1fr auto 1fr;align-items:center;gap:12px;margin-bottom:14px}
.gs-id{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.gs-rd{font-family:Prompt,sans-serif;font-weight:600;font-size:18px;background:rgba(255,255,255,.1);border-radius:99px;padding:5px 16px}.gs-rd b{color:var(--gs-gold);font-size:1.25em}
.gs-tag{font-size:14px;color:#CFE0FF;border:1px solid rgba(255,255,255,.25);border-radius:99px;padding:3px 12px}
.gs-lv{font-family:Prompt,sans-serif;font-weight:600;font-size:13.5px;border-radius:99px;padding:3px 12px;color:#101F44}.gs-lv.l1{background:#7BE8B0}.gs-lv.l2{background:var(--gs-gold)}.gs-lv.l3{background:#FF8A8A}
.gs-timer{position:relative;width:96px;height:96px}
.gs-timer svg{width:100%;height:100%;transform:rotate(-90deg);overflow:visible}
.gs-timer circle{fill:rgba(8,15,42,.7);stroke-width:8}.gs-timer .bg{stroke:rgba(255,255,255,.16)}
.gs-timer .fg{fill:none;stroke:var(--gs-cy);stroke-linecap:round;transition:stroke-dashoffset .12s linear,stroke .3s;filter:drop-shadow(0 0 5px rgba(91,227,255,.7))}
.gs-timer.mid .fg{stroke:var(--gs-gold)}.gs-timer.low .fg{stroke:var(--gs-bad);filter:drop-shadow(0 0 7px rgba(255,77,97,.9))}
.gs-timer b{position:absolute;inset:0;display:grid;place-items:center;font-family:Prompt,sans-serif;font-weight:700;font-size:34px;font-variant-numeric:tabular-nums}
.gs-timer.low{animation:gsThrob .5s ease-in-out infinite alternate}.gs-timer.low b{color:#FF8A96}
@keyframes gsThrob{to{transform:scale(1.07)}}
.gs-tools{display:flex;gap:8px;justify-content:flex-end;align-items:center}
.gs-hearts{display:flex;gap:4px;margin-right:6px}
.gs-hearts i{display:block;width:30px;height:30px}.gs-heart{width:100%;height:100%;fill:rgba(255,255,255,.14);stroke:rgba(255,255,255,.3);stroke-width:1.4}
.gs-hearts i.on .gs-heart{fill:#FF4D61;stroke:#FFB3BB;filter:drop-shadow(0 0 6px rgba(255,77,97,.7))}
.gs-main{display:grid;grid-template-columns:minmax(0,1fr) 92px;gap:18px;align-items:start}
.gs-board{position:relative;border-radius:22px;transition:box-shadow .3s}
.gs-board.is-ok{animation:gsOk .9s ease-out}.gs-board.is-bad{animation:gsShake .5s}
@keyframes gsOk{0%{box-shadow:0 0 0 0 rgba(34,208,131,.7)}100%{box-shadow:0 0 0 38px rgba(34,208,131,0)}}
@keyframes gsShake{20%,60%{transform:translateX(-8px)}40%,80%{transform:translateX(8px)}}
.gs-q{position:relative;margin:12px 6px 22px;padding:clamp(18px,3vw,30px) clamp(18px,3.5vw,40px);min-height:150px;display:grid;align-items:center;
  background:linear-gradient(180deg,#1C2C86,#0F1A5A);border-radius:26px;box-shadow:0 10px 30px rgba(0,0,0,.35),inset 0 0 0 2px rgba(255,255,255,.12)}
.gs-q::before{content:"";position:absolute;inset:-9px;border-radius:34px;border:6px dotted var(--gs-gold);pointer-events:none;animation:gsBulb 1.1s steps(1) infinite}
@keyframes gsBulb{0%{border-color:var(--gs-gold)}50%{border-color:#FFF3C4}}
.gs-qt{font-family:Prompt,Sarabun,sans-serif;font-weight:500;font-size:clamp(19px,2.5vw,28px);line-height:1.55;text-align:center}
.gs-qt p{margin:6px 0}.gs-qt .katex{font-size:1.14em}.gs-qt .katex-display{margin:10px 0;overflow-x:auto;overflow-y:hidden}
.gs-opts{display:grid;grid-template-columns:1fr 1fr;gap:14px 20px;margin:0 4px}
.gs-opt{--c:26px;position:relative;border:0;padding:0;background:linear-gradient(180deg,#5C79FF,#2B3FB8);cursor:pointer;color:#fff;
  clip-path:polygon(var(--c) 0,calc(100% - var(--c)) 0,100% 50%,calc(100% - var(--c)) 100%,var(--c) 100%,0 50%);transition:transform .12s,filter .2s;min-height:78px;text-align:left}
.gs-opt .in{position:absolute;inset:3px;display:flex;align-items:center;gap:14px;padding:6px calc(var(--c) + 8px);background:linear-gradient(180deg,#14206F,#0B1448);
  clip-path:polygon(var(--c) 0,calc(100% - var(--c)) 0,100% 50%,calc(100% - var(--c)) 100%,var(--c) 100%,0 50%)}
.gs-opt:not(:disabled):active{transform:scale(.985)}
.gs-opt .k{flex:none;width:36px;height:36px;border-radius:50%;display:grid;place-items:center;font-family:Prompt,sans-serif;font-weight:700;font-size:18px;color:#101F44;background:var(--gs-gold)}
.gs-opt .tx{flex:1;font-family:Prompt,Sarabun,sans-serif;font-weight:500;font-size:clamp(18px,2.3vw,25px);line-height:1.3;overflow-wrap:anywhere}
.gs-opt .tx .katex{font-size:1.1em}
.gs-opt.sel{background:linear-gradient(180deg,#FFE08A,#F4B71C);filter:drop-shadow(0 0 14px rgba(244,183,28,.8))}
.gs-opt.sel .in{background:linear-gradient(180deg,#8A6200,#5E4300)}.gs-opt.sel .k{background:#fff}
.gs-opt.lockedsel{animation:gsBlink .24s steps(1) infinite}
@keyframes gsBlink{50%{filter:brightness(1.6)}}
.gs-opt.ok{background:linear-gradient(180deg,#7DF2B8,#16B56A);filter:drop-shadow(0 0 18px rgba(34,208,131,.9));animation:none}.gs-opt.ok .in{background:linear-gradient(180deg,#0E8F52,#0A6B3C)}.gs-opt.ok .k{background:#fff;color:#0A6B3C}
.gs-opt.bad{background:linear-gradient(180deg,#FF8E9B,#D82E46);animation:none}.gs-opt.bad .in{background:linear-gradient(180deg,#B3283C,#7C1727)}.gs-opt.bad .k{background:#fff;color:#B3283C}
.gs-opt.dim{opacity:.42}.gs-opt.gone{visibility:hidden}
.gs-foot{display:flex;gap:14px;align-items:center;justify-content:space-between;flex-wrap:wrap;margin:20px 4px 0}
.gs-life{display:flex;gap:10px}
.gs-lf{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1px;width:96px;height:68px;border-radius:16px;border:2px solid rgba(255,255,255,.28);background:rgba(255,255,255,.08);color:#fff;cursor:pointer;font-family:var(--font-d)}
.gs-lf b{font-size:20px;font-weight:700;color:var(--gs-gold);line-height:1.1}.gs-lf svg{width:22px;height:22px;color:var(--gs-gold)}.gs-lf span{font-size:12.5px;color:#CFE0FF}
.gs-lf i{position:absolute;top:-8px;right:-8px;width:22px;height:22px;border-radius:50%;background:var(--gs-cy);color:#07204A;font-style:normal;font-weight:700;font-size:13px;display:grid;place-items:center}
.gs-lf:disabled{opacity:.35;cursor:default}
.gs-lock{--c:16px;font-family:Prompt,sans-serif;font-weight:700;font-size:21px;color:#101F44;border:0;cursor:pointer;display:inline-flex;align-items:center;gap:10px;padding:14px 38px;min-height:60px;background:linear-gradient(180deg,#FFE08A,#F4B71C 60%,#D99A00);
  clip-path:polygon(var(--c) 0,calc(100% - var(--c)) 0,100% 50%,calc(100% - var(--c)) 100%,var(--c) 100%,0 50%)}
.gs-lock:disabled{filter:grayscale(1) brightness(.6);cursor:default}
.gs-ladder ol{list-style:none;margin:12px 0 0;padding:10px 8px;display:flex;flex-direction:column;gap:5px;background:rgba(8,15,42,.6);border:1px solid rgba(255,255,255,.16);border-radius:18px}
.gs-ladder li{display:flex;align-items:center;justify-content:space-between;gap:4px;height:36px;padding:0 10px;border-radius:10px;background:rgba(255,255,255,.07);color:#8FA2DD;font-family:Prompt,sans-serif;font-weight:600;font-size:15px}
.gs-ladder li small{font-size:11px;color:#FFD966;font-weight:500}.gs-ladder li svg{width:18px;height:18px;color:var(--gs-gold)}
.gs-ladder li.safe{box-shadow:inset 0 0 0 1.5px rgba(255,217,102,.5)}
.gs-ladder li.done{background:rgba(34,208,131,.28);color:#9AF5C6}
.gs-ladder li.now{background:linear-gradient(90deg,var(--gs-gold),var(--gs-gold2));color:#101F44;box-shadow:0 0 16px rgba(244,183,28,.85);animation:gsNow 1.2s ease-in-out infinite alternate}
.gs-ladder li.now small,.gs-ladder li.now svg{color:#101F44}
@keyframes gsNow{to{transform:scale(1.06)}}
.gs-ins{margin:20px 4px 0;background:#fff;color:var(--ink);border-radius:20px;overflow:hidden;box-shadow:0 12px 34px rgba(0,0,0,.35);animation:gsRise .4s ease-out}
@keyframes gsRise{from{transform:translateY(16px);opacity:0}}
.gs-ins .hd{display:flex;gap:10px 16px;align-items:baseline;flex-wrap:wrap;padding:12px 20px;font-family:var(--font-d)}
.gs-ins.ok .hd{background:#DDF5E8;color:#0B6B3B}.gs-ins.bad .hd{background:#FCE4E2;color:#A1281F}
.gs-ins .hd b{font-size:22px}.gs-ins .hd .ans{margin-left:auto;font-weight:500;color:var(--ink)}
.gs-ins .bd{padding:14px 22px 6px}.gs-ins .lab{display:inline-flex;gap:6px;align-items:center;font-family:var(--font-d);font-weight:600;font-size:14.5px;color:#8A5E00;background:var(--gold-bg);border-radius:99px;padding:2px 12px;margin-bottom:6px}
.gs-ins .md{font-size:17px}.gs-ins .md p{margin:6px 0}
.gs-next{margin:6px 22px 18px;float:right}.gs-ins::after{content:"";display:block;clear:both}

/* end */
.gs-end{max-width:760px;margin:0 auto;text-align:center;padding-top:20px}
.gs-medal{width:120px;height:120px;border-radius:50%;margin:0 auto 14px;display:grid;place-items:center;background:radial-gradient(circle at 35% 30%,#FFE08A,#F4B71C 60%,#B97F00);color:#101F44;box-shadow:0 0 0 8px rgba(244,183,28,.2),0 0 50px rgba(244,183,28,.6)}
.gs-medal svg{width:60px;height:60px}.gs-medal.lose{background:radial-gradient(circle at 35% 30%,#6C7FCC,#2B3A87 70%);color:#fff;box-shadow:0 0 0 8px rgba(255,255,255,.08)}
.gs-end h1{font-family:Prompt,sans-serif;font-weight:700;font-size:clamp(28px,5vw,46px);color:#fff;margin:0 0 20px}
.gs-score{display:grid;grid-template-columns:repeat(3,1fr);gap:12px;margin-bottom:22px}
.gs-score div{background:rgba(255,255,255,.08);border:1px solid rgba(255,255,255,.18);border-radius:18px;padding:14px 8px}
.gs-score b{display:block;font-family:Prompt,sans-serif;font-weight:700;font-size:42px;line-height:1.1;color:var(--gs-gold)}.gs-score span{font-size:14px;color:#BCCBF5}
.gs-miss{text-align:left;background:#fff;color:var(--ink);border-radius:20px;padding:6px 20px 14px;margin-bottom:12px}
.gs-miss h3{font-size:18px;margin:12px 0 4px;display:flex;gap:8px;align-items:center;color:#8A5E00}
.gs-mi{border-top:2px dashed var(--line);padding:12px 0 2px}.gs-mi:first-of-type{border-top:0}.gs-mi .t{font-weight:600}.gs-mi .a{color:#0B6B3B;font-family:var(--font-d);font-weight:500;margin:2px 0 4px}.gs-mi .md{font-size:16px}
.gs-end .btn.ghost{background:rgba(255,255,255,.1);color:#fff;border:2px solid rgba(255,255,255,.3);box-shadow:none}

@media(max-width:860px){
  .gs-rules{grid-template-columns:1fr}.gs-setup{grid-template-columns:1fr}
  .gs-top{grid-template-columns:1fr auto}.gs-tools{grid-column:1/-1;grid-row:2;justify-content:space-between}
  .gs-main{grid-template-columns:1fr}
  .gs-ladder{order:-1}.gs-ladder ol{flex-direction:row-reverse;margin:0 0 6px;padding:6px;gap:4px}
  .gs-ladder li{flex:1;height:34px;padding:0;justify-content:center;font-size:14px}.gs-ladder li small,.gs-ladder li.top svg{display:none}.gs-ladder li.top::after{content:"★";color:var(--gs-gold);font-size:12px;margin-left:2px}
}
@media(max-width:620px){.gs-opts{grid-template-columns:1fr}.gs-lf{width:84px}.gs-lock{width:100%;justify-content:center}.gs-foot{flex-direction:column;align-items:stretch}.gs-life{justify-content:space-between}}
@media(prefers-reduced-motion:reduce){.gs-beam,.gs-sym,.gs-go,.gs-q::before,.gs-ladder li.now,.gs-timer.low,.gs-opt.lockedsel{animation:none!important}}

/* ================= ตู้กาชาปอง (v2) ================= */
.gm-stage{padding-top:clamp(18px,3vw,40px)}
.gm-wrap{display:grid;grid-template-columns:340px minmax(0,1fr);gap:clamp(24px,6vw,72px);max-width:1000px;margin:0 auto;align-items:center}
.gm{position:relative;width:340px;height:565px;margin:0 auto}
.gm::before{content:"";position:absolute;left:-18px;right:-18px;top:512px;height:56px;background:radial-gradient(ellipse at 50% 35%,rgba(0,0,0,.62),transparent 68%)}
/* โดมแก้ว */
.gm-dome{position:absolute;left:20px;top:0;width:300px;height:292px;border-radius:50% 50% 44% 44%/54% 54% 40% 40%;overflow:hidden;z-index:2;
  background:radial-gradient(circle at 30% 22%,rgba(255,255,255,.34),rgba(170,205,255,.1) 42%,rgba(70,110,255,.18));border:5px solid rgba(255,255,255,.42);box-shadow:inset 0 -20px 44px rgba(20,40,120,.55),inset 0 0 0 2px rgba(255,255,255,.12),0 0 46px rgba(110,150,255,.38)}
.gm-caps{position:absolute;inset:0}
.gm-c{position:absolute;width:48px;height:48px;border-radius:50%;transform:rotate(var(--r));
  background:radial-gradient(circle at 32% 28%,rgba(255,255,255,.8) 0 9%,transparent 22%),linear-gradient(180deg,var(--c) 0 50%,#EEF2FB 50% 100%);box-shadow:inset 0 -6px 9px rgba(0,0,0,.22),inset 0 0 0 1px rgba(255,255,255,.35),0 3px 5px rgba(0,0,0,.35)}
.gm-c::after{content:"";position:absolute;left:0;right:0;top:calc(50% - 1.5px);height:3px;background:rgba(0,0,0,.2)}
.gm-glare{position:absolute;left:34px;top:22px;width:92px;height:40px;border-radius:50%;background:linear-gradient(180deg,rgba(255,255,255,.6),transparent);transform:rotate(-24deg);pointer-events:none}
.gm-glare.g2{left:auto;right:30px;top:60px;width:12px;height:84px;border-radius:99px;transform:rotate(14deg);opacity:.55}
.gm.spin .gm-c{animation:gmTumble var(--d) ease-in-out infinite alternate}
@keyframes gmTumble{from{transform:translate(calc(var(--dx)*-1),calc(var(--dy)*-1)) rotate(var(--r))}to{transform:translate(var(--dx),var(--dy)) rotate(calc(var(--r) + 150deg))}}
/* ปลอกทองรอยต่อโดม */
.gm-collar{position:absolute;left:10px;top:262px;width:320px;height:30px;z-index:4;border-radius:16px;
  background:repeating-linear-gradient(90deg,rgba(0,0,0,.14) 0 2px,transparent 2px 9px),linear-gradient(180deg,#FFE9A3 0,#F4B71C 38%,#B77F00 100%);box-shadow:0 4px 0 #6d4a00,0 10px 16px rgba(0,0,0,.4),inset 0 2px 0 rgba(255,255,255,.55)}
/* ตัวตู้ */
.gm-body{position:absolute;left:6px;top:268px;width:328px;height:250px;z-index:3;border-radius:30px 30px 22px 22px;
  background:
   radial-gradient(circle at 24px 46px,#FFF1B8 0 2px,#E3A91A 3px 5px,transparent 6px),
   radial-gradient(circle at calc(100% - 24px) 46px,#FFF1B8 0 2px,#E3A91A 3px 5px,transparent 6px),
   radial-gradient(circle at 24px calc(100% - 24px),#FFF1B8 0 2px,#E3A91A 3px 5px,transparent 6px),
   radial-gradient(circle at calc(100% - 24px) calc(100% - 24px),#FFF1B8 0 2px,#E3A91A 3px 5px,transparent 6px),
   linear-gradient(180deg,#3358CC 0,#1C3A8E 34%,#10244A 100%);
  box-shadow:inset 0 0 0 4px #F4B71C,inset 0 0 0 7px #0A1840,inset 0 12px 0 7px rgba(255,255,255,.06),0 14px 0 #08132E,0 26px 40px rgba(0,0,0,.5)}
.gm.spin .gm-body{animation:gmJit .13s linear infinite}
@keyframes gmJit{25%{transform:translate(1.5px,0)}75%{transform:translate(-1.5px,1px)}}
.gm-plate{position:absolute;left:50%;top:30px;transform:translateX(-50%);display:flex;align-items:center;gap:10px;padding:4px 22px 4px 5px;border-radius:99px;background:linear-gradient(180deg,#FFFBEF,#EFE2B8);border:2px solid #F4B71C;box-shadow:inset 0 0 0 2px #fff,0 3px 0 #8a5e00;white-space:nowrap}
.gm-plate img{border-radius:50%;display:block}.gm-plate b{font-family:Prompt,sans-serif;font-weight:700;font-size:18px;color:#10244A}
/* หลอดไฟวิ่ง */
.gm-lamps{position:absolute;left:30px;right:30px;top:80px;display:flex;justify-content:space-between;pointer-events:none}
.gm-lamps i{--l:#FFD966;width:10px;height:10px;border-radius:50%;background:radial-gradient(circle at 35% 30%,#fff,var(--l) 60%);box-shadow:0 0 9px var(--l);opacity:.3;animation:gmChase 1.8s linear infinite;animation-delay:calc(var(--i)*-.2s)}
.gm-lamps i:nth-child(3n+2){--l:#5BE3FF}
@keyframes gmChase{0%{opacity:1}20%{opacity:.3}100%{opacity:.3}}
.gm.spin .gm-lamps i{animation-duration:.54s;animation-delay:calc(var(--i)*-.06s)}
.gm.opened .gm-lamps i{animation:gmAll .32s steps(1) infinite}
@keyframes gmAll{0%{opacity:1}50%{opacity:.28}}
/* ปุ่มหมุน (หน้าปัดมีฟันเฟือง) */
.gm-crank{position:absolute;left:26px;top:104px;width:84px;height:84px;border-radius:50%;
  background:radial-gradient(circle,#FFE9A3 0 34%,#F4B71C 35% 62%,transparent 63%),repeating-conic-gradient(#8a5e00 0 5deg,#FFD966 5deg 10deg);box-shadow:0 5px 0 #7a5400,0 0 0 4px #0A1840,inset 0 0 0 2px rgba(0,0,0,.25)}
.gm-crank .bar{position:absolute;left:50%;top:50%;width:50px;height:11px;margin-top:-5.5px;border-radius:6px;background:linear-gradient(#EEF2FB,#9CA9C5);box-shadow:0 2px 0 rgba(0,0,0,.25)}
.gm-crank .knob{position:absolute;left:calc(50% + 36px);top:50%;width:26px;height:26px;margin:-13px 0 0 -13px;border-radius:50%;background:radial-gradient(circle at 35% 30%,#FF9A8B,#E0412D);box-shadow:0 3px 0 #8e1f12}
/* ช่องเหรียญ + ไฟบอกสีชั้น */
.gm-slot{position:absolute;right:26px;top:104px;width:78px;height:84px;border-radius:16px;background:linear-gradient(180deg,#050B24,#0B1636);box-shadow:inset 0 0 0 3px #F4B71C,0 0 0 4px #0A1840}
.gm-slot>i{position:absolute;left:36px;top:12px;width:6px;height:34px;border-radius:3px;background:#000;box-shadow:0 0 0 2px rgba(244,183,28,.5),0 0 12px rgba(244,183,28,.35)}
.gm-gl{position:absolute;left:0;right:0;bottom:11px;display:flex;justify-content:center;gap:9px}
.gm-gl b{width:12px;height:12px;border-radius:50%;background:var(--c);opacity:.22;transition:opacity .25s,box-shadow .25s}
.gm[data-g="4"] .gm-gl b:nth-child(1),.gm[data-g="5"] .gm-gl b:nth-child(2),.gm[data-g="6"] .gm-gl b:nth-child(3){opacity:1;box-shadow:0 0 12px 2px var(--c)}
/* ช่องรับแคปซูล */
.gm-chute{position:absolute;left:50%;bottom:14px;width:128px;height:76px;margin-left:-64px;border-radius:18px 18px 0 0;background:linear-gradient(#02060F,#0A1432);box-shadow:inset 0 8px 16px rgba(0,0,0,.85),0 0 0 4px #F4B71C,0 0 0 7px #0A1840}
.gm-chute::after{content:"";position:absolute;left:7px;right:7px;top:7px;height:34px;border-radius:12px 12px 4px 4px;background:linear-gradient(180deg,rgba(255,255,255,.22),rgba(255,255,255,.04));border:1.5px solid rgba(255,255,255,.3);transform-origin:50% 0;transition:transform .3s}
.gm.dropping .gm-chute::after{transform:rotateX(-70deg)}
.gm-tray{position:absolute;left:48px;top:508px;width:244px;height:34px;z-index:4;border-radius:0 0 26px 26px;background:linear-gradient(180deg,#E0A91A,#8a5e00);box-shadow:inset 0 3px 0 rgba(255,255,255,.35),0 8px 14px rgba(0,0,0,.4)}
#gdrop{position:absolute;left:50%;top:425px;width:80px;height:80px;margin-left:-40px;z-index:5}
.gm-cap{position:relative;width:80px;height:80px;filter:drop-shadow(0 6px 6px rgba(0,0,0,.45))}
.gm-cap i{position:absolute;left:0;width:100%;height:50%}
.gm-cap .top{top:0;border-radius:80px 80px 0 0;background:linear-gradient(180deg,var(--c),var(--c2));border-bottom:3px solid rgba(0,0,0,.2);transform-origin:20% 100%}
.gm-cap .bot{bottom:0;border-radius:0 0 80px 80px;background:linear-gradient(180deg,#fff,#CAD5EA)}
.gm-cap .shine{top:10px;left:14px;width:22px;height:12px;border-radius:50%;background:rgba(255,255,255,.75);transform:rotate(-30deg)}
.gm-cap.fall{animation:gmFall .75s cubic-bezier(.4,0,.6,1) forwards}
@keyframes gmFall{0%{transform:translateY(-110px) scale(.4);opacity:0}20%{opacity:1}55%{transform:translateY(42px) scale(1)}72%{transform:translateY(18px)}86%{transform:translateY(42px)}100%{transform:translateY(34px)}}
.gm-cap.wob{animation:gmWob .22s ease-in-out infinite alternate;transform:translateY(34px)}
@keyframes gmWob{from{transform:translateY(34px) rotate(-14deg) scale(1.02)}to{transform:translateY(34px) rotate(14deg) scale(1.1)}}
.gm-cap.open{transform:translateY(34px)}
.gm-cap.open .top{animation:gmTop .8s ease-in forwards}.gm-cap.open .bot{animation:gmBot .8s ease-in .1s forwards}
@keyframes gmTop{to{transform:translate(-46px,-92px) rotate(-38deg);opacity:0}}
@keyframes gmBot{to{transform:translate(18px,44px) rotate(14deg);opacity:0}}

/* ตั๋วบทเรียน */
#gslip{position:absolute;left:14px;right:14px;top:128px;z-index:7;pointer-events:none;filter:drop-shadow(0 22px 22px rgba(0,0,0,.55))}
.gm-rays{position:absolute;left:50%;top:50%;width:560px;height:560px;margin:-290px 0 0 -280px;z-index:-1;border-radius:50%;
  background:repeating-conic-gradient(color-mix(in srgb,var(--gc) 60%,transparent) 0 7deg,transparent 7deg 20deg);
  -webkit-mask-image:radial-gradient(circle,#000 14%,transparent 64%);mask-image:radial-gradient(circle,#000 14%,transparent 64%);animation:gmRays 16s linear infinite,gmRayIn .9s ease-out both}
@keyframes gmRays{to{transform:rotate(360deg)}}
@keyframes gmRayIn{from{opacity:0;scale:.4}}
.gm-slip{position:relative;text-align:center;color:var(--ink);background:#fff;border-radius:22px;overflow:hidden;animation:gmSlip .8s cubic-bezier(.2,1.2,.35,1) both;
  -webkit-mask:radial-gradient(circle 12px at 0 calc(100% - 62px),#0000 97%,#000) left/52% 100% no-repeat,radial-gradient(circle 12px at 100% calc(100% - 62px),#0000 97%,#000) right/52% 100% no-repeat;
  mask:radial-gradient(circle 12px at 0 calc(100% - 62px),#0000 97%,#000) left/52% 100% no-repeat,radial-gradient(circle 12px at 100% calc(100% - 62px),#0000 97%,#000) right/52% 100% no-repeat}
@keyframes gmSlip{from{transform:translateY(240px) scale(.3) rotate(-6deg);opacity:0}}
.gm-foil{position:relative;overflow:hidden;display:flex;align-items:center;justify-content:space-between;gap:10px;padding:11px 18px;color:#fff;background:linear-gradient(110deg,var(--dk),var(--gc) 55%,color-mix(in srgb,var(--gc) 70%,#fff))}
.gm-foil::after{content:"";position:absolute;top:-30%;bottom:-30%;width:42px;left:-60px;background:linear-gradient(90deg,transparent,rgba(255,255,255,.55),transparent);transform:skewX(-20deg);animation:gmSheen 1.3s ease-out .55s both}
@keyframes gmSheen{to{left:115%}}
.gm-foil .gm-g{font-family:var(--font-d);font-weight:600;font-size:14px;background:rgba(255,255,255,.2);border:1.5px solid rgba(255,255,255,.55);border-radius:99px;padding:1px 14px}
.gm-foil .gm-no{font-family:var(--font-d);font-weight:600;font-size:16px}
.gm-main{padding:12px 18px 10px;background:linear-gradient(180deg,color-mix(in srgb,var(--gc) 9%,#fff),#fff 70%)}
.gm-main .gl{font-family:Prompt,sans-serif;font-weight:700;font-size:56px;line-height:1.1;color:var(--gc);text-shadow:0 3px 0 color-mix(in srgb,var(--gc) 22%,transparent)}
.gm-main h2{font-size:22px;margin:2px 0 8px}
.gm-meter{height:8px;border-radius:99px;background:color-mix(in srgb,var(--gc) 16%,#E6EBF5);overflow:hidden;margin:0 auto 4px;max-width:210px}.gm-meter i{display:block;height:100%;border-radius:99px;background:var(--gc);animation:gmMeter .9s ease-out .5s both}
@keyframes gmMeter{from{width:0!important}}
.gm-main small{display:block;color:var(--muted);font-size:14px}
.gm-stub{height:62px;display:flex;align-items:center;gap:10px;padding:0 16px 0 18px;text-align:left;border-top:2px dashed color-mix(in srgb,var(--gc) 40%,#C9D3E8);background:color-mix(in srgb,var(--gc) 8%,#fff)}
.gm-stub .gm-tag{flex:none;font-family:var(--font-d);font-weight:600;font-size:14px;color:#fff;background:var(--dk);border-radius:99px;padding:2px 12px}
.gm-stub b{font-size:14.5px;line-height:1.35;font-weight:500;color:var(--ink)}
.gm-sp{position:absolute;width:14px;height:14px;background:#FFE9A3;clip-path:polygon(50% 0,62% 38%,100% 50%,62% 62%,50% 100%,38% 62%,0 50%,38% 38%);filter:drop-shadow(0 0 6px #FFD966);animation:gmTw 1.1s ease-in-out var(--t) infinite alternate}
@keyframes gmTw{from{transform:scale(.2) rotate(0);opacity:.2}to{transform:scale(1.15) rotate(50deg);opacity:1}}

/* ฝั่งขวา */
.gm-side{color:#fff}
.gm-side h1{font-family:Prompt,sans-serif;font-weight:700;font-size:clamp(34px,5.4vw,60px);line-height:1.12;margin:0 0 10px;color:#fff;text-shadow:0 4px 0 rgba(0,0,0,.35)}
.gm-side h1 b{display:block;color:var(--gs-gold);text-shadow:0 4px 0 #8a5e00,0 0 30px rgba(244,183,28,.6)}
.gm-lead{font-size:clamp(16px,2vw,19px);color:#C9D6FF;margin:0 0 14px;max-width:30em}
.gm-filt{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:14px;justify-content:flex-start}
.gm-filt button{font-family:var(--font-d);font-weight:500;font-size:15.5px;color:#fff;padding:8px 18px;border-radius:99px;border:2px solid rgba(255,255,255,.28);background:rgba(255,255,255,.08);cursor:pointer}
.gm-filt button.on{background:var(--gs-gold);border-color:var(--gs-gold);color:#101F44;font-weight:600}
.gm-board{background:rgba(6,16,50,.45);border:1px solid rgba(255,255,255,.16);border-radius:18px;padding:12px 14px 10px;margin-bottom:18px;max-width:30em}
.gm-key{display:flex;gap:16px;margin-bottom:10px;font-size:14.5px;color:#CFE0FF}.gm-key i{display:inline-block;width:12px;height:12px;border-radius:50%;margin-right:6px;vertical-align:-1px;box-shadow:0 0 8px currentColor}
.gm-dots{display:flex;flex-wrap:wrap;gap:7px}
.gm-dots i{width:20px;height:20px;border-radius:50%;background:conic-gradient(var(--c) calc(var(--p)*1%),rgba(255,255,255,.14) 0);box-shadow:inset 0 0 0 2px rgba(255,255,255,.22);position:relative;transition:transform .2s}
.gm-dots i::after{content:"";position:absolute;inset:5px;border-radius:50%;background:#0F2260}
.gm-dots i.full::after{inset:3px;background:var(--c)}
.gm-dots i.hit{transform:scale(1.5);box-shadow:0 0 0 3px #fff,0 0 16px 4px var(--c);animation:gmHit .8s ease-in-out infinite alternate;z-index:1}
@keyframes gmHit{to{transform:scale(1.28)}}
.gm-note{margin:9px 0 0;font-size:13.5px;color:#9FB2E8}
.gm-act{display:flex;align-items:center;gap:14px;flex-wrap:wrap;margin-bottom:6px}
.gm-roll{margin-bottom:0}
.gm-snd{display:inline-flex;align-items:center;gap:8px;font-family:var(--font-d);font-weight:500;font-size:15px;color:#DCE7FF;background:rgba(255,255,255,.1);border:2px solid rgba(255,255,255,.26);border-radius:99px;padding:9px 16px;cursor:pointer}
.gm-snd:hover{border-color:var(--gs-gold)}.gm-snd:focus-visible{outline:3px solid var(--gs-gold);outline-offset:2px}.gm-snd .ic{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.gm-res{background:rgba(255,255,255,.1);border:1px solid rgba(255,255,255,.22);border-radius:18px;padding:14px 16px;margin-top:12px;animation:gsRise .4s ease-out}.gm-res p{margin:0 0 10px;color:#DDE6FF}.gm-res .row{display:flex;gap:10px;flex-wrap:wrap}
.gm-res .gm-bonus{display:flex;align-items:center;gap:6px;color:var(--gs-gold2);font-weight:600}.gm-res .gm-bonus svg{width:18px;height:18px;fill:currentColor}
.gm-res .btn.ghost{background:rgba(255,255,255,.1);color:#fff;border:2px solid rgba(255,255,255,.3);box-shadow:none}
.gm-hist{margin-top:20px}.gm-hist h3{font-size:16px;color:#BCCBF5;display:flex;gap:8px;align-items:center;margin-bottom:8px}.gm-hist h3 svg{color:var(--gs-gold)}
.gm-hist ul{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:6px}
.gm-hist li{display:flex;align-items:center;gap:10px;background:rgba(255,255,255,.07);border-left:5px solid var(--gc);border-radius:10px;padding:6px 12px;font-size:15px}
.gm-hist li b{font-family:Prompt,sans-serif;color:var(--gc);min-width:34px;font-size:18px;filter:brightness(1.35)}.gm-hist li span{flex:1}.gm-hist li small{color:#9FB2E8}
.gm-none{margin:0;color:#8FA2DD;font-size:15px}
@media(max-width:860px){.gm-wrap{grid-template-columns:1fr}.gm-side{text-align:center}.gm-lead,.gm-board{margin-inline:auto}.gm-key,.gm-dots,.gm-filt,.gm-act,.gm-res .row{justify-content:center}.gm-board{text-align:center}.gm-hist ul{max-width:520px;margin:0 auto}}
@media(max-height:780px) and (min-width:861px){.gm{zoom:.86}}
@media(prefers-reduced-motion:reduce){.gm.spin .gm-c,.gm.spin .gm-body,.gm-lamps i,.gm-rays,.gm-sp,.gm-dots i.hit,.gm-foil::after{animation:none!important}.gm-rays{opacity:.7}}

/* ================= เกมประจำบท (gg-*) ================= */
.fcard.gamec{background:linear-gradient(135deg,#1B1F6B,#3A2DA8);color:#fff;border-left-color:var(--gs-gold)}
.fcard.gamec h3,.fcard.gamec .sub{color:#fff}.fcard.gamec .sub{opacity:.85}
.gg-stage{--gc:#19C9B3}
.gg-hub,.gg-play,.gg-end{max-width:1040px;margin:0 auto}
.gg-head{display:flex;align-items:center;gap:14px;margin-bottom:14px}
.gg-head>div:first-of-type{flex:1;min-width:0}
.gg-head small{display:block;color:#9FB2E8;font-size:14px}
.gg-head h1{font-family:Prompt,sans-serif;font-weight:700;font-size:clamp(24px,4vw,38px);line-height:1.15;margin:0;color:#fff;text-shadow:0 3px 0 rgba(0,0,0,.25)}
.gg-total{display:flex;flex-direction:column;align-items:flex-end;gap:2px;color:#CFE0FF;font-size:14px}
.gg-stars{display:inline-flex;gap:3px}.gg-st{display:inline-flex;color:rgba(255,255,255,.28)}.gg-st svg{width:24px;height:24px}.gg-st.on{color:var(--gs-gold);filter:drop-shadow(0 0 8px rgba(244,183,28,.8))}
.gg-lead{max-width:720px;color:#CFE0FF;font-size:17px;line-height:1.6;margin:6px 0 22px}
.gg-cards{display:grid;grid-template-columns:repeat(3,1fr);gap:18px}
.gg-card{position:relative;text-align:left;color:#fff;font:inherit;cursor:pointer;border:2px solid rgba(255,255,255,.18);border-radius:24px;padding:22px 20px 18px;display:flex;flex-direction:column;gap:8px;
  background:linear-gradient(160deg,rgba(255,255,255,.14),rgba(255,255,255,.04));backdrop-filter:blur(2px);transition:transform .18s,border-color .18s,box-shadow .18s;min-height:290px}
.gg-card:hover,.gg-card:focus-visible{transform:translateY(-4px);border-color:var(--gs-gold);box-shadow:0 14px 40px rgba(0,0,0,.35),0 0 0 3px rgba(244,183,28,.25);outline:0}
.gg-card:active{transform:scale(.98)}
.gg-ic{display:grid;place-items:center;width:78px;height:78px;border-radius:22px;font-style:normal;font-family:Prompt,sans-serif;font-weight:700;font-size:22px;color:#101F44;background:linear-gradient(145deg,var(--gs-gold2),var(--gs-gold));box-shadow:0 5px 0 #8a5e00,0 0 24px rgba(244,183,28,.45);letter-spacing:-2px}
.gg-card b{font-family:Prompt,sans-serif;font-size:22px;margin-top:6px}
.gg-card>span:not(.gg-stars){color:#CFE0FF;font-size:15.5px;line-height:1.5;flex:1}
.gg-card small{color:#9FB2E8;font-size:13.5px}
.gg-card em{font-style:normal;display:inline-flex;gap:8px;align-items:center;align-self:flex-start;font-family:Prompt,sans-serif;font-weight:600;color:#101F44;background:var(--gs-gold);border-radius:99px;padding:8px 18px;margin-top:4px}
.gg-card em svg{width:18px;height:18px}
.gg-foot{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:26px}
.btn.ghost.light{background:rgba(255,255,255,.1);color:#fff;border:2px solid rgba(255,255,255,.3);box-shadow:none}
.gg-hud{display:flex;gap:10px;flex-wrap:wrap;justify-content:flex-end}
.gg-hud>span{font-family:Prompt,sans-serif;font-weight:500;font-size:15px;background:rgba(255,255,255,.12);border-radius:99px;padding:6px 14px;display:inline-flex;gap:6px;align-items:center;color:#DCE7FF}
.gg-hud b{color:var(--gs-gold);font-size:1.2em}.gg-hud svg{width:17px;height:17px}
.gg-hint{color:#BCCBF5;font-size:15px;margin:0 0 12px}
.gs-ic.off{opacity:.45}
.gg-tag{display:inline-flex;gap:6px;align-items:center;font-family:Prompt,sans-serif;font-weight:600;font-size:13.5px;color:#101F44;background:var(--gs-gold);border-radius:99px;padding:3px 12px}.gg-tag svg{width:15px;height:15px}

/* จับคู่ความจำ */
.gg-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:clamp(8px,1.6vw,16px)}
.gg-flip{perspective:900px;border:0;background:none;padding:0;cursor:pointer;aspect-ratio:1.5/1;min-height:96px;font:inherit;-webkit-tap-highlight-color:transparent}
.gg-flip .in{position:absolute;inset:0;display:block;transform-style:preserve-3d;transition:transform .45s cubic-bezier(.3,1.3,.5,1)}
.gg-flip{position:relative}
.gg-flip.up .in,.gg-flip.ok .in{transform:rotateY(180deg)}
.gg-flip .bk,.gg-flip .ft{position:absolute;inset:0;border-radius:18px;backface-visibility:hidden;-webkit-backface-visibility:hidden;display:grid;place-items:center;padding:8px;overflow:hidden}
.gg-flip .bk{background:repeating-linear-gradient(45deg,rgba(255,255,255,.08) 0 8px,transparent 8px 16px),linear-gradient(145deg,var(--gc),#2a2a8f);border:2px solid rgba(255,255,255,.35);box-shadow:0 5px 0 rgba(0,0,0,.3)}
.gg-flip .bk b{font-family:Prompt,sans-serif;font-size:clamp(30px,5vw,48px);color:rgba(255,255,255,.85)}
.gg-flip .ft{transform:rotateY(180deg);background:#fff;color:#0E1B45;border:3px solid var(--gs-cy);font-family:Prompt,Sarabun,sans-serif;font-weight:500;font-size:clamp(14px,1.9vw,19px);line-height:1.3;text-align:center}
.gg-flip .ft.r{background:#FFF7DA;border-color:var(--gs-gold)}
.gg-flip .tx{overflow-wrap:anywhere;max-height:100%}.gg-flip .tx .katex{font-size:1.05em}
.gg-flip.no .ft{border-color:var(--gs-bad);animation:ggShake .4s}
.gg-flip.ok .ft{border-color:var(--gs-ok);box-shadow:0 0 22px rgba(34,208,131,.65)}
.gg-flip.ok{animation:ggPulse .5s}
@keyframes ggShake{25%{transform:rotateY(180deg) translateX(-6px)}75%{transform:rotateY(180deg) translateX(6px)}}
@keyframes ggPulse{50%{transform:scale(1.06)}}

/* จริง/เท็จ */
.gg-bar{height:14px;border-radius:99px;background:rgba(255,255,255,.14);overflow:hidden;margin-bottom:18px}
.gg-bar i{display:block;height:100%;width:100%;border-radius:99px;background:linear-gradient(90deg,var(--gs-cy),#7BE8B0);transition:width .12s linear}
.gg-bar i.low{background:linear-gradient(90deg,var(--gs-bad),#FF9A7A)}
.gg-stmt,.gg-prob{position:relative;background:linear-gradient(160deg,#fff,#EAF1FF);color:#0E1B45;border-radius:26px;padding:26px 28px 24px;box-shadow:0 8px 0 rgba(0,0,0,.25),0 0 0 4px rgba(244,183,28,.55)}
.gg-stmt .tx,.gg-prob .tx{font-family:Prompt,Sarabun,sans-serif;font-weight:500;font-size:clamp(20px,2.8vw,30px);line-height:1.5;margin-top:10px;overflow-wrap:anywhere}
.gg-stmt .tx .katex,.gg-prob .tx .katex{font-size:1.1em}
.gg-tfb{display:grid;grid-template-columns:1fr 1fr;gap:18px;margin-top:20px}
.gg-tfb button{font-family:Prompt,sans-serif;font-weight:700;font-size:clamp(26px,4vw,40px);color:#fff;border:0;border-radius:22px;padding:18px 10px;min-height:92px;cursor:pointer;display:flex;align-items:center;justify-content:center;gap:14px;box-shadow:0 7px 0 rgba(0,0,0,.35);transition:transform .1s,box-shadow .1s,opacity .2s}
.gg-tfb button span{font-size:.9em;opacity:.9}
.gg-tfb .gg-t{background:linear-gradient(180deg,#34E0A0,#12A56C)}.gg-tfb .gg-f{background:linear-gradient(180deg,#FF7A8A,#D8283E)}
.gg-tfb button:active:not(:disabled){transform:translateY(5px);box-shadow:0 2px 0 rgba(0,0,0,.35)}
.gg-tfb button:disabled{cursor:default;opacity:.45}.gg-tfb button.right{opacity:1;outline:5px solid #fff;box-shadow:0 0 36px rgba(255,255,255,.7)}.gg-tfb button.wrongc{opacity:.9;outline:5px dashed rgba(255,255,255,.6)}
.gg-combo.hot{background:linear-gradient(90deg,#FF8A3C,#FF4D61)!important;color:#fff!important}.gg-combo.hot b{color:#fff}
.gg-fb{margin-top:18px;border-radius:20px;padding:16px 20px;background:rgba(255,255,255,.1);border:2px solid rgba(255,255,255,.25);animation:ggIn .3s ease-out}
.gg-fb.good{border-color:var(--gs-ok);background:rgba(34,208,131,.14)}.gg-fb.bad{border-color:var(--gs-bad);background:rgba(255,77,97,.14)}
.gg-fb>b{font-family:Prompt,sans-serif;font-size:20px;display:block}.gg-fb .cb{display:inline-block;font-family:Prompt,sans-serif;font-weight:700;color:#101F44;background:var(--gs-gold);border-radius:99px;padding:2px 12px;margin-top:6px}
.gg-fb p{margin:8px 0 12px;font-size:17px;line-height:1.6;color:#E3ECFF}.gg-fb .katex{font-size:1.05em}
.gs-go.sm{font-size:20px;min-height:52px;padding:10px 30px}.gs-go.sm svg{width:20px;height:20px}
@keyframes ggIn{from{opacity:0;transform:translateY(8px)}}

/* เรียงขั้นตอน */
.gg-slots{list-style:none;margin:0 0 16px;padding:0;display:grid;gap:10px}
.gg-slot{display:flex;gap:12px;align-items:center;min-height:62px;border:2px dashed rgba(255,255,255,.35);border-radius:18px;padding:8px 14px 8px 10px;background:rgba(255,255,255,.06);cursor:default}
.gg-slot i{flex:none;width:38px;height:38px;border-radius:50%;display:grid;place-items:center;font-style:normal;font-family:Prompt,sans-serif;font-weight:700;color:#101F44;background:var(--gs-gold)}
.gg-slot .tx{flex:1;font-size:17.5px;line-height:1.5;overflow-wrap:anywhere}.gg-slot em{color:#8FA2DD;font-style:normal}
.gg-slot.fill{border-style:solid;border-color:var(--gs-cy);background:rgba(91,227,255,.12);cursor:pointer}
.gg-slot.good{border-color:var(--gs-ok);background:rgba(34,208,131,.18)}.gg-slot.bad{border-color:var(--gs-bad);background:rgba(255,77,97,.18)}
.gg-pool{display:grid;grid-template-columns:repeat(2,1fr);gap:10px;margin-bottom:18px}
.gg-tile{font:inherit;text-align:left;color:#0E1B45;background:#fff;border:0;border-radius:16px;padding:12px 16px;min-height:62px;cursor:pointer;box-shadow:0 4px 0 rgba(0,0,0,.3);font-size:17px;line-height:1.5;transition:transform .1s}
.gg-tile:active:not(:disabled){transform:translateY(3px);box-shadow:0 1px 0 rgba(0,0,0,.3)}
.gg-tile.used{opacity:.25;box-shadow:none;cursor:default}
.gg-tile .tx{overflow-wrap:anywhere}
.gg-acts{display:flex;flex-wrap:wrap;gap:12px;align-items:center}
.gg-ord .gg-prob{margin-bottom:14px}

/* ผลสรุป */
.gg-res{text-align:center;background:linear-gradient(160deg,rgba(255,255,255,.14),rgba(255,255,255,.05));border:2px solid rgba(255,255,255,.2);border-radius:28px;padding:34px 22px 28px;margin-top:10px}
.gg-res .gg-st svg{width:56px;height:56px}.gg-res .gg-st.on{animation:ggStar .6s both}.gg-res .gg-st:nth-child(2).on{animation-delay:.2s}.gg-res .gg-st:nth-child(3).on{animation-delay:.4s}
@keyframes ggStar{from{transform:scale(0) rotate(-120deg)}60%{transform:scale(1.3) rotate(10deg)}}
.gg-res h2{font-family:Prompt,sans-serif;font-size:clamp(24px,4vw,34px);margin:14px 0 18px;color:#fff}
.gg-stats{display:flex;gap:16px;justify-content:center;flex-wrap:wrap;margin-bottom:14px}
.gg-stats div{min-width:120px;background:rgba(0,0,0,.2);border-radius:16px;padding:12px 16px}.gg-stats b{display:block;font-family:Prompt,sans-serif;font-size:30px;color:var(--gs-gold);line-height:1.15}.gg-stats span{font-size:13.5px;color:#BCCBF5}
.gg-xp{color:#CFE0FF;margin:6px 0 20px}.gg-res .gg-acts{justify-content:center}

@media(max-width:900px){.gg-cards{grid-template-columns:1fr}.gg-card{min-height:0;flex-direction:row;flex-wrap:wrap;align-items:center}.gg-card>span:not(.gg-stars){flex:1 1 60%}.gg-ic{width:64px;height:64px}}
@media(max-width:820px){.gg-grid{grid-template-columns:repeat(3,1fr)}.gg-pool{grid-template-columns:1fr}.gg-head{flex-wrap:wrap}.gg-hud{justify-content:flex-start}}
@media(max-width:520px){.gg-tfb{gap:10px}.gg-stmt,.gg-prob{padding:18px}}
@media(prefers-reduced-motion:reduce){.gg-flip .in{transition:none}.gg-res .gg-st.on,.gg-flip.ok,.gg-flip.no .ft{animation:none}}

.gg-ic svg{width:40px;height:40px}.gg-ic span{white-space:nowrap}

/* ================= ตกแต่งเลย์เอาต์ (decor) ================= */
body{background-color:var(--paper)}
body::before{content:"";position:fixed;inset:0;z-index:-1;pointer-events:none;
  background:
   radial-gradient(520px 380px at 96% 4%,rgba(25,201,179,.13),transparent 70%),
   radial-gradient(560px 420px at 2% 92%,rgba(138,134,255,.13),transparent 70%),
   url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='420' height='420' font-family='Georgia,serif' fill='%2314306B' fill-opacity='.055'><text x='28' y='70' font-size='46' transform='rotate(-8 28 70)'>∑</text><text x='250' y='60' font-size='40'>π</text><text x='340' y='170' font-size='52' transform='rotate(10 340 170)'>∫</text><text x='120' y='170' font-size='36'>√x</text><text x='30' y='290' font-size='44'>θ</text><text x='200' y='260' font-size='38' transform='rotate(-12 200 260)'>≠</text><text x='320' y='370' font-size='42'>Δ</text><text x='130' y='380' font-size='34'>x²+y²</text><text x='380' y='60' font-size='28'>∞</text><text x='250' y='350' font-size='30'>∠</text></svg>") 0 0/420px 420px}
body.gs-on::before{display:none}
.pagehead{position:relative}
.pagehead::after{content:"∑ ∫ π √";position:absolute;right:0;top:6px;font-family:Georgia,serif;font-size:54px;letter-spacing:.35em;color:var(--ink);opacity:.06;white-space:nowrap;pointer-events:none}

.dc-fl{position:absolute;inset:0;pointer-events:none;overflow:hidden}
.dc-fl i{position:absolute;font-style:normal;font-family:Georgia,'Times New Roman',serif;color:#fff;opacity:.13;line-height:1}

/* แถบหัวบทเรียน */
.lhero{position:relative;overflow:hidden;margin:-34px calc(-1*clamp(18px,4vw,48px)) 24px;padding:30px clamp(18px,4vw,48px) 24px;border-radius:24px 24px 0 0;color:#fff;
  background:linear-gradient(135deg,var(--gc),var(--gcd));isolation:isolate}
.lhero::before{content:"";position:absolute;inset:0;z-index:-1;opacity:.14;background-image:linear-gradient(#fff 1px,transparent 1px),linear-gradient(90deg,#fff 1px,transparent 1px);background-size:28px 28px;mask-image:linear-gradient(100deg,transparent 10%,#000 90%);-webkit-mask-image:linear-gradient(100deg,transparent 10%,#000 90%)}
.lh-glyph{position:absolute;right:clamp(10px,3vw,34px);bottom:-18px;font-style:normal;font-family:var(--font-d);font-weight:700;font-size:clamp(90px,16vw,150px);line-height:1;color:#fff;opacity:.16;pointer-events:none;white-space:nowrap}
.lh-tag{display:inline-block;font-family:var(--font-d);font-weight:500;font-size:13.5px;padding:3px 14px;border-radius:99px;background:rgba(255,255,255,.2);color:#fff;margin-bottom:10px}
.lhero h1{color:#fff;font-size:clamp(24px,3.4vw,34px);margin:0 0 14px;max-width:24em;text-shadow:0 2px 0 rgba(0,0,0,.12);position:relative}
.lh-chips{display:flex;flex-wrap:wrap;gap:8px;position:relative}
.lh-chips span{display:inline-flex;align-items:center;gap:6px;font-size:14px;background:rgba(0,0,0,.18);border-radius:99px;padding:4px 12px}
.lh-chips svg{width:16px;height:16px}
.lhero .katex{color:#fff}

/* การ์ดเริ่มแบบทดสอบ/ข้อสอบ */
.ihero{background:#fff;border-radius:26px;box-shadow:var(--sh);overflow:hidden;margin-top:6px}
.ih-top{position:relative;overflow:hidden;isolation:isolate;padding:34px clamp(20px,4vw,44px) 30px;color:#fff;background:linear-gradient(135deg,var(--gc),var(--gcd))}
.ih-top::before{content:"";position:absolute;inset:0;z-index:-1;opacity:.14;background-image:linear-gradient(#fff 1px,transparent 1px),linear-gradient(90deg,#fff 1px,transparent 1px);background-size:28px 28px}
.ih-glyph{position:absolute;right:clamp(8px,3vw,32px);top:50%;transform:translateY(-50%);font-style:normal;font-family:var(--font-d);font-weight:700;font-size:clamp(100px,18vw,170px);line-height:1;opacity:.17;pointer-events:none;white-space:nowrap}
.ih-tt{position:relative;max-width:34em}
.ih-kick{display:inline-block;font-family:var(--font-d);font-weight:500;font-size:14px;background:rgba(255,255,255,.22);border-radius:99px;padding:3px 14px;margin-bottom:10px}
.ih-tt h2{color:#fff;font-size:clamp(24px,3.6vw,34px);margin:0 0 6px}.ih-tt h2 .katex{color:#fff}
.ih-tt p{margin:0;opacity:.9;font-size:16px}
.ih-tiles{display:grid;grid-template-columns:repeat(4,1fr);gap:0;border-bottom:1px solid var(--line)}
.ih-tiles div{padding:18px 10px;text-align:center;border-right:1px solid var(--line)}.ih-tiles div:last-child{border-right:0}
.ih-tiles b{display:block;font-family:var(--font-d);font-weight:700;font-size:clamp(22px,3.2vw,30px);color:var(--gcd);line-height:1.2}
.ih-tiles span{font-size:14px;color:var(--muted)}
.ih-how{padding:22px clamp(20px,4vw,44px) 6px}
.ih-how h3{font-size:18px;display:flex;gap:8px;align-items:center;margin-bottom:8px}.ih-how h3 svg{width:22px;height:22px;color:var(--gold,#F4B71C)}
.ih-how ul{margin:0;padding:0;list-style:none;display:grid;grid-template-columns:1fr 1fr;gap:6px 24px}
.ih-how li{position:relative;padding-left:22px;font-size:16px;color:var(--ink-soft)}
.ih-how li::before{content:"";position:absolute;left:0;top:.62em;width:10px;height:10px;border-radius:3px;background:var(--gc);transform:rotate(45deg)}
.ih-act{padding:18px clamp(20px,4vw,44px) 28px;display:flex;flex-wrap:wrap;gap:12px;align-items:center}
.btn.lg{font-size:19px;padding:14px 30px;min-height:56px}

/* แผงข้างจอกว้าง */
.lgwrap{max-width:900px}
.lgrid{display:block}
.lrail{display:none}
@media(min-width:1280px){
  .lgwrap{max-width:1400px}
  .lgrid{display:grid;grid-template-columns:250px minmax(0,820px) 250px;gap:26px;justify-content:center;align-items:start}
  .lrail{display:flex;flex-direction:column;gap:16px;position:sticky;top:86px}
}
.lr-card{background:#fff;border-radius:20px;box-shadow:var(--sh);padding:16px}
.lr-head{display:flex;gap:12px;align-items:center;margin-bottom:12px}
.lr-head i{flex:none;width:46px;height:46px;border-radius:14px;display:grid;place-items:center;font-style:normal;font-family:var(--font-d);font-weight:700;font-size:16px;color:#fff;background:var(--gc);box-shadow:0 4px 0 var(--gcd)}
.lr-head small{display:block;color:var(--muted);font-size:13px;line-height:1.2}.lr-head b{font-family:var(--font-d);font-size:16px;line-height:1.25}
.lr-list{list-style:none;margin:0;padding:0;display:grid;gap:2px}
.lr-list a{display:flex;gap:10px;align-items:center;padding:7px 8px;border-radius:12px;color:var(--ink-soft);text-decoration:none;font-size:14.5px;line-height:1.3}
.lr-list a:hover{background:var(--gcbg)}
.lr-list a i{flex:none;width:24px;height:24px;border-radius:50%;display:grid;place-items:center;font-style:normal;font-size:12px;font-weight:600;font-family:var(--font-d);background:#E5ECF4;color:var(--ink-soft)}
.lr-list a i svg{width:14px;height:14px}
.lr-list a.ok i{background:var(--gc);color:#fff}
.lr-list a.cur{background:var(--gcbg);color:var(--gcd);font-weight:600;box-shadow:inset 3px 0 0 var(--gc)}.lr-list a.cur i{background:var(--gc);color:#fff}
.lr-prog{display:flex;gap:12px;align-items:center;margin-top:12px;padding-top:12px;border-top:1px dashed var(--line);font-size:13.5px;color:var(--muted)}.lr-prog b{color:var(--ink);font-family:var(--font-d)}
.lr-card h4{font-size:16px;display:flex;gap:8px;align-items:center;margin-bottom:10px}.lr-card h4 svg{width:20px;height:20px;color:var(--gc)}
.lr-go{display:grid;gap:8px}.lr-go .btn{justify-content:flex-start}
.lr-card.tip{position:relative;overflow:hidden;background:linear-gradient(160deg,#FFF8E1,#FFEFB8);isolation:isolate}
.lr-card.tip .dc-fl i{color:#B7860B;opacity:.12}
.lr-card.tip b{font-family:var(--font-d);display:block;margin-bottom:4px}.lr-card.tip p{margin:0;font-size:14.5px;line-height:1.55;color:#6a5310;position:relative}

/* โปรไฟล์ */
.grid2.prof{align-items:start}
.pcol{display:flex;flex-direction:column;gap:20px}
.pc-stats h3{margin-bottom:12px}
.pc-tiles{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}
.pc-tiles div{background:var(--paper);border-radius:16px;padding:12px 8px;text-align:center;display:flex;flex-direction:column;align-items:center;gap:2px}
.pc-tiles i{display:grid;place-items:center;width:34px;height:34px;border-radius:50%;background:#fff;color:var(--ink2);box-shadow:var(--sh)}.pc-tiles i svg{width:18px;height:18px}
.pc-tiles b{font-family:var(--font-d);font-size:22px;line-height:1.2}.pc-tiles span{font-size:12.5px;color:var(--muted);line-height:1.3}
.pc-bars{display:grid;gap:8px;margin-top:16px}
.pc-bars .pb{display:grid;grid-template-columns:44px 1fr 42px;gap:10px;align-items:center;font-size:14px}
.pc-bars .pb>div{height:12px;border-radius:99px;background:#E5ECF4;overflow:hidden}.pc-bars .pb i{display:block;height:100%;background:var(--gc);border-radius:99px}.pc-bars .pb b{text-align:right;font-family:var(--font-d)}

/* A-Level hub การ์ดเคล็ดลับ */
.setc.tipc{background:linear-gradient(150deg,#0F2152,#2A2C9A);color:#fff;position:relative;overflow:hidden;isolation:isolate;border-radius:var(--r-lg)}
.setc.tipc .body{position:relative;padding:22px;gap:10px}
.setc.tipc h3{color:#FFD966;font-size:20px}.setc.tipc ol{margin:0;padding-left:20px;display:grid;gap:8px;font-size:15.5px;line-height:1.5}.setc.tipc p{margin:4px 0 0;color:#BCCBF5;font-size:14.5px}
.setc.tipc .dc-fl i{color:#fff;opacity:.09}

@media(max-width:700px){.ih-tiles{grid-template-columns:1fr 1fr}.ih-tiles div:nth-child(2){border-right:0}.ih-tiles div:nth-child(-n+2){border-bottom:1px solid var(--line)}.ih-how ul{grid-template-columns:1fr}.pc-tiles{grid-template-columns:repeat(2,1fr)}.pagehead::after{display:none}}
@media print{body::before{display:none}}

/* ================= เช็กความเข้าใจแทรกในบทเรียน (cp-*) ================= */
.cp{margin:30px 0}
.cp-box{border-radius:22px;border:2px solid color-mix(in srgb,var(--gc,#10244A) 38%,#fff);background:linear-gradient(180deg,color-mix(in srgb,var(--gc,#10244A) 7%,#fff),#fff 160px);box-shadow:0 8px 24px rgba(16,36,74,.08);overflow:hidden}
.cp-h{display:flex;align-items:center;gap:14px;padding:14px 20px;background:color-mix(in srgb,var(--gc,#10244A) 14%,#fff);border-bottom:2px dashed color-mix(in srgb,var(--gc,#10244A) 32%,#fff)}
.cp-h>div{flex:1;min-width:0}.cp-h b{display:block;font-family:var(--font-d);font-weight:600;font-size:18px;color:var(--gcd,var(--ink))}.cp-h small{display:block;color:var(--muted);font-size:14px}
.cp-ic{flex:none;width:38px;height:38px;border-radius:12px;display:grid;place-items:center;background:var(--gc,#10244A);color:#fff}.cp-ic svg{width:20px;height:20px}
.cp-sc{flex:none;font-family:var(--font-d);font-weight:500;font-size:14.5px;color:var(--muted);text-align:right}.cp-sc.done{color:var(--gcd,var(--ink))}.cp-sc b{font-size:20px}
.cp-list{display:flex;flex-direction:column}
.cp-q{padding:20px clamp(14px,3vw,24px) 22px}.cp-q+.cp-q{border-top:1.5px solid var(--line)}
.cp-qh{display:flex;gap:14px;align-items:flex-start}
.cp-no{flex:none;min-width:34px;height:34px;border-radius:50%;display:grid;place-items:center;background:var(--gc,#10244A);color:#fff;font-family:var(--font-d);font-weight:600;font-size:15px;margin-top:2px}
.cp-q.cp-done.cp-ok .cp-no{background:var(--ok)}
.cp-qh .qtext{flex:1;min-width:0;font-size:18px}.cp-qh .qtext p{margin:.2em 0}
.cp-ch{margin:16px 0 4px;gap:10px}.cp-ch .ch{font-size:17px;min-height:52px}
.cp-q .numin{margin:16px 0 4px}.cp-q .numin input{font-size:20px;width:190px}
.cp-q .sol{margin-top:14px}
.cp-prev{display:inline-flex;align-items:center;gap:8px;font-family:var(--font-d);font-weight:500;font-size:15.5px;border-radius:99px;padding:4px 14px;margin-top:12px}.cp-prev.ok{background:var(--okbg);color:#0d7a45}.cp-prev.bad{background:var(--badbg);color:#a52b26}.cp-prev svg{width:18px;height:18px}
.cp-det{margin-top:10px}.cp-det summary{cursor:pointer;font-family:var(--font-d);font-weight:500;color:var(--gcd,var(--ink));padding:4px 0}
.cp-again{margin-top:10px}
@media(max-width:600px){.cp-h{padding:12px 14px}.cp-sc{display:none}.cp-qh{gap:10px}.cp-no{min-width:30px;height:30px}}

@media print{.cp,.cp-box{display:none!important}}
