﻿@charset "UTF-8";
/* กิจกรรมประจำเล่ม และภาพเคลื่อนไหวบนหัวหน้าเล่ม */

/* หัวหน้าเล่ม */
.book-head { position: relative; overflow: hidden; }
.book-head .wrap { position: relative; z-index: 1; }
.ph-deco { position: absolute; right: 2%; top: 18px; width: 240px; height: auto; opacity: .55; pointer-events: none; }
@media (max-width: 760px) { .ph-deco { width: 130px; right: -10px; top: 8px; opacity: .35; } }
.ph-deco .flag-wave { animation: flag 2.4s ease-in-out infinite; transform-origin: 152px 40px; }
@keyframes flag { 0%, 100% { transform: skewY(0) scaleX(1); } 50% { transform: skewY(-4deg) scaleX(.94); } }
.ph-deco .scroll { animation: m-bob 4s ease-in-out infinite; }
.ph-deco .fire { animation: flicker 1s ease-in-out infinite alternate; transform-origin: 182px 138px; }
.ph-deco .tw, .sky .tw { animation: twinkle 2.6s ease-in-out infinite; }
@keyframes twinkle { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }
.ph-deco .shoot, .sky .shoot { stroke-dasharray: 40 400; stroke-dashoffset: 40; animation: shoot 5s ease-in infinite; }
.sky .shoot { stroke: #fff; stroke-width: 2.5; stroke-linecap: round; }
@keyframes shoot { 0%, 80% { stroke-dashoffset: 40; opacity: 0; } 82% { opacity: 1; } 100% { stroke-dashoffset: -360; opacity: 0; } }
.ph-deco .moon { animation: m-bob 6s ease-in-out infinite; }
.ph-deco .waves, .pond-svg .waves { animation: wave-x 3s linear infinite; }
@keyframes wave-x { from { transform: translateX(0); } to { transform: translateX(-40px); } }
.ph-deco .buoy { animation: buoy 2.6s ease-in-out infinite; transform-origin: 110px 96px; }
@keyframes buoy { 0%, 100% { transform: translateY(0) rotate(-6deg); } 50% { transform: translateY(8px) rotate(6deg); } }
.ph-deco .meridian { animation: spin-y 4s linear infinite; transform-origin: 110px 80px; }
@keyframes spin-y { 0% { transform: scaleX(1); } 50% { transform: scaleX(-1); } 100% { transform: scaleX(1); } }

/* กล่องกิจกรรม */
.lab-card { --g: var(--leaf); background: #fff; border: 3px solid var(--g); border-radius: 26px; padding: 18px 22px 22px; box-shadow: 0 7px 0 var(--g); }
.lab-head { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; }
.lab-head h3 { font: 600 22px/1.3 var(--fun); margin: 0; }
.lab-lead { font-size: 16.5px; }
.lab-lead .ic { margin-right: 4px; color: var(--g, var(--forest)); }
.lab-note { font-size: 13.5px; color: var(--muted); display: flex; gap: 6px; align-items: flex-start; margin: 14px 0 0; }
.lab-note .ic { margin-top: .25em; flex: none; }
.lab-err { color: var(--c-safety); font-size: 14.5px; margin: 8px 0 0; }

/* CPR */
.cpr-stage { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: center; }
@media (max-width: 640px) { .cpr-stage { grid-template-columns: 1fr; } }
.cpr-heart {
  position: relative; width: min(240px, 70vw); aspect-ratio: 1; margin: 0 auto; display: grid; place-items: center;
  border: 0; background: none; cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
.cpr-heart:focus { outline: none; }
.cpr-heart:focus-visible { outline: 3px dashed var(--sun); outline-offset: -6px; border-radius: 50%; }
.cpr-heart svg { position: absolute; inset: 0; width: 100%; height: 100%; fill: var(--coral); filter: drop-shadow(0 8px 0 #C94D3D); transition: transform .08s; }
.cpr-heart span { position: relative; font: 600 26px var(--fun); color: #fff; margin-top: -8%; }
.cpr-heart.push svg { animation: cpr-push .22s ease-out; }
@keyframes cpr-push { 40% { transform: scale(.86, .8); filter: drop-shadow(0 2px 0 #C94D3D); } }
.cpr-heart.beat::after { content: ''; position: absolute; inset: 6%; border-radius: 50%; border: 4px solid var(--sun); animation: ring .5s ease-out; }
@keyframes ring { from { opacity: 1; transform: scale(.85); } to { opacity: 0; transform: scale(1.15); } }
.cpr-heart.breath svg { fill: var(--sky); filter: drop-shadow(0 8px 0 #2F7DB8); }
.cpr-heart.inflate svg { animation: inflate .7s ease-in-out; }
@keyframes inflate { 50% { transform: scale(1.15); } }
.gauge { width: 100%; max-width: 280px; display: block; margin: 0 auto; }
.gauge #needle { transition: transform .25s cubic-bezier(.3, 1.4, .5, 1); }
.cpr-bpm { text-align: center; font: 500 16px var(--fun); }
.cpr-bpm b { font-size: 40px; }
.cpr-bpm b.ok { color: var(--c-skills); }
.cpr-bpm b.slow, .cpr-bpm b.fast { color: var(--c-safety); }
.cpr-count { text-align: center; font: 600 20px var(--fun); margin-top: 6px; }
.cpr-side .bar { height: 12px; }
.cpr-side .bar span { background: var(--coral); }
.cpr-guide { display: flex; gap: 8px; justify-content: center; align-items: center; font-size: 15px; margin-top: 10px; cursor: pointer; }
.cpr-guide input { width: 20px; height: 20px; accent-color: var(--forest); }

/* ดาวเหนือ */
.sky-wrap { position: relative; }
.sky { width: 100%; display: block; border-radius: 18px; background: radial-gradient(ellipse at 30% 20%, #23456E, #0E1B33 70%); }
.sky .bgstars circle { fill: #fff; }
.sky .const line { stroke: rgba(255, 255, 255, .28); stroke-width: 1.5; }
.sky .st { fill: #FFF6D0; cursor: pointer; transition: r .2s; filter: drop-shadow(0 0 4px rgba(255, 240, 170, .9)); }
.sky .st.big { fill: #FFF0B0; }
.sky .st:hover { r: 8; }
.sky .st.pick { fill: var(--sun); r: 9; }
.sky .st.found { fill: #FFD447; r: 11; animation: polaris 1.2s ease-in-out infinite; }
@keyframes polaris { 50% { filter: drop-shadow(0 0 16px #FFD447); } }
.sky .st.nope { fill: var(--coral); }
.sky .pointer { stroke: var(--sun); stroke-width: 3; stroke-dasharray: 8 6; opacity: 0; }
.sky .pointer.go { opacity: 1; animation: draw-line 1.4s ease-out forwards; stroke-dasharray: 600; stroke-dashoffset: 600; }
@keyframes draw-line { to { stroke-dashoffset: 0; } }
.sky .lbl { fill: rgba(255, 255, 255, .6); font: 13px var(--fun); }
.compass-rose {
  position: absolute; right: 12px; top: 12px; width: 184px; height: 184px; border-radius: 50%;
  background: rgba(255, 255, 255, .92); display: grid; place-items: center; font: 600 12.5px var(--fun); color: var(--forest);
  animation: toast-pop .5s cubic-bezier(.3, 1.5, .5, 1);
}
.compass-rose[hidden] { display: none; }
.compass-rose .ic { width: 64px; height: 64px; color: var(--coral); animation: m-tilt 2s ease-in-out infinite; }
.compass-rose span { position: absolute; }
.compass-rose .n { top: 8px; color: var(--c-safety); } .compass-rose .s { bottom: 8px; }
.compass-rose .e { right: 6px; } .compass-rose .w { left: 6px; }
@media (max-width: 600px) { .compass-rose { position: static; margin: 10px auto 0; width: 170px; height: 170px; } }

/* วัดก้าว */
.track {
  position: relative; height: 120px; border-radius: 18px; margin-bottom: 18px; overflow: hidden;
  background: linear-gradient(#DDF0D3 0 64%, #C7A876 64% 100%);
}
.track .flag { position: absolute; top: 8px; font: 600 13px var(--fun); background: var(--forest); color: #fff; padding: 3px 8px; border-radius: 8px; }
.track .f0 { left: 8px; } .track .f1 { right: 8px; }
.walker { position: absolute; left: 2%; bottom: 30px; width: 62px; }
.walker.go { animation: walk 3s ease-in-out forwards; }
.walker.go .mascot .m-all { animation: m-jump .35s ease-in-out infinite; }
@keyframes walk { to { left: calc(98% - 62px); } }
.prints i { position: absolute; bottom: 14px; width: 10px; height: 14px; border-radius: 50%; background: rgba(90, 52, 23, .5); opacity: 0; animation: print .3s forwards; }
.prints i.up { bottom: 24px; }
@keyframes print { to { opacity: 1; } }
.pace-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 760px) { .pace-grid { grid-template-columns: 1fr; } }
.pace-step { background: var(--paper); border-radius: 18px; padding: 16px 18px; }
.pace-step[hidden] { display: none; }
.pace-step h4 { font: 600 17px var(--fun); display: flex; gap: 8px; align-items: center; }
.trips { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 12px; }
@media (max-width: 480px) { .trips { grid-template-columns: repeat(2, 1fr); } }
.trips label, .inline { font: 500 14px var(--fun); color: var(--muted); }
.lab input[type=number] {
  width: 100%; font: 600 18px var(--fun); padding: 8px 10px; border-radius: 12px; border: 2px solid var(--line); background: #fff; color: var(--ink);
}
.inline input[type=number] { width: 110px; display: inline-block; margin: 0 6px 10px; }
.lab input[type=number]:focus { outline: none; border-color: var(--forest-2); }
.calc { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: baseline; background: #fff; border-radius: 12px; padding: 10px 14px; margin-top: 10px; animation: toast-pop .35s; }
.calc span { color: var(--muted); }
.calc b { font: 600 20px var(--fun); }
.calc.big b { font-size: 26px; color: var(--c-skills); }
.calc small { color: var(--muted); }
.eye-game { margin-top: 18px; }
.eye-q { display: grid; grid-template-columns: 200px 1fr; gap: 18px; align-items: center; }
@media (max-width: 560px) { .eye-q { grid-template-columns: 1fr; } }
.far { height: 150px; border-radius: 14px; background: linear-gradient(#BFE3F7 0 60%, #A8D08D 60%); display: grid; place-items: end center; padding-bottom: 14px; overflow: hidden; }
.far-person { width: 110px; transform: scale(var(--s)); transform-origin: bottom center; transition: transform .6s; }
.eye-end { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; font: 600 18px var(--fun); }

/* ช่วยคนตกน้ำ */
.pond { position: relative; margin-bottom: 14px; }
.pond-svg { width: 100%; display: block; border-radius: 18px; }
.pond-mascot { position: absolute; left: 2%; top: 4%; width: 17%; }
.swimmer { animation: m-bob 1.4s ease-in-out infinite; }
.swimmer .hands { animation: help 0.6s ease-in-out infinite alternate; transform-origin: 430px 130px; }
@keyframes help { to { transform: rotate(10deg); } }
.swimmer.saved { animation: saved 1.4s ease-in-out forwards; }
.swimmer.saved .hands { animation: none; }
@keyframes saved { to { transform: translate(-230px, -12px); } }
.fx { transform-box: fill-box; transform-origin: center; }
.fx.new { animation: toast-pop .5s cubic-bezier(.3, 1.5, .5, 1); }
.fx.reach.new { stroke-dasharray: 220; stroke-dashoffset: 220; animation: draw-line .8s ease-out forwards; }
.fx.row.new { animation: row 1.4s ease-out; }
@keyframes row { from { transform: translateX(-120px); } }
.rescue-done { display: grid; gap: 8px; margin-bottom: 12px; }
.rd { display: flex; gap: 12px; align-items: flex-start; background: #E4F5DF; border-radius: 14px; padding: 10px 14px; animation: toast-pop .35s; }
.rd > span { flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--leaf); color: #fff; display: grid; place-items: center; font: 600 15px var(--fun); }
.rd b { font-family: var(--head); font-weight: 500; display: block; }
.rd small { color: var(--muted); font-size: 14px; line-height: 1.5; display: block; }
.rescue-opts { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

/* รัชกาล */
.chips-pool { display: flex; flex-wrap: wrap; gap: 8px; min-height: 48px; padding: 10px; border: 2.5px dashed var(--line); border-radius: 16px; margin-bottom: 14px; }
.ev-chip {
  font: 500 14.5px/1.4 var(--body); text-align: left; padding: 8px 12px; border-radius: 12px; cursor: pointer;
  border: 2px solid var(--khaki); background: #FFF6D8; color: var(--ink); transition: transform .12s;
}
.ev-chip:hover { transform: translateY(-2px); }
.ev-chip.sel { background: var(--sun); border-color: #C98A12; box-shadow: 0 4px 0 #C98A12; transform: translateY(-3px); }
.ev-chip small { display: block; font-size: 12.5px; color: var(--muted); }
.ev-chip.right { background: #E4F5DF; border-color: var(--leaf); }
.ev-chip.wrong { background: #FCE6E2; border-color: var(--coral); }
.reign-cols { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
@media (max-width: 760px) { .reign-cols { grid-template-columns: 1fr 1fr; } }
.reign-col { min-height: 120px; background: var(--paper); border: 2.5px solid var(--line); border-radius: 16px; padding: 8px; display: flex; flex-direction: column; gap: 6px; cursor: pointer; }
.reign-col:hover { border-color: #94631A; }
.reign-col > b { font: 600 18px var(--fun); text-align: center; color: #94631A; }
.reign-col .ev-chip { font-size: 13px; }

@media (prefers-reduced-motion: reduce) { .walker.go { left: calc(98% - 62px); } }

/* หลายกิจกรรมในเล่มเดียว */
.lab-card + .lab-card { margin-top: 28px; }
.hurry { color: var(--coral); animation: pulse .8s ease-in-out infinite; display: inline-block; }

/* เล่ม 7 เกมของคิม */
.kim-start { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.kim-mascot { width: 96px; height: auto; }
.kim-tray { position: relative; margin: 6px auto 14px; max-width: 620px; padding: 18px; border-radius: 28px; background: #C9A46A; box-shadow: inset 0 0 0 8px #A9824A, 0 6px 0 #8A6A3A; overflow: hidden; }
.kim-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
@media (max-width: 520px) { .kim-grid { grid-template-columns: repeat(3, 1fr); } }
.kim-item { background: #fff; border-radius: 16px; padding: 10px 4px 6px; text-align: center; transform: rotate(var(--r)); animation: kim-drop .45s backwards; }
.kim-item .ic { width: 40px; height: 40px; color: var(--c); }
.kim-item small, .kim-opt small { display: block; font-size: 13px; line-height: 1.3; margin-top: 4px; }
@keyframes kim-drop { from { transform: translateY(-30px) rotate(0); opacity: 0; } }
.kim-cloth { position: absolute; inset: 0; background: repeating-linear-gradient(45deg, #2F6A3D 0 14px, #3B7E4A 14px 28px); transform: translateY(-105%); transition: transform .8s cubic-bezier(.5, 1.4, .6, 1); border-radius: 28px; }
.kim-tray.covered .kim-cloth { transform: none; }
.kim-opts { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; margin: 8px 0 16px; }
.kim-opt { background: #fff; border: 3px solid var(--line); border-radius: 16px; padding: 10px 4px 8px; cursor: pointer; font: inherit; color: var(--ink); transition: transform .1s; }
.kim-opt .ic { width: 34px; height: 34px; color: var(--forest); }
.kim-opt.on { border-color: var(--sun); background: #FFF6DA; transform: translateY(-3px); }
.kim-opt.right { border-color: var(--c-skills); background: var(--forest-l); }
.kim-opt.wrong { border-color: var(--coral); background: #FCE6E2; }
.kim-opt.missed { border-style: dashed; border-color: var(--c-skills); }
.kim-opt:disabled { cursor: default; }

/* เล่ม 13 ฐานแสงเลเซอร์ */
.lz-msg { min-height: 2.6em; }
.lz-msg.bad { color: var(--c-safety); }
.lz-stage { display: grid; grid-template-columns: 1fr minmax(240px, 1.3fr) 1fr; gap: 14px; align-items: stretch; }
@media (max-width: 720px) { .lz-stage { grid-template-columns: 1fr; gap: 10px; } .lz-scout { width: 58px; } .lz-side { padding: 8px; } }
.lz-side { background: #F4EEDD; border-radius: 18px; padding: 10px; }
.lz-in { background: #E5DCC4; }
.lz-out { background: #FFF6DA; }
.lz-side > b { display: flex; gap: 6px; align-items: center; font: 600 15px var(--fun); margin-bottom: 8px; }
.lz-pile { display: flex; flex-wrap: wrap; gap: 6px; }
.lz-scout { display: grid; justify-items: center; gap: 1px; width: 64px; padding: 6px 2px; border: 2px solid transparent; border-radius: 14px; background: #fff; cursor: pointer; font: inherit; color: var(--ink); }
.lz-out .lz-scout { cursor: default; }
.lz-face { width: 30px; height: 30px; border-radius: 50%; background: #6BBF59; color: #fff; display: grid; place-items: center; font: 600 15px var(--fun); }
.lz-scout.strong .lz-face { background: #E8590C; }
.lz-scout small { font-size: 12px; line-height: 1.2; }
.lz-scout em { font-style: normal; font-size: 10.5px; color: #E8590C; }
.lz-scout.sel { border-color: var(--sun); background: #FFF6DA; transform: translateY(-3px); box-shadow: 0 4px 0 #E3B53A; }
.lz-scout.arrive { animation: lz-in .6s ease-out; }
@keyframes lz-in { from { transform: translateX(-60px) rotate(-80deg); opacity: 0; } }
.lz-web { width: 100%; height: auto; display: block; border-radius: 14px; }
.lz-web .beams line { stroke: #FF7A1A; stroke-width: 3; filter: drop-shadow(0 0 3px #FF5A00); animation: beam 1.6s ease-in-out infinite; }
@keyframes beam { 50% { stroke: #FFB067; } }
.lz-hole rect { fill: #3C3A30; stroke: none; transition: fill .2s; }
.lz-hole text { font: 600 16px var(--fun); fill: #8C8670; pointer-events: none; }
.lz-web.ready .lz-hole:not(.closed) { cursor: pointer; }
.lz-web.ready .lz-hole:not(.closed) rect { fill: #4A5A3A; animation: hole-glow 1s ease-in-out infinite; }
.lz-web.ready .lz-hole:not(.closed) text { fill: #fff; }
.lz-hole:focus { outline: none; }
.lz-hole:focus-visible rect { stroke: var(--sun); stroke-width: 3; }
@keyframes hole-glow { 50% { fill: #5E7A45; } }
.lz-hole.h-step rect { fill: #3F4A2E; }
.lz-hole.h-floor rect { fill: #33404A; }
.lz-hole.closed rect { fill: #5A2A1E; }
.lz-hole.closed text { fill: #FF9A6A; }
.lz-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 10px 0; font-size: 13.5px; color: var(--muted); }
.lz-legend .k::before { content: ''; display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.lz-legend .h-step::before { background: #3F4A2E; }
.lz-legend .h-floor::before { background: #33404A; }
.lz-legend .h-lift::before { background: #3C3A30; }
.lz-tools { display: flex; gap: 10px; flex-wrap: wrap; }
.lz-hints p { background: #FFF6DA; border-radius: 12px; padding: 8px 12px; margin: 8px 0 0; font-size: 15px; animation: toast-pop .3s; }

/* เล่ม 13 เดินทางวิบาก */
.ob-track { position: relative; height: 92px; margin: 6px 0 12px; }
.ob-line { position: absolute; left: 4%; right: 2%; top: 62px; height: 8px; border-radius: 6px; background: repeating-linear-gradient(90deg, #C9B88C 0 18px, #B5A273 18px 36px); }
.ob-dot { position: absolute; top: 52px; width: 28px; height: 28px; margin-left: -14px; border-radius: 50%; background: #fff; border: 3px solid #C9B88C; display: grid; place-items: center; font: 600 13px var(--fun); color: var(--muted); }
.ob-dot.done { background: var(--leaf); border-color: var(--leaf); color: #fff; }
.ob-dot.now { border-color: var(--sun); color: var(--ink); animation: pulse 1s ease-in-out infinite; }
.ob-runner { position: absolute; top: -4px; width: 54px; margin-left: -27px; transition: left .6s cubic-bezier(.4, 1.4, .6, 1); z-index: 1; }
.ob-runner .mascot { width: 54px; height: auto; }
.ob-list { columns: 2 240px; font-size: 15px; padding-left: 22px; }
.ob-list .ic { color: var(--forest); }
.ob-go { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; font: 500 15px var(--fun); }
.ob-panel { background: #F4EEDD; border-radius: 20px; padding: 14px 16px 10px; text-align: center; }
.ob-panel h4 { font: 600 19px/1.4 var(--fun); margin: 0 0 4px; }
.ob-panel h4 .ic { vertical-align: -3px; margin-right: 6px; color: var(--forest); }
.ob-how { margin: 0 0 12px; color: var(--muted); font-size: 15px; }
.ob-say { min-height: 1.6em; color: var(--c-safety); font: 500 15px var(--fun); margin: 8px 0 0; }
.ob-act { display: grid; gap: 12px; justify-items: center; }
.ob-big { font-size: 20px; padding: 14px 30px; touch-action: manipulation; user-select: none; -webkit-user-select: none; }
.ob-big.boing { animation: pop .25s; }
.ob-pips { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.ob-pips i { width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 2px solid #C9B88C; }
.ob-pips i.on { background: var(--leaf); border-color: var(--leaf); }
.ob-meter { position: relative; width: min(420px, 100%); height: 34px; border-radius: 17px; background: #fff; border: 3px solid #C9B88C; overflow: hidden; }
.ob-meter .zone { position: absolute; left: 38%; width: 24%; top: 0; bottom: 0; background: #BEE6B0; }
.ob-mark { position: absolute; top: 2px; bottom: 2px; width: 10px; margin-left: -5px; border-radius: 5px; background: var(--coral); animation: sweep 1.3s ease-in-out infinite alternate; }
.ob-meter.hit .ob-mark { animation-play-state: paused; background: var(--forest); }
@keyframes sweep { from { left: 4%; } to { left: 96%; } }
.ob-beam { position: relative; width: min(420px, 100%); height: 40px; }
.ob-beam::before { content: ''; position: absolute; left: 0; right: 0; top: 26px; height: 12px; border-radius: 6px; background: linear-gradient(90deg, #E9B8A8, #BEE6B0 30%, #BEE6B0 70%, #E9B8A8); border: 2px solid #8a5a2b; }
.ob-tilt { position: absolute; top: 0; width: 26px; height: 26px; margin-left: -13px; border-radius: 50%; background: #F7942F; border: 3px solid #5A3417; transition: left .05s linear; }
.ob-tilt.warn { background: var(--coral); }
.ob-beam + .bar { width: min(420px, 100%); margin: 0; }
.ob-lr { display: flex; gap: 12px; }
.ob-lr .btn { font-size: 18px; padding: 12px 22px; touch-action: manipulation; user-select: none; -webkit-user-select: none; }
.ob-chairs { display: flex; gap: 8px; }
.ob-chairs span { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: #fff; border: 2px solid #C9B88C; color: var(--muted); }
.ob-chairs span.now { border-color: var(--sun); background: #FFF6DA; color: var(--ink); transform: scale(1.15); }
.ob-chairs span.done { background: var(--leaf); border-color: var(--leaf); color: #fff; }
.ob-hold { position: relative; width: 150px; height: 150px; border: 0; background: none; padding: 0; cursor: pointer; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.ob-hold svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ob-hold .bg { fill: #fff; stroke: #E5DCC4; stroke-width: 10; }
.ob-hold .fg { fill: none; stroke: var(--leaf); stroke-width: 10; stroke-linecap: round; }
.ob-hold span { position: absolute; inset: 0; display: grid; place-items: center; padding: 26px; font: 600 15px/1.3 var(--fun); color: var(--forest); }
.ob-hold.down { transform: scale(.95); }
.ob-hold.ok .bg { fill: var(--forest-l); }
.ob-grid { display: grid; grid-template-columns: repeat(3, 64px); gap: 8px; }
.ob-grid button { width: 64px; height: 64px; border-radius: 12px; border: 3px solid #C9B88C; background: #fff; cursor: pointer; touch-action: manipulation; }
.ob-grid button.lit { background: var(--sun); border-color: #E3A21A; animation: pop .3s; }

/* เล่ม 13 สัญญาณนกหวีด */
.wh-stage { position: relative; }
.wh-scene { width: 100%; height: auto; display: block; border-radius: 18px; }
.wh-scene .wh-patrol { transition: transform .8s ease-out; }
.wh-scene.arrive .wh-patrol { animation: wh-walk 1.4s ease-out; }
@keyframes wh-walk { from { transform: translateX(-200px); } }
.wh-scene.arrive .wh-b, .wh-scene.leave .wh-b { animation: m-bob .4s ease-in-out infinite; }
.wh-scene.report .s0 { transform: translate(300px, 0); transition: transform .6s; }
.wh-scene .wh-s { transition: transform .6s; }
.wh-scene.work .wh-b { animation: wh-busy .7s ease-in-out infinite alternate; }
.wh-scene.work .s1 .wh-b, .wh-scene.work .s3 .wh-b, .wh-scene.work .s5 .wh-b { animation-delay: -.35s; }
@keyframes wh-busy { to { transform: translateY(-8px) rotate(4deg); } }
.wh-scene.leave .wh-patrol { animation: wh-out 2.4s ease-in forwards .3s; }
@keyframes wh-out { to { transform: translateX(-420px); } }
.wh-blow { position: absolute; left: 12px; top: 10px; display: flex; gap: 8px; align-items: center; background: #fff; border: 3px solid var(--sky); border-radius: 18px; padding: 6px 12px; cursor: pointer; font: inherit; color: var(--ink); }
.wh-blow > .ic { width: 28px; height: 28px; color: #24486F; }
.wh-blow small { font-size: 12px; color: var(--muted); }
.wh-bars { display: flex; gap: 6px; }
.wh-bars i { width: 42px; height: 10px; border-radius: 5px; background: #D6E9F7; position: relative; overflow: hidden; }
.wh-bars i::after { content: ''; position: absolute; inset: 0; background: var(--sky); transform: scaleX(0); transform-origin: left; }
.wh-blow.on .wh-bars i::after { animation: wh-bar .9s linear forwards; }
.wh-blow.on .wh-bars i:nth-child(2)::after { animation-delay: 1.2s; }
.wh-blow.on > .ic { animation: wh-shake .15s linear 6; }
@keyframes wh-bar { to { transform: scaleX(1); } }
@keyframes wh-shake { 50% { transform: rotate(-12deg); } }
.wh-q { margin: 4px 0 10px; font-size: 17px; }
.wh-why { background: #E4F5DF; border-radius: 14px; padding: 10px 14px; display: flex; gap: 8px; align-items: flex-start; animation: toast-pop .35s; }
.wh-why .ic { flex: none; margin-top: .2em; color: var(--forest); }
@media (prefers-reduced-motion: reduce) {
  .lz-web .beams line, .ob-mark, .kim-item, .wh-scene * { animation-duration: .01s !important; }
  .ob-mark { animation: sweep 2.6s ease-in-out infinite alternate !important; }
}

/* ห้องเรียนเงื่อน */
.knots { --t: .7s; }
.knots.slow { --t: 1.6s; }
.knot-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.knot-tab { display: inline-flex; gap: 4px; align-items: center; border: 2px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 14px; font: 500 15px var(--fun); color: var(--ink); cursor: pointer; }
.knot-tab .ic { width: 16px; height: 16px; color: var(--c-skills); }
.knot-tab.on { background: var(--forest); border-color: var(--forest); color: #fff; }
.knot-tab.on .ic { color: #fff; }
.knot-stage { position: relative; background: #FBF6E6; border-radius: 22px; padding: 10px; background-image: radial-gradient(#E9DFC2 1px, transparent 1px); background-size: 18px 18px; }
.knot-title { position: absolute; left: 16px; top: 12px; font: 600 18px var(--fun); }
.knot-title small { font: 400 13px var(--body); color: var(--muted); }
.knot-svg { display: block; width: 100%; max-width: 620px; height: auto; margin: 0 auto; overflow: visible; }
.knot-mascot { position: absolute; right: 8px; bottom: 6px; width: 70px; }
.knot-mascot .mascot { width: 100%; height: auto; }
@media (max-width: 560px) {
  .knot-mascot { width: 48px; } .knot-title { position: static; margin: 2px 6px 4px; }
  .knot-tabs { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; margin-right: -12px; } .knot-tab { flex: none; }
}
.rp path { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.rp .ro { stroke: #5A3A1A; }
.rp.a path { stroke-dasharray: 1 1; stroke-dashoffset: 1; animation: rope-draw var(--t) ease-in-out forwards; animation-delay: calc(var(--i) * var(--t)); }
@keyframes rope-draw { to { stroke-dashoffset: 0; } }
.kpole { fill: #B07A45; stroke: #6B4A2B; stroke-width: 3; }
.k-behind.k-slide { animation: k-slide calc(var(--t) * 2) ease-in-out both; }
@keyframes k-slide { from { transform: translateX(120px); } }
.k-pole-in { animation: k-drop var(--t) ease-out both; }
@keyframes k-drop { from { transform: translateY(-260px); } }
.k-fadeout { animation: k-out var(--t) ease-out forwards; }
@keyframes k-out { to { opacity: 0; } }
@keyframes k-fade { to { opacity: 1; } }
.k-pullA { animation: k-pullA calc(var(--t) * 2) ease-in-out both; }
.k-pullB { animation: k-pullB calc(var(--t) * 2) ease-in-out both; }
@keyframes k-pullA { to { transform: translateX(-30px); } }
@keyframes k-pullB { to { transform: translateX(30px); } }
.k-tight { transform-box: view-box; transform-origin: 200px 130px; animation: k-tight calc(var(--t) * 1.2) ease-in-out calc(var(--t) * 2) both; }
@keyframes k-tight { to { transform: scaleX(.78); } }
.knot-dots { display: flex; gap: 8px; justify-content: center; margin: 12px 0 4px; }
.knot-dots button { width: 34px; height: 34px; border-radius: 50%; border: 2px solid #C9B88C; background: #fff; font: 600 14px var(--fun); color: var(--muted); cursor: pointer; }
.knot-dots button.done { background: var(--leaf); border-color: var(--leaf); color: #fff; }
.knot-dots button.on { background: var(--sun); border-color: #E3A21A; color: #5A3A00; transform: scale(1.1); }
.knot-step { font-size: 17px; text-align: center; min-height: 2.6em; margin: 6px 0 10px; }
.knot-step b { font-family: var(--fun); color: var(--forest); margin-right: 4px; }
.knot-review { display: inline-block; font-size: 12.5px; background: #FFE3B3; color: #8A5A00; border-radius: 999px; padding: 1px 10px; vertical-align: 2px; }
.knot-ctrl { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.knot-ctrl .k-slow.on { background: #FFF6DA; border-color: var(--sun); }
.knot-info { background: #F4EEDD; border-radius: 16px; padding: 10px 14px; margin-top: 14px; font-size: 15px; }
.knot-info p { margin: 4px 0; }
.knot-info .ic { vertical-align: -3px; margin-right: 4px; color: var(--forest); }
.knot-from { color: var(--muted); font-size: 14px; }
@media (prefers-reduced-motion: reduce) { .knots { --t: .01s; } }
.k-squeeze { transform-box: view-box; transform-origin: 200px 125px; animation: k-squeeze calc(var(--t) * 1.6) ease-in-out both; }
.k-squeeze path { vector-effect: non-scaling-stroke; }
@keyframes k-squeeze { to { transform: scale(.82, .62); } }
