/* ===== พิพิธภัณฑ์เสมือนจริงบึงกาฬ ===== */
:root {
  --night: #0f2430;
  --night-2: #16323f;
  --mekong: #2f6f8f;
  --gold: #d9a441;
  --gold-soft: #f0d28c;
  --red: #b5342b;
  --cream: #f7f0e1;
  --paper: #fffaf0;
  --ink: #2a2118;
  --muted: #7a6c5c;
  --radius: 16px;
  --shadow: 0 18px 40px rgba(0, 0, 0, .28);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  font-family: 'Sarabun', system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.65;
  color: var(--cream);
  background: radial-gradient(1200px 600px at 50% -10%, #23485a 0%, var(--night) 60%) fixed, var(--night);
  min-height: 100vh;
}
body.no-scroll { overflow: hidden; }
h1, h2, h3, .btn-enter, .btn-primary, .marquee, .eyebrow { font-family: 'Prompt', 'Sarabun', sans-serif; }
h1, h2, h3 { line-height: 1.3; margin: 0 0 .4em; }
button { font: inherit; cursor: pointer; }
a { color: inherit; }
.muted { color: var(--muted); }

.screen { display: none; min-height: 100vh; }
.screen.active { display: block; animation: fadeIn .45s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.eyebrow { color: var(--gold); letter-spacing: .08em; font-size: .85rem; margin: 0 0 .3em; font-weight: 500; }

/* ---------- ปุ่ม ---------- */
.btn-primary, .btn-enter {
  background: linear-gradient(180deg, #e7b553, var(--gold));
  color: #2a1a05; border: 0; border-radius: 999px;
  padding: .75em 1.6em; font-weight: 600; font-size: 1rem;
  box-shadow: 0 6px 0 #9c7224, 0 10px 20px rgba(0,0,0,.25);
  transition: transform .12s, box-shadow .12s;
}
.btn-primary:active, .btn-enter:active { transform: translateY(4px); box-shadow: 0 2px 0 #9c7224; }
.btn-secondary {
  display: inline-block; text-decoration: none;
  background: transparent; color: var(--ink);
  border: 2px solid var(--ink); border-radius: 999px; padding: .6em 1.3em; font-weight: 500;
}
.btn-ghost {
  background: rgba(255,255,255,.06); color: var(--cream);
  border: 1px solid rgba(255,255,255,.18); border-radius: 999px; padding: .5em 1.1em;
}
.btn-ghost:hover { background: rgba(255,255,255,.12); }
:focus-visible { outline: 3px solid var(--gold-soft); outline-offset: 2px; }

/* ---------- ทางเข้า ---------- */
#entrance.active { display: grid; place-items: center; padding: 40px 18px 120px; position: relative; overflow: hidden; }
.facade { position: absolute; inset: auto 0 0 0; height: 46vh; opacity: .22; pointer-events: none; }
.facade .roof {
  position: absolute; left: 50%; bottom: 100%; transform: translateX(-50%);
  width: min(900px, 96vw); height: 18vh;
  background: linear-gradient(180deg, var(--gold), #8a6420);
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
}
.facade .pillars { position: absolute; inset: 0; display: flex; justify-content: center; gap: min(120px, 12vw); }
.facade .pillars span { width: min(54px, 7vw); background: linear-gradient(90deg, #c9a265, #f4e2b8, #c9a265); }

.entrance-card { position: relative; text-align: center; max-width: 560px; width: 100%; }
.entrance-card h1 { font-size: clamp(2rem, 5.5vw, 3.2rem); color: #fff; text-shadow: 0 4px 24px rgba(0,0,0,.4); }
.subtitle { color: var(--gold-soft); margin: 0 0 28px; }

.ticket {
  background: var(--paper); color: var(--ink);
  border-radius: var(--radius); padding: 22px 24px 20px; text-align: left;
  box-shadow: var(--shadow); position: relative;
  -webkit-mask: radial-gradient(circle 14px at 0 64px, transparent 98%, #000) , radial-gradient(circle 14px at 100% 64px, transparent 98%, #000);
  -webkit-mask-composite: source-in; mask-composite: intersect;
}
.ticket-head {
  display: flex; justify-content: space-between; align-items: center;
  font-family: 'Prompt', sans-serif; font-weight: 600; font-size: 1.1rem;
  border-bottom: 2px dashed #d8c8a8; padding-bottom: 14px; margin-bottom: 16px;
}
.ticket-free { background: var(--red); color: #fff; border-radius: 6px; padding: 2px 10px; font-size: .85rem; }
.ticket label { display: block; font-weight: 500; margin-bottom: 14px; }
.ticket small { color: var(--muted); font-weight: 400; }
.ticket input, .ticket select {
  display: block; width: 100%; margin-top: 6px;
  font: inherit; padding: .65em .8em; border-radius: 10px;
  border: 1.5px solid #d8c8a8; background: #fff; color: var(--ink);
}
.btn-enter { width: 100%; font-size: 1.15rem; margin-top: 6px; }
.hint { text-align: center; color: var(--muted); font-size: .9rem; margin: 12px 0 0; }

/* ---------- แถบบน ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 12px clamp(14px, 4vw, 40px);
  background: rgba(15, 36, 48, .85); backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.brand { display: flex; align-items: center; gap: 10px; font-family: 'Prompt', sans-serif; font-weight: 600; }
.brand-mark { width: 26px; height: 22px; background: var(--gold); clip-path: polygon(50% 0, 100% 45%, 100% 100%, 0 100%, 0 45%); }
.room-label { font-family: 'Prompt', sans-serif; color: var(--gold-soft); }

/* ---------- ล็อบบี้ ---------- */
.lobby-hero { text-align: center; padding: 40px 18px 10px; max-width: 700px; margin: 0 auto; }
.lobby-hero h2 { font-size: clamp(1.7rem, 4vw, 2.4rem); color: #fff; }
.lobby-hero p:last-child { color: #c9d6dc; }

.room-grid {
  display: grid; gap: 22px;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  padding: 26px clamp(14px, 4vw, 40px) 40px; max-width: 1200px; margin: 0 auto;
}
.room-card {
  text-decoration: none; background: var(--paper); color: var(--ink);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
  transition: transform .2s, box-shadow .2s; display: flex; flex-direction: column;
  border: 3px solid transparent;
}
.room-card:hover { transform: translateY(-6px); border-color: var(--gold); }
.room-cover {
  position: relative; aspect-ratio: 16/10; background: linear-gradient(135deg, var(--mekong), #1b4458);
  background-size: cover; background-position: center; display: grid; place-items: center;
}
.cover-initial { font-family: 'Prompt', sans-serif; font-size: 4.5rem; color: rgba(255,255,255,.35); font-weight: 700; }
.room-no {
  position: absolute; left: 12px; top: 12px; background: rgba(0,0,0,.55); color: #fff;
  font-size: .8rem; padding: 3px 10px; border-radius: 999px;
}
.room-body { padding: 16px 18px 18px; }
.room-body h3 { font-size: 1.25rem; }
.room-body p { margin: 0 0 12px; color: #5b4e40; }
.room-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.room-tags span { font-size: .78rem; background: #efe4cc; border-radius: 6px; padding: 2px 8px; }
.room-tags .tag-3d { background: var(--mekong); color: #fff; }
.room-tags .tag-movie { background: var(--red); color: #fff; }

.footer { text-align: center; color: #8aa0aa; font-size: .9rem; padding: 10px 18px 130px; }

/* ---------- ห้องจัดแสดง ---------- */
.room-layout {
  display: grid; grid-template-columns: 1.25fr 1fr; gap: 28px;
  padding: 26px clamp(14px, 4vw, 40px) 140px; max-width: 1300px; margin: 0 auto;
}
.stage {
  position: relative; border-radius: var(--radius); min-height: 520px;
  background: radial-gradient(70% 60% at 50% 30%, #2c5466 0%, #10232d 75%);
  box-shadow: inset 0 0 80px rgba(0,0,0,.5); overflow: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end; padding-bottom: 20px;
}
/* ภาพพื้นหลังเวทีที่ตั้งในหลังบ้าน: มืดลงด้านล่างให้แท่นวางกับคำแนะนำอ่านง่าย */
.stage.has-stage-bg {
  background:
    radial-gradient(70% 60% at 50% 30%, rgba(16, 35, 45, .05) 0%, rgba(16, 35, 45, .45) 80%),
    linear-gradient(180deg, rgba(10, 24, 32, .15) 0%, rgba(10, 24, 32, .25) 55%, rgba(10, 24, 32, .8) 100%),
    var(--stage-bg) center / cover no-repeat, #10232d;
}
.spotlight {
  position: absolute; top: -10%; left: 50%; width: 70%; height: 90%; transform: translateX(-50%);
  background: radial-gradient(50% 60% at 50% 0%, rgba(255, 236, 190, .28), transparent 70%);
  pointer-events: none;
}
.model-slot { position: absolute; inset: 0 0 90px 0; display: grid; place-items: center; }
.model-slot model-viewer { width: 100%; height: 100%; --poster-color: transparent; background: transparent; }
.model-placeholder { text-align: center; color: #c9d6dc; }
.model-placeholder.loading .cube { animation-duration: 2.2s; }
.model-placeholder.loading p::after { content: ''; display: block; width: 140px; height: 4px; margin: 10px auto 0; border-radius: 2px; background: linear-gradient(90deg, transparent, var(--gold), transparent) 0 0 / 50% 100% no-repeat, rgba(255,255,255,.15); animation: bar 1.2s linear infinite; }
@keyframes bar { from { background-position: -70px 0, 0 0; } to { background-position: 140px 0, 0 0; } }
.cube { width: 110px; height: 110px; margin: 0 auto 14px; position: relative; transform-style: preserve-3d; animation: spin 9s linear infinite; }
.cube span { position: absolute; inset: 0; border: 2px dashed rgba(240, 210, 140, .7); border-radius: 8px; }
.cube span:nth-child(2) { transform: rotateY(60deg); }
.cube span:nth-child(3) { transform: rotateY(120deg); }
@keyframes spin { to { transform: rotateY(360deg) rotateX(10deg); } }
.pedestal {
  position: relative; z-index: 2; width: min(380px, 80%); height: 64px;
  background: linear-gradient(180deg, #e8dcc3, #b8a582); border-radius: 10px 10px 4px 4px;
  box-shadow: 0 14px 26px rgba(0,0,0,.45); display: grid; place-items: center;
}
.pedestal::before {
  content: ''; position: absolute; left: -6%; right: -6%; top: -12px; height: 14px;
  background: #f3ead6; border-radius: 50%; box-shadow: 0 2px 0 #cbb994;
}
.pedestal span {
  position: relative; background: #3a2e20; color: var(--gold-soft); font-family: 'Prompt', sans-serif;
  font-size: .9rem; padding: 3px 14px; border-radius: 4px;
}
.stage-hint { position: relative; z-index: 2; color: #9fb4bd; font-size: .82rem; margin: 12px 0 0; text-align: center; }

.info {
  background: var(--paper); color: var(--ink); border-radius: var(--radius);
  padding: 26px clamp(18px, 3vw, 30px); box-shadow: var(--shadow); align-self: start;
}
.info h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); }
.info .eyebrow { color: #a5772a; }
.lead { color: #5b4e40; margin-top: 0; }

.tabs { display: flex; gap: 6px; border-bottom: 2px solid #eadcbf; margin: 18px 0 16px; }
.tab {
  background: none; border: 0; padding: .55em 1em; color: var(--muted); font-weight: 500;
  border-bottom: 3px solid transparent; margin-bottom: -2px;
}
.tab.active { color: var(--ink); border-bottom-color: var(--gold); }
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fadeIn .3s ease; }
.badge { display: inline-block; font-size: .78rem; border-radius: 6px; padding: 2px 10px; margin-bottom: 8px; font-weight: 500; }
.badge-fact { background: #dfeef5; color: #1f5670; }
.badge-legend { background: #f7e1dc; color: #8b2a22; }
.prose p { margin: 0 0 .8em; }
.map-frame { border-radius: 12px; overflow: hidden; aspect-ratio: 4/3; background: #e5ddcb; margin-bottom: 12px; }
.map-frame iframe { width: 100%; height: 100%; border: 0; }
.room-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; padding-top: 18px; border-top: 1px solid #eadcbf; }
.source { font-size: .85rem; color: var(--muted); margin: 14px 0 0; }

/* ---------- ปุ่มดูหนัง (ไอคอนประตู) ---------- */
.btn-movie {
  display: inline-flex; align-items: center; gap: 10px; border: 0; border-radius: 14px;
  padding: .55em 1.3em .55em .9em; background: linear-gradient(180deg, #d42a35, #9d1520); color: #fff;
  box-shadow: 0 6px 0 #6d0d15, 0 10px 20px rgba(0,0,0,.25); transition: transform .12s, box-shadow .12s;
}
.btn-movie:active { transform: translateY(4px); box-shadow: 0 2px 0 #6d0d15; }
.btn-movie svg { width: 34px; height: 34px; color: var(--gold-soft); flex: none; }
.btn-movie span { display: flex; flex-direction: column; align-items: flex-start; font: 600 1.1rem 'Prompt', sans-serif; line-height: 1.2; }
.btn-movie small { font: 400 .78rem 'Sarabun', sans-serif; opacity: .85; max-width: 200px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.btn-movie:hover svg path:first-of-type { transform: skewY(-4deg); transform-origin: 8px 16px; transition: transform .2s; }

/* ---------- โรงภาพยนตร์ ---------- */
.cinema {
  position: fixed; inset: 0; z-index: 100; display: none; overflow: hidden;
  background: linear-gradient(180deg, #1c0f0c 0%, #2a1310 34%, #140a09 62%, #0b0606 100%);
  flex-direction: column; align-items: center;
}
.cinema.open { display: flex; animation: fadeIn .4s ease; }
.ceiling { position: absolute; left: 0; right: 0; top: 0; height: 22vh; pointer-events: none;
  background: linear-gradient(180deg, #120807, #2b1410 85%, transparent); }
.ceiling-lights i {
  position: absolute; width: 10px; height: 10px; border-radius: 50%; transform: translate(-50%, -50%);
  background: #fff6dc; box-shadow: 0 0 10px 4px rgba(255, 220, 150, .85), 0 0 34px 12px rgba(255, 190, 110, .35);
  transition: opacity 1.2s;
}
.ceiling-lights i::before, .ceiling-lights i::after {
  content: ''; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  background: linear-gradient(90deg, transparent, rgba(255, 240, 200, .9), transparent);
}
.ceiling-lights i::before { width: 46px; height: 1.5px; }
.ceiling-lights i::after { width: 1.5px; height: 46px; background: linear-gradient(180deg, transparent, rgba(255, 240, 200, .9), transparent); }
.wall {
  position: absolute; top: 14vh; bottom: 24vh; width: 13vw; transition: filter 1.2s;
  background:
    repeating-linear-gradient(45deg, rgba(255,255,255,.06) 0 2px, transparent 2px 22px),
    repeating-linear-gradient(-45deg, rgba(0,0,0,.18) 0 2px, transparent 2px 22px),
    linear-gradient(180deg, #7a3f7d, #5b2c60);
  box-shadow: inset 0 0 0 10px #d4202c, inset 0 0 0 14px #8f1218, inset 0 0 40px rgba(0,0,0,.5);
}
.wall.left { left: 0; clip-path: polygon(0 0, 100% 10%, 100% 92%, 0 100%); }
.wall.right { right: 0; clip-path: polygon(0 10%, 100% 0, 100% 100%, 0 92%); }
.cinema.playing .ceiling-lights i { opacity: .18; }
.cinema.playing .wall { filter: brightness(.35); }
.cinema-top {
  position: relative; z-index: 5; width: 100%; max-width: 1100px; display: flex; justify-content: space-between;
  align-items: center; gap: 12px; padding: 12px 18px 0;
}
.marquee {
  color: var(--gold-soft); border: 2px solid var(--gold); border-radius: 8px; padding: 3px 14px; font-weight: 500;
  box-shadow: 0 0 18px rgba(217, 164, 65, .5), inset 0 0 12px rgba(217, 164, 65, .3); background: rgba(0,0,0,.4);
  max-width: 60vw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.btn-close { background: rgba(255,255,255,.1); color: #fff; border: 1px solid rgba(255,255,255,.25); border-radius: 999px; padding: .45em 1.1em; }
.screen-wrap {
  position: relative; z-index: 3; margin-top: 3.5vh; width: min(1000px, 70vw); aspect-ratio: 16 / 9; max-height: 54vh;
  background: linear-gradient(180deg, #f6eeee, #e8dede); border-radius: 50% / 5%; overflow: hidden;
  box-shadow: 0 0 0 6px #111, 0 0 70px rgba(255, 235, 225, .28);
  transition: box-shadow 1.2s;
}
.cinema.playing .screen-wrap { box-shadow: 0 0 0 6px #111, 0 0 110px rgba(170, 200, 255, .3); }
.movie-screen { position: absolute; inset: 0; background: transparent; }
.cinema.playing .movie-screen, .movie-screen:has(video), .movie-screen:has(iframe) { background: #000; }
.movie-screen iframe, .movie-screen video, .movie-screen > div { width: 100%; height: 100%; border: 0; display: block; background: #000; }
.screen-status {
  position: absolute; inset: 0; z-index: 2; display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: #3a2a2a; text-align: center; padding: 20px;
}
.pre-show { font: 500 clamp(1rem, 2.2vw, 1.5rem) 'Prompt', sans-serif; margin: 0 0 12px; }
.pre-bar { display: block; width: min(320px, 60%); height: 8px; border-radius: 4px; background: rgba(0,0,0,.12); overflow: hidden; }
.pre-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #c8202b, var(--gold)); transition: width .3s; }
.start-show { border: 0; border-radius: 999px; padding: .7em 1.8em; font: 600 1.2rem 'Prompt', sans-serif; background: #c8202b; color: #fff; }
.end-card { display: flex; flex-direction: column; align-items: center; gap: 2px; color: #3a2a2a; }
.end-card span { letter-spacing: .3em; font-size: .85rem; color: #9b2a2a; }
.end-card strong { font: 700 clamp(1.6rem, 4vw, 2.8rem) 'Prompt', sans-serif; }
.end-card small { color: #6b5a5a; }
.seats { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 30vh; z-index: 2; transition: filter 1.2s; }
.cinema.playing .seats { filter: brightness(.45); }

/* พนักงานโรงภาพยนตร์ (พิกเซล) */
.thanks {
  position: absolute; z-index: 6; left: 50%; bottom: 2vh; transform: translateX(-50%);
  display: flex; align-items: flex-end; gap: 14px; width: min(760px, 94vw); animation: fadeIn .5s ease;
}
.staff-sprite { width: clamp(110px, 16vh, 170px); flex: none; animation: staffIn .6s cubic-bezier(.3, 1.4, .5, 1); filter: drop-shadow(0 10px 10px rgba(0,0,0,.5)); }
.staff-sprite svg { width: 100%; display: block; }
@keyframes staffIn { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.staff-bubble {
  position: relative; flex: 1; margin-bottom: 8vh; background: var(--paper); color: var(--ink);
  border: 3px solid var(--ink); border-radius: 6px; padding: 12px 16px 14px;
  box-shadow: 6px 6px 0 rgba(0,0,0,.45); font-size: 1rem;
}
.staff-bubble::before {
  content: ''; position: absolute; left: -15px; bottom: 26px; width: 0; height: 0;
  border: 8px solid transparent; border-right: 14px solid var(--ink); border-left: 0;
}
.staff-name { font-family: 'Prompt', sans-serif; color: #c8202b; font-size: .92rem; }
.staff-bubble p { margin: 2px 0 12px; min-height: 3.2em; }
.thanks-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.thanks-actions .btn-primary { padding: .55em 1.3em; }
.thanks-actions .btn-secondary { padding: .45em 1.1em; }
.btn-link-dark { background: none; border: 0; color: #5b4e40; text-decoration: underline; }

/* ---------- ปุ่มหนังกลางแปลง (ในแท็บตำนาน) ---------- */
.outdoor-cta {
  display: flex; align-items: center; gap: 12px; width: 100%; margin-top: 14px; text-align: left;
  border: 0; border-radius: 14px; padding: 10px 14px; color: #fff; cursor: pointer;
  background: radial-gradient(120% 140% at 20% 0%, #33406b 0%, #141a33 70%);
  box-shadow: 0 5px 0 #0a0d1c, 0 10px 18px rgba(0,0,0,.22); transition: transform .12s, box-shadow .12s;
}
.outdoor-cta:hover { filter: brightness(1.08); }
.outdoor-cta:active { transform: translateY(3px); box-shadow: 0 2px 0 #0a0d1c; }
.oc-art { width: 64px; flex: none; }
.oc-art svg { display: block; width: 100%; }
.oc-text { flex: 1; display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.oc-text strong { font: 600 1.05rem 'Prompt', sans-serif; color: var(--gold-soft); }
.oc-text small { font-size: .82rem; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.oc-play {
  flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  background: #e8742a; color: #fff; font-size: .95rem; padding-left: 3px; box-shadow: 0 0 0 4px rgba(232,116,42,.25);
}

/* ---------- ลานหนังกลางแปลง ---------- */
.outdoor { position: fixed; inset: 0; z-index: 100; display: none; overflow: hidden; background: #0a0e1f; color: #fff; }
.outdoor.open { display: block; animation: fadeIn .5s ease; }
.od-sky { position: absolute; inset: 0 0 34% 0; background: linear-gradient(180deg, #050816 0%, #111a38 55%, #3b3150 88%, #6a4a4a 100%); }
.od-stars {
  position: absolute; inset: 0 0 30% 0; opacity: .8;
  background-image:
    radial-gradient(1.2px 1.2px at 12% 18%, #fff, transparent), radial-gradient(1px 1px at 27% 42%, #fff, transparent),
    radial-gradient(1.4px 1.4px at 44% 12%, #fff, transparent), radial-gradient(1px 1px at 63% 30%, #fff, transparent),
    radial-gradient(1.2px 1.2px at 78% 9%, #fff, transparent), radial-gradient(1px 1px at 91% 36%, #fff, transparent),
    radial-gradient(1px 1px at 6% 52%, #fff, transparent), radial-gradient(1.3px 1.3px at 55% 55%, #fff, transparent);
  animation: odTwinkle 4s ease-in-out infinite alternate;
}
@keyframes odTwinkle { from { opacity: .45; } to { opacity: .9; } }
.od-moon { position: absolute; right: 9%; top: 9%; width: 34px; height: 34px; border-radius: 50%; background: #fdf3d0; box-shadow: 0 0 30px 8px rgba(253, 243, 208, .25), inset -8px -3px 0 rgba(0,0,0,.12); }
.od-city { position: absolute; left: 0; right: 0; bottom: 34%; width: 100%; height: 15vh; }
.od-top {
  position: absolute; z-index: 8; top: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 1100px;
  display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 18px 0;
}
.od-marquee { border-color: #e8742a; color: #ffd9b8; box-shadow: 0 0 18px rgba(232,116,42,.45), inset 0 0 12px rgba(232,116,42,.25); }

/* จอผ้าใบบนโครงเหล็ก */
.od-stage {
  position: absolute; z-index: 3; left: 50%; top: 9vh; transform: translateX(-50%);
  display: flex; align-items: flex-end; justify-content: center; gap: clamp(8px, 1.6vw, 22px);
}
.od-truss {
  --w: min(860px, 72vw, calc(50vh * 16 / 9));
  position: relative; width: var(--w); aspect-ratio: 16 / 9; padding: 12px;
  background:
    repeating-linear-gradient(45deg, #9aa3ad 0 2px, transparent 2px 11px),
    repeating-linear-gradient(-45deg, #9aa3ad 0 2px, transparent 2px 11px),
    #2c3139;
  box-shadow: 0 0 0 2px #b9c1ca, 0 0 60px rgba(220, 230, 255, .12);
}
.od-truss::before, .od-truss::after {
  content: ''; position: absolute; top: -18px; bottom: -13vh; width: 12px;
  background: repeating-linear-gradient(45deg, #9aa3ad 0 2px, transparent 2px 9px), #2c3139;
  box-shadow: 0 0 0 2px #b9c1ca;
}
.od-truss::before { left: -16px; }
.od-truss::after { right: -16px; }
.od-screen {
  position: absolute; inset: 12px; overflow: hidden;
  background: linear-gradient(100deg, #e9ece6 0%, #f7f8f3 40%, #e3e6e0 70%, #f1f3ee 100%);
  box-shadow: inset 0 0 30px rgba(0,0,0,.18); transition: background .8s;
}
.outdoor.playing .od-screen { background: #000; }
.od-screen video, .od-screen iframe, .od-screen > div { width: 100%; height: 100%; border: 0; display: block; background: #000; }
.od-card {
  position: absolute; inset: 12px; z-index: 2; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; color: #3a3d42; padding: 4%; pointer-events: none;
}
.od-card > * { pointer-events: auto; }
.od-card:empty { display: none; }
.od-titlecard small { font: 500 clamp(.75rem, 1.4vw, 1rem) 'Prompt', sans-serif; letter-spacing: .35em; color: #8a5a2a; }
.od-titlecard strong {
  display: block; margin: .25em 0; padding: .15em .4em; font: 700 clamp(1.4rem, 4.4vw, 3.4rem) 'Prompt', sans-serif; line-height: 1.2;
  color: #43464c; border-top: 4px solid #43464c; border-bottom: 4px solid #43464c;
}
.od-titlecard span { font-size: clamp(.8rem, 1.4vw, 1rem); color: #6c6f75; }
.od-progress { margin-top: 12px; font-size: .9rem; color: #6c6f75; }
.od-progress .pre-bar { margin: 6px auto 0; }
.od-countdown {
  position: absolute; inset: 0; display: grid; place-items: center; overflow: hidden;
  background: radial-gradient(circle, #d8c9a6 0%, #a8946c 100%); color: #2b2418;
}
.od-countdown::before {
  content: ''; position: absolute; width: 140%; aspect-ratio: 1; border-radius: 50%;
  background: conic-gradient(rgba(0,0,0,.28) 0deg, transparent 0deg 360deg);
  animation: odSweep .9s linear infinite;
}
.od-countdown::after {
  content: ''; position: absolute; width: 58%; aspect-ratio: 1; border-radius: 50%;
  border: 3px solid rgba(43,36,24,.8); box-shadow: 0 0 0 12px rgba(43,36,24,.12);
  background: linear-gradient(transparent calc(50% - 1px), rgba(43,36,24,.6) 0 calc(50% + 1px), transparent 0),
              linear-gradient(90deg, transparent calc(50% - 1px), rgba(43,36,24,.6) 0 calc(50% + 1px), transparent 0);
}
@keyframes odSweep { from { background: conic-gradient(rgba(0,0,0,.28) 0deg, transparent 0deg); }
  25% { background: conic-gradient(rgba(0,0,0,.28) 90deg, transparent 90deg); }
  50% { background: conic-gradient(rgba(0,0,0,.28) 180deg, transparent 180deg); }
  75% { background: conic-gradient(rgba(0,0,0,.28) 270deg, transparent 270deg); }
  to { background: conic-gradient(rgba(0,0,0,.28) 360deg, transparent 360deg); } }
.od-countdown b { position: relative; z-index: 1; font: 700 clamp(3rem, 12vw, 8rem) 'Prompt', sans-serif; line-height: 1; }
.od-endcard .od-ornament { color: #a0692c; letter-spacing: .4em; font-size: clamp(.8rem, 1.5vw, 1.1rem); }
.od-endcard strong { display: block; font: 700 clamp(1.8rem, 5.4vw, 4rem) 'Prompt', sans-serif; color: #43464c; line-height: 1.25; }
.od-endcard small { color: #6c6f75; }
.od-error { font: 500 clamp(.95rem, 2vw, 1.3rem) 'Prompt', sans-serif; color: #7a2a20; max-width: 90%; }

/* ลำโพง */
.od-speakers {
  width: clamp(34px, 4.6vw, 62px); padding: 5px; display: flex; flex-direction: column; gap: 5px;
  background: #1b1c20; border: 2px solid #3a3c42; border-radius: 4px; margin-bottom: -13vh;
}
.od-speakers i { display: block; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle, #6a6d74 0 18%, #15161a 20% 48%, #8a8d94 50% 56%, #2a2b30 58%); }
.outdoor.playing .od-speakers i { animation: odThump .5s ease-in-out infinite alternate; }
@keyframes odThump { to { transform: scale(.94); } }

/* ลานพื้นเปียก ลำแสงเครื่องฉาย ผู้ชม และเต็นท์ */
.od-ground {
  position: absolute; left: 0; right: 0; bottom: 0; height: 34%; z-index: 1;
  background:
    radial-gradient(40% 50% at 50% 0%, rgba(230, 235, 255, .16), transparent 70%),
    repeating-linear-gradient(180deg, rgba(255,255,255,.07) 0 2px, transparent 2px 24px),
    linear-gradient(180deg, #30333b, #17191e);
}
.od-beam {
  position: absolute; inset: 0; z-index: 2; pointer-events: none; opacity: 0; transition: opacity 1s;
  clip-path: polygon(84% 76%, 14% 60%, 14% 12%, 86% 12%, 86% 60%);
  background: linear-gradient(200deg, rgba(255, 250, 225, .02) 30%, rgba(255, 250, 225, .22) 100%);
}
.outdoor.playing .od-beam { opacity: 1; animation: odFlicker 2.4s steps(6) infinite; }
@keyframes odFlicker { 0%, 100% { opacity: .9; } 30% { opacity: .75; } 60% { opacity: 1; } 80% { opacity: .82; } }
.od-audience { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 24vh; z-index: 4; }
.od-tent {
  position: absolute; z-index: 4; right: 2vw; bottom: 12vh; width: clamp(120px, 17vw, 230px); height: clamp(100px, 17vh, 180px);
  border-left: 4px solid #c9cdd3; border-right: 4px solid #c9cdd3;
}
.od-tent::before {
  content: ''; position: absolute; left: -14%; right: -14%; top: -2px; height: 26%;
  background: linear-gradient(180deg, #f08a3a, #c8561c); clip-path: polygon(10% 0, 90% 0, 100% 70%, 100% 100%, 0 100%, 0 70%);
}
.od-tent::after {
  content: ''; position: absolute; left: -14%; right: -14%; top: 25%; height: 9%;
  background: repeating-linear-gradient(90deg, #c8561c 0 16px, #a8460f 16px 18px);
}
.od-projector {
  position: absolute; left: 18%; right: 18%; bottom: 0; height: 34%;
  background: linear-gradient(180deg, #8a9099, #5a6069); border: 2px solid #2b2f36; border-radius: 3px;
}
.od-projector::before {
  content: ''; position: absolute; left: -10%; top: -46%; width: 46%; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle, #3a3f47 0 30%, #1d2026 32% 60%, #6a707a 62%); border: 2px solid #2b2f36;
}
.od-projector::after {
  content: ''; position: absolute; left: -16%; top: 30%; width: 14%; height: 34%; border-radius: 3px 0 0 3px;
  background: #fff6cc; box-shadow: 0 0 6px 2px rgba(255, 246, 204, .3); opacity: .35; transition: opacity .6s;
}
.outdoor.playing .od-projector::after { opacity: 1; box-shadow: 0 0 22px 8px rgba(255, 246, 204, .6); }

/* ลุงคนฉายหนัง (พิกเซล) */
.od-uncle {
  position: absolute; z-index: 7; left: max(2vw, 10px); bottom: 2vh; display: flex; align-items: flex-end; gap: 14px;
  width: min(780px, 94vw); transition: transform .6s cubic-bezier(.5, -0.3, .6, 1), opacity .5s;
}
.outdoor.playing .od-uncle { transform: translateY(120%); opacity: 0; pointer-events: none; }
.od-sprite { position: relative; width: clamp(84px, 15vh, 150px); flex: none; animation: staffIn .6s cubic-bezier(.3, 1.4, .5, 1); }
.od-sprite::after { content: ''; position: absolute; left: 6%; right: 6%; bottom: -4%; height: 9%; border-radius: 50%; background: rgba(0,0,0,.45); z-index: -1; }
.od-sprite svg { width: 100%; display: block; filter: drop-shadow(0 6px 8px rgba(0,0,0,.45)); }
.od-uncle.talking .od-sprite svg { animation: odBob .34s ease-in-out infinite alternate; }
@keyframes odBob { to { transform: translateY(-2px); } }
.od-bubble {
  position: relative; flex: 1; margin-bottom: 7vh; background: var(--paper); color: var(--ink);
  border: 3px solid var(--ink); border-radius: 6px; padding: 12px 16px 14px; box-shadow: 6px 6px 0 rgba(0,0,0,.45);
  font-size: 1rem; animation: fadeIn .4s ease;
}
.od-bubble::before {
  content: ''; position: absolute; left: -15px; bottom: 26px; width: 0; height: 0;
  border: 8px solid transparent; border-right: 14px solid var(--ink); border-left: 0;
}
.od-name { font-family: 'Prompt', sans-serif; color: #c8561c; font-size: .92rem; }
.od-bubble p { margin: 2px 0 10px; min-height: 3.2em; }
.od-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.od-actions .btn-primary { padding: .5em 1.2em; }
.od-actions .btn-secondary { padding: .42em 1.05em; }
.od-actions:empty { display: none; }

@media (max-width: 700px) {
  .od-speakers, .od-moon { display: none; }
  .od-stage { top: 12vh; }
  .od-truss { --w: min(94vw, calc(44vh * 16 / 9)); padding: 8px; }
  .od-screen, .od-card { inset: 8px; }
  .od-tent { right: 1vw; bottom: 30vh; width: 96px; height: 76px; }
  .od-uncle { gap: 8px; }
  .od-bubble { margin-bottom: 4vh; font-size: .92rem; padding: 10px 12px 12px; }
  .od-marquee { max-width: 54vw; }
}

@media (max-width: 760px) {
  .wall { display: none; }
  .screen-wrap { width: 94vw; margin-top: 2vh; border-radius: 50% / 3%; }
  .seats { height: 26vh; }
  .thanks { flex-direction: column; align-items: center; gap: 0; bottom: 1vh; }
  .staff-sprite { width: 96px; order: 2; }
  .staff-bubble { margin-bottom: 4px; order: 1; width: 100%; }
  .staff-bubble::before { left: 50%; bottom: -15px; transform: translateX(-50%); border: 8px solid transparent; border-top: 14px solid var(--ink); border-bottom: 0; }
}

/* ---------- ไกด์ ---------- */
.guide {
  position: fixed; left: clamp(8px, 2vw, 24px); bottom: 12px; z-index: 50;
  display: flex; align-items: flex-end; gap: 6px; pointer-events: none;
  opacity: 0; transform: translateY(30px); transition: opacity .4s, transform .4s;
}
.guide.visible { opacity: 1; transform: none; }
.guide > * { pointer-events: auto; }
.avatar { order: 1; background: none; border: 0; padding: 0; width: 104px; flex: none; }
.guide-svg { width: 100%; display: block; filter: drop-shadow(0 8px 14px rgba(0,0,0,.4)); transform-origin: 50% 100%; }
.guide.talking .guide-svg { animation: bob 1.6s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-4px) rotate(-1.5deg); } }
.mouth-open { display: none; }
.guide.talking .mouth-open { display: block; animation: talk .28s steps(2) infinite; }
.guide.talking .mouth-closed { animation: talk .28s steps(2) infinite reverse; }
@keyframes talk { 0% { opacity: 1; } 100% { opacity: 0; } }
.eyes { animation: blink 4.5s infinite; transform-origin: 60px 60px; }
@keyframes blink { 0%, 96%, 100% { transform: scaleY(1); } 98% { transform: scaleY(.1); } }

.bubble {
  order: 2; position: relative; width: min(420px, calc(100vw - 140px)); margin-bottom: 64px;
  background: var(--paper); color: var(--ink); border-radius: 18px 18px 18px 4px;
  padding: 12px 16px 10px; box-shadow: var(--shadow); border: 2px solid var(--gold);
  opacity: 0; transform: scale(.9) translateY(10px); transform-origin: 0 100%;
  transition: opacity .25s, transform .25s; pointer-events: none;
}
.bubble.show { opacity: 1; transform: none; pointer-events: auto; }
.guide-name { font-family: 'Prompt', sans-serif; color: #a5772a; font-size: .9rem; }
.bubble p { margin: 2px 0 8px; min-height: 1.6em; overflow-wrap: anywhere; max-height: 34vh; overflow-y: auto; }
/* ปุ่มตอบคำถามของไกด์ เช่น "เล่าเลย" / "ไว้ก่อน" */
.guide-ask { display: flex; flex-wrap: wrap; gap: 8px; margin: 2px 0 10px; }
.guide-ask button { border: 0; border-radius: 999px; padding: .4em 1.2em; font: 600 .92rem 'Prompt', sans-serif; cursor: pointer; }
.guide-ask .ask-yes { background: var(--red); color: #fff; box-shadow: 0 3px 0 #7d1f18; }
.guide-ask .ask-no { background: #efe4cc; color: var(--ink); }
/* หมุดที่ไกด์กำลังพูดถึง */
.map-pin.speaking { z-index: 2000 !important; }
.map-pin.speaking .mp-card { transform: translateY(-6px) scale(1.12); box-shadow: 0 0 0 4px #f3b13b, 0 12px 22px rgba(0,0,0,.25); }
.map-pin.speaking .mp-point { animation: pinBounce .6s ease-in-out infinite alternate; }
@keyframes pinBounce { to { translate: 0 -6px; } }
.map-list a.speaking { box-shadow: 0 0 0 3px #f3b13b; background: #fff8e6; }
.guide-controls { display: flex; gap: 6px; }
.guide-controls button {
  background: #efe4cc; color: var(--ink); border: 0; border-radius: 999px; padding: 2px 12px; font-size: .82rem;
}

.sample-banner {
  position: fixed; left: 50%; transform: translateX(-50%); top: 6px; z-index: 60;
  background: rgba(181, 52, 43, .92); color: #fff; font-size: .8rem; padding: 4px 12px; border-radius: 8px;
}


/* ---------- ภาพพื้นหลังทางเข้า (ตั้งค่าจากหลังบ้าน) ---------- */
#entrance.has-bg, #exit.has-bg {
  background:
    linear-gradient(180deg, rgba(10, 24, 32, .55) 0%, rgba(10, 24, 32, .82) 100%),
    var(--entrance-bg) center / cover no-repeat;
}
#entrance.has-bg .facade { display: none; }

/* ---------- ปุ่มออก ---------- */
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.btn-exit {
  background: var(--red); color: #fff; border: 0; border-radius: 999px; padding: .5em 1.1em; font-weight: 500;
}
.btn-exit:hover { background: #c94036; }
.btn-link { background: none; border: 0; color: #c9d6dc; text-decoration: underline; margin-top: 18px; }

.room-card.visited { border-color: rgba(217, 164, 65, .55); }
.room-seen {
  position: absolute; right: 12px; top: 12px; background: var(--gold); color: #2a1a05;
  font-size: .8rem; font-weight: 600; padding: 3px 10px; border-radius: 999px;
}

/* ---------- หน้าออก ---------- */
/* หน้าขอบคุณ: แถบเมนูด้านบน แล้วการ์ดขอบคุณอยู่กลางจอ */
#exit.active { display: flex; flex-direction: column; }
.exit-main { flex: 1; display: grid; place-items: center; padding: 40px 18px 150px; }
.exit-header { --navy: #22344d; --mint: #e4f5f2; --teal: #1b8079; color: #2b3445; }
.exit-header .wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 clamp(14px, 3vw, 28px); }
.site-nav .btn-restart { background: var(--navy); }
.site-nav .btn-restart:hover { background: #1b8079; }
.exit-card { text-align: center; max-width: 620px; width: 100%; }
.exit-card h1 { font-size: clamp(2rem, 5.5vw, 3rem); color: #fff; text-shadow: 0 4px 24px rgba(0,0,0,.4); }
.exit-summary { color: var(--gold-soft); font-size: 1.1rem; margin: 0 0 18px; }
.exit-rooms { list-style: none; padding: 0; margin: 0 0 26px; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.exit-rooms li {
  border: 1px solid rgba(255,255,255,.25); color: #9fb4bd; border-radius: 999px; padding: 4px 14px; font-size: .92rem;
}
.exit-rooms li.seen { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.exit-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.exit-actions .btn-primary { text-decoration: none; }
.exit-actions .btn-secondary { color: var(--cream); border-color: var(--cream); }


/* ---------- พื้นหลังหน้าหลัก (ตั้งค่าจากหลังบ้าน) ---------- */
body.has-main-bg #room.legacy-bg {
  background:
    linear-gradient(180deg, rgba(10, 24, 32, .72) 0%, rgba(10, 24, 32, .9) 100%),
    var(--main-bg) center / cover no-repeat fixed;
}

/* ---------- แถบเพลงประกอบ ---------- */
.music-bar {
  position: fixed; right: clamp(8px, 2vw, 24px); bottom: 14px; z-index: 55;
  display: flex; align-items: center; gap: 8px; max-width: 300px;
  background: rgba(15, 36, 48, .9); backdrop-filter: blur(8px);
  border: 1px solid rgba(240, 210, 140, .45); border-radius: 999px; padding: 6px 8px 6px 14px;
  box-shadow: 0 8px 20px rgba(0,0,0,.3); color: var(--cream);
}
.music-title { font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 1; }
.music-btn {
  width: 32px; height: 32px; border-radius: 50%; border: 0; flex: none;
  background: rgba(255,255,255,.1); color: var(--gold-soft); font-size: .8rem; line-height: 1;
}
.music-btn:hover { background: rgba(255,255,255,.2); }
.music-icon { display: flex; align-items: flex-end; gap: 2px; height: 14px; flex: none; }
.music-icon i { width: 3px; height: 4px; background: var(--gold); border-radius: 1px; }
.music-bar.playing .music-icon i { animation: eq .9s ease-in-out infinite; }
.music-bar.playing .music-icon i:nth-child(2) { animation-delay: .2s; }
.music-bar.playing .music-icon i:nth-child(3) { animation-delay: .4s; }
@keyframes eq { 0%, 100% { height: 4px; } 50% { height: 14px; } }
.music-bar.off { opacity: .75; }
.music-bar.off .music-title { text-decoration: line-through; color: #9fb4bd; }


/* =========================================================
   หน้าหลัก (ล็อบบี้) แบบแบนเนอร์ + การ์ดทรงโค้ง
   ========================================================= */
#lobby.lobby-light { --navy: #22344d; --mint: #e4f5f2; --teal: #1b8079; background: #fff; color: #2b3445; }
#lobby .wrap { max-width: 1180px; margin: 0 auto; padding: 0 clamp(14px, 3vw, 28px); }

/* แถบบนสุด */
.util-bar { background: var(--navy); color: #c9d6e6; font-size: .85rem; }
.util-bar .wrap { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 40px; }
.util-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.util-right { display: flex; align-items: center; gap: 8px; flex: none; }
.search { position: relative; display: flex; align-items: center; }
.search input {
  width: 210px; font: inherit; font-size: .85rem; padding: 4px 32px 4px 12px; border-radius: 6px;
  border: 0; background: #fff; color: #2b3445;
}
.search svg { position: absolute; right: 8px; width: 16px; height: 16px; color: var(--navy); pointer-events: none; }
.util-btn {
  width: 28px; height: 28px; border-radius: 50%; border: 0; display: grid; place-items: center;
  background: rgba(255,255,255,.15); color: #fff;
}
.util-btn svg { width: 16px; height: 16px; }
.util-btn:hover { background: rgba(255,255,255,.28); }

/* ส่วนหัว */
.site-header { position: sticky; top: 0; z-index: 60; background: #fff; box-shadow: 0 2px 14px rgba(34, 52, 77, .1); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 70px; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--navy); min-width: 0; }
.logo-mark {
  width: 44px; height: 40px; flex: none; position: relative;
  background: linear-gradient(180deg, var(--gold), #b9852c);
  clip-path: polygon(50% 0, 100% 38%, 92% 38%, 92% 100%, 8% 100%, 8% 38%, 0 38%);
}
.logo-mark::after {
  content: ''; position: absolute; left: 22%; right: 22%; bottom: 0; height: 46%;
  background: repeating-linear-gradient(90deg, #fff 0 4px, transparent 4px 9px); opacity: .85;
}
.logo-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.logo-text strong { font-family: 'Prompt', sans-serif; font-size: 1.08rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.logo-text small { color: var(--teal); font-size: .74rem; letter-spacing: .06em; }
.site-nav { display: flex; align-items: center; gap: 4px; }
.site-nav a, .site-nav button:not(.btn-exit) {
  background: none; border: 0; text-decoration: none; color: #2b3445; font-size: .95rem;
  padding: .45em .9em; border-radius: 6px; font-family: 'Sarabun', sans-serif; white-space: nowrap;
}
.site-nav a:hover, .site-nav button:not(.btn-exit):hover { background: var(--mint); color: var(--teal); }
.site-nav a.active { background: var(--navy); color: #fff; }
.site-nav .btn-exit { margin-left: 6px; }
/* จำนวนผู้เข้าชม (ข้างโลโก้) */
.visit-count {
  display: inline-flex; align-items: center; gap: 6px; margin-right: auto; margin-left: 4px; flex: none;
  padding: .3em .85em; border-radius: 999px; background: var(--mint, #e4f5f2); color: var(--teal, #1b8079);
  font: 500 .82rem 'Prompt', sans-serif; white-space: nowrap; border: 1px solid rgba(27, 128, 121, .25);
}
.visit-count svg { width: 16px; height: 16px; flex: none; }
.visit-count b { font-weight: 700; color: var(--navy, #22344d); }
@media (max-width: 1100px) { .visit-count { font-size: .76rem; padding: .25em .65em; } }
/* จอแท็บเล็ตที่เมนูยังเรียงแถวเดียว: เหลือแค่ไอคอนกับตัวเลข ไม่ให้เมนูตกบรรทัด */
@media (max-width: 960px) and (min-width: 761px) {
  .visit-count { padding: .25em .55em; gap: 4px; }
  .visit-count .vc-text { font-size: 0; }
  .visit-count .vc-text b { font-size: .78rem; }
  .site-nav .btn-exit { white-space: nowrap; }
}
@media (max-width: 480px) {
  .visit-count { padding: .25em .55em; gap: 4px; }
  .visit-count .vc-text { font-size: 0; }
  .visit-count .vc-text b { font-size: .78rem; }
}
.nav-toggle { display: none; background: none; border: 0; width: 42px; height: 42px; padding: 10px 8px; flex: none; }
.nav-toggle span { display: block; height: 3px; background: var(--navy); border-radius: 2px; margin: 4px 0; }

/* แบนเนอร์ */
.hero { position: relative; height: clamp(300px, 46vw, 520px); overflow: hidden; background: #6cc6ea; }
.hero-art { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero.has-photo { background: var(--hero-img) center / cover no-repeat; }
.hero.has-photo .hero-art { display: none; }
.hero::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(90deg, rgba(10, 30, 50, .05) 30%, rgba(10, 30, 50, .45) 100%);
}
.hero-inner {
  position: relative; z-index: 2; height: 100%; max-width: 1180px; margin: 0 auto;
  display: flex; flex-direction: column; justify-content: center; align-items: flex-end; text-align: center;
  padding: 0 clamp(18px, 5vw, 60px);
}
.hero-inner > * { max-width: 700px; }
.hero h1, .hero p { text-wrap: balance; }
.hero h1 {
  font-size: clamp(1.6rem, 3.6vw, 2.7rem); color: #fff; margin: 0 0 .4em; line-height: 1.35;
  text-shadow: 0 3px 14px rgba(0, 30, 60, .55), 0 1px 2px rgba(0,0,0,.4);
}
.hero p { color: #fff; font-size: clamp(1rem, 1.6vw, 1.2rem); margin: 0 0 1.2em; text-shadow: 0 2px 8px rgba(0, 30, 60, .6); }
.hero-cta {
  align-self: center; border: 0; border-radius: 999px; padding: .7em 2em; font: 600 1rem 'Prompt', sans-serif;
  background: #fff; color: var(--navy); box-shadow: 0 8px 20px rgba(0, 30, 60, .3);
}
.hero-inner .hero-cta { align-self: auto; }
.hero-cta:hover { background: var(--gold-soft); }

.footer.light { background: var(--navy, #22344d); color: #c9d6e6; padding: 18px 18px 96px; margin: 0; }
/* ท้ายเว็บ: ตราโรงเรียน + ชื่อโครงงาน + คณะผู้จัดทำ */
.site-footer { padding-top: 26px; text-align: left; }
.sf-inner { max-width: 1100px; margin: 0 auto; display: flex; align-items: flex-start; justify-content: center; gap: 18px 22px; }
.sf-logo { flex: none; width: clamp(64px, 9vw, 92px); height: auto; max-height: 110px; object-fit: contain; filter: drop-shadow(0 4px 10px rgba(0,0,0,.3)); }
.sf-text { min-width: 0; }
.sf-main { margin: 0 0 6px; font: 600 1rem 'Prompt', sans-serif; color: #fff; }
.sf-title { display: block; margin: 4px 0 4px; font: 500 .85rem 'Prompt', sans-serif; color: var(--gold-soft); letter-spacing: .04em; }
.sf-credits ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 2px 22px; font-size: .9rem; }
.sf-role { color: #8fa9bf; margin-right: 6px; }
.sf-role::after { content: ':'; }
@media (max-width: 600px) {
  .sf-inner { flex-direction: column; align-items: center; text-align: center; }
  .sf-credits ul { grid-template-columns: 1fr; }
}
.map-msg { width: 100%; color: #b25b00 !important; font-weight: 500; }

/* จอแท็บเล็ต: ย่อเมนูให้พอดีแถวเดียว ไม่ต้องพับเป็นปุ่ม ☰ */
@media (max-width: 1100px) {
  .site-nav { gap: 2px; }
  .site-nav a, .site-nav button:not(.btn-exit) { font-size: .86rem; padding: .4em .55em; }
  .site-nav .btn-exit { font-size: .86rem; padding: .45em .9em; margin-left: 4px; }
  .logo-text strong { font-size: .98rem; }
  .logo-mark { width: 38px; height: 34px; }
}
/* จอมือถือ: พับเมนูเป็นปุ่ม ☰ */
@media (max-width: 760px) {
  .nav-toggle { display: block; }
  .site-nav {
    position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 0;
    background: #fff; box-shadow: 0 12px 20px rgba(34, 52, 77, .15); padding: 8px 14px 14px;
    display: none;
  }
  .site-nav.open { display: flex; }
  .site-nav a, .site-nav button:not(.btn-exit) { text-align: left; padding: .7em .8em; }
  .site-nav .btn-exit { margin: 8px 0 0; }
}
@media (max-width: 760px) {
  .util-text { display: none; }
  .util-bar .wrap { justify-content: flex-end; }
  .util-right { flex: 1; }
  .search { flex: 1; }
  .search input { width: 100%; }
  .hero-inner { align-items: center; justify-content: center; }
  .hero::after { background: rgba(10, 30, 50, .3); }
  .logo-text strong { font-size: .95rem; }
}


/* ---------- พื้นหลังเฉพาะห้อง ---------- */
/* สีพื้นหลังที่เลือกในหลังบ้าน (มีแสงจางด้านบนและมืดลงด้านล่างให้ดูมีมิติ) */
#room.has-room-color {
  background:
    radial-gradient(1200px 600px at 50% -10%, rgba(255, 255, 255, .14), transparent 60%),
    linear-gradient(180deg, transparent 40%, rgba(0, 0, 0, .3) 100%),
    var(--room-color);
}
#room.has-room-bg {
  background:
    linear-gradient(180deg, rgba(10, 24, 32, .62) 0%, rgba(10, 24, 32, .88) 100%),
    var(--room-bg) center / cover no-repeat fixed;
}

/* ---------- ภาพสถานที่จริง (กรอบภาพในพิพิธภัณฑ์) ---------- */
.gallery { max-width: 1300px; margin: -110px auto 0; padding: 0 clamp(14px, 4vw, 40px) 150px; }
.gallery-head { text-align: center; margin-bottom: 22px; }
.gallery-head h3 { color: #fff; font-size: clamp(1.3rem, 2.6vw, 1.8rem); }
.gallery-grid { --g: calc(clamp(16px, 3vw, 36px) + 32px); display: flex; flex-wrap: wrap; justify-content: center; gap: 40px var(--g); padding: 16px 16px 0; }
.frame { margin: 0; width: calc((100% - 2 * var(--g)) / 3); max-width: 360px; text-align: center; }
.frame-img {
  display: block; width: 100%; aspect-ratio: 4 / 3; border: 0; cursor: zoom-in; padding: 0;
  background: #222 center / cover no-repeat;
  box-shadow:
    0 0 0 6px #f4ead2, 0 0 0 14px #b8862e, 0 0 0 16px #6e4d14,
    0 22px 30px rgba(0,0,0,.55);
  transition: transform .25s;
}
.frame-img:hover { transform: translateY(-4px) scale(1.02); }
.frame figcaption {
  display: inline-block; margin-top: 30px; background: #3a2e20; color: var(--gold-soft);
  font-size: .9rem; padding: 4px 14px; border-radius: 4px; max-width: 100%;
  box-shadow: 0 4px 10px rgba(0,0,0,.35);
}
.lightbox {
  position: fixed; inset: 0; z-index: 90; background: rgba(5, 10, 14, .92);
  display: flex; align-items: center; justify-content: center; gap: 10px; padding: 50px 12px;
  animation: fadeIn .25s ease;
}
.lightbox[hidden] { display: none; }
.lightbox figure { margin: 0; max-width: min(1200px, 100%); max-height: 100%; display: flex; flex-direction: column; align-items: center; }
.lightbox img { max-width: 100%; max-height: calc(100vh - 140px); object-fit: contain; border: 6px solid #f4ead2; box-shadow: 0 20px 40px rgba(0,0,0,.6); }
.lightbox figcaption { color: #eadfc7; margin-top: 12px; text-align: center; }
.lb-close { position: absolute; top: 12px; right: 14px; width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255,255,255,.15); color: #fff; font-size: 1.2rem; }
.lb-nav { flex: none; width: 48px; height: 48px; border-radius: 50%; border: 0; background: rgba(255,255,255,.15); color: #fff; font-size: 2rem; line-height: 1; }
.lb-nav[hidden] { visibility: hidden; display: block; }
.lb-close:hover, .lb-nav:hover { background: rgba(255,255,255,.3); }
@media (max-width: 760px) {
  .gallery { margin-top: -120px; }
  .frame { width: 100%; max-width: 420px; }
  .lb-nav { position: absolute; bottom: 14px; }
  .lb-nav.prev { left: 30%; } .lb-nav.next { right: 30%; }
}

/* ---------- มือถือ ---------- */
@media (max-width: 900px) {
  .room-layout { grid-template-columns: 1fr; }
  .stage { min-height: 400px; }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .avatar { width: 78px; }
  .bubble { margin-bottom: 48px; width: calc(100vw - 104px); font-size: .95rem; }
  .topbar .btn-ghost, .btn-exit { font-size: .85rem; padding: .4em .8em; }
  .hide-sm { display: none !important; }
  .sample-banner { font-size: .7rem; top: 2px; white-space: nowrap; }
  .music-bar { bottom: 10px; right: 8px; max-width: 150px; padding: 4px 4px 4px 10px; }
  .music-title { display: none; }
  .music-btn { width: 28px; height: 28px; }
}
/* ---------- ภาพโปรโมทด้านบนหน้าหลัก (ภาพอย่างเดียว ไม่มีปุ่ม) ---------- */
.promo { position: relative; background: #1d3b52; }
.promo-track { position: relative; height: clamp(180px, 38vw, 480px); overflow: hidden; }
.promo-slide {
  position: absolute; inset: 0; background: center / cover no-repeat; opacity: 0;
  transition: opacity 1.2s ease; transform: scale(1.04);
}
.promo-slide.on { opacity: 1; animation: promoZoom 9s ease-out both; }
@keyframes promoZoom { from { transform: scale(1.08); } to { transform: scale(1); } }
.promo-empty {
  position: absolute; inset: 0; display: grid; place-items: center; text-align: center; color: #c9d6e6;
  background: repeating-linear-gradient(45deg, #24455e 0 18px, #1f3e55 18px 36px); font: 500 1rem 'Prompt', sans-serif;
}
.promo-empty small { display: block; font: 400 .85rem 'Sarabun', sans-serif; opacity: .8; }

/* =====================================================================
   แผนที่หน้าหลัก: ประเทศไทย + แผนที่ขยายจังหวัดบึงกาฬพร้อมหมุด
   ===================================================================== */
.map-hero {
  position: relative; overflow: hidden; color: #10324a;
  background: linear-gradient(180deg, #9ddcf8 0%, #63c1ec 55%, #3ea6df 100%);
  padding: clamp(18px, 3vw, 36px) 0 clamp(34px, 4.5vw, 56px);
}
/* ภาพพื้นหลังที่ตั้งในหลังบ้าน: ทับด้วยฝ้าขาวบางๆ ให้อ่านตัวหนังสือได้ และซ่อนก้อนเมฆ */
.map-hero.has-bg {
  background:
    linear-gradient(180deg, rgba(235, 247, 255, .55) 0%, rgba(235, 247, 255, .25) 45%, rgba(235, 247, 255, .1) 100%),
    var(--map-bg) center / cover no-repeat, #3ea6df;
}
.map-hero.has-bg .mh-clouds { display: none; }
.map-hero.has-bg .mh-sub, .map-hero.has-bg .mh-text, .map-hero.has-bg .mh-kicker { text-shadow: 0 1px 6px rgba(255, 255, 255, .9); }
.mh-clouds i {
  position: absolute; display: block; width: 130px; height: 38px; background: #fff; border-radius: 999px;
  filter: drop-shadow(0 7px 0 rgba(150, 190, 220, .45)); animation: mhDrift 26s ease-in-out infinite alternate;
}
.mh-clouds i::before, .mh-clouds i::after { content: ''; position: absolute; background: #fff; border-radius: 50%; }
.mh-clouds i::before { width: 60px; height: 60px; left: 18px; top: -30px; }
.mh-clouds i::after { width: 44px; height: 44px; left: 62px; top: -20px; }
.mh-clouds i:nth-child(1) { left: 3%; top: 16%; }
.mh-clouds i:nth-child(2) { right: 4%; top: 6%; transform: scale(.8); animation-duration: 32s; }
.mh-clouds i:nth-child(3) { left: 30%; bottom: 4%; transform: scale(1.15); animation-duration: 38s; }
.mh-clouds i:nth-child(4) { right: 12%; bottom: 36%; transform: scale(.65); opacity: .8; }
@keyframes mhDrift { to { translate: 40px 0; } }
.mh-wrap {
  position: relative; display: grid; gap: 6px clamp(18px, 3vw, 40px); align-items: start;
  grid-template-columns: minmax(200px, 300px) 1fr; grid-template-areas: "thai head" "thai inset";
}
.mh-thai { grid-area: thai; }
.mh-thai svg { display: block; width: 100%; height: auto; overflow: visible; filter: drop-shadow(0 16px 14px rgba(10, 60, 100, .28)); }
.tm-neighbor { fill: #e8f2d6; stroke: #c4d8ae; stroke-width: 1; opacity: .75; }
.tm-side { fill: #3d5b6e; }
/* สีประจำภาค */
.tm-reg { stroke: #fff; stroke-width: .7; stroke-linejoin: round; }
.r-north { fill: #ef8a7a; }
.r-northeast { fill: #5cbfae; }
.r-central { fill: #f4c25a; }
.r-west { fill: #9aa8e0; }
.r-east { fill: #f39a5b; }
.r-south { fill: #f6dc78; }
.tm-bkprov { fill: #e2493c; stroke: #fff; stroke-width: 1.2; }
.tm-legend { font: 500 11px 'Prompt', sans-serif; fill: #10324a; }
.tm-legend-box rect { stroke: #fff; stroke-width: 1; }
.tm-legend-box text { paint-order: stroke; stroke: rgba(255,255,255,.75); stroke-width: 3px; stroke-linejoin: round; }
.tm-dot { fill: #22344d; stroke: #fff; stroke-width: 1.5; }
.tm-city, .tm-country, .tm-sea, .tm-bk-label { font-family: 'Prompt', sans-serif; paint-order: stroke; stroke-linejoin: round; }
.tm-city { font-size: 12px; font-weight: 500; fill: #22344d; stroke: #fff; stroke-width: 3px; }
.tm-country { font-size: 13px; fill: #7d8f6b; stroke: rgba(255,255,255,.7); stroke-width: 3px; }
.tm-sea { font-size: 13px; font-style: italic; fill: #1d6fa1; opacity: .8; }
.tm-zoom { fill: rgba(226, 86, 63, .12); stroke: #e2563f; stroke-width: 2; stroke-dasharray: 4 3; }
.tm-bk { fill: #e2563f; stroke: #fff; stroke-width: 2.5; }
.tm-pulse { fill: none; stroke: #e2563f; stroke-width: 3; transform-box: fill-box; transform-origin: center; animation: tmPulse 1.8s ease-out infinite; }
@keyframes tmPulse { from { transform: scale(.6); opacity: 1; } to { transform: scale(2.4); opacity: 0; } }
.tm-bk-label { font-size: 17px; font-weight: 700; fill: #e2563f; stroke: #fff; stroke-width: 4px; }

.mh-head { grid-area: head; padding-top: 6px; }
.mh-kicker { margin: 0; font: 600 .9rem 'Prompt', sans-serif; letter-spacing: .12em; color: #0f4a6e; }
.mh-title { margin: 0; line-height: 1.05; }
.mh-title span {
  font: 700 clamp(3rem, 8vw, 5.6rem) 'Mali', 'Prompt', sans-serif; color: #fff;
  text-shadow: 0 2px 0 #e3f4fd, 0 4px 0 #bfe1f5, 0 6px 0 #94c9ea, 0 8px 0 #66acda, 0 14px 20px rgba(10, 50, 90, .35);
}
.mh-sub { margin: .25em 0 .2em; font: 600 clamp(1.05rem, 2vw, 1.4rem) 'Prompt', sans-serif; color: #0d2f47; line-height: 1.4; }
.mh-text { margin: 0 0 10px; max-width: 580px; color: #0f3a57; }

.mh-inset {
  grid-area: inset; position: relative; background: #fff; border-radius: 22px; padding: 12px 12px 14px;
  box-shadow: 0 10px 0 #2f86bd, 0 24px 40px rgba(10, 50, 90, .3);
}
.mh-inset-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; padding: 2px 6px 10px; }
.mh-inset-head strong { font: 600 1.1rem 'Prompt', sans-serif; color: #22344d; }
.mh-inset-head span { color: #5a6478; font-size: .88rem; }
/* isolation: ให้ลำดับชั้นของหมุดอยู่แค่ในแผนที่ ไม่ลอยทับแถบเมนูด้านบนตอนเลื่อนหน้า */
.mh-inset-map { position: relative; aspect-ratio: 640 / 400; isolation: isolate; }
.mh-inset-map svg { display: block; width: 100%; height: 100%; border-radius: 14px; }
.im-laos { fill: #efe7cf; }
.im-other { fill: #dcebc6; stroke: #f4ffe8; stroke-width: 1; }
.im-other-lines { fill: none; stroke: #b9cf9c; stroke-width: 1.2; stroke-dasharray: 5 4; }
.im-bk-side { fill: #6aa743; }
.im-bk { fill: url(#imLand); }
.im-bk-border { fill: none; stroke: #e2563f; stroke-width: 2.2; stroke-dasharray: 7 4; stroke-linejoin: round; opacity: .85; }
.im-river-bank { fill: none; stroke: #e9f6fc; stroke-width: 16; stroke-linecap: round; stroke-linejoin: round; }
.im-river { fill: none; stroke: #3aa6e0; stroke-width: 10; stroke-linecap: round; stroke-linejoin: round; }
.im-river-shine { fill: none; stroke: #a9dcf5; stroke-width: 2.5; stroke-dasharray: 10 14; stroke-linecap: round; }
.im-river-small { fill: none; stroke: #6fbde6; stroke-width: 4; stroke-linecap: round; }
.im-lake { fill: #5fb9e8; stroke: #e9f6fc; stroke-width: 3; }
.im-road-casing { fill: none; stroke: #9aa3ad; stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; }
.im-road { fill: none; stroke: #fff8e6; stroke-width: 3.4; stroke-linecap: round; stroke-linejoin: round; }
.im-road-casing.minor { stroke: #b4bcc4; stroke-width: 4; }
.im-road.minor { stroke: #fffdf6; stroke-width: 2; }
.im-shield rect { fill: #2f6fb5; stroke: #fff; stroke-width: 1.8; }
.im-shield text { font: 700 10.5px 'Prompt', sans-serif; fill: #fff; }
.im-country, .im-river-label, .im-city-label, .im-label, .im-label-sm, .im-town-label, .im-park, .im-water-label, .im-prov-label, .im-prov-title {
  font-family: 'Prompt', sans-serif; paint-order: stroke; stroke-linejoin: round;
}
.im-country { font-size: 20px; font-weight: 600; fill: #a0957a; letter-spacing: .1em; }
.im-river-label { font-size: 15px; font-style: italic; font-weight: 500; fill: #1d6fa1; stroke: #e9f6fc; stroke-width: 4px; }
.im-city { fill: #22344d; stroke: #fff; stroke-width: 2; }
.im-city-label { font-size: 14px; font-weight: 600; fill: #22344d; stroke: rgba(255,255,255,.9); stroke-width: 3.5px; }
.im-town-label { font-size: 11.5px; font-weight: 500; fill: #22344d; stroke: rgba(255,255,255,.9); stroke-width: 3px; }
.im-label-sm { font-size: 10.5px; font-weight: 500; fill: #3d4b3a; stroke: rgba(255,255,255,.85); stroke-width: 3px; }
.im-park { font-size: 13px; font-weight: 600; fill: #2f6b2a; stroke: rgba(255,255,255,.9); stroke-width: 3.5px; }
.im-water-label { font-size: 11.5px; font-weight: 600; font-style: italic; fill: #1d6fa1; stroke: rgba(255,255,255,.9); stroke-width: 3px; }
.im-prov-label { font-size: 12px; font-weight: 500; fill: #8aa070; letter-spacing: .05em; stroke: rgba(255,255,255,.6); stroke-width: 3px; }
.im-prov-title { font-size: 15px; font-weight: 700; fill: #3f7a2c; letter-spacing: .08em; stroke: rgba(255,255,255,.75); stroke-width: 4px; }
.im-river-life { filter: drop-shadow(0 1px 1px rgba(0,0,0,.25)); }
.mh-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; padding: 10px 6px 0; font-size: .8rem; color: #5a6478; }
.mh-legend span { display: inline-flex; align-items: center; gap: 6px; }
.mh-legend i { display: inline-block; width: 22px; height: 6px; border-radius: 3px; }
.lg-road { background: #fff8e6; box-shadow: 0 0 0 1.5px #9aa3ad; }
.lg-river { background: #3aa6e0; }
.lg-border { height: 0 !important; border-top: 2.5px dashed #e2563f; border-radius: 0 !important; }
.lg-town { width: 14px !important; height: 12px !important; background: #ffe3b3; border: 1.5px solid #22344d; border-radius: 2px 2px 0 0 !important; }
.lg-shield { width: auto !important; height: auto !important; padding: 0 5px; background: #2f6fb5; color: #fff; font: 700 .68rem 'Prompt', sans-serif; font-style: normal; border-radius: 3px !important; }
.mh-compass { position: absolute; right: 10px; bottom: 10px; width: 46px !important; height: auto !important; border-radius: 0 !important; filter: drop-shadow(0 3px 4px rgba(0,0,0,.2)); }

/* หมุดสถานที่: รูป + ชื่อ อยู่เหนือหมุด */
.map-pins { position: absolute; inset: 0; }
.map-pin {
  position: absolute; display: flex; flex-direction: column; align-items: center; transform: translate(-50%, -100%);
  text-decoration: none; color: #22344d; animation: pinDrop .5s cubic-bezier(.3, 1.5, .5, 1) both;
}
.map-pin.left { align-items: flex-start; transform: translate(-14px, -100%); }
.map-pin.right { align-items: flex-end; transform: translate(calc(-100% + 14px), -100%); }
/* ป้ายอยู่ใต้หมุด (ใช้เมื่อหมุดอยู่ใกล้กันจนป้ายทับกัน) */
.map-pin.below { flex-direction: column-reverse; transform: translate(-50%, -27px); }
.map-pin.left.below { transform: translate(-14px, -27px); }
.map-pin.right.below { transform: translate(calc(-100% + 14px), -27px); }
.map-pin.below .mp-card { margin: 7px 0 0; }
/* ป้ายขนาดเล็ก เมื่อมีหมุดมากกว่า 4 อัน (ชี้เมาส์แล้วเห็นอำเภอ) */
.map-pins.compact .mp-card { gap: 6px; padding: 3px 11px 3px 3px; max-width: 170px; }
.map-pins.compact .mp-photo { width: 36px; height: 36px; border-width: 2.5px; font-size: .95rem; }
.map-pins.compact .mp-name { font-size: .8rem; }
.map-pins.compact .mp-name small { display: none; }
.map-pins.compact .map-pin:hover .mp-name small { display: block; }
.map-pins.compact .mp-seen { left: 22px; }
/* ป้ายที่ถูกดันออกห่างจากหมุด มีเส้นประโยงกลับมาที่หมุด */
.map-pin .mp-card { order: 0; }
.map-pin .mp-point { order: 2; }
.map-pin.far::before { content: ''; order: 1; height: 30px; border-left: 2px dashed #e2563f; }
.map-pin.far.left::before { margin-left: 13px; }
.map-pin.far.right::before { margin-right: 13px; }
@keyframes pinDrop { from { opacity: 0; translate: 0 -24px; } to { opacity: 1; translate: 0 0; } }
.mp-card {
  position: relative; display: flex; align-items: center; gap: 8px; max-width: 230px; margin-bottom: 3px;
  background: #fff; border-radius: 999px; padding: 4px 14px 4px 4px; white-space: nowrap;
  box-shadow: 0 4px 0 rgba(34, 52, 77, .2), 0 10px 18px rgba(0, 0, 0, .18); transition: transform .18s;
}
.mp-photo {
  flex: none; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center;
  background: #f3c77a center / cover no-repeat; border: 3px solid #e2563f; font: 700 1.1rem 'Prompt', sans-serif; color: #fff;
}
.mp-name { display: flex; flex-direction: column; min-width: 0; font: 600 .92rem 'Prompt', sans-serif; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; }
.mp-name small { font: 400 .74rem 'Sarabun', sans-serif; color: #5a6478; overflow: hidden; text-overflow: ellipsis; }
.mp-seen { position: absolute; left: 30px; top: -4px; width: 20px; height: 20px; border-radius: 50%; background: var(--gold); color: #2a1a05; font-size: .7rem; display: grid; place-items: center; border: 2px solid #fff; }
.mp-point {
  width: 22px; height: 22px; background: #e2563f; border: 3px solid #fff; border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg); box-shadow: -2px 3px 5px rgba(0, 0, 0, .3);
}
.map-pin.left .mp-point { margin-left: 3px; }
.map-pin.right .mp-point { margin-right: 3px; }
.map-pin:hover, .map-pin:focus-visible { z-index: 999 !important; }
.map-pin:hover .mp-card, .map-pin:focus-visible .mp-card { transform: translateY(-5px) scale(1.06); }
.map-pin.visited .mp-photo { border-color: var(--gold); }
.map-pin.dim { opacity: .25; }

/* =====================================================================
   หน้าข้อมูลสถานที่ท่องเที่ยว (แบบโปสเตอร์ท่องเที่ยว)
   ===================================================================== */
.poster-screen { background: #ece6d8; color: #2a2118; }
.poster { position: relative; max-width: 1120px; margin: 0 auto; background: #fbf8f1; box-shadow: 0 20px 50px rgba(0, 0, 0, .15); overflow: hidden; }
.ps-hero {
  position: relative; height: clamp(320px, 58vh, 580px); display: flex; align-items: flex-start;
  padding: clamp(22px, 4vw, 50px) clamp(18px, 4vw, 48px);
  background: radial-gradient(circle, rgba(255,255,255,.25) 1.4px, transparent 1.8px) 0 0 / 14px 14px, linear-gradient(135deg, #63b3c2, #2b6f7e);
}
.ps-hero.has-img { background: var(--ps-img) center / cover no-repeat, #2b6f7e; }
.ps-hero-shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.22), transparent 45%, rgba(0,0,0,.08)); }
.ps-hero-text { position: relative; z-index: 2; max-width: min(96%, 900px); }
.ps-kicker {
  display: inline-block; padding: .05em .8em .18em; border-radius: 999px; background: #2b7a8c; color: #fff;
  font: 700 clamp(1.1rem, 3vw, 2rem) 'Mali', 'Prompt', sans-serif; transform: rotate(-4deg); box-shadow: 4px 4px 0 rgba(0,0,0,.2);
}
.ps-title {
  margin: .08em 0 0; color: #fff; font: 700 clamp(2.6rem, 10vw, 7.4rem) 'Mali', 'Prompt', sans-serif; line-height: 1.18;
  -webkit-text-stroke: clamp(2px, .55vw, 6px) #10232d; paint-order: stroke fill;
  text-shadow: clamp(3px, .8vw, 9px) clamp(3px, .8vw, 9px) 0 #2b7a8c; overflow-wrap: anywhere;
}
.ps-title.long { font-size: clamp(2.1rem, 7vw, 5.4rem); }
.ps-title.xlong { font-size: clamp(1.7rem, 5.4vw, 4rem); }
.ps-burst {
  position: absolute; z-index: 1; right: 7%; top: 9%; width: clamp(90px, 15vw, 190px); aspect-ratio: 1; opacity: .9;
  background: radial-gradient(circle, #8e959c 1.3px, transparent 1.7px) 0 0 / 6px 6px, #e9ebed;
  clip-path: polygon(50% 0%, 59% 26%, 85% 15%, 74% 41%, 100% 50%, 74% 59%, 85% 85%, 59% 74%, 50% 100%, 41% 74%, 15% 85%, 26% 59%, 0% 50%, 26% 41%, 15% 15%, 41% 26%);
}
.ps-pin-ico { position: absolute; z-index: 3; right: 28%; top: 5%; width: clamp(36px, 5vw, 62px); transform: rotate(14deg); filter: drop-shadow(3px 4px 3px rgba(0,0,0,.3)); }

.ps-body { position: relative; display: grid; grid-template-columns: 1.15fr 1fr; gap: 0 30px; padding: 0 clamp(18px, 4vw, 48px) 56px; }
.ps-paper { position: relative; z-index: 2; margin-top: -44px; padding: 44px clamp(18px, 3vw, 36px) 40px; background: #fff; }
.ps-paper::before {
  content: ''; position: absolute; left: 0; right: 0; top: -17px; height: 18px; background: #fff;
  clip-path: polygon(0 100%, 0 45%, 5% 75%, 9% 30%, 14% 65%, 19% 20%, 24% 70%, 29% 35%, 34% 80%, 39% 25%, 45% 60%, 50% 15%, 55% 70%, 61% 30%, 66% 75%, 71% 25%, 77% 65%, 82% 30%, 88% 70%, 93% 35%, 97% 60%, 100% 30%, 100% 100%);
}
.ps-meta { margin: 0 0 .6em; font: 600 .92rem 'Prompt', sans-serif; color: #2b7a8c; letter-spacing: .04em; }
.ps-text { font-size: 1.02rem; line-height: 1.85; }
.ps-text p { margin: 0 0 .8em; }
.ps-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 20px 0 30px; }
.ps-btn {
  display: inline-flex; align-items: center; gap: 10px; border: 0; border-radius: 16px; cursor: pointer; text-align: left;
  padding: .6em 1.25em .6em .85em; color: #fff; font: 600 1.05rem 'Prompt', sans-serif; line-height: 1.25;
  box-shadow: 0 5px 0 rgba(0, 0, 0, .25), 0 10px 18px rgba(0, 0, 0, .12); transition: transform .12s, box-shadow .12s;
}
.ps-btn:active { transform: translateY(3px); box-shadow: 0 2px 0 rgba(0,0,0,.25); }
.ps-btn small { display: block; font: 400 .78rem 'Sarabun', sans-serif; opacity: .9; }
.ps-btn-main { background: linear-gradient(180deg, #2f8ea3, #1f6677); }
.ps-btn-movie { background: linear-gradient(180deg, #f08a3a, #c8561c); }
.ps-btn-ico { font-size: 1.6rem; line-height: 1; }
.ps-link { color: #2b7a8c; font-weight: 600; }

.ps-note {
  position: relative; max-width: 390px; margin-top: 6px; padding: 34px 24px 22px; border-radius: 2px; transform: rotate(-1.5deg);
  background: #fff linear-gradient(#e2e7ec 1px, transparent 1px) 0 0 / 18px 18px;
  background-image: linear-gradient(#e2e7ec 1px, transparent 1px), linear-gradient(90deg, #e2e7ec 1px, transparent 1px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, .13);
}
.ps-tape {
  position: absolute; top: -15px; left: 30%; width: 130px; height: 30px; background: rgba(240, 190, 80, .85); transform: rotate(-3deg);
  clip-path: polygon(3% 0, 97% 0, 100% 20%, 97% 40%, 100% 60%, 97% 80%, 100% 100%, 3% 100%, 0 80%, 3% 60%, 0 40%, 3% 20%);
}
.ps-scribble { position: absolute; left: -22px; top: -14px; width: 58px; }
.ps-note-title { margin: 0; }
.ps-note-title span {
  display: inline-block; padding: 0 .45em .05em; transform: rotate(-3deg); border: 3px solid #f0b24a; border-radius: 50% / 60%;
  font: 700 clamp(1.4rem, 3vw, 2rem) 'Mali', 'Prompt', sans-serif; color: #1d2b36;
}
.ps-spots { list-style: none; margin: 14px 0 0; padding: 0; }
.ps-spots a {
  display: flex; align-items: center; gap: 10px; padding: 3px 0; transform: rotate(-2deg); text-decoration: none;
  font: 600 clamp(1.05rem, 2.2vw, 1.35rem) 'Mali', 'Prompt', sans-serif; color: #2b6f9e;
}
.ps-spots a::before {
  content: ''; flex: none; width: 18px; height: 18px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg);
  background: radial-gradient(circle, #fff 0 3px, #e2563f 3.5px);
}
.ps-spots a:hover { color: #e2563f; }
.ps-badge {
  position: absolute; right: 2%; bottom: -24px; z-index: 3; width: clamp(120px, 15vw, 170px); aspect-ratio: 1.12; border-radius: 50%;
  display: grid; place-content: center; text-align: center; background: #f3b13b; color: #fff; transform: rotate(-10deg);
  box-shadow: 0 6px 0 #c98a1c; font-family: 'Mali', 'Prompt', sans-serif; line-height: 1.1;
}
.ps-badge span { font-size: clamp(1rem, 1.8vw, 1.3rem); font-weight: 700; }
.ps-badge b { font-size: clamp(1.4rem, 2.8vw, 2.1rem); }

.ps-photos { position: relative; z-index: 3; margin-top: min(-24vh, -150px); display: flex; flex-direction: column; align-items: center; gap: 20px; }
.ps-polaroid { width: 100%; max-width: 440px; margin: 0; padding: 12px 12px 16px; background: #fff; box-shadow: 0 10px 26px rgba(0, 0, 0, .22); }
.ps-polaroid:first-of-type { transform: rotate(2deg); }
.ps-polaroid:last-of-type { transform: rotate(-2deg); }
.ps-polaroid img { display: block; width: 100%; aspect-ratio: 4 / 3.3; object-fit: cover; }
.ps-ph-empty {
  aspect-ratio: 4 / 3.3; display: grid; place-items: center; text-align: center; border: 2px dashed #b9c4cb;
  background: repeating-linear-gradient(45deg, #eef2f4 0 10px, #e4e9ec 10px 20px); color: #7b8a94; font: 500 .95rem 'Prompt', sans-serif; line-height: 1.5;
}
.ps-ph-empty span { font-size: 1.6rem; }
.ps-ph-empty small { font-size: .85rem; }
.ps-camera { position: absolute; z-index: 4; left: -46px; top: 42%; width: clamp(90px, 11vw, 136px); transform: rotate(-12deg); filter: drop-shadow(0 6px 6px rgba(0,0,0,.25)); }
.ps-zigzag {
  position: absolute; right: -14px; top: -22px; width: 140px; height: 34px; background: #f3c14e; z-index: 4;
  clip-path: polygon(0 100%, 10% 0, 20% 100%, 30% 0, 40% 100%, 50% 0, 60% 100%, 70% 0, 80% 100%, 90% 0, 100% 100%, 100% 70%, 90% 0, 90% 0);
}

@media (max-width: 860px) {
  .mh-wrap { grid-template-columns: 96px 1fr; grid-template-areas: "thai head" "inset inset"; gap: 10px 14px; }
  .mh-title span { font-size: 2.7rem; }
  .mh-sub { font-size: 1rem; }
  .mh-text { font-size: .9rem; }
  .tm-city, .tm-country, .tm-sea { display: none; }
  .mh-inset { padding: 8px 8px 10px; border-radius: 16px; }
  .mh-compass { width: 30px !important; right: 6px; bottom: 6px; }
  .mh-legend { font-size: .72rem; gap: 3px 10px; }
  .mp-photo { width: 34px; height: 34px; border-width: 2px; font-size: .9rem; }
  .mp-card { gap: 5px; padding: 3px 9px 3px 3px; max-width: 140px; }
  .mp-name { font-size: .74rem; }
  .mp-name small { display: none; }
  .mp-seen { left: 20px; width: 16px; height: 16px; font-size: .6rem; }
  .mp-point { width: 16px; height: 16px; border-width: 2px; }

  .ps-hero { height: 340px; }
  .ps-pin-ico { right: 8%; top: auto; bottom: 14%; }
  .ps-burst { right: 4%; top: 6%; width: 80px; }
  .ps-body { grid-template-columns: 1fr; padding: 0 12px 36px; }
  .ps-paper { margin-top: 26px; padding: 30px 18px 28px; }
  .ps-photos { order: -1; margin-top: -40px; flex-direction: row; align-items: flex-start; gap: 10px; padding: 0 4px; }
  .ps-polaroid { width: 50%; padding: 6px 6px 10px; }
  .ps-camera, .ps-zigzag { display: none; }
  .ps-badge { position: relative; right: auto; bottom: auto; margin: 22px auto 0; }
  .ps-note { max-width: none; }
}

/* เลขบนหมุด และรายชื่อสถานที่ใต้แผนที่ (ใช้บนจอเล็ก) */
.mp-num { display: none; }
.map-list { display: none; list-style: none; margin: 12px 0 0; padding: 0; gap: 8px; }
.map-list a {
  display: flex; align-items: center; gap: 10px; padding: 6px 10px 6px 6px; border-radius: 14px; text-decoration: none;
  background: #f3f8fc; color: #22344d; border: 1px solid #dbe7f1;
}
.map-list a.dim { opacity: .35; }
.ml-num { flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: #22344d; color: #fff; font: 600 .75rem 'Prompt', sans-serif; }
.ml-photo { flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: #f3c77a center / cover no-repeat; border: 2.5px solid #e2563f; color: #fff; font: 700 1rem 'Prompt', sans-serif; }
.ml-name { flex: 1; min-width: 0; display: flex; flex-direction: column; font: 600 .92rem 'Prompt', sans-serif; line-height: 1.25; }
.ml-name small { font: 400 .76rem 'Sarabun', sans-serif; color: #5a6478; }
.ml-seen { flex: none; font-size: .72rem; background: var(--gold); color: #2a1a05; border-radius: 999px; padding: 1px 8px; }

/* จอเล็ก: ตัวหนังสือบนแผนที่จะเล็กเกินอ่าน จึงซ่อนป้ายรอง เหลือป้ายหลักกับไอคอน
   หมุดเหลือแค่รูปกับเลข แล้วแสดงรายชื่อเต็มใต้แผนที่ */
@media (max-width: 600px) {
  .map-list { display: grid; }
  .mp-name, .mp-seen { display: none; }
  .mp-card, .map-pins.compact .mp-card { padding: 2px; gap: 0; }
  .mp-photo, .map-pins.compact .mp-photo { width: 30px; height: 30px; }
  .mp-num {
    display: grid; place-items: center; position: absolute; right: -6px; top: -6px; width: 17px; height: 17px; border-radius: 50%;
    background: #22344d; color: #fff; font: 600 .62rem 'Prompt', sans-serif; border: 1.5px solid #fff;
  }
  .im-label-sm, .im-prov-label, .im-shield { display: none; }
  .im-town-label { font-size: 15px; stroke-width: 4px; }
  .im-city-label, .im-park, .im-water-label { font-size: 18px; stroke-width: 4.5px; }
}

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

/* ===== ภาษา ไทย / English / ລາວ ===== */
.lang-switch {
  display: inline-flex; align-items: center; gap: 2px; padding: 2px; flex: none;
  border-radius: 999px; background: rgba(128, 128, 128, .16); border: 1px solid rgba(128, 128, 128, .22);
}
.lang-switch button {
  border: 0; background: transparent; color: inherit; cursor: pointer; opacity: .78;
  font: 600 .78rem/1 'Prompt', 'Noto Sans Lao', sans-serif; padding: .45em .72em; border-radius: 999px;
  transition: background .2s, color .2s, opacity .2s;
}
.lang-switch button[lang="lo"] { font-family: 'Noto Sans Lao', sans-serif; }
.lang-switch button:hover { opacity: 1; }
.lang-switch button.on { background: var(--red); color: #fff; opacity: 1; box-shadow: 0 2px 6px rgba(0, 0, 0, .18); }
.lang-switch button:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }
/* หน้าทางเข้า: วางเหนือคำว่า "ยินดีต้อนรับสู่" */
.entrance-lang { color: #fff; background: rgba(0, 0, 0, .28); border-color: rgba(255, 255, 255, .25); margin-bottom: 14px; }
.util-lang { color: inherit; }
.lang-switch.mini button { font-size: .72rem; padding: .38em .62em; }
/* กล่องไกด์: แถว "ฟังเป็นภาษา" */
.guide-lang { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin: 6px 0 6px; font-size: .76rem; color: var(--muted); }
.guide-lang .lang-switch { color: var(--ink); background: #efe4cc; border-color: transparent; }
/* เนื้อหาที่ยังไม่มีคำแปล */
.tr-note {
  display: inline-block; margin: 0 0 8px; padding: .3em .75em; border-radius: 8px; font-size: .8rem;
  background: rgba(217, 164, 65, .18); border: 1px dashed rgba(217, 164, 65, .6);
}
/* ภาษาลาว: ฟอนต์ไทยไม่มีตัวอักษรลาว จึงใช้ Noto Sans Lao ก่อน (ตัวอักษรไทยที่ยังไม่แปลจะใช้ฟอนต์ไทยต่อ) */
html[lang="lo"] body, html[lang="lo"] body *:not(.lang-switch button) {
  font-family: 'Noto Sans Lao', 'Prompt', 'Sarabun', sans-serif !important;
}
@media (max-width: 760px) {
  .util-lang button { padding: .42em .55em; }
}
.entrance-lang button { font-size: .86rem; padding: .5em .95em; }
