/**
 * ============================================================
 *  竹林酒樓 · MEME BAR — Kiếm hiệp Kim Dung / tửu quán trong rừng
 *  Overlay OBS 16:9 (1920×1080)
 * ============================================================
 */

:root {
  --ink: #1a1208;
  --ink-soft: #3a2a18;
  --parchment: #f0e2c4;
  --parchment-deep: #d9c49a;
  --lacquer: #9b1b1b;
  --lacquer-bright: #c42828;
  --gold: #d4a017;
  --gold-bright: #ffe27a;
  --moss: #3d5c3a;
  --bamboo: #6f9b3c;
  --bamboo-deep: #3d6b24;
  --mist: rgba(220, 235, 245, 0.45);
  --lantern: #ffb347;
  --wood: #6b4423;
  --wood-dark: #3a2414;
  --text: #fff8e8;
  --muted: #d8c8a8;
  --glass: rgba(20, 35, 45, 0.55);
  --sky: #c5dde8;
  --font-brush: "Ma Shan Zheng", "ZCOOL XiaoWei", cursive;
  --font-song: "Noto Serif SC", "Songti SC", serif;
  --font-ui: "Noto Serif SC", "Songti SC", serif;
  --stage-w: 1920px;
  --stage-h: 1080px;
}

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

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 50% 40%, #24401f 0%, #16260f 55%, #0b1508 100%);
  color: var(--text);
  font-family: var(--font-ui);
}

body {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---------- Shell: tavern 16:9 · club TikTok dọc 9:16 ---------- */
.stage-shell {
  position: relative;
  width: min(100vw, calc(100vh * 16 / 9));
  height: min(100vh, calc(100vw * 9 / 16));
  overflow: hidden;
  flex-shrink: 0;
  border-radius: 6px;
  box-shadow:
    0 0 0 2px rgba(160, 200, 110, 0.35),
    0 24px 60px rgba(0, 0, 0, 0.75);
}

/* Club — khung dọc iPhone / TikTok 9:16 (1080×1920) */
body[data-theme="club"] .stage-shell,
body.theme-club .stage-shell {
  width: min(100vw, calc(100vh * 9 / 16));
  height: min(100vh, calc(100vw * 16 / 9));
  border-radius: 18px;
  box-shadow:
    0 0 0 2px rgba(255, 46, 136, 0.45),
    0 24px 60px rgba(0, 0, 0, 0.8);
}
body[data-theme="club"] .rotate-hint,
body.theme-club .rotate-hint {
  display: none !important;
}

/* Điện thoại dọc: nhắc xoay ngang cho đã mắt */
.rotate-hint {
  display: none;
  position: fixed;
  bottom: 132px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 900;
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(20, 35, 18, 0.85);
  border: 1px solid rgba(200, 230, 150, 0.35);
  color: #eaf5d8;
  font-size: 13px;
  white-space: nowrap;
}

@media (orientation: portrait) and (max-width: 900px) {
  .rotate-hint { display: block; }
}

.stage {
  position: absolute;
  top: 0;
  left: 0;
  width: var(--stage-w);
  height: var(--stage-h);
  overflow: hidden;
  transform-origin: top left;
  /* --stage-scale do JS cập nhật theo kích thước shell */
  transform: scale(var(--stage-scale, 1));
  /* Chiều sâu cho camera 3D */
  perspective: 1500px;
  perspective-origin: 50% 46%;
}

/* ---------- Lớp camera điện ảnh ---------- */
.world {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  transition: transform 2.6s cubic-bezier(0.42, 0, 0.18, 1);
  will-change: transform;
  backface-visibility: hidden;
}

/* Trôi nhè nhẹ để khung hình không bao giờ đứng chết */
.world__drift {
  position: absolute;
  inset: 0;
  animation: camDrift 22s ease-in-out infinite alternate;
}

@keyframes camDrift {
  from { transform: translate3d(-14px, 4px, 0) scale(1.01); }
  to { transform: translate3d(14px, -8px, 0) scale(1.03); }
}

/* Nhãn góc máy góc dưới trái */
.shot-label {
  position: absolute;
  left: 36px;
  bottom: 28px;
  z-index: 40;
  padding: 8px 18px;
  font-family: var(--font-brush);
  font-size: 24px;
  letter-spacing: 0.08em;
  color: var(--gold-bright);
  background: linear-gradient(90deg, rgba(12, 24, 10, 0.8), rgba(12, 24, 10, 0));
  border-left: 3px solid var(--gold);
  text-shadow: 0 2px 6px #000;
  animation: shotLabelIn 0.6s ease both;
}

@keyframes shotLabelIn {
  from { opacity: 0; transform: translateX(-14px); }
  to { opacity: 1; transform: translateX(0); }
}

/* Cấu hình "ẩn tên" từ /settings */
body.hide-labels .character__label,
body.hide-labels .character__hero {
  display: none;
}

/* Link nhỏ mở bảng điều khiển — ẩn khi quay OBS */
.settings-link {
  position: fixed;
  right: 14px;
  bottom: 14px;
  z-index: 950;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(18, 32, 16, 0.55);
  border: 1px solid rgba(200, 230, 150, 0.3);
  color: #dff0c0;
  font-size: 18px;
  text-decoration: none;
  opacity: 0.25;
  transition: opacity 0.2s ease;
}

.settings-link:hover { opacity: 1; }

/* ---------- Rừng trúc dày (ảnh mẫu) ---------- */
.bar-bg {
  position: absolute;
  /* Tràn ra ngoài khung để camera xoay không lộ mép */
  inset: -6%;
  z-index: 0;
  background: #1e3a1c;
}

.bar-bg__scenic {
  position: absolute;
  inset: 0;
  background:
    url("/assets/tavern-bg.png") center center / cover no-repeat;
  filter: saturate(1.05) contrast(1.02);
}

/* Ánh sáng xuyên tán lá */
.bar-bg__rays {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 50% 40% at 50% 0%, rgba(220, 255, 200, 0.35), transparent 55%),
    linear-gradient(180deg, rgba(180, 220, 160, 0.12), transparent 40%);
  pointer-events: none;
  mix-blend-mode: screen;
  animation: raysPulse 6s ease-in-out infinite;
}

@keyframes raysPulse {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}

.bar-bg__veil {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(30, 60, 35, 0.15) 0%, transparent 30%, rgba(10, 20, 12, 0.25) 55%, rgba(8, 14, 8, 0.78) 100%);
  pointer-events: none;
}

/* Cột trúc hai bên + lớp giữa */
.bar-bg__bamboo {
  position: absolute;
  top: -4%;
  bottom: 15%;
  pointer-events: none;
  z-index: 2;
  mask-image: linear-gradient(180deg, #000 0%, #000 80%, transparent);
}

.bar-bg__bamboo--l,
.bar-bg__bamboo--r {
  width: 12%;
  opacity: 0.5;
  background:
    repeating-linear-gradient(
      90deg,
      transparent 0 14px,
      rgba(45, 80, 22, 0.85) 14px 22px,
      transparent 22px 40px
    );
  filter: blur(1px);
}

.bar-bg__bamboo--l { left: 0; }
.bar-bg__bamboo--r {
  right: 0;
  transform: scaleX(-1);
}

/* Không cần lớp trúc giữa vì ảnh nền đã có rừng trúc */
.bar-bg__bamboo--mid {
  display: none;
}

.bar-bg__mist {
  position: absolute;
  inset: 0;
  z-index: 3;
  background:
    radial-gradient(ellipse 80% 40% at 50% 75%, rgba(230, 245, 220, 0.45), transparent 55%),
    radial-gradient(ellipse 50% 30% at 30% 50%, rgba(200, 230, 190, 0.25), transparent 50%);
  animation: mistDrift 14s ease-in-out infinite alternate;
  pointer-events: none;
}

@keyframes mistDrift {
  from { transform: translateX(-2%); opacity: 0.8; }
  to { transform: translateX(2%); opacity: 1; }
}

/* Sàn đá / đường trong rừng — thấp để lộ nhiều trúc */
.bar-bg__floor {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 32%;
  z-index: 2;
  background:
    linear-gradient(180deg, transparent, rgba(15, 25, 12, 0.55) 30%, rgba(12, 18, 10, 0.88)),
    repeating-linear-gradient(
      90deg,
      rgba(60, 50, 35, 0.25) 0 8px,
      transparent 8px 40px
    );
  border-top: 2px solid rgba(140, 180, 90, 0.25);
}

.bar-bg__smoke {
  position: absolute;
  inset: 0;
  z-index: 3;
  background:
    radial-gradient(circle at 50% 80%, rgba(255, 255, 255, 0.12), transparent 35%);
  pointer-events: none;
  animation: mistDrift 18s ease-in-out infinite alternate-reverse;
}

/* ---------- Brand biển hiệu ---------- */
.brand {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  pointer-events: none;
  animation: brandIn 0.9s cubic-bezier(0.2, 0.9, 0.2, 1) both;
}
/* Cận DJ: biển hiệu lùi lại nhường chỗ cho mặt cô ấy */
body.shot-dj .brand {
  /* brandIn dùng fill both nên phải tắt animation mới hạ được opacity */
  animation: none;
  opacity: 0.14;
}
.brand {
  transition: opacity 0.6s ease;
}
body[data-theme="club"] .brand__plaque {
  padding: 4px 22px 6px;
  background: rgba(8, 12, 24, 0.72);
  border-color: rgba(0, 229, 255, 0.65);
  box-shadow: 0 0 20px rgba(0, 229, 255, 0.35);
}
body[data-theme="club"] .brand__title {
  font-size: 28px;
  letter-spacing: 0.08em;
}
body[data-theme="club"] .brand__sub {
  font-size: 11px;
  letter-spacing: 0.2em;
}

.brand__plaque {
  padding: 8px 32px 12px;
  background:
    linear-gradient(180deg, rgba(30, 70, 30, 0.88), rgba(15, 40, 18, 0.92));
  border: 3px solid #c8e070;
  border-radius: 6px;
  box-shadow:
    0 0 0 2px rgba(20, 40, 15, 0.6),
    0 8px 28px rgba(0, 0, 0, 0.35),
    0 0 24px rgba(140, 200, 80, 0.35);
  text-align: center;
}

.brand__title {
  font-family: var(--font-brush);
  font-size: 44px;
  line-height: 1;
  color: #f4ffe0;
  text-shadow:
    0 2px 0 #1a3010,
    0 0 18px rgba(160, 220, 80, 0.65);
  letter-spacing: 0.12em;
}

.brand__sub {
  font-family: var(--font-song);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.35em;
  color: #d8f0a8;
  margin-top: 2px;
}

@keyframes brandIn {
  from { opacity: 0; transform: translateX(-50%) translateY(-18px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ---------- Status ---------- */
.status-pill {
  position: absolute;
  top: 24px;
  left: 28px;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: var(--glass);
  border: 1px solid rgba(201, 162, 39, 0.4);
  border-radius: 4px;
  font-size: 13px;
  font-weight: 700;
  backdrop-filter: blur(8px);
  color: var(--parchment);
}

.status-pill__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #666;
}

.status-pill__dot.is-live {
  background: #6dcf4a;
  box-shadow: 0 0 10px #6dcf4a;
  animation: livePulse 1.5s ease-in-out infinite;
}

@keyframes livePulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.25); }
}

