/* ============================================================
   Craftfiti TV — "Gallery" theme (จาก CI จริง)
   ครีม gallery + serif พิพิธภัณฑ์ + graffiti อำพัน + Renaissance
   จอ TV แนวนอน อ่านได้จากระยะไกล (ฟอนต์อิง vw/vh)
   ============================================================ */

:root {
  --cream: #F3EEE5;
  --card: #FBFAF6;
  --ink: #1A1714;
  --amber: #E8A33D;
  --muted: #8a7d6b;
  --soft: #5b5249;
  --sand: #9a8b75;
  --num: #c3b59c;
  --line: rgba(26, 23, 20, 0.12);
  --line-strong: rgba(26, 23, 20, 0.28);
  --hl: rgba(245, 194, 27, 0.55);
  --serif: 'Cinzel', 'Kanit', serif;
  --garamond: 'Cormorant Garamond', 'Kanit', serif;
  --marker: 'Permanent Marker', 'Kanit', cursive;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  background: var(--ink);
  color: var(--ink);
  font-family: 'Kanit', 'Segoe UI', sans-serif;
  cursor: none;
}

/* ---------- Stage + crossfade ---------- */

#stage { position: fixed; inset: 0; }

.slide {
  position: absolute; inset: 0;
  opacity: 0;
  transition: opacity 0.8s ease;
  display: flex; align-items: center; justify-content: center;
}
.slide.active { opacity: 1; }

/* ---------- Image slide (full-bleed photo) ---------- */

.slide-image { background: var(--ink); }
.slide-image .img-bg {
  position: absolute; inset: -5%;
  background-size: cover; background-position: center;
  filter: blur(30px) brightness(0.4);
}
.slide-image .img-main {
  position: relative;
  max-width: 100%; max-height: 100%;
  object-fit: contain;
}

/* ---------- Video slide ---------- */

