/* ==========================================================
   Skooldio New Year Gift 2027 — Web flow prototype
   หน่วย px ทั้งหมดอิง artboard 1080×1920 ของ Figma
   ========================================================== */
:root {
  --yellow: #ffd113;
  --orange: #faa91a;
  --blue: #5bb0d5;
  --ink: #4e4e4e;
  --ink-soft: #4b4a4b;
  --sky: #429bdb;
  --ease-out: cubic-bezier(.2, .8, .2, 1);
  --ease-pop: cubic-bezier(.34, 1.56, .64, 1);
  --plane-ease: cubic-bezier(.6, 0, .4, 1);   /* เครื่องบินและ wipe ใช้ ease + เวลาเดียวกัน */
  --plane-dur: 1500ms;  /* ค่าจริง set จาก config.timing ใน js/app.js */
  --turn-dur: 900ms;
  --tool-dur: 900ms;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: #14212e;
  font-family: "Rubik", "IBM Plex Sans Thai", system-ui, sans-serif;
  color: var(--ink);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
img { display: block; }

/* ---------- Stage ---------- */
.viewport {
  position: fixed; inset: 0;
  display: grid; place-items: center;
}
.stage {
  position: absolute;
  left: 50%; top: 50%;
  width: 1080px; height: 1920px;
  transform-origin: 0 0;
  /* transform ถูก set จาก JS: scale ให้พอดีจอ */
  overflow: hidden;
  perspective: 2800px;            /* สำหรับพลิกหน้า */
  background: var(--sky);
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.bg { position: absolute; inset: 0; background-size: cover; background-position: center; transition: opacity .5s ease; }
.bg--sky   { background: #419ada; overflow: hidden; }

/* เมฆ: layer แยกจากสีฟ้า ลอยซ้าย–ขวาช้า ๆ ตลอดเวลา (เป็น motion เดียวของพื้นหลัง)
   data-sky="low" = เมฆอยู่ต่ำ ใช้ตั้งแต่ปิดเล่มจนจบ (ขอบคุณ → เครื่องบิน → HNY)
   สลับตำแหน่งแบบไม่มี transition และสลับเฉพาะตอนที่หน้ากระดาษบังท้องฟ้าอยู่ → ผู้ใช้ไม่เห็นพื้นหลังเลื่อน */
.clouds { position: absolute; inset: 0; }
.stage[data-sky="low"] .clouds { transform: translateY(600px); }
.clouds__layer { position: absolute; top: 0; bottom: 0; left: -8%; right: -8%; background: url(../assets/clouds.png) center / 100% 100% no-repeat; will-change: transform; }
.clouds__layer--near { animation: cloud-drift 38s ease-in-out infinite alternate; }
.clouds__layer--far  { opacity: .4; top: -90px; animation: cloud-drift-far 56s ease-in-out infinite alternate; }
@keyframes cloud-drift     { from { transform: translateX(-60px); } to { transform: translateX(60px); } }
@keyframes cloud-drift-far { from { transform: scaleX(-1.2) translateX(-50px); } to { transform: scaleX(-1.2) translateX(50px); } }
.bg--paper { background-image: url(../assets/bg-paper-hex.jpg); opacity: 0; }
.stage[data-bg="paper"] .bg--paper { opacity: 1; }

.scene {
  position: absolute; inset: 0;
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity .5s ease, visibility 0s linear .5s;
}
.scene.is-active {
  opacity: 1; visibility: visible; pointer-events: auto;
  transition: opacity .5s ease, visibility 0s;
}

.logo { position: absolute; left: 50%; transform: translateX(-50%); }
.logo--seat { top: 201px; width: 272px; }
.logo--top  { top: 151px; width: 272px; }
.logo--stat { top: 211px; width: 215px; }

/* ---------- Buttons ---------- */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 30px;
  width: 760px; height: 140px;
  background: var(--yellow);
  border: 4px solid rgba(255, 255, 255, .5);
  border-radius: 140px;
  font-family: "Inter", "IBM Plex Sans Thai", sans-serif;
  font-size: 50px; color: #000;
  transition: transform .15s ease, filter .15s ease;
}
.btn:active { transform: scale(.97); filter: brightness(.95); }
.btn:focus-visible, .seat__input:focus-visible, .hny__replay:focus-visible { outline: 6px solid #fff; outline-offset: 6px; }
.btn[disabled] { opacity: .7; cursor: progress; }
.btn--icon { font-size: 45px; }

/* ปุ่ม Share/Download แบบ 2 จังหวะ (js/app.js) — is-loading: แถบเติมตาม --p (0..1) อยู่หลังไอคอน/ข้อความ
   is-indeterminate: ไม่รู้ขนาดไฟล์ แถบวิ่งไปมา · is-ready: พื้นขาว + กรอบเหลือง + กระพริบ 1 ครั้ง */
.hny__actions .btn { position: relative; overflow: hidden; isolation: isolate; }
.btn.is-loading { background: #fff0b0; cursor: progress; }
.btn.is-loading::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: var(--yellow);
  transform-origin: left center; transform: scaleX(var(--p, 0));
  transition: transform .2s linear;
}
.btn.is-indeterminate::before { transform: translateX(-100%) scaleX(.4); transform-origin: left center; animation: btn-indeterminate 1.2s ease-in-out infinite; transition: none; }
.btn.is-ready { background: #fff; border-color: var(--yellow); animation: btn-ready .9s var(--ease-out) 1; }
@keyframes btn-indeterminate { from { transform: translateX(-40%) scaleX(.4); } to { transform: translateX(100%) scaleX(.4); } }
@keyframes btn-ready {
  0%   { transform: scale(1);    box-shadow: 0 0 0 0 rgba(255, 209, 19, .8); }
  35%  { transform: scale(1.05); }
  100% { transform: scale(1);    box-shadow: 0 0 0 40px rgba(255, 209, 19, 0); }
}

/* ==========================================================
   1 · Seat Number
   ========================================================== */
.seat__icon {
  position: absolute; left: 50%; top: 520px;
  width: 135.5px; height: 167.7px;
  margin-left: -67.7px; margin-top: -16px;
  transform: rotate(90deg);
}
.seat__copy {
  position: absolute; left: 0; right: 0; top: 722px;
  font-family: "Sriracha", "IBM Plex Sans Thai", cursive;
  color: #fff; text-align: center; line-height: 1.2;
}
.seat__copy > span { position: absolute; left: 0; right: 0; white-space: nowrap; }   /* เฉพาะบรรทัด ไม่รวมตัวอักษรที่ถูกแยกเป็น span */
.seat__l1 { top: 0;       font-size: 63px; letter-spacing: .63px; }
.seat__l2 { top: 101px;   font-size: 63px; letter-spacing: .63px; }
.seat__l3 { top: 187px;   font-size: 96.5px; letter-spacing: .96px; }
.seat__l3 b { font-weight: 400; font-size: 112.5px; }
.seat__l4 { top: 305.5px; font-size: 96.5px; letter-spacing: .96px; }

.seat__form { position: absolute; left: 0; right: 0; top: 1200px; }   /* Figma 1264 — ขยับขึ้นให้มีที่สำหรับช่องชื่อ */

/* เปิดหน้า: ไอคอน → เมฆรวมตัวเป็นข้อความทีละบรรทัด (keyframes cloud-letter) → ฟอร์มเลื่อนขึ้น */
.seat__copy .ch { display: inline-block; white-space: pre; opacity: 0; }
.seat__l1 { --ld: 250ms; } .seat__l2 { --ld: 550ms; } .seat__l3 { --ld: 900ms; } .seat__l3 b { --ld: 1100ms; } .seat__l4 { --ld: 1250ms; }
.scene--seat.is-ready .seat__copy .ch { animation: cloud-letter 1.1s cubic-bezier(.25, .6, .2, 1) calc(var(--i) * 22ms + var(--ld, 0ms)) forwards; }
.seat__icon { opacity: 0; }
/* บินเข้า แล้วลอยตัวขึ้นลงเบา ๆ ตลอด (จังหวะเดียวกับ jet stream ด้านหลัง) */
.scene--seat.is-ready .seat__icon { animation: seat-icon 1.25s cubic-bezier(.2, .7, .25, 1) forwards, seat-icon-idle 3s ease-in-out 2.05s infinite alternate; }
@keyframes seat-icon-idle { from { transform: translateY(0) rotate(90deg); } to { transform: translateY(-9px) rotate(88.5deg); } }
/* บินเข้าจากนอกจอซ้าย (ต่ำกว่าเล็กน้อย เชิดหัวขึ้น) เลยจุดจอดไปนิดแล้วถอยกลับ */
@keyframes seat-icon {
  0%   { opacity: 0; transform: translate(-760px, 70px) rotate(80deg); }
  12%  { opacity: 1; }
  72%  { opacity: 1; transform: translate(26px, -8px) rotate(93deg); }
  100% { opacity: 1; transform: translate(0, 0) rotate(90deg); }
}
/* jet stream: เส้นเมฆ 2 เส้นหลังเครื่องบิน — ยืดออกตอนบินเข้า แล้วค้างไว้จาง ๆ และไหลเบา ๆ ให้ดูเหมือนกำลังบินอยู่ */
.seat__trail {
  position: absolute; right: 622px; top: 556px; width: 600px; height: 62px;
  opacity: 0; transform-origin: 100% 50%;
}
.seat__trail::before, .seat__trail::after {
  content: ""; position: absolute; left: 0; right: 0; height: 9px;
  border-radius: 999px; filter: blur(3px);
  background: linear-gradient(to left, rgba(255, 255, 255, .95), rgba(255, 255, 255, .5) 35%, rgba(255, 255, 255, 0));
}
.seat__trail::before { top: 10px; }
.seat__trail::after  { bottom: 10px; right: 6px; }
.scene--seat.is-ready .seat__trail { animation: seat-trail 1.7s ease-out .35s forwards, seat-trail-idle 3s ease-in-out 2.05s infinite alternate; }
@keyframes seat-trail {
  0%   { opacity: 0;   transform: translateY(18px) rotate(-4deg) scaleX(.15); }
  35%  { opacity: .9;  transform: translateY(4px) rotate(-1deg) scaleX(1); }
  100% { opacity: .42; transform: scaleX(.92); }
}
@keyframes seat-trail-idle {
  from { opacity: .42; transform: translateY(0) scaleX(.92); }
  to   { opacity: .28; transform: translateY(-9px) scaleX(1.06); }
}
.seat__form { opacity: 0; transform: translateY(40px); }
.scene--seat.is-ready .seat__form { animation: rise .7s var(--ease-out) 1.9s forwards; }

/* ---- ออกจากหน้าแรก (หลังได้ข้อมูล + preload ครบ) → .scene--seat.is-leaving ----
   กล่องกรอก/ปุ่มยุบตัวจางลง · ข้อความฟุ้งเป็นเมฆ · เครื่องบินบินออกทางขวา · โลโก้เลื่อนขึ้นไปตำแหน่งของฉากถัดไป
   (กติกาชุดนี้ต้องอยู่หลังชุด is-ready เพื่อทับ animation ตอนเข้า) */
.logo--seat { transition: transform var(--exit-dur, 900ms) cubic-bezier(.5, 0, .2, 1); }
.scene--seat.is-leaving .logo--seat { transform: translate(-50%, -50px); }           /* 201 → 151 */
.scene--seat.is-leaving .seat__label  { animation: seat-out-fade .3s ease-in forwards; }
.scene--seat.is-leaving .seat__error  { animation: seat-out-fade .2s ease-in forwards; }
.scene--seat.is-leaving .seat__input  { animation: seat-out-box .5s cubic-bezier(.5, 0, .9, .5) .05s forwards; }
.scene--seat.is-leaving .seat__submit { animation: seat-out-box .5s cubic-bezier(.5, 0, .9, .5) .16s forwards; }
.scene--seat.is-leaving .seat__copy .ch { animation: cloud-disperse .85s cubic-bezier(.4, 0, .7, .6) calc(var(--i) * 9ms + var(--ld, 0ms) * .18) forwards; }
.scene--seat.is-leaving .seat__icon  { animation: seat-icon-out .8s cubic-bezier(.6, 0, .9, .5) forwards; }
.scene--seat.is-leaving .seat__trail { animation: none; opacity: 0; }
@keyframes seat-out-fade { to { opacity: 0; } }
@keyframes seat-out-box {
  0%   { opacity: 1; transform: none; filter: blur(0); }
  100% { opacity: 0; transform: translateY(46px) scale(.9, .7); filter: blur(10px); }
}
@keyframes seat-icon-out {
  0%   { opacity: 1; transform: translate(0, 0) rotate(90deg); }
  25%  { opacity: 1; transform: translate(-22px, 6px) rotate(86deg); }       /* ย่อตัวก่อนพุ่ง */
  100% { opacity: 0; transform: translate(880px, -210px) rotate(72deg); }
}
.seat__label {
  display: block; text-align: center;
  font-family: "Inter", sans-serif; font-size: 40px; line-height: 48px; color: var(--ink-soft);
}
.seat__input {
  display: block; width: 704px; height: 117px; margin: 24px auto 0;
  padding: 10px 37px;
  background: #fff; border: 0; border-radius: 18px;
  font-family: "IBM Plex Sans Thai", sans-serif; font-weight: 500; font-size: 44px; color: var(--ink);
  text-transform: uppercase;
}
.seat__input::placeholder { color: #c5c5c5; font-size: 38px; text-transform: none; }
.seat__input.is-invalid { box-shadow: 0 0 0 5px #e5484d; }
/* ช่องชื่อ: ไม่มีใน Figma — ต่อจาก Seat ด้วยหน้าตาเดียวกัน */
.seat__label--name { margin-top: 32px; }
.seat__error {
  /* ไม่มีใน Figma — เพิ่มเพื่อรองรับ Seat ผิด/หาไม่เจอ */
  width: 704px; margin: 18px auto 0;
  font-family: "IBM Plex Sans Thai", sans-serif; font-weight: 500; font-size: 32px; line-height: 1.35; color: #a4161a;
  background: rgba(255, 255, 255, .85); border-radius: 14px; padding: 12px 24px;
}
.seat__submit { margin: 40px auto 0; }   /* ต่อท้ายฟอร์ม (ข้อความแจ้งเตือนดันปุ่มลง) */

/* ==========================================================
   2–3 / 10–11 · Passport book
   ========================================================== */
.scene--book { perspective: 2600px; perspective-origin: 540px 960px; }
.book {
  position: absolute; left: 118px; top: 513px;
  width: 831.6px; height: 1155px;
  transform-style: preserve-3d;
  transform: translate(0, 1500px) rotate(-8deg) scale(.9);   /* จุดเริ่ม: ใต้ขอบจอ เอียงเล็กน้อย */
  opacity: 0;
  transition: transform .6s var(--ease-out), opacity .6s ease;
}
/* เข้าฉาก: ลอยขึ้นจากใต้เมฆ หมุนกลับมาตรง ช้าลงตอนถึงที่ */
.book.is-rising { transition: transform var(--rise-dur, 1100ms) cubic-bezier(.16, .84, .28, 1), opacity .25s ease; }

/* ก้อนเมฆที่เล่มทะลุขึ้นมา: บังส่วนล่างตอนเริ่ม แล้วแตกออกสองข้างพร้อมจางหาย */
.book__puffs { position: absolute; inset: 0; pointer-events: none; }
.book__puffs i {
  position: absolute; left: var(--x); top: var(--y); width: var(--w); height: calc(var(--w) * .5);
  border-radius: 50%; opacity: 0; filter: blur(38px);
  background: radial-gradient(closest-side, #fff, rgba(255, 255, 255, .6) 55%, rgba(255, 255, 255, 0));
}
.book__puffs i:nth-child(1) { --x: -60px;  --y: 1500px; --w: 620px; --tx: -260px; --ty: 40px; }
.book__puffs i:nth-child(2) { --x: 520px;  --y: 1480px; --w: 640px; --tx: 280px;  --ty: 30px; }
.book__puffs i:nth-child(3) { --x: 220px;  --y: 1600px; --w: 660px; --tx: -40px;  --ty: 110px; }
.book__puffs i:nth-child(4) { --x: 40px;   --y: 1330px; --w: 460px; --tx: -320px; --ty: -30px; }
.book__puffs i:nth-child(5) { --x: 600px;  --y: 1340px; --w: 460px; --tx: 330px;  --ty: -20px; }
.scene--book.is-emerging .book__puffs i { animation: book-puff calc(var(--rise-dur, 1100ms) + 500ms) ease-out forwards; }
@keyframes book-puff {
  0%   { opacity: 0;  transform: scale(.7); }
  22%  { opacity: .95; transform: scale(1); }
  55%  { opacity: .45; transform: translate(calc(var(--tx) * .45), calc(var(--ty) * .45)) scale(1.15); }
  100% { opacity: 0;  transform: translate(var(--tx), var(--ty)) scale(1.5); }
}
.book.is-in     { transform: none; opacity: 1; }
/* ซูมให้หน้ากระดาษเต็มจอ: scale = 1920 / 1155 */
.book.is-zoomed { transform: translate(6px, -130.5px) scale(1.6624); opacity: 1; transition: transform .6s cubic-bezier(.5, 0, .2, 1); }
.book.is-zoomed.is-closing { transition: none; }
.book.is-closing .book__cover { transition: none; }
.book.is-out    { opacity: 0; transition: opacity .8s ease; }

.book__page {
  position: absolute; inset: 0;
  border-radius: 0 36px 36px 0;
  background: url(../assets/bg-paper-hex.jpg) center / cover;
  box-shadow: 0 18px 50px rgba(20, 50, 80, .25);
  overflow: hidden;
}
.book__pagecontent {
  /* artboard 1080×1920 ย่อให้สูงเท่าหน้ากระดาษ → ตอน book ซูมเต็มจอจะกลับมา 1:1 พอดี */
  position: absolute; left: 50%; top: 0;
  width: 1080px; height: 1920px; margin-left: -540px;
  transform-origin: 50% 0; transform: scale(.60156);
}
.book__cover {
  position: absolute; inset: 0;
  transform-origin: 0 50%;
  transform-style: preserve-3d;
  transition: transform .8s cubic-bezier(.6, 0, .3, 1);
}
.book.is-open .book__cover { transform: rotateY(-178deg); }
.book__front, .book__inside {
  position: absolute; inset: 0; width: 100%; height: 100%;
  border-radius: 0 36px 36px 0;
  backface-visibility: hidden;
}
.book__inside { background: #454545; transform: rotateY(180deg); border-radius: 36px 0 0 36px; }

/* ==========================================================
   4 · Profile
   ========================================================== */
.profile__photo { position: absolute; left: 0; top: 0; width: 1080px; height: 1000px; }
.profile__ring { position: absolute; left: 233px; top: 380px; width: 614px; height: 614px; }
/* ตอนรูปขึ้น: วงเส้นประขยาย + หมุนเข้าที่ แล้วหมุนช้า ๆ ต่อ · รูปเด้งเข้า · เครื่องบินเล็กบนวงโยกตัว · ตราไปรษณีย์แกว่งเบา ๆ */
.profile__photo.is-in .profile__ring { animation: profile-ring-in 1s var(--ease-out) both, ring-spin 80s linear 1s infinite; }
@keyframes profile-ring-in { from { opacity: 0; transform: scale(.78) rotate(-70deg); } to { opacity: 1; transform: scale(1) rotate(0); } }
.profile__photo.is-in .avatar--profile { animation: profile-avatar-in .7s var(--ease-pop) both; }
@keyframes profile-avatar-in { from { transform: scale(.86); } to { transform: none; } }
.profile__photo.is-in .profile__plane { animation: profile-plane 3.2s ease-in-out 1s infinite alternate; }
@keyframes profile-plane { from { transform: translate(0, 0) rotate(48deg); } to { transform: translate(6px, -8px) rotate(53deg); } }
.profile__photo.is-in .profile__postmark { transform-origin: 30% 85%; animation: ring-postmark 5s ease-in-out 1s infinite alternate; }
.profile__postmark { position: absolute; left: 68px; top: 408px; width: 344px; height: 294px; }
.profile__plane { position: absolute; left: 714px; top: 857px; width: 75.5px; height: 93.5px; transform: rotate(48deg); }

.avatar {
  position: absolute; border-radius: 50%; overflow: hidden;
  background: linear-gradient(189deg, #9ad0e8 1%, #369dc9 87%);
  display: grid; place-items: center;
}
/* --photo-* มาจาก photoFit (app.js ตั้งให้) หน่วย % ของวง · min-height กันรูปเตี้ยจนเห็นขอบล่าง */
.avatar img {
  position: absolute; max-width: none;
  left: calc((100% - var(--photo-scale, 115%)) / 2 + var(--photo-x, 0%)); top: var(--photo-y, 0%);
  width: var(--photo-scale, 115%); height: auto; min-height: calc(100% - var(--photo-y, 0%));
  object-fit: cover; object-position: 50% 0;
}
.avatar img:not([src]), .avatar img[src=""] { display: none; }
.avatar span { font-weight: 600; color: #fff; }
.avatar--profile { left: 290px; top: 437px; width: 500px; height: 500px; }
.avatar--profile span { font-size: 220px; }

.profile__fields {
  position: absolute; left: 247px; top: 1066px; width: 586px;
  display: flex; flex-direction: column; gap: 40px;
}
.field dt {
  height: 28px; line-height: 28px; margin-bottom: 20px;
  font-style: italic; font-weight: 400; font-size: 39.8px; color: var(--blue); white-space: nowrap;
}
.field dd {
  height: 79.6px; display: flex; align-items: center; padding: 0 36.6px;
  background: rgba(255, 255, 255, .8);
  font-weight: 600; font-size: 47.8px; letter-spacing: .48px; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* ชื่อยาว: JS จะใส่ --fit เพื่อย่อฟอนต์ */
.field dd { font-size: calc(47.8px * var(--fit, 1)); }

/* fade ขึ้นทีละช่อง */
.scene--profile .profile__photo,
.scene--profile .field { opacity: 0; transform: translateY(24px); transition: opacity .5s ease, transform .5s var(--ease-out); }
.scene--profile .profile__photo.is-in,
.scene--profile .field.is-in { opacity: 1; transform: none; }

/* ==========================================================
   5a–8 · Stat cards
   ========================================================== */
.stat__title {
  position: absolute; left: 0; right: 0; top: 360px;
  font-weight: 500; font-size: 65px; line-height: 1.2; text-align: center; text-transform: uppercase; color: var(--ink);
}
.stat__card { position: absolute; inset: 0; }
.stat__paper { position: absolute; left: 99px; top: 521px; width: 890.4px; height: 1135.6px; filter: drop-shadow(0 4px 6px rgba(120, 100, 80, .22)); }
.stat__frame { position: absolute; left: 200.4px; top: 630px; width: 687.2px; height: 736.9px; border: 3.55px solid var(--blue); border-radius: 26.7px; }
.stat__badge { position: absolute; left: 80px; top: 663px; width: 240px; height: 153px; }
.stat__mascot {
  position: absolute; left: 329px; top: 1432px; width: 423px; height: 289px;
  transform-origin: 50% 100%;
  --step: 620ms; --k: .45;                            /* ค้าง: เดินช้า ๆ อยู่กับที่ (--k = ความกว้างของก้าว) */
  animation: mascot-bob var(--step) ease-in-out infinite alternate;
}
.stat__mascot svg, .stat__mascot img { display: block; width: 100%; height: 100%; overflow: visible; }

/* ชิ้นส่วนใน mascot.svg (id จาก Figma): Vector = ขาหลัง · Vector_2 = ขาหน้า
   Group 1410104489 = แขนที่ชูขึ้น · Group 1410104491 = กระเป๋า + แขนที่ลาก
   ขาเป็นชิ้นแยกที่ซ่อนโคนไว้หลังลำตัว → จุดหมุนต้องอยู่ในลำตัว และหมุนไม่เกิน ~11° ไม่งั้นโคนขาโผล่/เส้นขอบตัดกัน
   ความรู้สึก "เดิน" มาจากลำตัวที่โยก + ขายกขึ้นลงเล็กน้อย */
.stat__mascot [id="Vector"], .stat__mascot [id="Vector_2"] { transform-box: fill-box; }
.stat__mascot [id="Vector"]   { transform-origin: 88% 6%;  animation: mascot-leg-back  calc(var(--step) * 2) ease-in-out infinite alternate; }
.stat__mascot [id="Vector_2"] { transform-origin: 50% -6%; animation: mascot-leg-front calc(var(--step) * 2) ease-in-out infinite alternate; }
.stat__mascot [id="Group 1410104489"] { transform-box: fill-box; transform-origin: 8% 92%; animation: mascot-arm var(--step) ease-in-out infinite alternate; }
.stat__mascot [id="Group 1410104491"] { transform-box: fill-box; transform-origin: 92% 12%; animation: mascot-bag calc(var(--step) * 2) ease-in-out infinite alternate; }
@keyframes mascot-leg-back  { from { transform: rotate(calc(11deg * var(--k))); } to { transform: rotate(calc(-9deg * var(--k))) translateY(calc(-5px * var(--k))); } }
@keyframes mascot-leg-front { from { transform: rotate(calc(-9deg * var(--k))) translateY(calc(-5px * var(--k))); } to { transform: rotate(calc(10deg * var(--k))); } }
@keyframes mascot-arm { from { transform: rotate(-4deg); } to { transform: rotate(7deg); } }
@keyframes mascot-bag { from { transform: rotate(-3deg); } to { transform: rotate(4deg); } }
@keyframes mascot-bob { from { transform: translateY(0) rotate(-1.2deg); } to { transform: translateY(-6px) rotate(1.2deg); } }

/* ตอนตัวเลขกำลังนับ: เดินเร็ว ก้าวกว้างขึ้น ตัวเอนไปข้างหน้า */
.stat__mascot.is-walk { --step: 170ms; --k: 1; animation-name: mascot-walk; }
@keyframes mascot-walk { from { transform: translateY(0) rotate(1.5deg) scale(1.02, .98); } to { transform: translateY(-14px) rotate(4.5deg) scale(.99, 1.02); } }

/* จังหวะสุดท้าย (ตัวเลขนับจบ): ย่อตัว → กระโดด → ลงพื้นแล้วเด้ง จากนั้นกลับไปเดินช้า ๆ */
.stat__mascot.is-hop { animation: mascot-hop .8s cubic-bezier(.3, .7, .4, 1), mascot-bob var(--step) ease-in-out .8s infinite alternate; }
.stat__mascot.is-hop [id="Vector"]   { animation: mascot-leg-back-jump  .8s ease-in-out, mascot-leg-back  calc(var(--step) * 2) ease-in-out .8s infinite alternate; }
.stat__mascot.is-hop [id="Vector_2"] { animation: mascot-leg-front-jump .8s ease-in-out, mascot-leg-front calc(var(--step) * 2) ease-in-out .8s infinite alternate; }
.stat__mascot.is-hop [id="Group 1410104489"] { animation: mascot-arm-jump .8s ease-in-out, mascot-arm var(--step) ease-in-out .8s infinite alternate; }
@keyframes mascot-hop {
  0%   { transform: none; }
  16%  { transform: translateY(9px) scale(1.09, .88); }
  48%  { transform: translateY(-66px) scale(.95, 1.07) rotate(-6deg); }
  74%  { transform: translateY(4px) scale(1.08, .9) rotate(2deg); }
  88%  { transform: translateY(-12px) scale(.99, 1.02); }
  100% { transform: translateY(0) rotate(-1.2deg); }
}
@keyframes mascot-leg-back-jump  { 0%, 100% { transform: none; } 48% { transform: rotate(14deg); }  74% { transform: rotate(-4deg); } }
@keyframes mascot-leg-front-jump { 0%, 100% { transform: none; } 48% { transform: rotate(-12deg); } 74% { transform: rotate(4deg); } }
@keyframes mascot-arm-jump { 0%, 100% { transform: none; } 48% { transform: rotate(-22deg); } 74% { transform: rotate(6deg); } }
.stat__thank { position: absolute; left: 766px; top: 1265px; width: 240px; height: 241px; opacity: 0; transform: scale(1.5) rotate(-12deg); }
.stat__thank.is-in { opacity: 1; transform: none; transition: opacity .12s ease, transform .22s var(--ease-pop); }

.stat__stamper {
  position: absolute; left: 610px; top: 880px; width: 568px; height: 599px;
  transform-origin: 50% 85%;
  opacity: 0; transform: translate(60px, -520px) rotate(14deg);
  pointer-events: none;
}
.stat__stamper.is-press { animation: stamper .9s ease forwards; }
@keyframes stamper {
  0%   { opacity: 0; transform: translate(60px, -520px) rotate(14deg); }
  18%  { opacity: 1; }
  42%  { opacity: 1; transform: translate(0, 0) rotate(0) scale(1); }
  50%  { transform: translate(0, 14px) rotate(0) scale(1.03, .95); }
  62%  { opacity: 1; transform: translate(0, 0) rotate(0); }
  100% { opacity: 0; transform: translate(80px, -560px) rotate(16deg); }
}
.stat__card.is-shake { animation: shake .28s ease; }
@keyframes shake {
  0%, 100% { transform: none; }
  25% { transform: translate(-6px, 5px); }
  50% { transform: translate(5px, -3px); }
  75% { transform: translate(-3px, 2px); }
}

.stat__body {
  position: absolute; left: 229px; top: 630px; width: 626px; height: 737px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; transform: translateY(-40px);
  transition: opacity .28s ease;
}
.stat__body.is-swap { opacity: 0; }
.stat__pre { display: none; font-weight: 500; font-size: 60px; line-height: 72px; color: var(--ink); max-width: 480px; }
.stat__value { font-weight: 500; font-size: 239px; line-height: 1.2; color: var(--orange); font-variant-numeric: tabular-nums; white-space: nowrap; }
.stat__label { font-weight: 400; font-size: 60px; line-height: 1; letter-spacing: -1.2px; color: var(--ink); max-width: 420px; }
/* ใบสุดท้าย (Students) มีข้อความนำ + ตัวเลขเล็กลง */
.stat__body.is-finale { transform: translateY(-10px); }
.stat__body.is-finale .stat__pre { display: block; }
.stat__body.is-finale .stat__value { font-size: 162px; margin-top: 7px; }
.stat__body.is-finale .stat__label { line-height: 72px; margin-top: 45px; }
/* ตัวเลข 5 หลักขึ้นไป: JS ใส่ --fit */
.stat__value { transform: scale(var(--fit, 1)); }

/* ==========================================================
   9–10 · Stamps
   ========================================================== */
.stamps { position: absolute; inset: 0; }
.stamp {
  position: absolute;
  --r: 0deg;                       /* มุมเอียงจากสูตรจัดวาง */
  opacity: 0; transform: rotate(var(--r)) scale(1.25);
}
.stamp.is-in { opacity: 1; transform: rotate(var(--r)); animation: stamp-in .3s var(--ease-pop); }
@keyframes stamp-in {
  0%   { opacity: 0; transform: rotate(var(--r)) scale(1.25); }
  50%  { opacity: 1; transform: rotate(var(--r)) scale(.95); }
  100% { opacity: 1; transform: rotate(var(--r)) scale(1); }
}

/* ตัวปั๊ม (กลม/เหลี่ยมตามรูปทรงตรา): วางให้กึ่งกลางฐานตรงกลางตรา (--x, --y) */
.stamps__tool {
  position: absolute; z-index: 3;
  /* ขนาด (--tw, --th) และจุดกึ่งกลางฐาน (--bx, --by เป็นสัดส่วน 0–1) ตั้งจาก config.stampTools ต่อ 1 ตรา */
  width: var(--tw, 400px); height: var(--th, 471px);
  left: calc(var(--x, 540px) - var(--tw, 400px) * var(--bx, .5)); top: calc(var(--y, 960px) - var(--th, 471px) * var(--by, .7));
  transform-origin: calc(var(--bx, .5) * 100%) calc(var(--by, .7) * 100%);
  opacity: 0; pointer-events: none;
  filter: drop-shadow(0 30px 24px rgba(90, 60, 30, .28));
}
.stamps__tool.is-press { animation: tool-press var(--tool-dur) ease forwards; }
@keyframes tool-press {
  0%   { opacity: 0; transform: translate(90px, -420px) rotate(14deg); }
  14%  { opacity: 1; }
  38%  { opacity: 1; transform: translate(0, -30px) rotate(0); }
  45%  { transform: translate(0, 12px) rotate(0) scale(1.04, .94); }   /* กด = TOOL_IMPACT ใน app.js */
  58%  { transform: translate(0, 12px) rotate(0) scale(1.04, .94); }
  72%  { opacity: 1; transform: translate(0, -40px) rotate(0); }
  100% { opacity: 0; transform: translate(110px, -460px) rotate(16deg); }
}

/* ==========================================================
   12 · Thanks  /  13 · Plane wipe
   ========================================================== */
.thanks__copy {
  position: absolute; left: 0; right: 0; top: 662px;
  font-family: "Sriracha", "IBM Plex Sans Thai", cursive;
  font-size: 70px; line-height: 1.2; text-align: center; color: #fff;
}
/* เข้า: เมฆรวมตัวเป็นตัวอักษร (keyframes cloud-letter ตัวเดียวกับหน้า HNY) */
.thanks__copy .ch { display: inline-block; white-space: pre; opacity: 0; }
.scene--thanks.is-active .thanks__copy .ch { animation: cloud-letter .9s cubic-bezier(.25, .6, .2, 1) calc(var(--i) * 16ms + 150ms) forwards; }
/* ออก: ตัวอักษรฟุ้งเป็นเมฆแล้วปลิวตามทางที่เครื่องบินบิน ไล่จากซ้ายไปขวา */
.scene--thanks.is-dispersing .thanks__copy .ch { animation: cloud-disperse 1.15s cubic-bezier(.4, 0, .7, .6) calc(var(--i) * 24ms) forwards; }
@keyframes cloud-disperse {
  0%   { opacity: 1;   filter: blur(0);    transform: none; }
  35%  { opacity: .9;  filter: blur(12px); transform: translate(calc(var(--bx) * .25), calc(var(--by) * .25)) scale(1.5); }
  100% { opacity: 0;   filter: blur(46px); transform: translate(var(--bx), var(--by)) scale(3); }
}

.plane {
  position: absolute; left: 0; top: 330px; width: 2739px; height: 1432px; max-width: none;
  transform: translateX(-2900px) rotate(-5deg);
  pointer-events: none; z-index: 5;
}
.plane.is-fly  { animation: plane-fly var(--plane-dur) var(--plane-ease) forwards; }
@keyframes plane-fly {
  from { transform: translateX(-2900px) rotate(-5deg); }
  to   { transform: translateX(1300px) rotate(-5deg); }
}
/* ==========================================================
   14 · Happy New Year
   ========================================================== */
.hny__title { position: absolute; left: 0; right: 0; top: 472px; font-weight: 500; font-size: 100px; line-height: 120px; text-align: center; color: #fff; }
.hny__year  { position: absolute; left: 0; right: 0; top: 595px; font-weight: 700; font-size: 158px; line-height: 190px; text-align: center; color: #fff; }
.hny__photo { position: absolute; left: 0; top: 0; width: 1080px; height: 1300px; }
.hny__ring { position: absolute; left: 193px; top: 864px; width: 533px; height: 388px; }
.hny__confetti { position: absolute; left: 214px; top: 825px; width: 624px; height: 430px; }
.hny__ring svg, .hny__confetti svg { display: block; width: 100%; height: 100%; overflow: visible; }

/* ขยับเบา ๆ ตลอดเวลา: confetti แต่ละชิ้น, วงเส้นประหมุนช้า, เครื่องบินเล็กโยกตัว */
.hny__confetti path {
  transform-box: fill-box; transform-origin: center;
  animation: confetti-float 3.4s ease-in-out infinite alternate;
  animation-delay: calc(var(--i, 0) * -0.41s);
}
.hny__confetti path:nth-of-type(3n)   { animation-name: confetti-twinkle; animation-duration: 2.3s; }
.hny__confetti path:nth-of-type(3n+1) { animation-name: confetti-sway; animation-duration: 4.2s; }
@keyframes confetti-float   { from { transform: translateY(5px) rotate(-5deg); } to { transform: translateY(-9px) rotate(7deg); } }
@keyframes confetti-sway    { from { transform: translate(-5px, 3px) rotate(6deg); } to { transform: translate(6px, -5px) rotate(-6deg); } }
@keyframes confetti-twinkle { from { transform: scale(.82) rotate(-8deg); opacity: .75; } to { transform: scale(1.12) rotate(8deg); opacity: 1; } }
.hny__ring [id="Ellipse 3413"] { transform-box: fill-box; transform-origin: center; animation: ring-spin 70s linear infinite; }
.hny__ring [id="Vector"] { transform-box: fill-box; transform-origin: center; animation: ring-plane 3.6s ease-in-out infinite alternate; }
.hny__ring [id="Group 2087330700"] { transform-box: fill-box; transform-origin: 30% 80%; animation: ring-postmark 5s ease-in-out infinite alternate; }
@keyframes ring-spin     { to { transform: rotate(360deg); } }
@keyframes ring-plane    { from { transform: translate(-4px, 4px) rotate(-4deg); } to { transform: translate(5px, -6px) rotate(5deg); } }
@keyframes ring-postmark { from { transform: rotate(-2.5deg); } to { transform: rotate(2.5deg); } }
.avatar--hny { left: 385px; top: 911px; width: 305.5px; height: 305.5px; }
.avatar--hny span { font-size: 130px; }
.hny__name { position: absolute; left: 60px; right: 60px; top: 1330px; font-weight: 600; font-size: 56px; line-height: 68px; text-align: center; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hny__actions { position: absolute; left: 160px; top: 1495px; display: flex; flex-direction: column; gap: 21px; align-items: center; }
.hny__replay { margin-top: 6px; padding: 14px 30px; font-family: "IBM Plex Sans Thai", sans-serif; font-size: 34px; color: #1d5f93; text-decoration: underline; text-underline-offset: 6px; }

/* ---- เข้าฉาก: เมฆลอยมารวมกันแล้วคมขึ้นเป็นตัวอักษร ----
   ตัวอักษรขาวที่เบลอหนัก ๆ = ก้อนเมฆ → ลดเบลอ + เลื่อนเข้าที่ทีละตัว */
.hny__title .ch, .hny__year .ch { display: inline-block; white-space: pre; opacity: 0; }
.scene--hny.is-pop .hny__title .ch { animation: cloud-letter 1.5s cubic-bezier(.25, .6, .2, 1) calc(var(--i) * 55ms + 250ms) forwards; }
.scene--hny.is-pop .hny__year .ch  { animation: cloud-letter 1.5s cubic-bezier(.25, .6, .2, 1) calc(var(--i) * 110ms + 850ms) forwards; }
@keyframes cloud-letter {
  0%   { opacity: 0;   filter: blur(46px); transform: translate(var(--dx), var(--dy)) scale(2.6); }
  30%  { opacity: .85; filter: blur(30px); transform: translate(calc(var(--dx) * .45), calc(var(--dy) * .45)) scale(1.9); }
  70%  { opacity: 1;   filter: blur(7px);  transform: translate(0, 0) scale(1.08); }
  100% { opacity: 1;   filter: blur(0);    transform: none; }
}
/* ก้อนเมฆประกอบ: ลอยเข้ามาจากสองข้าง แล้วจางไปตอนตัวอักษรคมขึ้น */
.hny__puffs { position: absolute; inset: 0; pointer-events: none; }
.hny__puffs i {
  position: absolute; left: var(--x); top: var(--y); width: var(--w); height: calc(var(--w) * .55);
  border-radius: 50%; opacity: 0; filter: blur(34px);
  background: radial-gradient(closest-side, rgba(255, 255, 255, .95), rgba(255, 255, 255, .55) 55%, rgba(255, 255, 255, 0));
}
.hny__puffs i:nth-child(1) { --x: 90px;  --y: 440px; --w: 420px; --fx: -520px; --fy: 40px; }
.hny__puffs i:nth-child(2) { --x: 560px; --y: 430px; --w: 460px; --fx: 560px;  --fy: -30px; }
.hny__puffs i:nth-child(3) { --x: 300px; --y: 480px; --w: 480px; --fx: -640px; --fy: -60px; }
.hny__puffs i:nth-child(4) { --x: 280px; --y: 610px; --w: 380px; --fx: 620px;  --fy: 50px; }
.hny__puffs i:nth-child(5) { --x: 470px; --y: 640px; --w: 340px; --fx: -560px; --fy: 70px; }
.hny__puffs i:nth-child(6) { --x: 150px; --y: 560px; --w: 360px; --fx: 660px;  --fy: -40px; }
.scene--hny.is-pop .hny__puffs i { animation: cloud-puff 2.1s ease-out forwards; }
.scene--hny.is-pop .hny__puffs i:nth-child(n+4) { animation-delay: .55s; }
@keyframes cloud-puff {
  0%   { opacity: 0;   transform: translate(var(--fx), var(--fy)) scale(.8); }
  35%  { opacity: .9; }
  65%  { opacity: .7;  transform: translate(0, 0) scale(1.05); }
  100% { opacity: 0;   transform: translate(0, 0) scale(1.35); }
}

/* ที่เหลือ pop ตามลำดับ */
.scene--hny .avatar--hny, .scene--hny .hny__ring,
.scene--hny .hny__confetti, .scene--hny .hny__name { opacity: 0; transform: scale(.6); }
.scene--hny .hny__actions { opacity: 0; transform: translateY(120px); }
.scene--hny.is-pop .avatar--hny,
.scene--hny.is-pop .hny__ring     { animation: pop .5s var(--ease-pop) 2.2s forwards; }
.scene--hny.is-pop .hny__confetti { animation: pop .6s var(--ease-pop) 2.45s forwards; }
.scene--hny.is-pop .hny__name     { animation: pop .45s var(--ease-pop) 2.7s forwards; }
.scene--hny.is-pop .hny__actions  { animation: rise .6s var(--ease-out) 3.1s forwards; }
@keyframes pop  { to { opacity: 1; transform: none; } }
@keyframes rise { to { opacity: 1; transform: none; } }

/* ---- เครื่องบินลำเล็กบินผ่านแบบสุ่ม + cloud trail จากปลายปีก ----
   .flyby        กำหนดแนวบิน (ความสูง --y, เอียง --rot, กลับทิศด้วย --rtl)
   .flyby__mover เลื่อนตามแนวนั้นจากนอกจอด้านหนึ่งไปอีกด้าน                 */
.hny__flybys { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.flyby { position: absolute; left: 0; top: 0; width: 1080px; height: 1920px; transform-origin: 540px var(--y); transform: rotate(var(--rot)); }
.flyby--rtl { transform: scaleX(-1) rotate(var(--rot)); }
.flyby__mover {
  position: absolute; left: 0; top: var(--y); width: calc(250px * var(--s));
  animation: flyby var(--dur) linear forwards;
}
@keyframes flyby { from { transform: translateX(-380px); } to { transform: translateX(2100px); } }
.flyby__mover img { position: relative; display: block; width: 100%; height: auto; }
.flyby__trail {
  position: absolute; right: 62%; top: 4%;
  width: calc(720px * var(--s)); height: calc(11px * var(--s));
  border-radius: 999px; filter: blur(3px);
  background: linear-gradient(to left, rgba(255, 255, 255, .95), rgba(255, 255, 255, .6) 30%, rgba(255, 255, 255, 0));
  animation: trail-breathe 1.6s ease-in-out infinite alternate;
}
.flyby__trail--b { right: 66%; top: 87%; animation-delay: -.8s; }
@keyframes trail-breathe { from { opacity: .75; transform: scaleY(.85); } to { opacity: 1; transform: scaleY(1.25); } }

/* ---------- Toast ---------- */
.toast {
  position: absolute; left: 90px; right: 90px; bottom: 60px; z-index: 10;
  padding: 26px 36px; border-radius: 28px;
  background: rgba(20, 33, 46, .92); color: #fff;
  font-family: "IBM Plex Sans Thai", sans-serif; font-size: 32px; line-height: 1.4; text-align: center;
}

/* ---------- ปุ่มเปิด/ปิดเสียง (มุมขวาบน อยู่เหนือทุกฉาก เครื่องบิน และ toast) ---------- */
.sound-toggle {
  position: absolute; top: 60px; right: 60px; z-index: 20;
  width: 104px; height: 104px; border-radius: 50%; padding: 0; border: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(13, 42, 66, .32); color: #fff; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform .12s ease;
}
.sound-toggle[hidden] { display: none; }
.sound-toggle svg { width: 52px; height: 52px; display: block; }
.sound-toggle:active { transform: scale(.94); }
.sound-toggle:focus-visible { outline: 6px solid #fff; outline-offset: 6px; }
.sound-toggle .sound-toggle__off, .sound-toggle.is-muted .sound-toggle__on { display: none; }
.sound-toggle.is-muted .sound-toggle__off { display: block; }

/* ==========================================================
   Dev panel (อยู่นอก stage — ลบได้ทั้งก้อน)
   ========================================================== */
.dev-toggle {
  position: fixed; left: 10px; bottom: 10px; z-index: 50;
  padding: 6px 10px; border-radius: 8px;
  background: #0b1722; color: #9fd0f0; border: 1px solid #2d4a63;
  font: 600 11px/1 ui-monospace, Menlo, monospace; letter-spacing: .08em;
}
.dev {
  position: fixed; left: 10px; bottom: 44px; z-index: 50;
  width: min(340px, calc(100vw - 20px)); max-height: calc(100vh - 60px); overflow: auto;
  padding: 14px; border-radius: 12px;
  background: #0b1722; color: #d7e6f2; border: 1px solid #2d4a63;
  font: 13px/1.5 "IBM Plex Sans Thai", system-ui, sans-serif;
}
.dev h2 { font-size: 14px; margin-bottom: 4px; }
.dev h2 small { font-weight: 400; color: #f0b86a; margin-left: 6px; }
.dev h3 { font-size: 11px; font-weight: 600; color: #8fb2cc; margin: 12px 0 6px; }
.dev__row { display: flex; flex-wrap: wrap; gap: 6px; }
.dev__row button { padding: 5px 9px; border-radius: 7px; background: #17324a; color: #d7e6f2; border: 1px solid #2d4a63; font-size: 12px; }
.dev__row button:hover { background: #1f4463; }
.dev pre { padding: 10px; border-radius: 8px; background: #06101a; color: #a9d6b7; font: 11px/1.45 ui-monospace, Menlo, monospace; white-space: pre-wrap; word-break: break-word; max-height: 240px; overflow: auto; }
.dev ul { padding-left: 18px; color: #f0b86a; font-size: 12px; }

@media (prefers-reduced-motion: reduce) {
  .stat__mascot, .stat__mascot [id], .stat__card.is-shake, .clouds__layer, .hny__confetti path, .hny__ring [id], .profile__photo.is-in .profile__plane, .profile__photo.is-in .profile__postmark { animation: none; }
}


/* ==========================================================
   Page turn — หน้ากระดาษแต่ละฉากมีพื้นหลังของตัวเอง เพื่อพลิกทั้งแผ่นได้
   ========================================================== */
.scene--profile, .scene--stat, .scene--stamps { background: url(../assets/bg-paper-hex.jpg) center / cover; }
.scene.no-fade { transition: none; }

/* สำเนาของหน้าที่กำลังพลิก (สร้างใน turnPage()) หมุนรอบสันซ้าย */
.page-snap {
  z-index: 7; opacity: 1; visibility: visible; pointer-events: none; transition: none;
  transform-origin: 0 50%;
  backface-visibility: hidden;
  box-shadow: 30px 0 60px rgba(60, 40, 20, .25);
}
.page-snap::after {            /* แสงตกบนหน้าที่ยกขึ้น */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(90deg, rgba(70, 45, 20, .0) 30%, rgba(70, 45, 20, .38));
  opacity: 0;
}
.page-snap.is-turning { animation: page-turn var(--turn-dur) cubic-bezier(.5, 0, .75, .6) forwards; }
.page-snap.is-turning::after { animation: page-turn-shade var(--turn-dur) ease-in forwards; }
@keyframes page-turn { from { transform: rotateY(0); } to { transform: rotateY(-96deg); } }
@keyframes page-turn-shade { to { opacity: 1; } }

/* เงาที่หน้าพลิกทอดลงบนหน้าถัดไป */
.page-shade {
  position: absolute; inset: 0; z-index: 6; pointer-events: none; opacity: 0;
  background: linear-gradient(90deg, rgba(70, 45, 20, .45), rgba(70, 45, 20, .12) 55%, rgba(70, 45, 20, 0));
}
.page-shade.is-on { animation: page-shade var(--turn-dur) ease-out forwards; }
@keyframes page-shade { 0% { opacity: 0; } 20% { opacity: 1; } 100% { opacity: 0; } }

.dev-log { position: fixed; left: 0; right: 0; top: 0; z-index: 60; margin: 0; padding: 6px 8px; background: rgba(13, 27, 42, .85); color: #d7e6f2; font: 11px/1.35 ui-monospace, monospace; white-space: pre-wrap; pointer-events: none; }
.dev__checks { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 10px; font-size: 12px; }
.dev__checks label { display: flex; gap: 6px; align-items: center; }
.dev__checks label.is-missing { color: #f0b86a; }
.dev h3 small { font-weight: 400; color: #a9d6b7; }
.dev pre.dev__small { max-height: 120px; margin-top: 6px; }

/* ---------- โหมด render วิดีโอ (#render-<SEAT>): ไม่มีปุ่มและ toast ในวิดีโอ ---------- */
.is-render .hny__actions, .is-render .toast, .is-render .sound-toggle { visibility: hidden; }

/* ตัวอักษรเมฆ (.ch): ห้ามใส่ will-change — Safari บน iOS วาดวรรณยุกต์ที่ซ้อนบนสระบนหาย (ที่ → ที, เพื่อ → เพือ)
   เมื่อตัวอักษรถูกแยกเป็น layer ของตัวเอง (ทดสอบใน iOS Simulator: filter อย่างเดียวไม่เป็น, will-change เป็น) */