/* ============================================================
   CHIBI ANH HÙNG KIM DUNG
   Biến CSS mỗi nhân vật: --robe --robe2 --accent --hair --skin
   ============================================================ */
.character {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 78px;
  user-select: none;
  transform-style: preserve-3d;
}

.chibi {
  position: relative;
  width: 64px;
  height: 92px;
  transform-origin: center bottom;
  transform-style: preserve-3d;
  /* --s: cỡ nhân vật · --dance: điệu nhảy · --dd: nhịp */
  animation: var(--dance, danceGroove) var(--dd, 0.62s) ease-in-out infinite;
  animation-delay: var(--ddelay, 0s);
}

/* ---- Chân ---- */
.chibi__legs {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 30px;
  height: 10px;
}

.chibi__legs::before,
.chibi__legs::after {
  content: "";
  position: absolute;
  bottom: 0;
  width: 12px;
  height: 8px;
  background: #2a1f18;
  border-radius: 6px 6px 3px 3px;
  border: 1px solid rgba(0, 0, 0, 0.4);
}

.chibi__legs::before { left: 0; }
.chibi__legs::after { right: 0; }

/* ---- Thân / áo choàng ---- */
.chibi__body {
  position: absolute;
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%);
  width: 46px;
  height: 44px;
  z-index: 1;
}