.slide-video { background: #000; }
.slide-video video { width: 100%; height: 100%; object-fit: contain; }

/* ---------- Template base ---------- */

.tpl {
  position: relative;
  width: 100%; height: 100%;
  background: var(--cream);
  color: var(--ink);
  overflow: hidden;
}

.foam {
  position: absolute; top: 0; left: 0;
  width: 100%; height: auto;
  z-index: 3; pointer-events: none;
  filter: drop-shadow(0 0.6vh 1vh rgba(26, 23, 20, 0.05));
}

/* kicker: ── LABEL ── */
.rule-kicker { display: flex; align-items: center; gap: 1.2vw; }
.rule-kicker.center { justify-content: center; }
.rule-kicker .rule { height: 1px; width: 6vw; background: var(--line-strong); }
.rule-kicker .kicker {
  font-family: var(--serif);
  font-size: 1.9vw; letter-spacing: 0.4em; font-weight: 600;
  white-space: nowrap;
}
.kicker-sub {
  font-weight: 300; font-size: 1.3vw; letter-spacing: 0.22em;
  color: var(--muted); margin-top: 1vh;
}

.pill {
  display: inline-block;
  padding: 0.55vh 1.2vw;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-size: 1vw; font-weight: 400; letter-spacing: 0.05em;
  margin-right: 0.7vw;
}

.marker-hl { position: relative; }
.marker-hl::after {
  content: '';
  position: absolute; left: -2%; right: -2%; bottom: 8%;
  height: 34%;
  background: var(--hl);
  z-index: -1;
  transform: rotate(-1deg);
}

/* กรอบรูปแบบ gallery + ลายแรเงาตอนไม่มีรูป */
.hatch {
  background: repeating-linear-gradient(48deg, #ECE4D4 0 0.9vw, var(--cream) 0.9vw 1.8vw);
}
.art-initial {
  font-family: var(--serif);
  font-size: 9vw; font-weight: 700; color: #cdbfa6;
}

/* ---------- A. Beer of the Day ---------- */

.tpl-botd .botd-grid {
  height: 100%;
  display: grid; grid-template-columns: 1.18fr 0.82fr;
  gap: 3.5vw;
  padding: 15vh 6vw 6vh;
  align-items: center;
}
.botd-brewery {
  font-family: var(--garamond); font-style: italic;
  font-size: 2vw; color: var(--sand);
  margin: 3vh 0 0.2vh;
}
.botd-name {
  font-family: var(--serif);
  font-size: 5.4vw; line-height: 1; font-weight: 700;
  overflow-wrap: anywhere;
}
.botd-meta {
  display: flex; gap: 1.1vw; align-items: center;
  margin-top: 2vh;
  font-size: 1.45vw; color: #4a423a;
  white-space: nowrap;
}
.botd-meta .sep { color: #cbbfa9; }
.botd-notes {
  font-weight: 300; font-size: 1.45vw; line-height: 1.65;
  color: var(--soft);
  max-width: 33vw;
  margin-top: 2.4vh;
}
.botd-tags { margin-top: 2.6vh; }
.botd-price-row { display: flex; align-items: baseline; gap: 1.1vw; margin-top: 4vh; }
.price-label { font-weight: 300; font-size: 1.3vw; color: var(--sand); }
.botd-price {
  font-family: var(--garamond); font-weight: 600;
  font-size: 7vw; line-height: 0.7;
  color: var(--amber);
}

.botd-art { position: relative; height: 64vh; }
.botd-art .art-frame {
  position: absolute; inset: 0;
  border: 1px solid rgba(26, 23, 20, 0.16);
  border-radius: 3px;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.botd-art .art-frame img { width: 100%; height: 100%; object-fit: contain; }
.hand-god {
  position: absolute; top: -9vh; right: -3vw;
  width: 20vw; height: auto;
  transform: rotate(14deg);
  filter: drop-shadow(0 1.5vh 2vh rgba(26, 23, 20, 0.18));
  pointer-events: none;
  z-index: 2;
}

/* ---------- C. Today's Menu ---------- */

.tpl-menu2 .menu-wrap { height: 100%; padding: 14vh 6vw 6vh; display: flex; flex-direction: column; }
.menu-head {
  display: flex; align-items: baseline; justify-content: space-between;
  border-bottom: 2px solid var(--ink);
  padding-bottom: 1.4vh;
}
.menu-title { font-family: var(--serif); font-size: 2.6vw; letter-spacing: 0.16em; font-weight: 700; }
.menu-sub { font-weight: 300; font-size: 1.3vw; color: var(--muted); margin-left: 1.2vw; }
.menu-count {
  font-family: var(--garamond); font-style: italic;
  font-size: 1.7vw; color: var(--sand); white-space: nowrap;
}
.menu-rows {
  flex: 1;
  display: flex; flex-direction: column; justify-content: space-evenly;
  padding: 1vh 0;
}
.m-row {
  display: grid; grid-template-columns: 3.2vw 1fr auto;
  gap: 2vw; align-items: center;
  padding: 0.9vh 0;
  border-bottom: 1px solid var(--line);
}
.m-row:last-child { border-bottom: none; }
.m-num { font-family: var(--garamond); font-size: 1.9vw; color: var(--num); }
.m-main { display: flex; flex-direction: column; min-width: 0; }
.m-name { font-weight: 500; font-size: 2.1vw; line-height: 1.05; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-style { font-weight: 300; font-size: 1.1vw; color: var(--muted); }
.m-price { font-family: var(--garamond); font-weight: 600; font-size: 2.7vw; color: var(--amber); }

/* ---------- C2. Tap Wall (เมนู ≤6 tap) — เหรียญโลโก้ห้อยจากราวก๊อก ---------- */

.taps-rail {
  flex: 1;
  display: grid; gap: 2vw;
  margin-top: 8vh;
  align-items: start; justify-items: center;
  position: relative;
}
/* ราวทองเหลืองด้านบน (ก๊อกห้อยลงมา) */
.taps-rail::before {
  content: '';
  position: absolute; top: -2vh; left: -2vw; right: -2vw;
  height: 0.85vh;
  background: linear-gradient(180deg, #e0c081 0%, #c2a05c 45%, #876a32 100%);
  border-radius: 99px;
  box-shadow: 0 0.5vh 1.4vh -0.2vh rgba(26, 23, 20, 0.4), inset 0 0.15vh 0 rgba(255,255,255,0.5);
}

.tap2 { display: flex; flex-direction: column; align-items: center; text-align: center; width: 100%; }
.tap2-rig { position: relative; padding-top: 4.6vh; }
/* คอ+เหรียญแกว่งพร้อมกันเหมือนป้ายห้อยจากราว (หัวก๊อกอยู่กับที่) */
.tap2-hang {
  transform-origin: 50% 0.3vh;
  animation: tapSwing 4.6s ease-in-out var(--d, 0s) infinite;
}

/* หัวก๊อกโครเมียมที่เกาะราว + คอก๊อก */
.tap2-head {
  position: absolute; top: -1.7vh; left: 50%; transform: translateX(-50%); z-index: 2;
  width: 2.6vw; height: 2.2vh;
  background: linear-gradient(180deg, #f1ece1, #9a8b75);
  border-radius: 0.5vw;
  box-shadow: 0 0.4vh 0.8vh rgba(26, 23, 20, 0.35);
}
.tap2-neck {
  position: absolute; top: 0.3vh; left: 50%; transform: translateX(-50%);
  width: 1.05vw; height: 4.6vh;
  background: linear-gradient(90deg, #2a241e, #4a4036 50%, #2a241e);
  border-radius: 0 0 0.3vw 0.3vw;
}

/* เหรียญโลโก้กลม — พระเอกของสไลด์ */
.tap2-medallion {
  position: relative; z-index: 1;
  width: 13.5vw; aspect-ratio: 1 / 1; margin: 0 auto;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 38%, #fffdf8, #efe7d7);
  border: 0.5vw solid var(--ink);
  box-shadow:
    0 0 0 0.22vw #c9a25a,                  /* วงแหวนทองเหลือง */
    0 2.4vh 4.5vh -1.2vh rgba(26,23,20,.5), /* เงาตก */
    0 0 6vh rgba(232,163,61,.5);            /* แสงเรืองอุ่นๆ (เหมือนป้ายเรืองแสงในรูป) */
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.tap2-logo { width: 100%; height: 100%; object-fit: cover; display: block; }
.tap2-mono {
  font-family: var(--serif); font-weight: 700;
  font-size: 6.4vw; color: var(--amber);
  text-shadow: 0 0.3vh 0 rgba(26,23,20,0.12);
}
/* เลขก๊อกมุมบนซ้าย */
.tap2-num {
  position: absolute; top: 0.5vw; left: 0.5vw; z-index: 3;
  min-width: 2.6vw; height: 2.6vw; padding: 0 0.4vw;
  border-radius: 99px;
  background: var(--ink); color: var(--cream);
  font-family: var(--serif); font-weight: 700; font-size: 1.15vw;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0.3vh 0.6vh rgba(26,23,20,0.3);
}
/* แสงเงาบนเหรียญ + แสงวับวิ่งผ่าน (เหมือนกระจก/โลหะขัดเงา) */
.tap2-sheen {
  position: absolute; inset: 0; z-index: 2; pointer-events: none; overflow: hidden; border-radius: 50%;
  background: linear-gradient(135deg, rgba(255,255,255,0.38) 0 16%, transparent 40%);
}
.tap2-sheen::after {
  content: '';
  position: absolute; top: -40%; left: -70%;
  width: 45%; height: 180%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.65), transparent);
  transform: rotate(20deg);
  animation: tapShine 4.6s ease-in-out var(--d, 0s) infinite;
}

@keyframes tapSwing {
  0%, 100% { transform: rotate(-2.2deg); }
  50% { transform: rotate(2.2deg); }
}
@keyframes tapShine {
  0%, 55% { left: -70%; }
  78%, 100% { left: 150%; }
}

.tap2-name { font-family: var(--serif); font-weight: 700; font-size: 1.75vw; line-height: 1.12; margin-top: 3vh; }
.tap2-style { font-weight: 300; font-size: 1.08vw; color: var(--muted); margin-top: 0.5vh; }
.tap2-price { font-family: var(--garamond); font-weight: 600; font-size: 2.5vw; color: var(--amber); margin-top: 0.9vh; }
.tap2-price.dual { font-size: 2vw; }

/* ---------- B/E. Cards (Staff Picks / New Arrivals) ---------- */

.tpl-cards2 .cards-wrap { height: 100%; padding: 13vh 6vw 6vh; display: flex; flex-direction: column; }
.cards-head { text-align: center; }
.cards-head .marker-side {
  font-family: var(--marker);
  font-size: 2.2vw; color: var(--amber);
  transform: rotate(-7deg);
  display: inline-block;
}
.cards-grid { flex: 1; display: grid; gap: 1.8vw; margin-top: 3vh; justify-content: center; }
.b-card {
  position: relative;
  background: var(--card);
  border: 1px solid rgba(26, 23, 20, 0.1);
  border-radius: 4px;
  box-shadow: 0 2.4vh 4vh -2vh rgba(26, 23, 20, 0.16);
  overflow: hidden;
  display: flex; flex-direction: column;
}
/* ช่องรูปแนวตั้ง — รูปขวด/กระป๋องส่วนใหญ่เป็น portrait */
.b-card-img {
  height: 46vh; flex-shrink: 0;         /* สูงขึ้นจาก 36vh → กระป๋องยาวขึ้น */
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  padding: 2.4vh 1vw;                   /* เว้นบน-ล่าง → กระป๋องที่ชิดขอบไฟล์ไม่แน่นติดการ์ด */
}
.b-card-img img { width: 100%; height: 100%; object-fit: contain; }
.b-card-img .art-initial { font-size: 5vw; }

/* กระป๋อง/ขวด ลอยโยกเบาๆ จากฐาน + เงานุ่ม — ใส่เฉพาะรูปจริง (placeholder ตัวอักษรไม่โดน) */
@keyframes canFloat {
  0%   { transform: translateY(0.5vh) rotate(-1.4deg); }
  50%  { transform: translateY(-1.1vh) rotate(1.4deg); }
  100% { transform: translateY(0.5vh) rotate(-1.4deg); }
}
.b-card-img img, .botd-art .art-frame img {
  animation: canFloat 4.8s ease-in-out infinite;
  transform-origin: 50% 90%;
  filter: drop-shadow(0 1.3vh 1vh rgba(26, 23, 20, 0.22));
  will-change: transform;
}
@media (prefers-reduced-motion: reduce) {
  .b-card-img img, .botd-art .art-frame img { animation: none; }
}
.b-card-body {
  padding: 1.8vh 1.4vw 2vh;
  display: flex; flex-direction: column; gap: 0.6vh; flex: 1;
}
.b-card-name { font-family: var(--serif); font-weight: 600; font-size: 1.6vw; line-height: 1.05; }
.b-card-style { font-weight: 300; font-size: 1vw; color: var(--muted); }
.b-card-notes { font-weight: 300; font-size: 1.1vw; line-height: 1.5; color: var(--soft); margin-top: 0.4vh; }
.b-card-price { font-family: var(--garamond); font-weight: 600; font-size: 2.4vw; color: var(--amber); }
.new-tag {
  position: absolute; top: 1.8vh; left: -0.4vw; z-index: 2;
  transform: rotate(-7deg);
  font-family: var(--marker);
  background: var(--amber); color: var(--card);
  padding: 0.4vh 1.1vw;
  font-size: 1.1vw; letter-spacing: 0.04em;
  box-shadow: 0 0.8vh 1.4vh rgba(26, 23, 20, 0.22);
}
/* badge ระดับเบียร์ (Tier) — มุมขวาบนการ์ด */
.tier-badge {
  position: absolute; top: 1.8vh; right: 0; z-index: 3;
  font-family: var(--serif); font-weight: 600;
  background: rgba(26, 23, 20, 0.82); color: var(--card);
  padding: 0.5vh 1vw 0.5vh 1.2vw;
  font-size: 0.95vw; letter-spacing: 0.08em;
  border-radius: 999px 0 0 999px;
  box-shadow: 0 0.6vh 1.2vh -0.3vh rgba(26, 23, 20, 0.3);
}
.tier-botd {                 /* botd: ย้ายไปซ้าย เลี่ยงมือที่เอื้อมจากขวาบน */
  top: 2vh; left: 0; right: auto;
  font-size: 1.05vw; padding: 0.6vh 1.4vw 0.6vh 1vw;
  border-radius: 0 999px 999px 0;
}
/* ป้ายโปร (1+1 / 2+1) มุมซ้ายบนการ์ด — แดงอิฐให้ดูเป็นดีล (ต่างจาก NEW สีอำพัน) */
.promo-tag {
  position: absolute; top: 1.8vh; left: -0.4vw; z-index: 3;
  transform: rotate(-7deg);
  font-family: var(--garamond); font-weight: 700;
  background: #b5462f; color: var(--card);
  padding: 0.4vh 1.1vw;
  font-size: 1.5vw; letter-spacing: 0.02em; line-height: 1;
  border-radius: 3px;
  box-shadow: 0 0.8vh 1.4vh rgba(26, 23, 20, 0.28);
}

/* ---------- D. Top Spenders ---------- */

.tpl-top2 .top-wrap { height: 100%; padding: 14vh 6vw 6vh; display: flex; flex-direction: column; }
.top-head { display: flex; flex-direction: column; gap: 0.5vh; }
.top-head-row { display: flex; align-items: baseline; gap: 1.4vw; }
.top-eyebrow {
  font-family: var(--serif); font-weight: 700;
  font-size: 1.5vw; letter-spacing: 0.26em; text-transform: uppercase;
  color: var(--amber);
}
.top-title { font-family: var(--serif); font-size: 2.6vw; letter-spacing: 0.16em; font-weight: 700; }
.top-marker {
  font-family: var(--marker); font-size: 2vw; color: var(--amber);
  transform: rotate(-4deg); display: inline-block;
}
.top-period {
  font-family: var(--garamond); font-style: italic;
  font-size: 1.6vw; color: var(--sand);
  margin-left: auto; white-space: nowrap;
}
.top-grid {
  flex: 1;
  display: grid; grid-template-columns: 1.05fr 0.95fr;
  gap: 3vw; margin-top: 3vh; align-items: center;
}
.champ {
  position: relative;
  background: var(--ink); color: var(--cream);
  border-radius: 6px;
  padding: 5vh 3vw;
  overflow: hidden;
  box-shadow: 0 3vh 5vh -2vh rgba(26, 23, 20, 0.4);
}
.champ-bg {
  position: absolute; top: -3vh; right: -1vw;
  font-family: var(--marker);
  font-size: 13vw; line-height: 1;
  color: rgba(232, 163, 61, 0.16);
}
.champ-inner { position: relative; }
.champ-rank { display: flex; align-items: center; gap: 1vw; }
.champ-hash { font-family: var(--marker); font-size: 2.2vw; color: var(--amber); }
.champ-label {
  font-weight: 300; font-size: 1.1vw; letter-spacing: 0.24em;
  color: #cbb89a; text-transform: uppercase;
}
.champ-name {
  font-family: var(--serif); font-weight: 700;
  font-size: 3.4vw; line-height: 1.05;
  margin-top: 1.6vh;
  overflow-wrap: anywhere;
}
.champ-amount {
  font-family: var(--garamond); font-weight: 600;
  font-size: 5.4vw; line-height: 0.85;
  color: var(--amber);
  margin-top: 3vh;
}
.champ-note { font-weight: 300; font-size: 1.2vw; color: #a99c87; margin-top: 1.8vh; }
/* การ์ดกลุ่ม TOP CREW — โทนเดียวกัน ต่างที่ไอคอน 🍻 + ดาวพื้นหลัง + รัศมีอุ่นขึ้นนิด */
.tpl-top2.crew .champ-bg { font-size: 11vw; top: -1vh; }
.tpl-top2.crew .champ-rays { background: repeating-conic-gradient(rgba(217, 139, 58, 0.28) 0deg 9deg, transparent 9deg 24deg); }

/* ---------- Champion glory (ถ้วยแชมป์นักดื่ม) ---------- */

.champ-inner { padding-right: 12vw; } /* เว้นที่ให้ถ้วยรางวัลฝั่งขวา */

.champ-glory {
  position: absolute;
  right: 0.5vw; top: 50%;
  transform: translateY(-50%);
  width: 13vw; height: 30vh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  pointer-events: none;
}
.champ-rays {
  position: absolute; inset: -45%;
  background: repeating-conic-gradient(rgba(232, 163, 61, 0.22) 0deg 11deg, transparent 11deg 26deg);
  border-radius: 50%;
  -webkit-mask-image: radial-gradient(circle, #000 28%, transparent 66%);
  mask-image: radial-gradient(circle, #000 28%, transparent 66%);
  animation: raysSpin 16s linear infinite;
}
@keyframes raysSpin { to { transform: rotate(360deg); } }

.champ-trophy {
  position: relative; z-index: 2;
  font-size: 6.2vw; line-height: 1;
  filter: drop-shadow(0 1.2vh 2.2vh rgba(232, 163, 61, 0.5));
  animation: trophyBob 2.6s ease-in-out infinite;
}
@keyframes trophyBob {
  0%, 100% { transform: scale(1) rotate(-3deg); }
  50% { transform: scale(1.07) rotate(3deg); }
}

.champ-spark {
  position: absolute; z-index: 2;
  font-size: 1.4vw; color: #ffd479;
  animation: twinkle 1.9s ease-in-out infinite;
}
@keyframes twinkle {
  0%, 100% { opacity: 0.1; transform: scale(0.6); }
  50% { opacity: 1; transform: scale(1.15); }
}

.champ-thai {
  position: relative; z-index: 2;
  font-family: var(--marker);
  font-size: 1.45vw; color: var(--amber);
  transform: rotate(-6deg);
  margin-top: 1.2vh;
  white-space: nowrap;
}

/* ชื่อแชมป์ shimmer ทอง */
.champ-name {
  background: linear-gradient(105deg, var(--amber) 25%, #ffe9b0 45%, var(--amber) 65%);
  background-size: 220% 100%;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  animation: goldShimmer 3.2s linear infinite;
}
@keyframes goldShimmer {
  0% { background-position: 120% 0; }
  100% { background-position: -100% 0; }
}

/* อันดับ 2-5 ไหลเข้าทีละแถว */
.runners .r-row { animation: riseIn 0.7s ease-out backwards; }
.runners .r-row:nth-child(1) { animation-delay: 0.25s; }
.runners .r-row:nth-child(2) { animation-delay: 0.5s; }
.runners .r-row:nth-child(3) { animation-delay: 0.75s; }
.runners .r-row:nth-child(4) { animation-delay: 1s; }
@keyframes riseIn {
  from { opacity: 0; transform: translateY(2.4vh); }
  to { opacity: 1; transform: translateY(0); }
}

/* ราคา 2 ไซส์ (S/M) */
.pp-sz {
  font-family: 'Kanit', sans-serif;
  font-weight: 400; font-size: 0.48em;
  color: var(--sand);
  margin-right: 0.3vw;
  letter-spacing: 0;
}
.pp-sep { margin: 0 0.6vw; color: #cbbfa9; font-size: 0.6em; }
.botd-price.dual { font-size: 4.3vw; line-height: 1; }
.tap-price.dual { font-size: 1.9vw; }
.b-card-price.dual { font-size: 1.9vw; }
.m-price.dual { font-size: 2.2vw; }

.runners { display: flex; flex-direction: column; }
.r-row {
  display: grid; grid-template-columns: 3.4vw 1fr auto;
  gap: 1.4vw; align-items: center;
  padding: 2vh 0;
  border-bottom: 1px solid rgba(26, 23, 20, 0.14);
}
.r-row:last-child { border-bottom: none; }
.r-num { font-family: var(--garamond); font-weight: 600; font-size: 3vw; color: #bcae96; }
.r-name { font-weight: 500; font-size: 1.9vw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.r-amount { font-family: var(--garamond); font-weight: 600; font-size: 2.6vw; }

/* ---------- F. Promotion ---------- */

.tpl-promo2 .promo-center {
  height: 100%;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center;
  padding: 14vh 8vw 8vh;
  position: relative; z-index: 2;
}
.promo-title2 {
  font-family: var(--serif); font-weight: 700;
  font-size: 6.4vw; line-height: 0.98;
  margin-top: 2.6vh;
  overflow-wrap: anywhere;
}
.promo-msg {
  font-weight: 400; font-size: 2.1vw; color: #4a423a;
  margin-top: 2.8vh; max-width: 50vw; line-height: 1.5;
}
.promo-foot { display: flex; align-items: center; gap: 2.4vw; margin-top: 4vh; }
.promo-time-block { display: flex; flex-direction: column; align-items: center; }
.promo-time-label {
  font-weight: 300; font-size: 1.1vw; letter-spacing: 0.2em;
  color: var(--muted); text-transform: uppercase; white-space: nowrap;
}
.promo-time-val {
  font-family: var(--garamond); font-weight: 600;
  font-size: 4.4vw; line-height: 1; white-space: nowrap;
}
.promo-div { width: 1px; height: 7vh; background: rgba(26, 23, 20, 0.2); }
.promo-countdown {
  display: flex; align-items: center; gap: 0.8vw;
  background: var(--amber); color: var(--ink);
  border-radius: 999px;
  padding: 1.4vh 2.2vw;
  box-shadow: 0 1.6vh 3vh -1vh rgba(232, 163, 61, 0.5);
  font-weight: 600; font-size: 1.9vw; white-space: nowrap;
  min-height: 1.4em;
}
.promo-countdown::before {
  content: '';
  width: 1vw; height: 1vw; border-radius: 50%;
  background: var(--ink);
  flex-shrink: 0;
}

/* สถานะ LIVE (ดนตรีสดกำลังเล่น) — ป้ายดำ จุดแดงกระพริบ + คลื่นแสงอำพัน */
.promo-countdown.live-now {
  background: var(--ink);
  color: var(--cream);
  animation: livePulse 1.8s ease-out infinite;
}
.promo-countdown.live-now::before {
  background: #e0483d;
  animation: liveBlink 1.1s steps(2, start) infinite;
}
@keyframes livePulse {
  0% { box-shadow: 0 0 0 0 rgba(232, 163, 61, 0.55); }
  70% { box-shadow: 0 0 0 1.4vw rgba(232, 163, 61, 0); }
  100% { box-shadow: 0 0 0 0 rgba(232, 163, 61, 0); }
}
@keyframes liveBlink {
  50% { opacity: 0.2; }
}

/* กรอบรูป art มุมจอ */
.art-corner {
  position: absolute; z-index: 1;
  background: var(--card);
  border: 1px solid rgba(26, 23, 20, 0.25);
  box-shadow: 0 2.4vh 4.4vh -1vh rgba(26, 23, 20, 0.34);
  padding: 0.7vw;
}
.art-corner img { display: block; width: 100%; height: auto; }
.art-cap {
  text-align: center;
  font-family: var(--garamond); font-style: italic;
  font-size: 0.85vw; color: var(--sand);
  padding-top: 0.6vh;
}
.tpl-promo2 .art-corner { left: 2.6vw; bottom: 5vh; width: 21vw; transform: rotate(-3deg); }
.tpl-promo2 .art-corner.art-music { width: 12.5vw; bottom: 6vh; } /* รูปแนวตั้ง (Mona Lisa) */

/* ---------- G. Text ---------- */

.tpl-text2 .text-center {
  height: 100%;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center;
  padding: 12vh 18vw;
  position: relative; z-index: 2;
}
.text-quote {
  font-family: var(--garamond);
  font-size: 7vw; line-height: 0; height: 3vh;
  color: var(--amber);
}
.text-msg {
  font-family: var(--serif); font-weight: 600;
  font-size: 4vw; line-height: 1.2;
}
.text-msg.long { font-size: 2.8vw; }
.text-tagline {
  font-family: var(--garamond); font-style: italic;
  font-size: 1.5vw; color: var(--sand);
  margin-top: 4.5vh; letter-spacing: 0.04em;
}
.tpl-text2 .art-left { left: 3vw; top: 50%; transform: translateY(-50%) rotate(-2.5deg); width: 12vw; }
.tpl-text2 .art-right { right: 3vw; top: 50%; transform: translateY(-50%) rotate(2.5deg); width: 13vw; }

/* ---------- Text variants ---------- */

/* G2. กราฟฟิตี้ */
.tpl-text-marker .tm-center {
  height: 100%;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center;
  padding: 12vh 12vw;
  transform: rotate(-2deg);
}
.tm-text {
  font-family: var(--marker);
  font-size: 5.2vw; line-height: 1.25;
  color: var(--ink);
}
.tm-text.long { font-size: 3.4vw; }
.tm-stroke {
  width: 22vw; height: 1.6vh;
  background: var(--amber);
  border-radius: 99px;
  transform: rotate(-1.5deg) skewX(-18deg);
  margin-top: 3.5vh;
  opacity: 0.85;
}
.tm-sign {
  font-family: var(--marker);
  font-size: 1.8vw; color: var(--sand);
  margin-top: 3vh;
  transform: rotate(1deg);
}

/* G3. กระดานดำ */
.tpl-text-chalk { background: var(--ink); color: var(--cream); }
.tpl-text-chalk .tc-frame {
  position: absolute; inset: 9vh 7vw;
  border: 2px solid rgba(243, 238, 229, 0.35);
  outline: 1px solid rgba(243, 238, 229, 0.18);
  outline-offset: 0.6vw;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center;
  padding: 4vh 6vw;
}
.tc-kicker {
  font-family: var(--serif);
  font-size: 1.5vw; letter-spacing: 0.46em;
  color: var(--amber);
}
.tc-text {
  font-family: var(--marker);
  font-size: 4.6vw; line-height: 1.3;
  color: var(--cream);
  margin-top: 3vh;
}
.tc-text.long { font-size: 3vw; }
.tc-tag {
  font-family: var(--serif);
  font-size: 1.2vw; letter-spacing: 0.4em;
  color: rgba(243, 238, 229, 0.6);
  margin-top: 4vh;
}
.tc-tag span { font-family: var(--marker); color: var(--amber); letter-spacing: 0; }

/* G4. โปสเตอร์ */
.tpl-text-poster .tp-center {
  height: 100%;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center;
  padding: 12vh 10vw;
  position: relative; z-index: 2; /* ให้ปื้น marker (z-index:-1) อยู่หลังตัวอักษรแต่หน้า bg */
}
.tp-text {
  font-family: var(--serif); font-weight: 700;
  font-size: 6vw; line-height: 1.08;
  margin-top: 3vh;
}
.tp-text.long { font-size: 3.6vw; }

/* G5. ป้ายประกาศ */
.tpl-text-placard {
  display: flex; align-items: center; justify-content: center;
}
.placard {
  position: relative; z-index: 2;
  background: var(--card);
  border: 1px solid rgba(26, 23, 20, 0.3);
  outline: 1px solid rgba(26, 23, 20, 0.15);
  outline-offset: 0.5vw;
  box-shadow: 0 4vh 7vh -2vh rgba(26, 23, 20, 0.3);
  max-width: 62vw;
  padding: 7vh 5vw;
  text-align: center;
}
.pl-kicker {
  font-size: 1.1vw; font-weight: 400;
  letter-spacing: 0.3em; text-transform: uppercase;
  color: var(--sand);
}
.pl-text {
  font-weight: 500;
  font-size: 3vw; line-height: 1.45;
  margin-top: 3vh;
}
.pl-text.long { font-size: 2.1vw; }
.pl-foot {
  font-family: var(--serif);
  font-size: 1.1vw; letter-spacing: 0.4em;
  color: var(--muted);
  margin-top: 4vh;
}

/* ---------- Feature card (รูป/วิดีโอ + ข้อความ) ---------- */

.tpl-feature .feat-center {
  height: 100%;
  display: flex; align-items: center; justify-content: center;
  padding: 13vh 6vw 7vh;
}
.feat-frame {
  background: var(--card);
  border: 1px solid rgba(26, 23, 20, 0.25);
  box-shadow: 0 3vh 5.5vh -1.5vh rgba(26, 23, 20, 0.32);
  padding: 0.9vw;
}
.feat-polaroid {
  max-width: 56vw;
  transform: rotate(-1.5deg);
}
.feat-media {
  width: 100%; height: 56vh;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.feat-media img, .feat-media video {
  width: 100%; height: 100%;
  object-fit: contain;
}
.feat-empty { font-size: 6vw; opacity: 0.5; }
.feat-cap {
  text-align: center;
  font-family: var(--marker);
  font-size: 2vw; line-height: 1.4;
  color: var(--ink);
  padding: 2.2vh 2vw 1vh;
  max-width: 54vw;
}

.tpl-feature-split .fs-grid {
  height: 100%;
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 4vw;
  padding: 15vh 6vw 7vh;
  align-items: center;
}
.fs-frame { transform: rotate(-1deg); }
.fs-frame .feat-media { height: 60vh; }
.fs-msg {
  font-weight: 500;
  font-size: 2.9vw; line-height: 1.45;
  margin-top: 3vh;
  overflow-wrap: anywhere;
}
.fs-msg.long { font-size: 2.1vw; }

/* ---------- Animations (วันเกิด / ดนตรีสด / Hurry Hour) ---------- */

@keyframes confettiFall {
  0% { transform: translateY(-8vh) rotate(0deg); }
  100% { transform: translateY(112vh) rotate(640deg); }
}
@keyframes floaty {
  0%, 100% { transform: rotate(-3deg) translateY(0); }
  50% { transform: rotate(-3deg) translateY(-1.4vh); }
}
@keyframes bdayBob {
  0%, 100% { transform: rotate(-2deg) scale(1); }
  50% { transform: rotate(-2deg) scale(1.035); }
}
@keyframes eqBounce {
  0%, 100% { transform: scaleY(0.25); }
  50% { transform: scaleY(1); }
}
@keyframes breathe {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.018); }
}
@keyframes urgentShake {
  0%, 86%, 100% { transform: rotate(0); }
  88% { transform: rotate(-2.4deg); }
  90% { transform: rotate(2.2deg); }
  92% { transform: rotate(-1.8deg); }
  94% { transform: rotate(1.4deg); }
  96% { transform: rotate(-0.8deg); }
  98% { transform: rotate(0.4deg); }
}

/* confetti วันเกิด */
.confetti { position: absolute; inset: 0; overflow: hidden; z-index: 1; pointer-events: none; }
.confetti span {
  position: absolute; top: -3vh;
  width: 0.7vw; height: 1.2vh;
  opacity: 0.85;
  animation: confettiFall linear infinite;
}

/* แถบ EQ ดนตรีสด */
.eq {
  display: flex; gap: 0.45vw; align-items: flex-end;
  height: 4.2vh;
  margin-top: 2.6vh;
}
.eq span {
  width: 0.75vw; height: 100%;
  background: var(--amber);
  border-radius: 3px;
  transform-origin: bottom;
  animation: eqBounce 1s ease-in-out infinite;
}
.eq.eq-live span { animation-duration: 0.45s !important; background: #d9763d; }

.title-breathe { animation: breathe 3.2s ease-in-out infinite; }
.promo-countdown.urgent { animation: urgentShake 3s ease-in-out infinite; }
.tpl-promo2 .art-corner.art-music { animation: floaty 4.5s ease-in-out infinite; }

/* ---------- วันเกิด 🎂 ---------- */

.tpl-bday {
  background:
    radial-gradient(circle at 12% 30%, rgba(232, 163, 61, 0.35) 0 0.45vw, transparent 0.55vw),
    radial-gradient(circle at 22% 75%, rgba(26, 23, 20, 0.2) 0 0.3vw, transparent 0.4vw),
    radial-gradient(circle at 35% 22%, rgba(232, 163, 61, 0.3) 0 0.3vw, transparent 0.4vw),
    radial-gradient(circle at 62% 80%, rgba(232, 163, 61, 0.3) 0 0.4vw, transparent 0.5vw),
    radial-gradient(circle at 75% 28%, rgba(26, 23, 20, 0.18) 0 0.35vw, transparent 0.45vw),
    radial-gradient(circle at 88% 64%, rgba(232, 163, 61, 0.35) 0 0.45vw, transparent 0.55vw),
    radial-gradient(circle at 50% 12%, rgba(154, 139, 117, 0.35) 0 0.3vw, transparent 0.4vw),
    var(--cream);
}
.tpl-bday {
  display: flex; flex-direction: column;
  padding: 6.5vh 4vw 4.5vh;
  z-index: 2;
}
.tpl-bday .bday-hero { flex: 0 0 auto; text-align: center; }
.bday-name {
  font-family: var(--marker);
  font-size: 5.6vw; line-height: 1.05;
  color: var(--amber);
  text-shadow: 0.18vw 0.35vh 0 rgba(26, 23, 20, 0.85);
  transform: rotate(-2deg);
  margin-top: 1.6vh;
  overflow-wrap: anywhere;
  animation: bdayBob 2.8s ease-in-out infinite;
}
.bday-name.long { font-size: 4vw; }
.bday-msg {
  font-weight: 400; font-size: 1.85vw; color: #4a423a;
  margin-top: 1.4vh;
}

/* สองคอลัมน์: ซ้าย = QR ก้อนใหญ่ (สแกนไกล 5 ม.) · ขวา = คำอวยพรสด */
.bday-cols {
  flex: 1 1 auto; min-height: 0;
  display: flex; gap: 3vw; margin-top: 3vh;
  align-items: stretch;
}
.bday-qr-card {
  flex: 0 0 38%;
  background: #fff;
  border: 0.45vw solid var(--ink);
  border-radius: 1.4vw;
  box-shadow: 0.4vw 0.7vh 0 rgba(26, 23, 20, 0.85);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 2.4vh 2vw; gap: 1.2vh;
}
.bday-qr {
  width: 100%; aspect-ratio: 1 / 1; max-height: 44vh;
  display: flex; align-items: center; justify-content: center;
}
.bday-qr svg { width: 100%; height: 100%; display: block; }
.bday-qr-cta {
  font-family: var(--marker); font-size: 2.2vw; color: var(--ink);
  text-align: center; line-height: 1.1;
}
.bday-qr-url {
  font-family: var(--serif); font-size: 1.25vw;
  color: var(--sand); letter-spacing: 0.02em; word-break: break-all; text-align: center;
}
.bday-wishes {
  flex: 1 1 auto; min-width: 0; min-height: 0;
  display: flex; flex-direction: column;
}
.bday-wishes-head {
  font-family: var(--serif); font-weight: 700;
  font-size: 1.8vw; color: var(--ink);
  display: flex; align-items: center; gap: 0.8vw; margin-bottom: 1.4vh;
}
.bday-wishes-live {
  font-family: var(--marker); font-size: 1vw; letter-spacing: 0.12em;
  color: #fff; background: #d9763d;
  padding: 0.2vh 0.7vw; border-radius: 1vw;
  animation: liveBlink 1.4s steps(1, end) infinite;
}
.bday-wishes-track {
  flex: 1 1 auto; min-height: 0;
  display: flex; flex-direction: column; gap: 1.2vh; overflow: hidden;
}
.wish-card {
  background: #fff;
  border-left: 0.4vw solid var(--amber);
  border-radius: 0.8vw;
  box-shadow: 0.15vw 0.3vh 0 rgba(26, 23, 20, 0.12);
  padding: 1.2vh 1.4vw;
  animation: riseIn 0.5s ease both;
  animation-delay: calc(var(--i, 0) * 0.08s);
}
.wish-from {
  display: block;
  font-family: var(--marker); font-size: 1.45vw; color: var(--amber);
  margin-bottom: 0.25vh;
}
.wish-text {
  display: block;
  font-size: 1.45vw; color: #3a332c; line-height: 1.35; overflow-wrap: anywhere;
}
.wish-empty {
  font-size: 1.55vw; color: var(--sand);
  padding: 3vh 1vw; text-align: center;
}
.tpl-bday .bday-art { display: none; }

/* ---------- Brand fallback ---------- */

.tpl-brand2 .brand-center {
  height: 100%;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center; gap: 1.5vh;
}
.brand-serif-big { font-family: var(--serif); font-size: 6vw; font-weight: 700; letter-spacing: 0.18em; }
.brand-marker-big { font-family: var(--marker); font-size: 4vw; color: var(--amber); }
.brand-sub { font-family: var(--garamond); font-style: italic; font-size: 1.8vw; color: var(--sand); margin-top: 2vh; }

/* ---------- Overlay: clock / logo / status ---------- */

#overlay { position: fixed; inset: 0; pointer-events: none; z-index: 10; }

#clock {
  position: absolute; top: 5vh; right: 3vw;
  display: flex; align-items: center; gap: 0.6vw;
  font-family: var(--garamond);
  font-size: 2.3vw; font-weight: 600; letter-spacing: 0.04em;
  color: var(--ink);
}
#clock::before {
  content: '';
  width: 0.7vw; height: 0.7vw; border-radius: 50%;
  background: var(--amber);
}

#brand {
  position: absolute; bottom: 3.6vh; right: 3vw;
  display: flex; align-items: flex-end; gap: 0.55vw;
  opacity: 0.92;
}
#brand-serif {
  font-family: var(--serif);
  font-size: 1.3vw; letter-spacing: 0.4em; font-weight: 600;
  color: var(--ink);
}
#brand-marker {
  font-family: var(--marker);
  font-size: 1.7vw; color: var(--amber); line-height: 0.75;
}

/* บน slide รูป/วิดีโอ (พื้นมืด) นาฬิกา/โลโก้ต้องอ่านออก */
body.on-dark #clock { color: var(--cream); text-shadow: 0 2px 12px rgba(0, 0, 0, 0.7); }
body.on-dark #brand-serif { color: var(--cream); text-shadow: 0 2px 12px rgba(0, 0, 0, 0.7); }

#status-dot {
  position: absolute; bottom: 1.2vh; left: 1vw;
  width: 0.6vw; height: 0.6vw; border-radius: 50%;
  opacity: 0.6;
}
#status-dot.demo { background: #4a9eda; }
#status-dot.error { background: #c0563f; }
#status-dot.ok { background: transparent; }

/* ป้ายบอกว่ากำลังดู preview (เปิดจาก admin) */
body.preview::after {
  content: 'PREVIEW';
  position: fixed; top: 1.5vh; left: 1.5vw;
  z-index: 20;
  font-family: 'Kanit', sans-serif;
  font-size: 1.1vw; font-weight: 600; letter-spacing: 0.2em;
  color: var(--cream);
  background: rgba(26, 23, 20, 0.75);
  padding: 0.5vh 1vw;
  border-radius: 99px;
}