.chibi__robe {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(105deg, rgba(255, 255, 255, 0.14) 0 42%, transparent 43%),
    linear-gradient(180deg, var(--robe, #4a7c59), var(--robe2, #2d5038));
  border: 2px solid rgba(0, 0, 0, 0.35);
  border-radius: 14px 14px 6px 6px;
  clip-path: polygon(18% 0, 82% 0, 100% 100%, 0 100%);
  box-shadow: inset 0 6px 10px rgba(255, 255, 255, 0.18);
}

/* Vạt áo vắt chéo kiểu giao lĩnh */
.chibi__robe::after {
  content: "";
  position: absolute;
  left: 46%;
  top: 4px;
  width: 2px;
  height: 100%;
  background: rgba(0, 0, 0, 0.25);
  transform: rotate(-6deg);
}

/* Cổ áo trắng chữ V */
.chibi__collar {
  position: absolute;
  top: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 22px;
  height: 16px;
  background: var(--accent, #f0e6d0);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  z-index: 2;
}

/* Đai lưng */
.chibi__belt {
  position: absolute;
  bottom: 14px;
  left: -2px;
  right: -2px;
  height: 7px;
  background: var(--accent, #e8c547);
  border: 1px solid rgba(0, 0, 0, 0.3);
  z-index: 2;
}

.chibi__belt::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  width: 6px;
  height: 16px;
  background: var(--accent, #e8c547);
  opacity: 0.9;
  transform: translateX(-50%);
  animation: sashSway 0.9s ease-in-out infinite;
}

@keyframes sashSway {
  0%, 100% { transform: translateX(-50%) rotate(-8deg); }
  50% { transform: translateX(-50%) rotate(10deg); }
}

/* ---- Tay áo ---- */
.chibi__arm {
  position: absolute;
  top: 2px;
  width: 13px;
  height: 30px;
  background: linear-gradient(180deg, var(--robe, #4a7c59), var(--robe2, #2d5038));
  border: 2px solid rgba(0, 0, 0, 0.3);
  border-radius: 8px 8px 10px 10px;
  transform-origin: top center;
  z-index: 1;
}

/* Cổ tay áo màu viền */
.chibi__arm::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: -1px;
  right: -1px;
  height: 6px;
  background: var(--accent, #e8c547);
  border-radius: 0 0 6px 6px;
  opacity: 0.9;
}

.chibi__arm--l {
  left: -12px;
  animation: armWaveL 0.5s ease-in-out infinite;
}

.chibi__arm--r {
  right: -12px;
  animation: armWaveR 0.5s ease-in-out infinite;
}

@keyframes armWaveL {
  0%, 100% { transform: rotate(16deg); }
  50% { transform: rotate(-38deg); }
}

@keyframes armWaveR {
  0%, 100% { transform: rotate(-16deg); }
  50% { transform: rotate(38deg); }
}

/* ---- Dương Quá: cụt tay phải (bên trái theo hướng nhìn) ---- */
.chibi--onearm .chibi__arm--l {
  height: 16px;
  border-radius: 8px 8px 12px 12px;
  animation: emptySleeve 1.1s ease-in-out infinite;
}

/* Tay áo rỗng thì không lộ cổ tay */
.chibi--onearm .chibi__arm--l::after {
  display: none;
}

@keyframes emptySleeve {
  0%, 100% { transform: rotate(6deg); }
  50% { transform: rotate(-20deg); }
}

/* ============================================================
   Vũ công trong lồng — đồ bơi thay áo choàng
   ============================================================ */
.chibi--bikini {
  --bikini: var(--accent, #e8477f);
}

/* Thân để trần, dáng thon hơn áo choàng */
.chibi--bikini .chibi__robe {
  background: linear-gradient(180deg, var(--skin, #ffe0cc), #f0c3a6);
  clip-path: polygon(28% 0, 72% 0, 84% 100%, 16% 100%);
  border-radius: 12px 12px 8px 8px;
  box-shadow: inset 0 5px 9px rgba(255, 255, 255, 0.3);
}

/* Bỏ vạt áo giao lĩnh */
.chibi--bikini .chibi__robe::after { display: none; }

/* Áo bikini: hai chén tròn + dây ngang */
.chibi--bikini .chibi__robe::before {
  content: "";
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  width: 34px;
  height: 16px;
  background:
    linear-gradient(90deg, transparent 6%, var(--bikini) 6% 94%, transparent 94%) center 2px / 100% 3px no-repeat,
    radial-gradient(circle at 27% 62%, var(--bikini) 0 50%, transparent 51%),
    radial-gradient(circle at 73% 62%, var(--bikini) 0 50%, transparent 51%);
  filter:
    drop-shadow(0 0 1px rgba(0, 0, 0, 0.9))
    drop-shadow(0 2px 2px rgba(0, 0, 0, 0.45));
  z-index: 3;
}

/* Nam thì chỉ mặc quần bơi, không có áo */
.chibi--bikini.chibi--male .chibi__robe::before { display: none; }

/* Đai lưng → quần bơi */
.chibi--bikini .chibi__belt {
  bottom: 1px;
  left: 6px;
  right: 6px;
  height: 12px;
  background: linear-gradient(180deg, var(--bikini), rgba(0, 0, 0, 0.3));
  border: none;
  border-radius: 3px 3px 9px 9px;
  clip-path: polygon(0 0, 100% 0, 78% 100%, 22% 100%);
  filter: drop-shadow(0 0 1px rgba(0, 0, 0, 0.9));
}

.chibi--bikini .chibi__belt::after { display: none; }

/* Cổ áo, vũ khí không hợp với sàn nhảy */
.chibi--bikini .chibi__collar,
.chibi--bikini .chibi__weapon { display: none; }

/* Tay trần */
.chibi--bikini .chibi__arm {
  width: 10px;
  background: linear-gradient(180deg, var(--skin, #ffe0cc), #f0c3a6);
  border-radius: 6px 6px 8px 8px;
}

.chibi--bikini .chibi__arm::after { display: none; }

/* Chân trần + giày cao gót tối màu */
.chibi--bikini .chibi__legs::before,
.chibi--bikini .chibi__legs::after {
  height: 14px;
  background: linear-gradient(180deg, var(--skin, #ffe0cc) 62%, #2a1f18 62%);
  border-radius: 5px 5px 3px 3px;
}

/* ---- Đầu ---- */
.chibi__head {
  position: absolute;
  bottom: 42px;
  left: 50%;
  transform: translateX(-50%);
  width: 46px;
  height: 44px;
  z-index: 3;
}

.chibi__face {
  position: absolute;
  inset: 4px 3px 0 3px;
  background: linear-gradient(180deg, var(--skin, #ffe0cc), #f0c8b0);
  border: 2px solid rgba(90, 50, 40, 0.35);
  border-radius: 46% 46% 50% 50%;
}

.chibi__eye {
  position: absolute;
  top: 20px;
  width: 7px;
  height: 8px;
  background: #241a10;
  border-radius: 50%;
}

.chibi__eye::after {
  content: "";
  position: absolute;
  top: 1px;
  right: 1px;
  width: 3px;
  height: 3px;
  background: #fff;
  border-radius: 50%;
}

.chibi__eye--l { left: 9px; }
.chibi__eye--r { right: 9px; }

.chibi__brow {
  position: absolute;
  top: 15px;
  width: 8px;
  height: 2px;
  background: rgba(40, 26, 16, 0.75);
  border-radius: 2px;
}

.chibi__brow--l { left: 8px; transform: rotate(-8deg); }
.chibi__brow--r { right: 8px; transform: rotate(8deg); }

.chibi__nose {
  position: absolute;
  top: 26px;
  left: 50%;
  width: 3px;
  height: 3px;
  margin-left: -1.5px;
  background: rgba(190, 130, 110, 0.6);
  border-radius: 50%;
}

.chibi__blush {
  position: absolute;
  top: 27px;
  width: 8px;
  height: 4px;
  background: rgba(255, 130, 130, 0.5);
  border-radius: 50%;
  filter: blur(1px);
}

.chibi__blush--l { left: 5px; }
.chibi__blush--r { right: 5px; }

.chibi__mouth {
  position: absolute;
  left: 50%;
  top: 30px;
  transform: translateX(-50%);
  width: 8px;
  height: 4px;
  border: 2px solid #a35a52;
  border-top: none;
  border-radius: 0 0 8px 8px;
}

/* ---- Tóc ---- */
/* Chỏm tóc + mái */
.chibi__hair {
  position: absolute;
  top: 1px;
  left: 1px;
  right: 1px;
  height: 19px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.16), transparent 55%),
    var(--hair, #1a1a22);
  border-radius: 24px 24px 4px 4px;
  z-index: 2;
}

/* Mái tóc rủ xuống trán, hơi lệch cho tự nhiên */
.chibi__hair::after {
  content: "";
  position: absolute;
  top: 14px;
  left: 0;
  right: 0;
  height: 9px;
  background: var(--hair, #1a1a22);
  border-radius: 0 0 60% 40%;
}

/* Hai lọn tóc hai bên má */
.chibi__locks {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 44px;
  z-index: 3;
  pointer-events: none;
}

.chibi__locks::before,
.chibi__locks::after {
  content: "";
  position: absolute;
  top: 10px;
  width: 7px;
  height: 24px;
  background: var(--hair, #1a1a22);
  border-radius: 4px 4px 6px 6px;
}

.chibi__locks::before { left: 0; }
.chibi__locks::after { right: 0; }

/* Tóc dài xoã sau lưng (nữ) — nằm sau cả thân người */
.chibi__hair-back {
  position: absolute;
  top: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 48px;
  height: 68px;
  background: linear-gradient(180deg, var(--hair, #1a1a22), rgba(0, 0, 0, 0.85));
  border-radius: 24px 24px 26% 26%;
  z-index: 0;
}

/* Nam: búi tóc + khăn buộc trán */
.chibi--male .chibi__bun {
  position: absolute;
  top: -7px;
  left: 50%;
  transform: translateX(-50%);
  width: 15px;
  height: 13px;
  background: var(--hair, #1a1a22);
  border-radius: 50% 50% 40% 40%;
  z-index: 2;
}

.chibi--male .chibi__bun::before {
  content: "";
  position: absolute;
  top: -3px;
  left: 5px;
  width: 5px;
  height: 8px;
  background: var(--accent, #e8c547);
  border-radius: 2px;
  transform: rotate(18deg);
}

.chibi--male .chibi__bun::after {
  content: "";
  position: absolute;
  top: 13px;
  left: -15px;
  width: 45px;
  height: 5px;
  background: linear-gradient(180deg, var(--accent, #e8c547), rgba(0, 0, 0, 0.25));
  border-radius: 3px;
}

/* Nữ: hai búi nhỏ ôm sát đỉnh đầu */
.chibi--female .chibi__bun {
  position: absolute;
  top: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 12px;
  z-index: 1;
}

.chibi--female .chibi__bun::before,
.chibi--female .chibi__bun::after {
  content: "";
  position: absolute;
  top: 0;
  width: 13px;
  height: 13px;
  background: var(--hair, #1a1a22);
  border-radius: 50%;
}

.chibi--female .chibi__bun::before { left: -1px; }
.chibi--female .chibi__bun::after { right: -1px; }

/* Trâm cài ngang búi */
.chibi__pin {
  position: absolute;
  top: 3px;
  left: 50%;
  transform: translateX(-50%) rotate(-6deg);
  width: 26px;
  height: 3px;
  background: var(--accent, #ffe27a);
  border-radius: 3px;
  z-index: 4;
  box-shadow: 0 0 6px rgba(255, 226, 122, 0.7);
}

.chibi__pin::after {
  content: "";
  position: absolute;
  right: -3px;
  top: -2px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent, #ffe27a);
}

/* ---- Vũ khí / bảo bối ---- */
.chibi__weapon {
  position: absolute;
  z-index: 4;
  pointer-events: none;
  animation: weaponSwing 0.6s ease-in-out infinite;
  transform-origin: bottom center;
}

@keyframes weaponSwing {
  0%, 100% { transform: rotate(-10deg); }
  50% { transform: rotate(14deg); }
}

.chibi__weapon--sword,
.chibi__weapon--saber {
  right: -18px;
  bottom: 22px;
  width: 5px;
  height: 46px;
  background: linear-gradient(180deg, #eef4ff, #9db4cc);
  border: 1px solid #5a6a7a;
  border-radius: 2px;
}

.chibi__weapon--saber {
  background: linear-gradient(180deg, #fff0d0, #c8a050);
  border-radius: 2px 2px 8px 2px;
}

.chibi__weapon--sword::after,
.chibi__weapon--saber::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: -5px;
  width: 15px;
  height: 4px;
  background: var(--accent, #e8c547);
  border-radius: 2px;
}

/* Huyền Thiết trọng kiếm — nặng, không sắc, màu sắt đen */
.chibi__weapon--heavysword {
  right: -20px;
  bottom: 20px;
  width: 9px;
  height: 48px;
  background: linear-gradient(180deg, #7a8290, #3a424e 60%, #22282f);
  border: 1px solid #1a1f26;
  border-radius: 2px 2px 5px 5px;
  animation: heavySwing 1.4s ease-in-out infinite;
}

.chibi__weapon--heavysword::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: -4px;
  width: 17px;
  height: 5px;
  background: #4a3418;
  border-radius: 2px;
}

/* Kiếm nặng nên vung chậm hơn hẳn */
@keyframes heavySwing {
  0%, 100% { transform: rotate(-5deg); }
  50% { transform: rotate(7deg); }
}

.chibi__weapon--staff {
  right: -16px;
  bottom: 14px;
  width: 5px;
  height: 60px;
  background: linear-gradient(180deg, #8a6a3a, #4a3418);
  border-radius: 3px;
}

.chibi__weapon--fan {
  right: -20px;
  bottom: 30px;
  width: 24px;
  height: 20px;
  background: conic-gradient(from 200deg at 50% 100%, var(--accent, #f5f0dc) 0deg 80deg, transparent 81deg);
  border-radius: 50% 50% 0 0;
  border-bottom: 2px solid #8a6a3a;
}

.chibi__weapon--flute {
  right: -20px;
  bottom: 34px;
  width: 26px;
  height: 5px;
  background: linear-gradient(90deg, #4a7c59, #2d5038);
  border-radius: 3px;
  animation: none;
}

.chibi__weapon--ribbon,
.chibi__weapon--needle,
.chibi__weapon--stick,
.chibi__weapon--dagger,
.chibi__weapon--bow,
.chibi__weapon--fist {
  right: -18px;
  bottom: 26px;
  width: 6px;
  height: 34px;
  background: linear-gradient(180deg, var(--accent, #f5f0dc), rgba(255, 255, 255, 0.4));
  border-radius: 4px;
}

.chibi__weapon--ribbon {
  width: 8px;
  height: 44px;
  background: linear-gradient(180deg, #ffffff, var(--accent, #8ec8e8));
  border-radius: 6px;
  animation: ribbonFly 0.7s ease-in-out infinite;
}

@keyframes ribbonFly {
  0%, 100% { transform: rotate(-20deg) translateY(0); }
  50% { transform: rotate(24deg) translateY(-8px); }
}

.chibi__weapon--fist {
  width: 12px;
  height: 12px;
  bottom: 34px;
  border-radius: 50%;
  background: var(--skin, #ffe0cc);
  border: 2px solid rgba(90, 50, 40, 0.4);
}

/* ---- Ly rượu VIP ---- */
.character__glass {
  position: absolute;
  left: -14px;
  top: 44px;
  width: 14px;
  height: 18px;
  background: linear-gradient(180deg, rgba(255, 240, 200, 0.7), rgba(200, 80, 40, 0.8));
  border: 1px solid rgba(255, 230, 170, 0.85);
  border-radius: 2px 2px 6px 6px;
  animation: toastGlass 1.2s ease-in-out infinite;
  z-index: 5;
}

@keyframes toastGlass {
  0%, 100% { transform: rotate(-10deg) translateY(0); }
  50% { transform: rotate(14deg) translateY(-5px); }
}

/* ============================================================
   VŨ ĐẠO — 6 điệu, đều xoay người trong không gian 3D
   Mọi keyframe nhân với var(--s) để giữ đúng cỡ từng khu vực
   ============================================================ */

/* Nhún nảy + đảo người hai bên */
@keyframes danceGroove {
  0%, 100% { transform: scale(var(--s, 1)) translateY(0) rotateY(-22deg) rotateZ(-4deg); }
  25% { transform: scale(var(--s, 1)) translateY(-13px) rotateY(0deg) rotateZ(3deg); }
  50% { transform: scale(var(--s, 1)) translateY(-2px) rotateY(22deg) rotateZ(4deg); }
  75% { transform: scale(var(--s, 1)) translateY(-13px) rotateY(0deg) rotateZ(-3deg); }
}

/* Đảo người qua lại — giới hạn 45° để hình không bị dẹt cạnh */
@keyframes danceSpin {
  0%, 100% { transform: scale(var(--s, 1)) translateY(0) rotateY(-45deg) rotateZ(-6deg); }
  25% { transform: scale(var(--s, 1)) translateY(-16px) rotateY(0deg) rotateZ(0deg); }
  50% { transform: scale(var(--s, 1)) translateY(-3px) rotateY(45deg) rotateZ(6deg); }
  75% { transform: scale(var(--s, 1)) translateY(-16px) rotateY(0deg) rotateZ(0deg); }
}

/* Bước ngang, ngả người theo hướng bước */
@keyframes danceStep {
  0%, 100% { transform: scale(var(--s, 1)) translate3d(-9px, 0, 0) rotateY(-26deg) rotateZ(5deg); }
  50% { transform: scale(var(--s, 1)) translate3d(9px, -7px, 20px) rotateY(26deg) rotateZ(-5deg); }
}

/* Ngả người ra sau rồi bật lên — kiểu wave */
@keyframes danceWave {
  0%, 100% { transform: scale(var(--s, 1)) translateY(0) rotateX(-14deg) rotateY(-10deg); }
  30% { transform: scale(var(--s, 1)) translateY(-10px) rotateX(12deg) rotateY(6deg); }
  65% { transform: scale(var(--s, 1)) translateY(-3px) rotateX(-6deg) rotateY(16deg); }
}

/* Bật cao, vặn mình trên không */
@keyframes danceJump {
  0%, 100% { transform: scale(var(--s, 1)) translateY(0) rotateY(0deg) rotateZ(0deg); }
  30% { transform: scale(var(--s, 1)) translateY(-26px) rotateY(34deg) rotateZ(-9deg); }
  55% { transform: scale(var(--s, 1)) translateY(-9px) rotateY(-30deg) rotateZ(7deg); }
  80% { transform: scale(var(--s, 1)) translateY(-20px) rotateY(20deg) rotateZ(-5deg); }
}

/* ---- Bước chân + gật đầu cho ra dáng dân nhảy ---- */
.chibi__legs::before {
  animation: stepL var(--dd, 0.62s) ease-in-out infinite;
  animation-delay: var(--ddelay, 0s);
}

.chibi__legs::after {
  animation: stepR var(--dd, 0.62s) ease-in-out infinite;
  animation-delay: var(--ddelay, 0s);
}

@keyframes stepL {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  50% { transform: translate(-3px, -6px) rotate(-14deg); }
}

@keyframes stepR {
  0%, 100% { transform: translate(0, -6px) rotate(12deg); }
  50% { transform: translate(3px, 0) rotate(0deg); }
}

.chibi__head {
  animation: headBob var(--dd, 0.62s) ease-in-out infinite;
  animation-delay: var(--ddelay, 0s);
}

@keyframes headBob {
  0%, 100% { transform: translateX(-50%) rotate(-5deg); }
  50% { transform: translateX(-50%) rotate(5deg); }
}

/* Lắc hông, đổ người sang hai bên */
@keyframes danceHip {
  0%, 100% { transform: scale(var(--s, 1)) translate3d(0, 0, 0) rotateZ(-9deg) rotateY(-14deg); }
  50% { transform: scale(var(--s, 1)) translate3d(0, -6px, 30px) rotateZ(9deg) rotateY(14deg); }
}

.character__label {
  margin-top: 2px;
  max-width: 92px;
  font-size: 11px;
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 2px 4px #000, 0 0 6px rgba(0, 0, 0, 0.8);
  color: #f8f4e0;
}

.character__hero {
  font-family: var(--font-brush);
  font-size: 12px;
  color: var(--gold-bright);
  text-shadow: 0 1px 3px #000;
  margin-top: -2px;
  white-space: nowrap;
}

/* Khung ảnh đại diện treo trên đầu nhân vật */
.character__avatar-frame {
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  width: 32px;
  height: 32px;
  padding: 2px;
  border-radius: 7px;
  background: linear-gradient(180deg, rgba(30, 48, 22, 0.95), rgba(14, 24, 10, 0.95));
  border: 2px solid var(--gold);
  box-shadow:
    0 3px 10px rgba(0, 0, 0, 0.65),
    0 0 12px rgba(255, 226, 122, 0.35);
  z-index: 6;
  animation: avatarFloat 2.4s ease-in-out infinite;
}

/* Mũi nhọn chỉ xuống nhân vật */
.character__avatar-frame::after {
  content: "";
  position: absolute;
  bottom: -6px;
  left: 50%;
  margin-left: -5px;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid var(--gold);
}

.character__avatar {
  width: 100%;
  height: 100%;
  border-radius: 4px;
  object-fit: cover;
  display: block;
  background: #2a3a20;
}

@keyframes avatarFloat {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(-3px); }
}

/* Hào quang kiếm khí (Top 3) */
.character--aura::before {
  content: "";
  position: absolute;
  bottom: -6px;
  left: 50%;
  width: 96px;
  height: 96px;
  margin-left: -48px;
  border-radius: 50%;
  background: conic-gradient(
    from 0deg,
    transparent,
    var(--gold),
    transparent,
    #ffe27a,
    transparent,
    #a8e063,
    transparent
  );
  opacity: 0.55;
  z-index: 0;
  animation: auraSpin 3s linear infinite;
  filter: blur(3px);
}

@keyframes auraSpin {
  to { transform: rotate(360deg); }
}

/* ============================================================
   Đang tặng quà — rọi đèn vào đúng chỗ người đó đứng
   ============================================================ */
.character.is-donating {
  z-index: 80;
  /* Pop đặt ở gốc để không đè lên animation nhảy của .chibi */
  animation: donorPop 0.5s ease-out;
}

.character.is-donating .chibi {
  filter:
    brightness(1.28) saturate(1.15)
    drop-shadow(0 0 10px rgba(255, 214, 92, 0.95))
    drop-shadow(0 0 22px rgba(255, 170, 40, 0.6));
}

@keyframes donorPop {
  0% { transform: scale(1); }
  45% { transform: scale(1.16); }
  100% { transform: scale(1); }
}

/* Cột sáng vàng chiếu từ trần xuống */
.character__beam {
  position: absolute;
  bottom: -4px;
  left: 50%;
  width: 130px;
  height: 300px;
  margin-left: -65px;
  pointer-events: none;
  z-index: -1;
  background: linear-gradient(
    180deg,
    rgba(255, 214, 92, 0) 0%,
    rgba(255, 214, 92, 0.28) 45%,
    rgba(255, 236, 160, 0.6) 100%
  );
  clip-path: polygon(34% 0, 66% 0, 100% 100%, 0 100%);
  filter: blur(1.5px);
  animation: beamPulse 1.1s ease-in-out infinite;
}

/* Vũng sáng dưới chân */
.character__beam::after {
  content: "";
  position: absolute;
  bottom: -8px;
  left: 50%;
  width: 120px;
  height: 26px;
  margin-left: -60px;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(255, 236, 160, 0.75), transparent 70%);
  filter: blur(2px);
}

@keyframes beamPulse {
  0%, 100% { opacity: 0.75; }
  50% { opacity: 1; }
}

/* Bong bóng +xu bay lên */
.character__coin {
  position: absolute;
  bottom: 104px;
  left: 50%;
  transform: translate3d(-50%, 0, 90px);
  padding: 2px 9px;
  border-radius: 999px;
  background: linear-gradient(180deg, #ffe27a, #d9a521);
  border: 1px solid rgba(90, 60, 0, 0.5);
  color: #3a2600;
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.45);
  pointer-events: none;
  z-index: 90;
  animation: coinFloat 1.8s ease-out forwards;
}

/* translateZ giữ bong bóng luôn nổi trước nhân vật trong không gian 3D */
@keyframes coinFloat {
  0% { opacity: 0; transform: translate3d(-50%, 12px, 90px) scale(0.7); }
  18% { opacity: 1; transform: translate3d(-50%, 0, 90px) scale(1.1); }
  30% { transform: translate3d(-50%, 0, 90px) scale(1); }
  100% { opacity: 0; transform: translate3d(-50%, -46px, 90px) scale(0.95); }
}

/* Dòng tương ứng trong 英雄榜 cũng sáng lên */
.leaderboard__item.is-donating {
  background: linear-gradient(90deg, rgba(255, 214, 92, 0.28), rgba(255, 214, 92, 0.04));
  box-shadow: inset 0 0 0 1px rgba(255, 214, 92, 0.55);
  animation: lbFlash 0.6s ease-out;
}

@keyframes lbFlash {
  0% { transform: translateX(6px); }
  100% { transform: translateX(0); }
}

/* ---------- 論劍台 (căn giữa tuyệt đối) ---------- */
.dj-booth {
  position: absolute;
  top: 120px;
  left: 50%;
  width: 560px;
  margin-left: -280px;
  z-index: 15;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.dj-booth__sign {
  order: -1;
  /* Chừa chỗ cho cô cô đứng nhô lên phía sau đài */
  margin-bottom: 52px;
  font-family: var(--font-brush);
  font-size: 34px;
  letter-spacing: 0.18em;
  color: var(--gold-bright);
  text-shadow: 0 0 12px rgba(201, 162, 39, 0.6), 0 2px 0 #1a1008;
}

.dj-booth__deck {
  position: relative;
  width: 100%;
  height: 270px;
  background:
    linear-gradient(180deg, rgba(24, 52, 22, 0.9), rgba(10, 22, 10, 0.94)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.04) 0 2px, transparent 2px 10px);
  border: 3px solid var(--gold);
  border-radius: 16px 16px 10px 10px;
  box-shadow:
    0 0 46px rgba(150, 200, 80, 0.3),
    0 18px 40px rgba(0, 0, 0, 0.5),
    inset 0 0 46px rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0 20px 14px;
  backdrop-filter: blur(2px);
}

/* Viền ngọc bích chạy quanh mặt bàn */
.dj-booth__deck::before {
  content: "";
  position: absolute;
  inset: 6px;
  border: 1px solid rgba(200, 240, 140, 0.35);
  border-radius: 12px;
  pointer-events: none;
}

/* Ánh đèn hắt từ gầm bàn */
.dj-booth__deck::after {
  content: "";
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: -18px;
  height: 26px;
  background: radial-gradient(ellipse at center, rgba(180, 240, 120, 0.5), transparent 70%);
  filter: blur(6px);
  animation: deckUnderglow 1.6s ease-in-out infinite;
}

@keyframes deckUnderglow {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 0.9; }
}

/* ---- Thiết bị trên mặt bàn ---- */
.deck-gear {
  position: absolute;
  top: 38px;
  left: 18px;
  right: 18px;
  height: 92px;
  z-index: 1;
  pointer-events: none;
}

/* Mâm đĩa than */
.deck-vinyl {
  position: absolute;
  top: 8px;
  width: 74px;
  height: 74px;
  border-radius: 50%;
  border: 3px solid var(--gold);
  background:
    radial-gradient(circle, #d8c07a 0 12%, #1a1410 13% 16%, #221a12 17%, #14100c 40%, #1d1610 41%),
    repeating-radial-gradient(circle, rgba(255, 255, 255, 0.06) 0 1px, transparent 1px 4px);
  box-shadow:
    0 0 20px rgba(201, 162, 39, 0.45),
    inset 0 0 14px rgba(0, 0, 0, 0.8);
  animation: vinylSpin 2.4s linear infinite;
}

.deck-vinyl--l { left: 4px; }
.deck-vinyl--r { right: 4px; animation-direction: reverse; }

/* Cần kim đĩa */
.deck-vinyl__arm {
  position: absolute;
  top: 6px;
  right: -4px;
  width: 34px;
  height: 4px;
  background: linear-gradient(90deg, #cfd6dd, #8a939c);
  border-radius: 3px;
  transform-origin: right center;
  transform: rotate(38deg);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}

@keyframes vinylSpin {
  to { transform: rotate(360deg); }
}

/* Mixer giữa bàn */
.deck-mixer {
  position: absolute;
  left: 50%;
  top: 16px;
  transform: translateX(-50%);
  width: 118px;
  height: 60px;
  border-radius: 8px;
  background: linear-gradient(180deg, #2b2f26, #16190f);
  border: 2px solid rgba(201, 162, 39, 0.6);
  box-shadow: inset 0 3px 8px rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: flex-end;
  justify-content: space-evenly;
  padding: 8px 10px;
}

.deck-fader {
  width: 6px;
  height: 34px;
  border-radius: 3px;
  background: #0b0d08;
  position: relative;
}

.deck-fader::after {
  content: "";
  position: absolute;
  left: -4px;
  width: 14px;
  height: 8px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--gold-bright), #8a6508);
  box-shadow: 0 0 8px rgba(255, 226, 122, 0.6);
  animation: faderSlide 1.1s ease-in-out infinite alternate;
}

.deck-fader:nth-child(2)::after { animation-duration: 0.8s; }
.deck-fader:nth-child(3)::after { animation-duration: 1.4s; }

@keyframes faderSlide {
  from { bottom: 2px; }
  to { bottom: 22px; }
}

/* Núm vặn */
.deck-knobs {
  width: 34px;
  height: 34px;
  border-radius: 4px;
  background:
    radial-gradient(circle 6px at 25% 30%, #d0d6c0 60%, transparent 61%),
    radial-gradient(circle 6px at 75% 30%, #d0d6c0 60%, transparent 61%),
    radial-gradient(circle 6px at 25% 75%, #c0392b 60%, transparent 61%),
    radial-gradient(circle 6px at 75% 75%, #6aab38 60%, transparent 61%),
    #12150d;
}

/* Dải LED chạy dọc mép trên đài, nhấp nháy theo nhạc */
.deck-eq {
  position: absolute;
  top: 8px;
  left: 22px;
  right: 22px;
  height: 22px;
  display: flex;
  align-items: flex-end;
  gap: 3px;
  z-index: 2;
}

.deck-eq i {
  flex: 1;
  height: 30%;
  border-radius: 2px 2px 0 0;
  background: linear-gradient(180deg, #d8ff8a, #4a9b28);
  box-shadow: 0 0 6px rgba(160, 240, 90, 0.6);
  animation: eqBar 0.6s ease-in-out infinite alternate;
}

.deck-eq i:nth-child(2n) { animation-duration: 0.42s; }
.deck-eq i:nth-child(3n) { animation-duration: 0.78s; }
.deck-eq i:nth-child(5n) { animation-duration: 0.34s; }

@keyframes eqBar {
  from { height: 15%; opacity: 0.7; }
  to { height: 100%; opacity: 1; }
}

/* Loa hai bên đài, rung theo beat */
.deck-speaker {
  position: absolute;
  bottom: -6px;
  width: 68px;
  height: 132px;
  border-radius: 8px;
  background: linear-gradient(180deg, #3a2a18, #1a1209);
  border: 2px solid var(--gold);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.55);
  animation: speakerThump 0.5s ease-in-out infinite;
  z-index: 1;
}

.deck-speaker::before,
.deck-speaker::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(circle, #4a4238 30%, #14110c 60%, #2a251c);
  border: 2px solid rgba(201, 162, 39, 0.6);
}

.deck-speaker::before {
  top: 12px;
  width: 44px;
  height: 44px;
}

.deck-speaker::after {
  bottom: 14px;
  width: 30px;
  height: 30px;
}

.deck-speaker--l { left: -78px; }
.deck-speaker--r { right: -78px; animation-delay: 0.25s; }

@keyframes speakerThump {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05, 0.96); }
}

/* ---- Tiểu Long Nữ (CSS character) ---- */
.character--dj-host {
  position: absolute;
  top: -52px;
  left: 50%;
  transform: translateX(-50%);
  width: 140px;
  /* Đứng phía sau, cao hơn Top 1 để không che nhau */
  z-index: 2;
  animation: xlnFloat 0.7s ease-in-out infinite;
}

.character--dj-host::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 20%;
  width: 110px;
  height: 110px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(200, 230, 255, 0.45), transparent 70%);
  z-index: -1;
  animation: xlnGlow 1.2s ease-in-out infinite;
}

@keyframes xlnGlow {
  0%, 100% { opacity: 0.55; transform: translateX(-50%) scale(1); }
  50% { opacity: 1; transform: translateX(-50%) scale(1.15); }
}

.character--dj-host .character__label {
  margin-top: 2px;
  font-family: var(--font-brush);
  font-size: 18px;
  color: #eaf6ff;
  text-shadow: 0 0 10px rgba(180, 220, 255, 0.8), 0 2px 0 #1a1008;
  max-width: 160px;
}

.character--dj-host .chibi {
  --s: 1.2;
  --dance: danceHip;
  --dd: 0.55s;
}

.xln {
  position: relative;
  width: 120px;
  height: 130px;
  margin: 0 auto;
}

.xln__hair {
  position: absolute;
  top: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 70px;
  height: 78px;
  background: linear-gradient(180deg, #1a1a1a 0%, #0a0a0a 60%, #111 100%);
  border-radius: 40px 40px 20px 20px;
  z-index: 1;
  box-shadow: -18px 30px 0 -8px #0a0a0a, 18px 30px 0 -8px #0a0a0a;
}

.xln__face {
  position: absolute;
  top: 28px;
  left: 50%;
  transform: translateX(-50%);
  width: 48px;
  height: 52px;
  background: linear-gradient(180deg, #ffe8e0, #f5d0c8);
  border-radius: 45% 45% 48% 48%;
  border: 2px solid rgba(80, 40, 30, 0.25);
  z-index: 3;
}

.xln__eye {
  position: absolute;
  top: 22px;
  width: 7px;
  height: 8px;
  background: #1a1208;
  border-radius: 50%;
}

.xln__eye--l { left: 10px; }
.xln__eye--r { right: 10px; }

.xln__blush {
  position: absolute;
  top: 30px;
  width: 8px;
  height: 5px;
  background: rgba(255, 120, 130, 0.45);
  border-radius: 50%;
  filter: blur(1px);
}

.xln__blush--l { left: 6px; }
.xln__blush--r { right: 6px; }

.xln__mouth {
  position: absolute;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  width: 10px;
  height: 5px;
  border: 2px solid #c07070;
  border-top: none;
  border-radius: 0 0 10px 10px;
}

.xln__robe {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 78px;
  height: 70px;
  background:
    linear-gradient(180deg, #f8fbff 0%, #e4eef8 40%, #d0e0f0 100%);
  border: 2px solid rgba(180, 200, 220, 0.8);
  border-radius: 40% 40% 20% 20%;
  z-index: 2;
  box-shadow:
    inset 0 10px 0 rgba(255, 255, 255, 0.5),
    0 0 20px rgba(200, 230, 255, 0.35);
}

.xln__robe::after {
  content: "";
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 16px;
  height: 40px;
  background: linear-gradient(180deg, #9ec8e8, #6aa0c8);
  border-radius: 4px;
  opacity: 0.7;
}

.xln__sleeve {
  position: absolute;
  top: 62px;
  width: 36px;
  height: 50px;
  background: linear-gradient(180deg, #f8fbff, #c8d8e8);
  border: 2px solid rgba(160, 180, 200, 0.7);
  border-radius: 40% 40% 60% 60%;
  z-index: 1;
  transform-origin: top center;
}

.xln__sleeve--l {
  left: 2px;
  animation: sleeveWaveL 0.55s ease-in-out infinite;
}

.xln__sleeve--r {
  right: 2px;
  animation: sleeveWaveR 0.55s ease-in-out infinite;
}

.xln__ribbon {
  position: absolute;
  top: 48px;
  width: 10px;
  height: 70px;
  background: linear-gradient(180deg, #e8f4ff, #a8c8e0);
  border-radius: 4px;
  z-index: 0;
  opacity: 0.85;
}

.xln__ribbon--l {
  left: 18px;
  animation: ribbonL 0.7s ease-in-out infinite;
}

.xln__ribbon--r {
  right: 18px;
  animation: ribbonR 0.7s ease-in-out infinite;
}

@keyframes xlnFloat {
  0%, 100% { transform: translateX(-50%) translateY(0) rotate(-2deg); }
  25% { transform: translateX(-50%) translateY(-12px) rotate(3deg); }
  50% { transform: translateX(-50%) translateY(-4px) rotate(-1deg); }
  75% { transform: translateX(-50%) translateY(-16px) rotate(4deg); }
}

@keyframes sleeveWaveL {
  0%, 100% { transform: rotate(18deg) translateY(0); }
  50% { transform: rotate(-25deg) translateY(-8px); }
}

@keyframes sleeveWaveR {
  0%, 100% { transform: rotate(-18deg) translateY(0); }
  50% { transform: rotate(25deg) translateY(-8px); }
}

@keyframes ribbonL {
  0%, 100% { transform: rotate(-8deg) translateY(0); }
  50% { transform: rotate(12deg) translateY(6px); }
}

@keyframes ribbonR {
  0%, 100% { transform: rotate(8deg) translateY(0); }
  50% { transform: rotate(-12deg) translateY(6px); }
}

.dj-slots {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 36px;
  width: 100%;
  padding: 0 80px;
  z-index: 3;
}

.dj-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  min-width: 120px;
  min-height: 150px;
}

.dj-slot--1 {
  transform: translateY(-22px) scale(1.18);
  z-index: 4;
}

.dj-slot--2,
.dj-slot--3 {
  transform: translateY(-4px) scale(1.02);
}

.dj-slot__pedestal {
  width: 92px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-brush);
  font-size: 22px;
  border-radius: 3px;
  margin-top: 6px;
  border: 1px solid rgba(0, 0, 0, 0.35);
}

.dj-slot--1 .dj-slot__pedestal {
  background: linear-gradient(180deg, var(--gold-bright), #a8841a);
  color: #2a1a00;
  box-shadow: 0 0 20px rgba(232, 197, 71, 0.5);
}

.dj-slot--2 .dj-slot__pedestal {
  background: linear-gradient(180deg, #d0d4dc, #8a93a0);
  color: #1a1e24;
}

.dj-slot--3 .dj-slot__pedestal {
  background: linear-gradient(180deg, #c4844c, #8a5528);
  color: #2a1608;
}

.dj-slot__char {
  min-height: 110px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.dj-slot__char .character {
  animation: partyDance 0.5s ease-in-out infinite;
}

.dj-slot--1 .dj-slot__char .character {
  animation: partyDance 0.42s ease-in-out infinite;
}

.dj-slot--2 .dj-slot__char .character {
  animation-delay: 0.08s;
}

.dj-slot--3 .dj-slot__char .character {
  animation-delay: 0.16s;
}

@keyframes partyDance {
  0%, 100% { transform: translateY(0) rotate(-6deg) scale(1); }
  30% { transform: translateY(-18px) rotate(4deg) scale(1.08); }
  60% { transform: translateY(-4px) rotate(8deg) scale(0.96); }
  80% { transform: translateY(-14px) rotate(-4deg) scale(1.05); }
}

/* ============================================================
   貴賓雅座 — dãy 5 bàn VIP (hạng 4–8)
   ============================================================ */
.vip-row {
  position: absolute;
  top: 512px;
  left: 50%;
  width: 1060px;
  margin-left: -530px;
  z-index: 13;
  text-align: center;
}

.vip-row__sign {
  font-family: var(--font-brush);
  font-size: 28px;
  letter-spacing: 0.24em;
  color: var(--gold-bright);
  text-shadow: 0 0 12px rgba(201, 162, 39, 0.6), 0 2px 0 #1a1008;
  margin-bottom: 6px;
}

.vip-tables {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 14px;
}

.vip-table {
  position: relative;
  width: 196px;
  height: 168px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
}

/* Khách đứng sau bàn, chân khuất sau mặt bàn */
.vip-table__guest {
  position: relative;
  z-index: 1;
  margin-bottom: -30px;
}

/* Mặt bàn tròn trải khăn đỏ */
.vip-table__top {
  position: relative;
  width: 148px;
  height: 54px;
  border-radius: 50%;
  background:
    radial-gradient(ellipse at 50% 30%, #a8352a, #6b1c15 60%, #3a0f0b);
  border: 2px solid var(--gold);
  box-shadow:
    0 10px 22px rgba(0, 0, 0, 0.55),
    inset 0 6px 14px rgba(255, 255, 255, 0.18);
  z-index: 2;
}

/* Chân bàn gỗ */
.vip-table__top::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 70%;
  transform: translateX(-50%);
  width: 26px;
  height: 34px;
  background: linear-gradient(180deg, var(--wood), var(--wood-dark));
  border-radius: 0 0 8px 8px;
  z-index: -1;
}

/* Bình rượu + hai chén trên bàn */
.vip-table__set {
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  width: 90px;
  height: 26px;
  z-index: 3;
}

.vip-table__jug {
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 18px;
  height: 26px;
  background: linear-gradient(180deg, #d8e8f0, #7f97a8);
  border: 1px solid rgba(0, 0, 0, 0.35);
  border-radius: 4px 4px 7px 7px;
}

.vip-table__jug::after {
  content: "";
  position: absolute;
  top: -5px;
  left: 4px;
  width: 10px;
  height: 6px;
  background: var(--gold);
  border-radius: 3px 3px 0 0;
}

.vip-table__cup {
  position: absolute;
  bottom: 2px;
  width: 12px;
  height: 10px;
  background: linear-gradient(180deg, #f0e2c4, #b89a68);
  border-radius: 2px 2px 6px 6px;
  border: 1px solid rgba(0, 0, 0, 0.3);
}

.vip-table__cup--l { left: 6px; }
.vip-table__cup--r { right: 6px; }

/* Đèn lồng treo cao phía trên mỗi bàn */
.vip-table__lantern {
  position: absolute;
  top: -74px;
  left: 50%;
  width: 26px;
  height: 32px;
  margin-left: -13px;
  border-radius: 50% / 40%;
  background: radial-gradient(circle at 50% 35%, #ffe0a8, #c0392b 72%);
  box-shadow: 0 0 22px rgba(255, 160, 80, 0.65);
  transform-origin: 50% -40px;
  animation: lanternSway 3.2s ease-in-out infinite;
  z-index: 0;
}

/* Dây treo đèn */
.vip-table__lantern::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 100%;
  width: 2px;
  height: 40px;
  margin-left: -1px;
  background: rgba(220, 200, 150, 0.55);
}

@keyframes lanternSway {
  0%, 100% { transform: rotate(-7deg); }
  50% { transform: rotate(7deg); }
}

/* Biển số bàn */
.vip-table__no {
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-brush);
  font-size: 17px;
  color: var(--gold-bright);
  text-shadow: 0 2px 4px #000;
  z-index: 4;
}

.vip-table .chibi { --s: 0.98; }

/* Biển tên khách gắn dưới bàn */
.vip-table__plate {
  margin-top: 4px;
  max-width: 150px;
  padding: 2px 10px;
  border-radius: 5px;
  background: rgba(20, 32, 14, 0.8);
  border: 1px solid rgba(201, 162, 39, 0.55);
  font-size: 13px;
  font-weight: 700;
  color: #f6f0d8;
  text-shadow: 0 2px 4px #000;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vip-table__empty {
  font-size: 12px;
  color: rgba(220, 220, 200, 0.45);
  margin-bottom: 20px;
}

/* ============================================================
   Khách còn lại: đứng nhảy, tay nâng ly
   ============================================================ */
.vip-floor {
  position: absolute;
  top: 754px;
  left: 50%;
  width: 900px;
  margin-left: -450px;
  z-index: 13;
}

.vip-floor__list {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 56px;
}

.vip-floor .chibi { --s: 0.95; }

/* Bệ sáng dưới chân khách đứng */
.vip-floor .character::after {
  content: "";
  position: absolute;
  bottom: 12px;
  left: 50%;
  width: 56px;
  height: 12px;
  margin-left: -28px;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(255, 220, 140, 0.35), transparent 70%);
}

/* ============================================================
   醉仙牢 — hai lồng treo hai bên đài
   Lồng trái (甲) khảm vàng, sang hơn lồng phải (乙) đan trúc
   ============================================================ */
.cage {
  position: absolute;
  top: 246px;
  z-index: 16;
  width: 224px;
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: cageSwing 5s ease-in-out infinite;
  transform-origin: top center;
}

.cage--gold { left: 336px; }
.cage--bamboo {
  right: 336px;
  width: 196px;
  animation-delay: 0.8s;
}

@keyframes cageSwing {
  0%, 100% { transform: rotate(-1.4deg); }
  50% { transform: rotate(1.4deg); }
}

/* Dây xích treo lồng lên xà nhà */
.cage__chain {
  width: 6px;
  height: 62px;
  background:
    repeating-linear-gradient(180deg, var(--gold) 0 6px, rgba(90, 70, 20, 0.8) 6px 11px);
  border-radius: 3px;
  margin-bottom: -4px;
}

.cage--bamboo .cage__chain {
  background: repeating-linear-gradient(180deg, #9aa7a8 0 6px, rgba(60, 70, 60, 0.8) 6px 11px);
}

.cage__frame {
  position: relative;
  width: 100%;
  height: 196px;
  border-radius: 110px 110px 14px 14px;
  background:
    radial-gradient(ellipse at 50% 20%, rgba(80, 60, 20, 0.5), rgba(12, 10, 6, 0.92) 70%);
  border: 3px solid var(--gold);
  box-shadow:
    0 0 34px rgba(201, 162, 39, 0.5),
    inset 0 0 40px rgba(0, 0, 0, 0.6);
  overflow: hidden;
}

.cage--bamboo .cage__frame {
  height: 176px;
  border-color: #8fae66;
  background:
    radial-gradient(ellipse at 50% 20%, rgba(50, 70, 30, 0.45), rgba(10, 14, 8, 0.92) 70%);
  box-shadow:
    0 0 22px rgba(120, 170, 80, 0.35),
    inset 0 0 34px rgba(0, 0, 0, 0.6);
}

/* Vòm nóc lồng */
.cage__dome {
  position: absolute;
  top: -3px;
  left: -3px;
  right: -3px;
  height: 74px;
  border-radius: 110px 110px 0 0;
  border: 3px solid var(--gold);
  border-bottom: none;
  background: linear-gradient(180deg, rgba(201, 162, 39, 0.28), transparent);
  z-index: 6;
}

.cage--bamboo .cage__dome { border-color: #8fae66; background: linear-gradient(180deg, rgba(140, 180, 90, 0.22), transparent); }

/* Song lồng phía trước nhân vật */
.cage__bars {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  background:
    repeating-linear-gradient(
      90deg,
      transparent 0 15px,
      rgba(201, 162, 39, 0.85) 15px 19px,
      rgba(120, 90, 20, 0.5) 19px 21px,
      transparent 21px 36px
    ),
    linear-gradient(180deg, transparent 34%, rgba(201, 162, 39, 0.7) 34% 36%, transparent 36%),
    linear-gradient(180deg, transparent 72%, rgba(201, 162, 39, 0.7) 72% 74%, transparent 74%);
  mask-image: radial-gradient(ellipse 120% 100% at 50% 100%, #000 70%, rgba(0, 0, 0, 0.6));
}

.cage--bamboo .cage__bars {
  background:
    repeating-linear-gradient(
      90deg,
      transparent 0 17px,
      rgba(150, 190, 100, 0.8) 17px 21px,
      rgba(60, 90, 40, 0.5) 21px 23px,
      transparent 23px 40px
    ),
    linear-gradient(180deg, transparent 40%, rgba(150, 190, 100, 0.6) 40% 42%, transparent 42%);
}

/* Hào quang trong lồng — lồng vàng sáng hơn hẳn */
.cage__glow {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    radial-gradient(ellipse 70% 50% at 50% 75%, rgba(255, 214, 120, 0.45), transparent 70%),
    linear-gradient(90deg, var(--gold), var(--lacquer-bright), var(--gold-bright), var(--gold));
  background-size: auto, 220% 100%;
  opacity: 0.35;
  animation: ledRun 2.2s linear infinite;
  pointer-events: none;
}

.cage--bamboo .cage__glow {
  background:
    radial-gradient(ellipse 70% 50% at 50% 75%, rgba(170, 230, 130, 0.3), transparent 70%),
    linear-gradient(90deg, var(--bamboo), #9fd06a, var(--bamboo));
  background-size: auto, 220% 100%;
  opacity: 0.22;
}

@keyframes ledRun {
  to { background-position: 0 0, 220% 0; }
}

/* Đế lồng */
.cage__base {
  position: absolute;
  left: -6px;
  right: -6px;
  bottom: -6px;
  height: 18px;
  border-radius: 6px;
  background: linear-gradient(180deg, var(--gold), #6b5210);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.6);
  z-index: 7;
}

.cage--bamboo .cage__base {
  background: linear-gradient(180deg, #8fae66, #3d5228);
}

/* Người nhảy trong lồng */
.cage__slot {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 16px;
}

.cage__empty {
  font-size: 13px;
  color: var(--muted);
  align-self: center;
}

.cage--gold .cage__slot .chibi {
  --s: 1.25;
  --dance: danceSpin;
  --dd: 0.7s;
}

.cage--bamboo .cage__slot .chibi {
  --s: 1.05;
  --dance: danceJump;
  --dd: 0.58s;
}

/* Biển tên dưới lồng */
.cage__plate {
  margin-top: 10px;
  padding: 5px 14px;
  border-radius: 6px;
  background: linear-gradient(180deg, rgba(60, 40, 12, 0.9), rgba(24, 16, 6, 0.92));
  border: 2px solid var(--gold);
  text-align: center;
  min-width: 150px;
}

.cage--bamboo .cage__plate { border-color: #8fae66; }

.cage__label {
  font-family: var(--font-brush);
  font-size: 21px;
  letter-spacing: 0.08em;
  color: var(--gold-bright);
  text-shadow: 0 0 8px rgba(201, 162, 39, 0.6);
}

.cage--bamboo .cage__label { color: #d8f0a8; }

.cage__name,
.cage__count {
  font-size: 13px;
  font-weight: 700;
  text-shadow: 0 2px 4px #000;
}

.cage__count {
  color: var(--gold-bright);
  font-size: 12px;
}

/* ---------- Crowd ~100 meme + Floor gift ---------- */
.crowd {
  position: absolute;
  left: 100px;
  right: 100px;
  bottom: 12px;
  height: 340px;
  z-index: 11;
  pointer-events: none;
}

.crowd-dancer {
  position: absolute;
  width: 58px;
  transform-origin: center bottom;
  will-change: transform;
  filter: drop-shadow(0 4px 3px rgba(0, 0, 0, 0.45));
  animation: crowdHop var(--dur, 0.45s) ease-in-out infinite;
  animation-delay: var(--delay, 0s);
}

.crowd-dancer .character {
  width: 58px;
  animation: none;
}

.crowd-dancer .chibi { --s: var(--scale, 0.62); }

.crowd-dancer .character__label {
  font-size: 9px;
  max-width: 58px;
  color: #fff3d0;
}

.crowd-dancer .character__avatar-frame {
  width: 22px;
  height: 22px;
  top: -20px;
  border-width: 1px;
}

@keyframes crowdHop {
  0%, 100% { transform: translateY(0) rotate(var(--rot, -4deg)) scale(1); }
  40% { transform: translateY(-16px) rotate(calc(var(--rot, -4deg) * -1)) scale(1.1); }
  70% { transform: translateY(-2px) rotate(var(--rot, -4deg)) scale(0.96); }
}

.floor {
  position: absolute;
  left: 100px;
  right: 100px;
  bottom: 12px;
  height: 340px;
  z-index: 12;
  pointer-events: none;
}

.floor-char {
  position: absolute;
  bottom: 20px;
  animation:
    dropIn 0.55s cubic-bezier(0.2, 1.4, 0.3, 1) both,
    floorGroove 0.48s ease-in-out 0.55s infinite;
}

.floor-char .chibi { --s: 0.85; }

@keyframes floorGroove {
  0%, 100% { transform: translateY(0) rotate(-3deg); }
  50% { transform: translateY(-8px) rotate(4deg); }
}

.floor-char.is-leaving {
  animation: fadeOutUp 0.5s ease forwards !important;
}

@keyframes dropIn {
  from { opacity: 0; transform: translateY(-220px) scale(0.4); }
  70% { opacity: 1; transform: translateY(8px) scale(1.05); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes fadeOutUp {
  to { opacity: 0; transform: translateY(-40px) scale(0.8); }
}

/* ---------- 英雄榜 ---------- */
.leaderboard {
  position: absolute;
  top: 110px;
  right: 36px;
  width: 260px;
  z-index: 20;
  background: var(--glass);
  border: 2px solid rgba(201, 162, 39, 0.5);
  border-radius: 6px;
  backdrop-filter: blur(10px);
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

.leaderboard__header {
  font-family: var(--font-brush);
  font-size: 26px;
  letter-spacing: 0.08em;
  text-align: center;
  padding: 10px;
  background: linear-gradient(90deg, rgba(155, 27, 27, 0.55), rgba(201, 162, 39, 0.25));
  color: var(--gold-bright);
  text-shadow: 0 2px 0 #1a1008;
  border-bottom: 1px solid rgba(201, 162, 39, 0.35);
}

.leaderboard__list {
  list-style: none;
  max-height: 520px;
  overflow: hidden;
  padding: 6px 0;
}

.leaderboard__item {
  display: grid;
  grid-template-columns: 28px 36px 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 7px 12px;
  font-size: 13px;
}

.leaderboard__item:nth-child(odd) {
  background: rgba(255, 255, 255, 0.03);
}

.leaderboard__item.is-top3 {
  background: rgba(201, 162, 39, 0.1);
}

.leaderboard__rank {
  font-family: var(--font-brush);
  font-size: 20px;
  color: var(--muted);
  text-align: center;
}

.leaderboard__item:nth-child(1) .leaderboard__rank { color: var(--gold-bright); }
.leaderboard__item:nth-child(2) .leaderboard__rank { color: #d0d4dc; }
.leaderboard__item:nth-child(3) .leaderboard__rank { color: #c4844c; }

.leaderboard__avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #333;
  border: 2px solid rgba(201, 162, 39, 0.4);
  object-fit: cover;
}

.leaderboard__avatar--hero {
  border-radius: 50%;
  border: 2px solid var(--gold);
}

.leaderboard__name {
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.leaderboard__coins {
  font-weight: 800;
  color: var(--gold-bright);
  font-variant-numeric: tabular-nums;
}

/* ---------- Spotlight ---------- */
.spotlight {
  position: absolute;
  inset: 0;
  z-index: 100;
  pointer-events: none;
}

.spotlight[hidden] {
  display: none !important;
}

.spotlight__dim {
  position: absolute;
  inset: 0;
  background: rgba(8, 4, 0, 0.8);
  animation: dimIn 0.4s ease both;
}

.spotlight__beam {
  position: absolute;
  top: -10%;
  left: 50%;
  width: 420px;
  height: 120%;
  transform: translateX(-50%);
  background: linear-gradient(
    180deg,
    rgba(255, 220, 140, 0.4),
    rgba(201, 162, 39, 0.15) 40%,
    transparent 80%
  );
  clip-path: polygon(35% 0, 65% 0, 100% 100%, 0 100%);
  animation: beamPulse 1.2s ease-in-out infinite;
}

@keyframes dimIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes beamPulse {
  0%, 100% { opacity: 0.75; }
  50% { opacity: 1; }
}

.spotlight__center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  animation: spotlightPop 0.5s cubic-bezier(0.2, 1.4, 0.3, 1) both;
}

@keyframes spotlightPop {
  from { opacity: 0; transform: translate(-50%, -40%) scale(0.6); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

.spotlight__avatar {
  width: 140px;
  height: 140px;
  margin: 0 auto 12px;
  border-radius: 50%;
  border: 4px solid var(--gold);
  box-shadow: 0 0 40px rgba(201, 162, 39, 0.7);
  background: #222 center/cover no-repeat;
}

.spotlight__meme {
  display: flex;
  justify-content: center;
  margin: -10px auto 6px;
  transform: scale(1.35);
  transform-origin: center bottom;
  height: 100px;
}

.spotlight__name {
  font-family: var(--font-brush);
  font-size: 64px;
  letter-spacing: 0.06em;
  color: #fff8e8;
  text-shadow:
    0 0 20px rgba(201, 162, 39, 0.9),
    3px 3px 0 #1a1008;
}

.spotlight__gift {
  margin-top: 8px;
  font-size: 22px;
  font-weight: 700;
  color: var(--gold-bright);
}

.spotlight__marquee {
  margin-top: 24px;
  width: 720px;
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}

.spotlight__marquee-track {
  display: inline-block;
  white-space: nowrap;
  font-family: var(--font-brush);
  font-size: 30px;
  letter-spacing: 0.1em;
  color: var(--gold-bright);
  text-shadow: 0 0 12px rgba(201, 162, 39, 0.7);
  animation: marquee 7s linear infinite;
}

@keyframes marquee {
  from { transform: translateX(40%); }
  to { transform: translateX(-100%); }
}

/* ============================================================
   Panel kết nối gọn — căn giữa đáy
   ============================================================ */
.panda-panel {
  position: fixed;
  left: 50%;
  bottom: max(12px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 9999;
  width: auto;
  max-width: min(560px, calc(100vw - 16px));
  padding: 8px 10px;
  background: linear-gradient(180deg, #e8f5d8, #c8e0a8);
  color: var(--ink);
  border: 2px solid #2d5016;
  border-radius: 10px;
  box-shadow: 3px 3px 0 #1a3010;
  font-family: var(--font-ui);
}

.panda-panel.is-hidden { display: none; }

.panda-panel__hide {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 22px;
  height: 22px;
  border: 2px solid #3a2410;
  border-radius: 50%;
  background: #fffdf5;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  font-weight: 800;
}

.panda-panel__row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}

.panda-panel__row input {
  width: 140px;
  min-width: 0;
  flex: 1 1 120px;
  padding: 8px 10px;
  border: 2px solid #2d5016;
  border-radius: 6px;
  background: #fffdf5;
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 700;
  outline: none;
}

.panda-panel__row input:focus {
  border-color: #1b5e20;
}

/* Điện thoại: panel full-width, nút to hơn */
@media (max-width: 700px) {
  .panda-panel {
    width: calc(100vw - 12px);
    max-width: none;
    bottom: max(8px, env(safe-area-inset-bottom));
    padding: 10px;
  }

  .panda-panel__row {
    gap: 8px;
  }

  .panda-btn {
    padding: 10px 12px;
    font-size: 14px;
    min-height: 42px;
  }

  .panda-panel__row input {
    flex: 1 1 100%;
    width: 100%;
    font-size: 16px; /* tránh zoom iOS */
    min-height: 42px;
  }

  .live-modal__card {
    max-height: 85vh;
    overflow: auto;
  }
}

.panda-panel__error {
  margin-top: 6px;
  max-width: 320px;
  padding: 6px 8px;
  background: #fff0f0;
  border: 1px solid var(--lacquer);
  border-radius: 4px;
  color: var(--lacquer);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.35;
}

.panda-panel__error[hidden] {
  display: none !important;
}

.panda-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  border: 2px solid #3a2410;
  border-radius: 6px;
  font-family: var(--font-song);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}

.panda-btn--connect {
  background: linear-gradient(180deg, #e8c547, #c9a227);
  color: #2a1a00;
}

.panda-btn--connect.is-loading {
  opacity: 0.7;
  pointer-events: none;
}

.panda-btn--music {
  background: linear-gradient(180deg, #7dd3fc, #38bdf8);
  color: #0c4a6e;
  min-width: 64px;
}

.panda-btn--music.is-on {
  background: linear-gradient(180deg, #f472b6, #db2777);
  color: #fff;
  box-shadow: 0 0 12px rgba(244, 114, 182, 0.55);
}

.panda-btn--live {
  background: linear-gradient(180deg, #fb7185, #e11d48);
  color: #fff;
  min-width: 88px;
}

/* Modal lên Live */
.live-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.65);
  padding: 16px;
}

.live-modal[hidden] {
  display: none !important;
}

.live-modal__card {
  position: relative;
  width: min(520px, 100%);
  padding: 22px 24px 18px;
  background: linear-gradient(180deg, #f3e6c8, #e4d2a8);
  color: #1a1208;
  border: 3px solid #3a2410;
  border-radius: 10px;
  box-shadow: 6px 6px 0 #1a1008;
  font-family: var(--font-ui);
}

.live-modal__card h2 {
  font-family: var(--font-brush);
  font-size: 32px;
  margin-bottom: 10px;
  color: #7a1515;
}

.live-modal__warn {
  font-size: 13px;
  line-height: 1.45;
  margin-bottom: 12px;
  padding: 10px;
  background: rgba(155, 27, 27, 0.1);
  border-left: 4px solid #9b1b1b;
}

.live-modal__card ol {
  margin: 0 0 12px 20px;
  font-size: 13px;
  line-height: 1.55;
  font-weight: 600;
}

.live-modal__card code {
  background: #fffdf5;
  padding: 1px 5px;
  border: 1px solid #3a2410;
  border-radius: 3px;
  font-size: 12px;
}

.live-modal__note {
  font-size: 12px;
  color: #4a3820;
  margin-bottom: 14px;
  line-height: 1.4;
}

.live-modal__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.live-modal__close {
  position: absolute;
  top: 8px;
  right: 10px;
  width: 28px;
  height: 28px;
  border: 2px solid #3a2410;
  border-radius: 50%;
  background: #fffdf5;
  font-size: 16px;
  cursor: pointer;
  font-weight: 800;
}

.panda-btn--ghost {
  background: #fffdf5;
  color: var(--ink);
  min-width: 36px;
  padding: 8px 10px;
}

/* Beat pulse toàn quán khi nhạc bật */
.stage.is-pumping .bar-bg__floor {
  animation: floorPump 0.46875s ease-in-out infinite; /* 128bpm */
}

.stage.is-pumping .dj-booth__deck {
  box-shadow:
    0 0 50px rgba(201, 162, 39, 0.35),
    inset 0 0 50px rgba(0, 0, 0, 0.35);
}

@keyframes floorPump {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.12); }
}

.panda-fab {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  z-index: 9999;
  width: 48px;
  height: 48px;
  border: 2px solid #3a2410;
  border-radius: 50%;
  background: #f3e6c8;
  font-size: 22px;
  cursor: pointer;
  box-shadow: 3px 3px 0 #1a1008;
}

.panda-fab[hidden] {
  display: none !important;
}
