:root {
  --ink: #fbeed2;
  --muted: #cdb48c;
  --gold: #e8bd63;
  --gold-deep: #a97a2c;
  --glass: rgba(34, 15, 9, .72);
  --glass-strong: rgba(30, 13, 8, .9);
  --line: rgba(232, 189, 99, .5);
  --red: #8c1d17;
  --serif: "Noto Serif", Georgia, "Times New Roman", serif;
  --sans: "Be Vietnam Pro", "Segoe UI", system-ui, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #1a0b06;
  color: var(--ink);
  font: 14px/1.45 var(--sans);
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
input, textarea {
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
  user-select: text;
}
img {
  -webkit-user-drag: none;
  user-drag: none;
}
[hidden] { display: none !important; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
button:focus-visible, input:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
#view { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: pointer; }
#tags { position: fixed; inset: 0; overflow: hidden; pointer-events: none; }

.tag { position: absolute; left: 0; top: 0; display: flex; flex-direction: column; align-items: center; gap: 2px; white-space: nowrap; will-change: transform; color: #fff; font-weight: 600; pointer-events: none; user-select: none; }
.tag b { font-weight: 700; font-size: 13px; letter-spacing: 0.3px; text-shadow: 0 1px 3px #000, 0 0 6px rgba(0, 0, 0, 0.85); transition: all 0.3s ease; }
.tag small {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.3;
  padding: 1.5px 8px;
  border-radius: 99px;
  backdrop-filter: blur(4px);
  white-space: nowrap;
  letter-spacing: 0.25px;
  background: rgba(18, 12, 8, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.95);
  transition: all 0.3s ease;
}
.tag.me b { color: #ffd979; }
.tag.npc b { border: 1px solid var(--line); background: var(--glass); border-radius: 99px; padding: 1px 10px; font-weight: 600; color: var(--gold); text-shadow: none; }

/* --- 12 BẬC DANH HIỆU & CẤP ĐỘ (LV 1 ĐẾN LV 100): ĐỔI MÀU & HIỆU ỨNG DẦN DẦN --- */
/* 1. BẬC 0: SƠ TÂM (Lv 1 - 4) - Mầm Thiện Sơ Khai */
.tag[data-rank="0"] b { color: #f4f7f2; }
.tag[data-rank="0"] small, .rank-pill.rank-0, .rank-badge.rank-0 {
  color: #dcead6;
  background: rgba(22, 32, 20, 0.8);
  border: 1px solid rgba(180, 215, 170, 0.35);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
}
.rank-lvl.rank-0 { color: #dcead6; }

/* 2. BẬC 1: TÍN TÂM (Lv 5 - 9) - Lục Ngọc Thanh Mộc */
.tag[data-rank="1"] b { color: #c2f5d6; text-shadow: 0 1px 3px #000, 0 0 6px rgba(110, 235, 160, 0.45); }
.tag[data-rank="1"] small, .rank-pill.rank-1, .rank-badge.rank-1 {
  color: #88edb7;
  background: rgba(14, 40, 26, 0.82);
  border: 1px solid rgba(100, 230, 155, 0.55);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6), 0 0 7px rgba(100, 230, 155, 0.3);
  text-shadow: 0 0 5px rgba(100, 230, 155, 0.5);
}
.rank-lvl.rank-1 { color: #88edb7; }

/* 3. BẬC 2: TỊNH TÂM (Lv 10 - 19) - Lam Bích Thanh Khiết */
.tag[data-rank="2"] b { color: #b3ecff; text-shadow: 0 1px 3px #000, 0 0 7px rgba(70, 200, 255, 0.55); }
.tag[data-rank="2"] small, .rank-pill.rank-2, .rank-badge.rank-2 {
  color: #6edaff;
  background: rgba(12, 34, 52, 0.85);
  border: 1px solid rgba(110, 218, 255, 0.6);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6), 0 0 9px rgba(110, 218, 255, 0.38);
  text-shadow: 0 0 6px rgba(110, 218, 255, 0.6);
}
.rank-lvl.rank-2 { color: #6edaff; }

/* 4. BẬC 3: TỪ TÂM (Lv 20 - 29) - Diệu Liên Sen Hồng */
.tag[data-rank="3"] b { color: #ffc2d8; text-shadow: 0 1px 3px #000, 0 0 8px rgba(255, 140, 185, 0.6); }
.tag[data-rank="3"] small, .rank-pill.rank-3, .rank-badge.rank-3 {
  color: #ffa8cb;
  background: rgba(45, 16, 32, 0.85);
  border: 1px solid rgba(255, 168, 203, 0.65);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6), 0 0 10px rgba(255, 168, 203, 0.42);
  text-shadow: 0 0 7px rgba(255, 168, 203, 0.65);
}
.rank-lvl.rank-3 { color: #ffa8cb; }

/* 5. BẬC 4: MINH TÂM (Lv 30 - 39) - Hoàng Kim Hổ Phách (Ảnh gốc Lv 33) */
.tag[data-rank="4"] b { color: #ffe066; text-shadow: 0 1px 3px #000, 0 0 8px #d48b00, 0 0 15px rgba(255, 180, 0, 0.4); }
.tag[data-rank="4"] small, .rank-pill.rank-4, .rank-badge.rank-4 {
  color: #ffe066;
  background: rgba(44, 28, 5, 0.88);
  border: 1px solid rgba(255, 215, 64, 0.75);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.7), 0 0 12px rgba(255, 215, 64, 0.5);
  text-shadow: 0 0 8px rgba(255, 215, 64, 0.8), 0 0 14px rgba(255, 160, 0, 0.4);
}
.rank-lvl.rank-4 { color: #ffe066; }

/* 6. BẬC 5: ĐỊNH TÂM (Lv 40 - 49) - Hỏa Quang Cam Ngọc */
.tag[data-rank="5"] b { color: #ffb356; text-shadow: 0 1px 3px #000, 0 0 9px #d35400, 0 0 18px rgba(230, 81, 0, 0.5); }
.tag[data-rank="5"] small, .rank-pill.rank-5, .rank-badge.rank-5 {
  color: #ffa742;
  background: rgba(48, 20, 5, 0.9);
  border: 1px solid rgba(255, 167, 66, 0.8);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.7), 0 0 14px rgba(255, 167, 66, 0.55);
  text-shadow: 0 0 9px rgba(255, 167, 66, 0.85), 0 0 16px rgba(230, 81, 0, 0.5);
}
.rank-lvl.rank-5 { color: #ffa742; }

/* 7. BẬC 6: VIÊN TÂM (Lv 50 - 59) - Tử La Lan Thần Bí */
.tag[data-rank="6"] b { color: #ea95ff; text-shadow: 0 1px 3px #000, 0 0 10px #9c27b0, 0 0 20px rgba(171, 71, 188, 0.6); }
.tag[data-rank="6"] small, .rank-pill.rank-6, .rank-badge.rank-6 {
  color: #e280ff;
  background: rgba(38, 12, 50, 0.9);
  border: 1px solid rgba(226, 128, 255, 0.85);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.7), 0 0 16px rgba(226, 128, 255, 0.6);
  text-shadow: 0 0 10px rgba(226, 128, 255, 0.9), 0 0 18px rgba(171, 71, 188, 0.6);
}
.rank-lvl.rank-6 { color: #e280ff; }

/* 8. BẬC 7: BỒ ĐỀ TÂM (Lv 60 - 69) - Chu Sa Xích Kim */
.tag[data-rank="7"] b { color: #ff6e85; text-shadow: 0 1px 3px #000, 0 0 10px #c2185b, 0 0 22px rgba(233, 30, 99, 0.65); }
.tag[data-rank="7"] small, .rank-pill.rank-7, .rank-badge.rank-7 {
  color: #ff5975;
  background: rgba(52, 10, 22, 0.92);
  border: 1px solid rgba(255, 89, 117, 0.9);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.7), 0 0 18px rgba(255, 89, 117, 0.65);
  text-shadow: 0 0 11px rgba(255, 89, 117, 0.95), 0 0 20px rgba(233, 30, 99, 0.7);
}
.rank-lvl.rank-7 { color: #ff5975; }

/* 9. BẬC 8: QUẢNG TUỆ (Lv 70 - 79) - Thái Âm Lam Tím Huyễn Quang */
.tag[data-rank="8"] b { color: #6ee7ff; text-shadow: 0 1px 3px #000, 0 0 11px #0288d1, 0 0 24px #673ab7; }
.tag[data-rank="8"] small, .rank-pill.rank-8, .rank-badge.rank-8 {
  background: linear-gradient(135deg, rgba(10, 30, 60, 0.92), rgba(35, 10, 55, 0.92));
  color: #5ce1e6;
  border: 1px solid rgba(92, 225, 230, 0.9);
  box-shadow: 0 2px 14px rgba(0, 0, 0, 0.75), 0 0 20px rgba(92, 225, 230, 0.7);
  text-shadow: 0 0 10px #5ce1e6, 0 0 20px #845ec2;
  animation: tag-pulse-slow 2.4s ease-in-out infinite alternate;
}
.rank-lvl.rank-8 { color: #5ce1e6; }

/* 10. BẬC 9: VÔ LƯỢNG THỌ (Lv 80 - 89) - Bạch Kim Hoàng Gia Vương Giả */
.tag[data-rank="9"] b { color: #fff8d6; text-shadow: 0 0 11px #ffd700, 0 0 24px #ff9800, 0 0 32px rgba(255, 215, 0, 0.6); }
.tag[data-rank="9"] small, .rank-pill.rank-9, .rank-badge.rank-9 {
  background: linear-gradient(135deg, rgba(48, 34, 10, 0.94), rgba(28, 18, 5, 0.94));
  color: #fff275;
  border: 1.5px solid #ffd700;
  box-shadow: 0 2px 15px rgba(0, 0, 0, 0.8), 0 0 22px rgba(255, 215, 0, 0.8), inset 0 0 8px rgba(255, 215, 0, 0.4);
  text-shadow: 0 0 10px #ffe600, 0 0 18px #ff9800;
  animation: tag-shimmer-gold 2.6s linear infinite;
}
.rank-lvl.rank-9 { color: #fff275; }

/* 11. BẬC 10: KIM CƯƠNG TÂM (Lv 90 - 99) - Kim Cương Bất Hoại Thần Thánh */
.tag[data-rank="10"] b { color: #fff9db; text-shadow: 0 0 12px #ffe066, 0 0 24px #f59f00, 0 0 36px #f03e3e; }
.tag[data-rank="10"] small, .rank-pill.rank-10, .rank-badge.rank-10 {
  background: linear-gradient(135deg, rgba(40, 15, 25, 0.95), rgba(45, 25, 0, 0.95));
  color: #fff3bf;
  border: 1.5px solid #fcc419;
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.85), 0 0 26px rgba(252, 196, 25, 0.85), 0 0 12px rgba(255, 107, 107, 0.7);
  text-shadow: 0 0 11px #ffd43b, 0 0 20px #ff6b6b;
  animation: tag-kimcuong 2.2s linear infinite;
}
.rank-lvl.rank-10 { color: #fff3bf; }

/* 12. BẬC 11: ĐẠI GIÁC NGỘ (Lv 100 MAX) - Phật Quang Phổ Chiếu Ngũ Sắc */
.tag[data-rank="11"] b {
  animation: tag-rainbow-text 3s linear infinite;
  text-shadow: 0 0 14px rgba(255, 215, 0, 0.9), 0 0 28px rgba(255, 107, 107, 0.7), 0 0 40px rgba(116, 143, 252, 0.6);
}
.tag[data-rank="11"] small, .rank-pill.rank-11, .rank-badge.rank-11 {
  background: linear-gradient(135deg, rgba(30, 10, 40, 0.96), rgba(10, 20, 45, 0.96));
  color: #ffffff;
  border: 1.5px solid #ffd700;
  box-shadow: 0 3px 20px rgba(0, 0, 0, 0.9), 0 0 30px rgba(255, 215, 0, 0.95), 0 0 18px rgba(240, 101, 149, 0.85);
  animation: tag-divine-aurora 2.8s linear infinite;
  letter-spacing: 0.4px;
  font-weight: 700;
}
.rank-lvl.rank-11 { color: #ffd700; font-weight: 800; text-shadow: 0 0 8px rgba(255, 215, 0, 0.8); }

/* Keyframe Animations cho các bậc cao */
@keyframes tag-pulse-slow {
  0% { box-shadow: 0 2px 14px rgba(0, 0, 0, 0.75), 0 0 15px rgba(92, 225, 230, 0.5); }
  100% { box-shadow: 0 2px 14px rgba(0, 0, 0, 0.75), 0 0 24px rgba(132, 94, 194, 0.85); }
}

@keyframes tag-shimmer-gold {
  0%, 100% { border-color: #ffd700; box-shadow: 0 2px 15px rgba(0,0,0,.8), 0 0 18px rgba(255,215,0,.7); }
  50% { border-color: #fff275; box-shadow: 0 2px 15px rgba(0,0,0,.8), 0 0 26px rgba(255,242,117,.95), 0 0 10px #ff9800; }
}

@keyframes tag-kimcuong {
  0%, 100% { border-color: #fcc419; box-shadow: 0 2px 16px rgba(0,0,0,.85), 0 0 22px rgba(252,196,25,.8); }
  50% { border-color: #ff8787; box-shadow: 0 2px 16px rgba(0,0,0,.85), 0 0 28px rgba(255,107,107,.9), 0 0 14px #ffd43b; }
}

@keyframes tag-divine-aurora {
  0% { border-color: #ffd700; box-shadow: 0 0 25px rgba(255,215,0,.9), 0 0 15px rgba(255,107,107,.7); }
  33% { border-color: #da77f2; box-shadow: 0 0 28px rgba(218,119,242,.9), 0 0 18px rgba(116,143,252,.7); }
  66% { border-color: #38d9a9; box-shadow: 0 0 28px rgba(56,217,169,.9), 0 0 18px rgba(255,215,0,.7); }
  100% { border-color: #ffd700; box-shadow: 0 0 25px rgba(255,215,0,.9), 0 0 15px rgba(255,107,107,.7); }
}

@keyframes tag-rainbow-text {
  0% { color: #ffe066; }
  25% { color: #ff8787; }
  50% { color: #da77f2; }
  75% { color: #74c0fc; }
  100% { color: #ffe066; }
}

/* ==========================================================================
   HIỆU ỨNG ĐẶC BIỆT TỪ CẤP 50 TRỞ LÊN:
   - Chạy từ phải qua trái xếp từng chữ một (Letter-by-letter slide-in from right)
   - Nhấp nháy hào quang rực rỡ (Blink & Pulse glow)
   ========================================================================== */
.tag.tier-high b {
  animation: name-blink-pulse 2s ease-in-out infinite alternate;
}
@keyframes name-blink-pulse {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.35) drop-shadow(0 0 8px currentColor); }
}

.tag small.char-animated,
.rank-pill.char-animated {
  overflow: visible;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1.5px 9px;
  animation: badge-blink-pulse 1.25s ease-in-out infinite alternate;
}

.tag small.char-animated .c-char,
.tag small.char-animated .c-space,
.rank-pill.char-animated .c-char,
.rank-pill.char-animated .c-space {
  display: inline-block;
  opacity: 0;
  transform: translateX(38px) scale(0.65);
  animation: char-slide-step 6.2s infinite cubic-bezier(0.2, 0.9, 0.3, 1.2);
  animation-delay: calc(var(--i) * 0.065s);
  will-change: transform, opacity;
}

.tag small.char-animated .c-space,
.rank-pill.char-animated .c-space {
  display: inline-block;
  width: 4px;
}

/* Từng chữ chạy từ bên phải qua sang trái, hơi văng nhẹ rồi dừng ngay ngắn vào hàng */
@keyframes char-slide-step {
  0% {
    opacity: 0;
    transform: translateX(38px) scale(0.6);
    filter: blur(2px);
  }
  4% {
    opacity: 1;
    transform: translateX(-4px) scale(1.18);
    filter: blur(0);
  }
  7% {
    opacity: 1;
    transform: translateX(0) scale(1);
    filter: blur(0);
  }
  86% {
    opacity: 1;
    transform: translateX(0) scale(1);
    filter: blur(0);
  }
  93% {
    opacity: 0.15;
    transform: translateX(-16px) scale(0.9);
    filter: blur(1px);
  }
  100% {
    opacity: 0;
    transform: translateX(-30px) scale(0.6);
  }
}

/* Khung huy hiệu nhấp nháy hào quang sáng tối liên tục */
@keyframes badge-blink-pulse {
  0%, 100% {
    filter: brightness(1) drop-shadow(0 0 3px rgba(255, 255, 255, 0.35));
    opacity: 0.92;
  }
  50% {
    filter: brightness(1.5) drop-shadow(0 0 14px rgba(255, 255, 255, 0.95));
    opacity: 1;
  }
}

.rank-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1.5px 8px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
}
.rank-lvl { font-weight: 700; font-size: 11.5px; }

.me-rank { font-size: 11px; font-weight: 600; }
.gift-toast { --petal: #f7a8c4; --petal-in: #fbd0df; --case: #c0436f; position: absolute; top: 88px; left: 50%; transform: translateX(-50%); z-index: 3; display: grid; gap: 1px; justify-items: center; min-width: 240px; padding: 6px 18px 10px; text-align: center; background: var(--glass-strong); border: 1px solid var(--gold); border-radius: 16px; box-shadow: 0 6px 20px rgba(0,0,0,.45); animation: gift-in .3s ease-out; }
.gift-toast[data-tier="1"] { --petal: #d5dee8; --petal-in: #f2f6fa; --case: #8493a3; }
.gift-toast[data-tier="2"] { --petal: #f3c64e; --petal-in: #fbe7a6; --case: #b98718; box-shadow: 0 0 22px rgba(255, 200, 80, .7); }
.gift-toast[data-tier="3"] { --petal: #c79bf0; --petal-in: #ecdcfb; --case: #7a3fb0; box-shadow: 0 0 26px rgba(214, 170, 255, .8); }
.gift-toast strong { color: var(--ink); font-size: 14px; }
.gift-toast small { color: #ffd76a; font-size: 12px; font-weight: 600; }
.gift-lotus { position: relative; width: 150px; height: 124px; }
.gift-case { position: absolute; left: 50%; top: 50%; width: 54px; height: 50px; margin: -25px 0 0 -27px; border-radius: 7px; background: linear-gradient(90deg, transparent 42%, #f2d58f 42% 58%, transparent 58%), linear-gradient(180deg, transparent 26%, #f2d58f 26% 36%, transparent 36%), var(--case); box-shadow: 0 3px 8px rgba(0,0,0,.4); animation: gift-case 1s ease-in forwards; }
.gift-lotus .petal { position: absolute; left: 50%; top: 50%; width: 30px; height: 54px; margin: -54px 0 0 -15px; border-radius: 50% 50% 46% 46% / 72% 72% 28% 28%; background: linear-gradient(0deg, var(--petal-in), var(--petal)); box-shadow: inset 0 0 6px rgba(120, 30, 70, .25); transform-origin: 50% 100%; transform: rotate(var(--a)) scale(0); opacity: 0; animation: gift-petal .55s cubic-bezier(.2, 1.4, .4, 1) calc(.75s + var(--d)) forwards; }
.gift-lotus .petal.inner { width: 26px; height: 40px; margin: -40px 0 0 -13px; background: linear-gradient(0deg, #fff6dc, var(--petal-in)); animation-delay: calc(1s + var(--d)); }
.gift-lotus b { position: absolute; left: 50%; top: 50%; display: grid; place-items: center; min-width: 46px; height: 46px; padding: 0 6px; color: #5a2a06; font: 700 19px var(--sans); background: radial-gradient(circle, #ffe9a8, #f2c24d); border-radius: 50%; box-shadow: 0 0 12px rgba(255, 215, 106, .9); transform: translate(-50%, -50%) scale(0); animation: gift-gain .45s cubic-bezier(.2, 1.6, .4, 1) 1.35s forwards; }
@keyframes gift-case { 0%, 45% { transform: scale(1) rotate(0); opacity: 1; } 55% { transform: scale(1.06) rotate(-5deg); } 65% { transform: scale(1.06) rotate(5deg); } 100% { transform: scale(.2); opacity: 0; } }
@keyframes gift-petal { to { transform: rotate(var(--a)) scale(1); opacity: 1; } }
@keyframes gift-gain { to { transform: translate(-50%, -50%) scale(1); } }
@keyframes gift-in { from { opacity: 0; transform: translate(-50%, -10px); } to { opacity: 1; transform: translate(-50%, 0); } }
.float { position: absolute; left: 0; top: 0; pointer-events: none; will-change: transform; }
.float.talk { max-width: 240px; padding: 5px 11px; border-radius: 12px; text-align: center; font-weight: 500; line-height: 1.3; color: #3a1c0e; background: rgba(255, 248, 232, .95); box-shadow: 0 3px 10px rgba(0,0,0,.35); }
.float.coin { font: 700 17px var(--sans); color: #ffd76a; text-shadow: 0 1px 3px #000, 0 0 6px rgba(0,0,0,.7); white-space: nowrap; }
.bubble { max-width: 210px; white-space: normal; text-align: center; padding: 5px 10px; margin-bottom: 4px; border-radius: 12px; background: rgba(255, 248, 232, .95); color: #3a1c0e; font-weight: 500; text-shadow: none; line-height: 1.3; box-shadow: 0 3px 10px rgba(0,0,0,.35); }

#loading { position: fixed; inset: 0; z-index: 30; display: grid; place-content: center; justify-items: center; gap: 14px; background: #1a0b06; color: var(--muted); }
#loading p { margin: 0; }
.lotus-spin { width: 44px; height: 44px; border: 3px solid rgba(232, 189, 99, .22); border-top-color: var(--gold); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

#entry { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 16px; overflow: auto; background: radial-gradient(ellipse at center, rgba(26, 11, 6, .2), rgba(26, 11, 6, .72)); }
.card { margin: auto; width: min(420px, 100%); padding: 24px; display: grid; gap: 14px; background: var(--glass-strong); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 20px 60px rgba(0,0,0,.55); backdrop-filter: blur(8px); }
.card header { text-align: center; padding-bottom: 12px; border-bottom: 1px solid rgba(232, 189, 99, .25); }
.entry-lotus-logo {
  width: 76px;
  height: 76px;
  display: block;
  margin: 0 auto 10px;
  border-radius: 18px;
  box-shadow: 0 4px 18px rgba(240, 185, 55, 0.4);
  animation: lotus-logo-pulse 4s infinite ease-in-out;
}
@keyframes lotus-logo-pulse {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 0 6px rgba(255, 215, 0, 0.4)); }
  50% { transform: scale(1.05); filter: drop-shadow(0 0 16px rgba(255, 215, 0, 0.75)); }
}
.card h1 { margin: 0; font: 700 28px/1.2 var(--serif); color: var(--gold); }
.sub { margin: 4px 0 0; color: var(--muted); letter-spacing: .02em; }
.field { display: grid; gap: 6px; color: var(--muted); font-weight: 500; }
.field input { width: 100%; padding: 10px 12px; border-radius: 10px; color: var(--ink); background: rgba(255, 240, 210, .08); border: 1px solid rgba(232, 189, 99, .34); }
.field input::placeholder { color: rgba(205, 180, 140, .7); }
.choices { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.choices.two { grid-template-columns: repeat(2, 1fr); }
.choices button { padding: 9px 6px; border-radius: 10px; color: var(--ink); background: rgba(255, 240, 210, .07); border: 1px solid rgba(232, 189, 99, .28); }
.choices button.on { background: rgba(232, 189, 99, .22); border-color: var(--gold); }
.swatches { display: flex; gap: 10px; }
.swatches button { width: 32px; height: 32px; border-radius: 50%; background: var(--c); border: 2px solid rgba(0,0,0,.35); }
.swatches button.on { box-shadow: 0 0 0 2px #1e0d08, 0 0 0 4px var(--gold); }
.error { margin: 0; color: #ff9d86; }
.primary { background: linear-gradient(180deg, #edc871, #bc8a32); color: #2c1407 !important; font-weight: 700; border-radius: 12px; }
.card form { display: grid; gap: 14px; }
.card form > .primary { padding: 12px; font-size: 16px; }
.card .link { justify-self: center; padding: 2px 6px; color: var(--muted); background: none; border: 0; text-decoration: underline; text-underline-offset: 3px; }
.card .link:hover { color: var(--gold); }
.card .note { margin: 0; color: var(--muted); }
.hello-line { margin: 0; text-align: center; color: var(--ink); font-size: 17px; }
.hello-line strong { color: var(--gold); }
.online-line { margin: 0; text-align: center; color: var(--muted); }
.dot { display: inline-block; width: 9px; height: 9px; margin-right: 6px; border-radius: 50%; background: #5cd67c; box-shadow: 0 0 8px #5cd67c; }

#hud { position: fixed; inset: 0; pointer-events: none; }
#hud button, #hud input, #hud .joystick { pointer-events: auto; }

/* ---- Canvas Pháo hoa toàn màn hình ---- */
#fireworksCanvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 38;
}

/* ---- Banner Chính Điện An Lạc (Hiệu ứng nhấp nháy, dát vàng & pháo hoa lung linh) ---- */
.banner {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  padding: 8px 36px 9px;
  text-align: center;
  background: radial-gradient(ellipse at 50% 0%, rgba(56, 30, 14, 0.95), rgba(20, 10, 5, 0.96));
  border: 1.5px solid #e0ad48;
  border-radius: 16px;
  box-shadow: 0 0 16px rgba(255, 215, 0, 0.45), 0 8px 24px rgba(0, 0, 0, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  cursor: pointer;
  pointer-events: auto !important;
  user-select: none;
  transition: transform 0.2s cubic-bezier(0.18, 0.89, 0.32, 1.28), box-shadow 0.25s ease, border-color 0.25s ease;
  animation: bannerPulseGlow 3.5s ease-in-out infinite alternate;
  overflow: visible;
  z-index: 39;
}
.banner:hover {
  transform: translateX(-50%) translateY(-1px) scale(1.03);
  border-color: #ffe082;
  box-shadow: 0 0 30px rgba(255, 215, 0, 0.8), 0 10px 32px rgba(0, 0, 0, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.45);
}
.banner:active {
  transform: translateX(-50%) scale(0.97);
}
@keyframes bannerPulseGlow {
  0% {
    box-shadow: 0 0 12px rgba(255, 215, 0, 0.35), 0 6px 20px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    border-color: rgba(224, 173, 72, 0.8);
  }
  50% {
    box-shadow: 0 0 24px rgba(255, 215, 0, 0.65), 0 8px 26px rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.35);
    border-color: #ffd700;
  }
  100% {
    box-shadow: 0 0 16px rgba(255, 183, 77, 0.45), 0 6px 20px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    border-color: rgba(224, 173, 72, 0.8);
  }
}

/* Ánh sáng quét ngang mặt banner */
.banner-shimmer {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  overflow: hidden;
  pointer-events: none;
}
.banner-shimmer::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -80%;
  width: 50%;
  height: 200%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent);
  transform: rotate(25deg);
  animation: bannerRaySweep 4.5s ease-in-out infinite;
}
@keyframes bannerRaySweep {
  0% { left: -80%; }
  35% { left: 140%; }
  100% { left: 140%; }
}

/* Các ngôi sao nhấp nháy xung quanh */
.banner-stars {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: visible;
}
.banner-star {
  position: absolute;
  color: #ffd700;
  font-size: 13px;
  line-height: 1;
  filter: drop-shadow(0 0 5px rgba(255, 215, 0, 0.9));
  user-select: none;
}
.banner-star.s-tl { top: -7px; left: -7px; animation: starBlink 1.8s ease-in-out infinite alternate; }
.banner-star.s-tr { top: -7px; right: -7px; animation: starBlink 2.2s ease-in-out infinite alternate 0.5s; }
.banner-star.s-bl { bottom: -7px; left: -7px; animation: starBlink 2s ease-in-out infinite alternate 0.9s; }
.banner-star.s-br { bottom: -7px; right: -7px; animation: starBlink 2.4s ease-in-out infinite alternate 0.3s; }
.banner-star.s-top { top: -11px; left: 50%; transform: translateX(-50%); font-size: 11px; color: #fff59d; animation: starBlink 1.6s ease-in-out infinite alternate 1.1s; }

@keyframes starBlink {
  0% { transform: scale(0.65) rotate(0deg); opacity: 0.35; filter: drop-shadow(0 0 2px #ffd700); }
  50% { transform: scale(1.3) rotate(15deg); opacity: 1; filter: drop-shadow(0 0 8px #ffffff) drop-shadow(0 0 14px #ffd700); }
  100% { transform: scale(0.8) rotate(-10deg); opacity: 0.5; filter: drop-shadow(0 0 3px #ffd700); }
}

/* Chữ Chính Điện An Lạc: Dát vàng ánh kim lấp lánh */
.banner h2 {
  margin: 0;
  font: 800 22px/1.2 var(--serif);
  letter-spacing: .04em;
  white-space: nowrap;
  background: linear-gradient(135deg, #fff2a3 0%, #ffd700 25%, #ffae19 50%, #fff9d2 75%, #ffd700 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: goldTextShimmer 4s linear infinite;
  filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.65)) drop-shadow(0 2px 4px rgba(0, 0, 0, 0.9));
}
@keyframes goldTextShimmer {
  0% { background-position: 0% center; }
  100% { background-position: 200% center; }
}

.banner p,
.banner-sub {
  margin: 2px 0 0;
  color: #fff9e6;
  font-size: 12px;
  letter-spacing: .15em;
  white-space: nowrap;
  font-weight: 600;
  text-shadow: 0 0 8px rgba(255, 215, 120, 0.65), 0 1px 3px rgba(0, 0, 0, 0.85);
  animation: subTextBreathe 3s ease-in-out infinite alternate;
}
@keyframes subTextBreathe {
  0% { opacity: 0.85; text-shadow: 0 0 6px rgba(255, 215, 120, 0.4); }
  100% { opacity: 1; text-shadow: 0 0 12px rgba(255, 235, 150, 0.8), 0 0 18px rgba(255, 215, 0, 0.5); }
}
/* ---- HUD Profile Badge (Theo ảnh mẫu chuẩn: Avatar viền vàng + Tên + Bậc/Công Đức + Vạch ngăn + Lv) ---- */
.profile {
  position: absolute;
  top: 10px;
  left: 10px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 3px 6px 3px 4px;
  background: rgba(18, 11, 7, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1.5px solid #8e6831;
  border-radius: 999px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  cursor: pointer;
  pointer-events: auto !important;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
  user-select: none;
  z-index: 40;
}
.profile * {
  pointer-events: auto;
  cursor: pointer;
}
.profile:hover {
  transform: translateY(-1px);
  border-color: #ffd700;
  box-shadow: 0 6px 20px rgba(232, 189, 99, 0.45);
}
.profile .avatar-box {
  position: relative;
  width: 36px;
  height: 36px;
  flex: none;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 0 0 2px #d4a74a;
  background: #2a1810;
}
.profile .avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.profile .avatar-dot {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #d9707e, #8b2b3f);
  color: #fff;
  font-weight: 800;
  font-family: var(--serif);
  font-size: 15px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}
.profile .profile-info-col {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  min-width: 0;
}
.profile .profile-name-text {
  font-size: 14.5px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: 0.2px;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
}
.profile .profile-sub-row {
  display: flex;
  align-items: center;
  gap: 6px;
  line-height: 1;
}
.profile .profile-rank-pill {
  flex: none;
  font-size: 11px;
  padding: 1.5px 7px;
  background: #2b170c;
  color: #dfb466;
  border: 1px solid #7d5725;
  border-radius: 999px;
  font-weight: 700;
  white-space: nowrap;
  line-height: 1.2;
}
.profile .profile-merit-ratio {
  flex: none;
  font-size: 12px;
  font-weight: 700;
  color: #ded7ce;
  white-space: nowrap;
  line-height: 1.2;
  font-family: inherit;
  letter-spacing: 0.2px;
}
.profile .profile-divider {
  width: 1px;
  height: 24px;
  background: rgba(255, 255, 255, 0.4);
  margin: 0 2px;
  flex: none;
}
.profile .profile-level-badge,
.profile .level-badge {
  flex: none;
  display: inline-flex;
  align-items: baseline;
  gap: 2.5px;
  padding: 3px 12px;
  background: linear-gradient(180deg, #ffd836 0%, #f4b518 52%, #df970b 100%);
  border: 1.5px solid #fff5a5;
  border-radius: 999px;
  color: #301802;
  font-weight: 900;
  font-size: 13.5px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35), inset 0 1px 1px rgba(255, 255, 255, 0.6);
  letter-spacing: -0.2px;
  cursor: pointer;
  line-height: 1.2;
}
.profile .profile-level-badge .lv-tag,
.profile .level-badge .lv-tag {
  font-size: 12px;
  font-weight: 800;
  color: #301802;
  opacity: 1;
}
.level-badge {
  flex: none;
  display: flex;
  align-items: baseline;
  gap: 1.5px;
  padding: 3px 8px;
  background: linear-gradient(135deg, #ffd700, #e5a93b);
  border: 1px solid #fff5cc;
  border-radius: 999px;
  color: #2c1407;
  font-weight: 900;
  font-size: 11.5px;
  box-shadow: 0 2px 6px rgba(232, 189, 99, 0.4);
  letter-spacing: -0.2px;
  cursor: pointer;
}
.level-badge .lv-tag {
  font-size: 9.5px;
  opacity: 0.9;
  font-weight: 800;
}
.online { position: absolute; top: 62px; left: 18px; margin: 0; font-size: 12.5px; color: var(--ink); text-shadow: 0 1px 3px #000; }
.merit {
  position: absolute;
  top: 58px;
  right: 12px;
  width: 236px;
  padding: 10px 14px;
  background: var(--glass-strong);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .45);
  z-index: 45;
}
.merit[hidden] {
  display: none !important;
}
.merit-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  border-bottom: 1px solid rgba(232, 189, 99, .25);
  padding-bottom: 6px;
}
.merit-header .merit-tabs {
  flex: 1;
  display: flex;
  gap: 4px;
  margin-bottom: 0;
  border-bottom: none;
  padding-bottom: 0;
}
.merit-close {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 16px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 6px;
  line-height: 1;
  transition: all .15s ease;
}
.merit-close:hover {
  color: #fff;
  background: rgba(255, 255, 255, .15);
}
.merit-footer {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px dashed rgba(232, 189, 99, .2);
  text-align: center;
}
.merit-footer button {
  background: transparent;
  border: none;
  color: var(--gold);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color .15s ease;
}
.merit-footer button:hover {
  color: #ffffff;
}
.tab-btn { flex: 1; padding: 4px 6px; font-size: 11px; font-weight: 600; border-radius: 8px; background: rgba(255, 240, 210, .05); border: 1px solid rgba(232, 189, 99, .2); color: var(--muted); cursor: pointer; transition: all .15s ease; }
.tab-btn:hover { background: rgba(232, 189, 99, .15); color: var(--gold); }
.tab-btn.active { background: var(--gold); color: #2c1407; border-color: var(--gold); font-weight: 700; }
.merit h3 { margin: 0 0 6px; text-align: center; font: 700 16px var(--serif); color: var(--gold); }
.merit ol { margin: 0; padding: 0; list-style: none; counter-reset: rank; }
.merit li { counter-increment: rank; display: flex; justify-content: space-between; gap: 8px; font-size: 13px; padding: 3px 0; }
.merit li span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.merit li span:first-child::before { content: counter(rank) ". "; color: var(--muted); }
.merit li span:last-child { color: var(--gold); font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 600; }
.merit li:first-child span:first-child::before { color: #ffd700; font-weight: 700; }
.merit li:nth-child(2) span:first-child::before { color: #c0c0c0; font-weight: 700; }
.merit li:nth-child(3) span:first-child::before { color: #cd7f32; font-weight: 700; }
.tally { margin: 6px 0 0; padding-top: 6px; border-top: 1px solid rgba(232, 189, 99, .25); font-size: 12px; color: var(--muted); }
.top-right { position: absolute; top: 12px; right: 12px; display: flex; gap: 8px; }
.top-right button { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; background: var(--glass); border: 1px solid rgba(232, 189, 99, .3); }
.top-right button.active { background: var(--gold); color: #2c1407; border-color: var(--gold); box-shadow: 0 0 12px rgba(232, 189, 99, .45); }
.top-right button.off { opacity: .5; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

.views { position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); display: flex; gap: 2px; padding: 4px; background: var(--glass); border: 1px solid rgba(232, 189, 99, .3); border-radius: 99px; max-width: calc(100vw - 24px); }
.views button { padding: 7px 13px; border-radius: 99px; white-space: nowrap; }
.views button.on { background: var(--gold); color: #2c1407; font-weight: 600; }

#hud.viewing .actions, #hud.viewing .prompt, #hud.viewing .tail-tag { display: none !important; }
.actions { position: absolute; bottom: 14px; right: 12px; display: grid; grid-template-columns: repeat(3, 76px); gap: 8px; }
.actions button { height: 66px; display: grid; justify-items: center; align-content: center; gap: 3px; border-radius: 13px; font-size: 12px; font-weight: 500; background: var(--glass); border: 1px solid rgba(232, 189, 99, .34); }
.actions button.primary { background: linear-gradient(180deg, #edc871, #bc8a32); border-color: #f2d58f; }
.actions button.active { border-color: var(--gold); background: rgba(232, 189, 99, .28); }
.actions button:disabled { opacity: .45; }
.offer-log { display: none !important; position: absolute; left: 12px; bottom: 62px; width: min(300px, 26vw); min-width: 210px; padding: 7px 11px 8px; background: var(--glass); border: 1px solid rgba(232, 189, 99, .28); border-radius: 12px; }
.offer-log h3 { margin: 0 0 3px; font: 700 13px var(--serif); color: var(--gold); }
.offer-log ol { display: grid; gap: 1px; margin: 0; padding: 0; list-style: none; font-size: 12px; }
.offer-log li { display: flex; justify-content: space-between; gap: 8px; }
.offer-log li span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.offer-log li span:first-child { flex: 1; }
.offer-log li span:nth-child(2) { flex: none; color: var(--gold); font-variant-numeric: tabular-nums; }
.offer-log time { flex: none; color: var(--muted); font-variant-numeric: tabular-nums; }
.offer-log li.fresh { animation: offer-new 1.6s ease-out; }
@keyframes offer-new { from { background: rgba(232, 189, 99, .4); } to { background: transparent; } }
.niem { display: none !important; }
.niem p { position: absolute; left: 0; bottom: 0; margin: 0; padding: 3px 12px; font: 700 15px var(--serif); color: var(--gold); background: rgba(20, 8, 4, .62); border-radius: 99px; white-space: nowrap; animation: niem 5s ease-out forwards; }
@keyframes niem { 0% { opacity: 0; transform: translateY(10px); } 12% { opacity: 1; } 75% { opacity: 1; } 100% { opacity: 0; transform: translateY(-100px); } }
.chat { position: absolute; bottom: 14px; left: 12px; display: flex; gap: 6px; width: min(300px, 26vw); min-width: 210px; }
.chat input { flex: 1; min-width: 0; padding: 9px 13px; color: var(--ink); background: var(--glass); border: 1px solid rgba(232, 189, 99, .3); border-radius: 99px; }
.chat input::placeholder { color: var(--muted); }
.chat button { padding: 0 13px; background: var(--glass); border: 1px solid rgba(232, 189, 99, .3); border-radius: 99px; }

.quality-menu { position: absolute; top: 58px; right: 12px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px; width: 262px; padding: 6px 6px 6px 12px; background: var(--glass-strong); border: 1px solid var(--line); border-radius: 18px; }
.quality-menu strong { margin-right: 6px; color: var(--gold); }
.quality-menu button { padding: 4px 12px; border-radius: 99px; }
.quality-menu #soloBtn { flex: 1 0 100%; margin: 4px 0 0 -6px; border: 1px solid var(--line); }
.quality-menu button.on { background: var(--gold); color: #2c1407; font-weight: 700; }
.queue-card { position: absolute; top: 84px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 12px; padding: 8px 10px 8px 16px; background: var(--glass-strong); border: 1px solid var(--gold); border-radius: 99px; white-space: nowrap; }
.queue-card strong { color: var(--gold); }
.queue-card span { color: var(--muted); }
.queue-card button { padding: 5px 11px; border-radius: 99px; border: 1px solid rgba(232, 189, 99, .4); }

.feed { position: absolute; top: 140px; left: 50%; transform: translateX(-50%); display: grid; gap: 4px; justify-items: center; width: min(520px, 80vw); }
.feed p { margin: 0; padding: 3px 12px; font-size: 13px; text-align: center; background: rgba(20, 8, 4, .5); border-radius: 99px; animation: fade 6s forwards; }
@keyframes fade { 0% { opacity: 0; transform: translateY(6px); } 6% { opacity: 1; transform: none; } 80% { opacity: 1; } 100% { opacity: 0; } }
.prompt { position: absolute; bottom: 118px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 10px; padding: 11px 20px; font-size: 15px; font-weight: 700; color: #2c1407; white-space: nowrap; background: linear-gradient(180deg, #edc871, #bc8a32); border: 1px solid #f2d58f; border-radius: 99px; box-shadow: 0 6px 24px rgba(0,0,0,.45); }
.prompt kbd { padding: 0 7px; font: 600 12px/20px var(--sans); border-radius: 6px; background: rgba(44, 20, 7, .18); }
.tail-tag { position: absolute; left: 0; top: 0; padding: 5px 13px; font-size: 13px; font-weight: 700; color: #2c1407; white-space: nowrap; background: linear-gradient(180deg, #edc871, #bc8a32); border: 1px solid #f2d58f; border-radius: 99px; box-shadow: 0 3px 12px rgba(0,0,0,.45); will-change: transform; }
.hint { position: absolute; bottom: 66px; left: 50%; transform: translateX(-50%); padding: 3px 12px; font-size: 12px; color: var(--ink); background: rgba(20, 8, 4, .5); border-radius: 99px; white-space: nowrap; transition: opacity .8s; }
.hint.gone { opacity: 0; }

.joystick { display: none; position: absolute; left: 18px; bottom: 76px; width: 112px; height: 112px; border-radius: 50%; background: rgba(30, 13, 8, .45); border: 1px solid rgba(232, 189, 99, .4); touch-action: none; -webkit-user-select: none; user-select: none; }
.joystick i { position: absolute; left: 34px; top: 34px; width: 44px; height: 44px; border-radius: 50%; background: rgba(232, 189, 99, .7); pointer-events: none; touch-action: none; }

dialog { width: min(460px, calc(100vw - 24px)); padding: 20px; color: var(--ink); background: var(--glass-strong); border: 1px solid var(--line); border-radius: 18px; }
dialog::backdrop { background: rgba(15, 6, 3, .5); }
dialog h3 { margin: 0; font: 700 21px var(--serif); color: var(--gold); }
dialog form { display: grid; gap: 12px; }
.items { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.items button { display: grid; justify-items: center; gap: 2px; padding: 8px 2px; border-radius: 12px; font-size: 12px; line-height: 1.25; background: rgba(255, 240, 210, .07); border: 1px solid rgba(232, 189, 99, .28); }
.items button.on { background: rgba(232, 189, 99, .24); border-color: var(--gold); }
.items i { width: 26px; height: 26px; border-radius: 50%; background: var(--c); box-shadow: inset 0 -4px 7px rgba(0,0,0,.25); }
.items small { color: var(--gold); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips button { padding: 4px 10px; font-size: 12px; border-radius: 99px; border: 1px solid rgba(232, 189, 99, .28); }
.items button.poor { opacity: .5; }
.offer-warn { margin: 0; padding: 7px 11px; color: #ffd9c8; background: rgba(170, 50, 30, .38); border: 1px solid rgba(255, 140, 110, .5); border-radius: 10px; }
.who-card { position: absolute; top: 96px; left: 12px; display: grid; gap: 2px; min-width: 190px; padding: 10px 14px; background: var(--glass-strong); border: 1px solid var(--gold); border-radius: 14px; }
.who-card strong { font: 700 16px var(--serif); color: var(--gold); }
.who-card span { font-size: 13px; }
.wallet { margin: 0; }
.wallet strong { color: var(--gold); font-size: 17px; }
.task-list { display: grid; gap: 6px; grid-template-columns: repeat(2, 1fr); }
#taskDialog { width: min(620px, calc(100vw - 24px)); }
.task-row { display: flex; align-items: center; gap: 6px; padding: 6px 8px; border-radius: 12px; background: rgba(255, 240, 210, .07); border: 1px solid rgba(232, 189, 99, .3); }
.task-row:hover { background: rgba(232, 189, 99, .2); border-color: var(--gold); }
.task-row.on { background: rgba(232, 189, 99, .3); border-color: var(--gold); }
.task-pick { flex: 1; min-width: 0; display: grid; gap: 1px; padding: 3px 4px; text-align: left; font-weight: 600; background: none; border: 0; }
.task-row.on .task-pick span::before { content: "✓ "; color: var(--gold); }
.login-note { margin: -8px 0 0; color: var(--muted); font-size: 12px; text-align: center; }
.need-box { display: grid; gap: 2px; padding: 8px 12px; border: 1px solid #ffd76a; border-radius: 12px; background: rgba(232, 189, 99, .14); }
.need-box strong { color: #ffd76a; }
.need-box small { color: var(--muted); }
.task-row.need { order: -1; background: rgba(232, 189, 99, .2); border-color: #ffd76a; box-shadow: 0 0 10px rgba(255, 215, 106, .28); }
.task-row.need .task-pick span { color: #fff3cf; }
.task-row.need small { color: #ffd76a; }
.task-row.dim { opacity: .38; }
.task-row.dim:hover { background: rgba(255, 240, 210, .07); border-color: rgba(232, 189, 99, .3); }
.stepper button:disabled, .task-pick:disabled { cursor: not-allowed; }
.stepper button:disabled { opacity: .35; }
.stepper { display: flex; align-items: center; gap: 2px; }
.stepper button { width: 30px; height: 30px; font-size: 17px; line-height: 1; border-radius: 8px; background: rgba(255, 240, 210, .08); border: 1px solid rgba(232, 189, 99, .34); }
.stepper b { min-width: 24px; text-align: center; font-variant-numeric: tabular-nums; }
.row .left { margin-right: auto; }
#taskGo:disabled, #offerGo:disabled { opacity: .45; cursor: not-allowed; }
.task-list small { color: var(--gold); font-weight: 600; white-space: nowrap; }
.work-bar { position: absolute; top: 84px; left: 50%; transform: translateX(-50%); display: grid; gap: 5px; width: min(300px, 76vw); padding: 8px 14px 10px; text-align: center; background: var(--glass-strong); border: 1px solid var(--gold); border-radius: 14px; }
.work-bar i { display: block; height: 7px; border-radius: 99px; overflow: hidden; background: rgba(255, 240, 210, .14); }
.work-bar b { display: block; height: 100%; width: 0; background: var(--gold); }
.chips.wishes button.on, .chips.money button.on { background: rgba(232, 189, 99, .28); border-color: var(--gold); color: var(--ink); }
.today { margin: 6px 0 0; color: var(--ink); font-size: 13px; }
.today.next { margin-top: 2px; color: var(--gold); font-weight: 600; }
.today.next.holy { color: #ffd76a; }
#supportAsk { width: min(380px, calc(100vw - 24px)); }
#supportAsk h3 { font-size: 18px; line-height: 1.35; text-align: center; }
#supportAsk .row { justify-content: center; }
#supportAsk .row button { min-width: 96px; }
#supportDialog { max-height: calc(100dvh - 24px); overflow-y: auto; }
#supportForm { position: relative; }
.dialog-close { position: absolute; top: -8px; right: -8px; width: 34px; height: 34px; color: var(--muted); font-size: 22px; line-height: 1; background: none; border: 0; }
.dialog-close:hover { color: var(--gold); }
.support-qr-box { display: flex; flex-direction: column; align-items: center; gap: 10px; margin: 4px 0 12px; }
.support-qr { justify-self: center; width: 220px; height: 220px; max-width: min(220px, 68vw); max-height: min(220px, 68vw); background: #fff; border-radius: 14px; padding: 8px; overflow: hidden; box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45); border: 2px solid rgba(232, 189, 99, 0.4); display: flex; align-items: center; justify-content: center; }
.support-qr svg { display: block !important; width: 100% !important; height: 100% !important; fill: #000000 !important; stroke: none !important; }
.bank-lines { display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; margin: 0; }
.bank-lines dt { color: var(--muted); }
.bank-lines dd { margin: 0; font-weight: 600; word-break: break-word; }
.row { display: flex; justify-content: flex-end; gap: 8px; }
.row button { padding: 9px 16px; border-radius: 11px; }

.rank-dialog { width: min(560px, calc(100vw - 20px)); max-height: calc(100dvh - 32px); padding: 22px; }
.leaderboard-table-wrap { max-height: min(390px, 52vh); overflow-y: auto; margin: 6px 0 10px; border-radius: 12px; border: 1px solid rgba(232, 189, 99, .25); background: rgba(0, 0, 0, .25); }
.leaderboard-table { width: 100%; border-collapse: collapse; font-size: 13px; text-align: left; }
.leaderboard-table th { padding: 9px 10px; background: rgba(232, 189, 99, .18); color: var(--gold); font-weight: 600; position: sticky; top: 0; backdrop-filter: blur(8px); z-index: 1; }
.leaderboard-table td { padding: 8px 10px; border-bottom: 1px solid rgba(232, 189, 99, .1); }
.leaderboard-table tr:hover { background: rgba(232, 189, 99, .08); }
.leaderboard-table tr.me { background: rgba(232, 189, 99, .24); font-weight: 700; color: #fff; }
.medal-1 { color: #ffd700; font-weight: 800; font-size: 14px; }
.medal-2 { color: #d0d0d0; font-weight: 800; font-size: 14px; }
.medal-3 { color: #cd7f32; font-weight: 800; font-size: 14px; }
.col-rank { width: 60px; text-align: center; }
.col-level { text-align: center; font-weight: 700; color: var(--gold); }
.col-merit { text-align: right; font-variant-numeric: tabular-nums; }
.my-rank-banner { padding: 9px 14px; background: rgba(232, 189, 99, .15); border: 1px solid var(--gold); border-radius: 10px; font-size: 13px; text-align: center; color: var(--gold); font-weight: 600; }

/* Dialog Hồ sơ tu tập (chuẩn giao diện theo ảnh mẫu) */
.profile-card-dialog {
  width: min(450px, calc(100vw - 20px));
  max-height: calc(100dvh - 30px);
  padding: 18px 20px 20px 20px;
  background: #faf6ee !important;
  color: #382417 !important;
  border: 1px solid #ebdcc5 !important;
  border-radius: 24px !important;
  box-shadow: 0 16px 48px rgba(25, 12, 6, .45);
  overflow-y: auto;
}
.profile-card-dialog form { display: grid; gap: 10px; }

/* Tiêu đề & nút đóng tròn góc trên */
.pp-dialog-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.pp-main-title {
  margin: 0;
  font-size: 19px;
  font-weight: 800;
  font-family: var(--serif);
  color: #2e1a0f !important;
  letter-spacing: .3px;
}
.pp-dialog-close {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #ede2d1;
  border: none;
  font-size: 14px;
  color: #5a4233;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: all 0.15s ease;
  line-height: 1;
}
.pp-dialog-close:hover {
  background: #dfd0bb;
  color: #2e1a0f;
  transform: scale(1.08);
}

/* Thanh Tabs theo ảnh mẫu: Của tôi, Danh hiệu, Bộ sưu tập, Tài khoản */
.pp-tabs-bar {
  display: flex;
  gap: 7px;
  margin: 2px 0 6px 0;
  overflow-x: auto;
  padding-bottom: 2px;
}
.pp-tab {
  padding: 6px 15px;
  border-radius: 999px;
  border: none;
  background: #ede4d4;
  color: #4a3424;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
}
.pp-tab:hover {
  background: #e2d5c0;
}
.pp-tab.active {
  background: #3d2b1f;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(61, 43, 31, .3);
}

.pp-tab-pane {
  display: grid;
  gap: 10px;
}
.pp-tab-pane[hidden] {
  display: none !important;
}

/* Header thông tin nhân vật */
.pp-header {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  background: #ffffff;
  border: 1px solid #ebd9c0;
  border-radius: 18px;
  padding: 12px 14px;
  box-shadow: 0 2px 8px rgba(100, 70, 40, .05);
}
.pp-header-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #ede2d1;
  border: none;
  font-size: 13px;
  color: #5a4233;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: all 0.15s ease;
  line-height: 1;
  z-index: 2;
}
.pp-header-close:hover {
  background: #dfd0bb;
  color: #2e1a0f;
  transform: scale(1.08);
}
.pp-avatar-wrap {
  position: relative;
  flex-shrink: 0;
}
.pp-avatar {
  width: 66px;
  height: 66px;
  border-radius: 50%;
  background: linear-gradient(135deg, #d9707e, #8b2b3f);
  border: 3px solid #e5a93b;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 26px;
  font-weight: 700;
  font-family: var(--serif);
  box-shadow: 0 3px 10px rgba(139, 43, 63, .3);
  overflow: hidden;
}
.pp-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.pp-avatar-cam-btn {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #ffd700;
  border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
  display: grid;
  place-items: center;
  font-size: 12px;
  cursor: pointer;
  transition: transform 0.15s ease;
  padding: 0;
}
.pp-avatar-cam-btn:hover {
  transform: scale(1.15);
}

.pp-title-box { flex: 1; min-width: 0; padding-right: 28px; }
.pp-title-box h3 { margin: 0; font-size: 17px; font-weight: 800; font-family: var(--serif); color: #2e1a0f !important; letter-spacing: .4px; }
.pp-sub-line-1 { font-size: 12.5px; color: #965d6c; font-weight: 600; margin-top: 2px; }
.pp-sub-line-2 { font-size: 11.5px; color: #7f6e60; margin-top: 2px; }
.pp-sub-line-2 .loc-tag { color: #1e7e34; font-weight: 600; }
.pp-header-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 6px; }

/* Nút Tải ảnh đại diện theo ảnh mẫu */
.pp-btn-upload-pill {
  padding: 5px 14px;
  background: linear-gradient(135deg, #f0ba54, #d89b2b);
  border: 1px solid #e0b462;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  color: #38200c;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  box-shadow: 0 2px 6px rgba(216, 155, 43, .35);
  transition: all 0.15s ease;
}
.pp-btn-upload-pill:hover {
  background: linear-gradient(135deg, #ffd06b, #e6a735);
  transform: translateY(-1px);
}
.pp-btn-remove-pill {
  padding: 5px 9px;
  background: #fff;
  border: 1px solid #e2c0c7;
  border-radius: 999px;
  font-size: 12px;
  color: #8b2b3f;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}
.pp-btn-remove-pill:hover {
  background: #fff0f2;
}
.pp-btn-friend-pill {
  padding: 5px 12px;
  background: linear-gradient(135deg, #f0ba54, #d89b2b);
  border: 1px solid #e0b462;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  color: #38200c;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
}
.pp-btn-friend-pill.is-friend {
  background: #ede4d4;
  color: #4a3424;
  border-color: #d8c8b0;
}
.pp-btn-chat-pill {
  padding: 5px 12px;
  background: #3d2b1f;
  border: 1px solid #3d2b1f;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
}
.pp-btn-chat-pill:hover {
  background: #563e2d;
}

/* Thẻ thống kê */
.pp-stats-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pp-stat-card {
  background: #ffffff; border: 1px solid #ebd9c0; border-radius: 16px;
  padding: 10px 6px; text-align: center;
  box-shadow: 0 2px 6px rgba(100, 70, 40, .05);
}
.pp-stat-num { font-size: 22px; font-weight: 800; color: #2e1a0f; font-family: var(--serif); }
.pp-stat-label { font-size: 11px; color: #857465; margin-top: 1px; }

/* Trang bị & 3D Chibi */
.pp-sec-title { font-size: 11px; font-weight: 800; letter-spacing: 1px; color: #9c733f; margin-bottom: 5px; }
.pp-equip-body { display: flex; gap: 10px; align-items: stretch; }
.pp-figurine-box {
  width: 110px; background: radial-gradient(circle at 50% 36%, #543422, #2c160c);
  border-radius: 16px; border: 1px solid #6b432a;
  display: flex; align-items: center; justify-content: center;
  box-shadow: inset 0 2px 8px rgba(0,0,0,.4);
  flex-shrink: 0;
}
.pp-figurine-box canvas { display: block; border-radius: 14px; }
.pp-equip-list { flex: 1; display: grid; gap: 6px; }
.pp-equip-item {
  display: flex; align-items: center; gap: 10px;
  background: #ffffff; border: 1px solid #ebd9c0; border-radius: 14px;
  padding: 6px 10px;
}
.pp-equip-icon {
  width: 36px; height: 36px; border-radius: 50%;
  background: #341e12; border: 1.5px solid #573926;
  display: grid; place-items: center; flex-shrink: 0;
  box-shadow: inset 0 2px 5px rgba(0,0,0,.5);
}
.pp-equip-text { display: grid; font-size: 12px; line-height: 1.25; }
.pp-equip-text .label { font-size: 10px; color: #8e7c6d; }
.pp-equip-text strong { color: #2e1a0f; font-weight: 700; font-size: 13px; }

/* Khối Tài chính & Công đức */
.pp-finance-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pp-finance-card {
  background: #fff; border: 1px solid #ebd9c0; border-radius: 14px;
  padding: 8px 12px; display: grid; gap: 2px;
}
.pp-finance-card .fin-label { font-size: 11px; color: #8e7c6d; }
.pp-finance-card .fin-val { font-size: 14px; font-weight: 800; font-family: var(--serif); }
.pp-finance-card .fin-val.gold { color: #b87a1d; }
.pp-finance-card .fin-val.purple { color: #7b4397; }

/* Banner chúc lành */
.pp-bless-bar {
  background: transparent;
  padding: 6px 10px;
  font-size: 12.5px;
  color: #6b533f;
  text-align: center;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.15s ease;
}
.pp-bless-bar:hover {
  transform: scale(1.02);
  color: #8b5b29;
}

/* Lời chúc & quà tặng */
.pp-wish-section {
  display: grid;
  gap: 6px;
  margin-top: 2px;
}
.pp-chips-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 2px; }
.pp-chip {
  background: #ffffff; border: 1px solid #ebd9c0; border-radius: 999px;
  padding: 6px 14px; font-size: 12px; color: #2e1a0f; font-weight: 600; cursor: pointer;
  box-shadow: 0 1px 3px rgba(100, 70, 40, .04);
  transition: all .15s ease;
}
.pp-chip:hover { background: #faf2e4; border-color: #d4a34b; transform: translateY(-1px); }
.pp-input-row { display: flex; gap: 8px; }
.pp-input-row input {
  flex: 1; min-width: 0; background: #ffffff;
  border: 1px solid #ebd9c0; border-radius: 14px;
  padding: 9px 12px; font-size: 12.5px; color: #2e1a0f;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.03);
}
.pp-input-row input:focus { outline: none; border-color: #d4a34b; }
.pp-send-btn {
  background: linear-gradient(180deg, #e3af4f, #c78b27); color: #fff;
  border: 0; border-radius: 14px; padding: 0 18px; font-weight: 700; font-size: 13px; cursor: pointer;
  box-shadow: 0 2px 6px rgba(199, 139, 39, .3);
  transition: all 0.15s ease;
}
.pp-send-btn:hover { background: linear-gradient(180deg, #ecbe63, #d4952f); }

.pp-actions-row { display: flex; gap: 10px; margin-top: 6px; }
.pp-gift-btn {
  flex: 1;
  background: #ffffff;
  border: 1px solid #ebd9c0;
  border-radius: 999px;
  padding: 11px 16px;
  font-size: 13px;
  font-weight: 700;
  color: #2e1a0f;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  box-shadow: 0 2px 5px rgba(100, 70, 40, .05);
  transition: all 0.15s ease;
  white-space: nowrap;
}
.pp-gift-btn:hover {
  background: #faf2e4;
  border-color: #d4a34b;
  transform: translateY(-1px);
}
.pp-friend-btn {
  flex: 1.25;
  background: linear-gradient(180deg, #fed574, #f5bc43);
  border: 1px solid #e0ab36;
  border-radius: 999px;
  padding: 11px 18px;
  font-size: 13px;
  font-weight: 700;
  color: #2e1a0f;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  box-shadow: 0 3px 8px rgba(245, 188, 67, .35);
  transition: all 0.15s ease;
  white-space: nowrap;
}
.pp-friend-btn:hover {
  background: linear-gradient(180deg, #ffdf85, #f7c352);
  transform: translateY(-1px);
}
.pp-friend-btn.is-friend {
  background: #ede4d4;
  border-color: #d8c8b0;
  color: #4a3424;
  box-shadow: none;
}
.pp-footnote {
  font-size: 11px;
  color: #8e7c6d;
  text-align: center;
  margin-top: 6px;
  line-height: 1.35;
}

/* CSS cho Tab Danh hiệu, Bộ sưu tập, Tài khoản */
.pp-titles-list { display: grid; gap: 8px; max-height: 380px; overflow-y: auto; padding-right: 2px; }
.pp-title-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #ffffff;
  border: 1px solid #ebd9c0;
  border-radius: 14px;
  padding: 10px 14px;
  transition: all 0.15s ease;
}
.pp-title-item.current {
  border-color: #f0ba54;
  background: #fffdf8;
  box-shadow: 0 2px 10px rgba(229, 169, 59, 0.22);
}
.pp-title-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}
.pp-title-icon {
  font-size: 22px;
  flex-shrink: 0;
}
.pp-title-info {
  flex: 1;
  min-width: 0;
}
.pp-title-name {
  font-weight: 700;
  font-size: 13.5px;
  color: #2e1a0f;
  line-height: 1.25;
}
.pp-title-level-tag {
  font-weight: normal;
  color: #9c733f;
  font-size: 11px;
}
.pp-title-req {
  font-size: 11px;
  color: #8e7c6d;
  margin-top: 2px;
  line-height: 1.25;
}
.pp-title-right {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}
.pp-title-badge {
  font-size: 11.5px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap !important;
  display: inline-block;
  line-height: 1.2;
  text-align: center;
  box-sizing: border-box;
}
.pp-title-badge.unlocked {
  background: #e8f5e9;
  color: #2e7d32;
  border: 1px solid #c8e6c9;
}
.pp-title-badge.current-badge {
  background: #fff3e0;
  color: #e65100;
  border: 1.5px solid #ffb74d;
  box-shadow: 0 1px 4px rgba(230, 81, 0, 0.15);
}
.pp-title-badge.locked {
  background: #f5f5f5;
  color: #9e9e9e;
  border: 1px solid #e0e0e0;
}

.pp-collection-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; max-height: 380px; overflow-y: auto; }
.pp-col-card {
  background: #fff; border: 1px solid #ebd9c0; border-radius: 12px;
  padding: 10px; display: flex; align-items: center; gap: 10px;
}
.pp-col-icon { font-size: 24px; }
.pp-col-info { display: grid; font-size: 11.5px; }
.pp-col-name { font-weight: 700; color: #2e1a0f; }
.pp-col-sub { font-size: 10.5px; color: #8e7c6d; }

.pp-account-box {
  background: #fff; border: 1px solid #ebd9c0; border-radius: 16px;
  padding: 14px 16px; display: grid; gap: 10px;
}
.pp-acc-row {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 13px; border-bottom: 1px solid #f2e9dc; padding-bottom: 7px;
}
.pp-acc-row:last-child { border-bottom: none; padding-bottom: 0; }
.pp-acc-label { color: #8e7c6d; }
.pp-acc-val { font-weight: 700; color: #2e1a0f; }
.pp-footnote { font-size: 11px; color: #877565; text-align: center; margin-top: 2px; }

/* Dialog Nhắn tin riêng */
.pm-dialog { width: min(420px, calc(100vw - 20px)); max-height: calc(100dvh - 30px); padding: 18px; border-radius: 20px; }
.pm-dialog form { display: grid; gap: 10px; }
.pm-header { border-bottom: 1px solid rgba(232, 189, 99, .25); padding-bottom: 8px; }
.pm-title { font-size: 15px; font-weight: 700; color: var(--ink); }
.pm-title .gold-name { color: var(--gold); }
.pm-status { font-size: 11px; color: var(--muted); margin-top: 2px; }
.pm-messages {
  height: 220px; max-height: 40vh; overflow-y: auto; display: flex; flex-direction: column; gap: 8px;
  padding: 8px; border-radius: 12px; background: rgba(0, 0, 0, .25); border: 1px solid rgba(232, 189, 99, .2);
}
.pm-bubble { max-width: 80%; padding: 6px 10px; border-radius: 12px; font-size: 12.5px; line-height: 1.35; word-break: break-word; }
.pm-bubble.in { align-self: flex-start; background: rgba(255, 255, 255, .15); border: 1px solid rgba(255, 255, 255, .1); color: var(--ink); border-bottom-left-radius: 2px; }
.pm-bubble.out { align-self: flex-end; background: rgba(232, 189, 99, .3); border: 1px solid var(--gold); color: #fff; border-bottom-right-radius: 2px; }
.pm-input-bar { display: flex; gap: 6px; }
.pm-input-bar input { flex: 1; min-width: 0; padding: 8px 12px; border-radius: 10px; background: rgba(0, 0, 0, .3); border: 1px solid rgba(232, 189, 99, .3); color: var(--ink); }
.pm-send-btn { padding: 0 16px; border-radius: 10px; background: var(--gold); color: #2c1407; font-weight: 700; border: 0; }

/* ---- Sổ Tay Nhiệm Vụ Tu Học & Phụng Sự --------------------------------- */
.quest-dialog {
  width: min(780px, calc(100vw - 16px));
  max-height: calc(100dvh - 24px);
  padding: 0;
  border-radius: 22px;
  background: var(--glass-strong);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--line);
  color: var(--ink);
  overflow: hidden;
}
.quest-dialog-inner {
  display: flex;
  flex-direction: column;
  max-height: calc(100dvh - 24px);
  padding: 16px 20px;
}
.quest-header {
  border-bottom: 1px solid rgba(232, 189, 99, .25);
  padding-bottom: 12px;
  flex-shrink: 0;
}
.quest-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.quest-title-row h3 {
  margin: 0;
  font: 700 19px var(--serif);
  color: var(--gold);
}
.quest-dialog-close {
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(232, 189, 99, .3);
  color: var(--muted);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 16px;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: all .15s ease;
}
.quest-dialog-close:hover {
  background: rgba(232, 189, 99, .25);
  color: #fff;
}
.quest-main-tabs {
  display: flex;
  gap: 8px;
  background: rgba(0, 0, 0, .25);
  padding: 4px;
  border-radius: 14px;
  border: 1px solid rgba(232, 189, 99, .2);
}
.quest-tab-btn {
  flex: 1;
  padding: 8px 12px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--muted);
  background: transparent;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: all .18s ease;
  white-space: nowrap;
}
.quest-tab-btn.active {
  background: var(--gold);
  color: #2c1407;
  box-shadow: 0 3px 10px rgba(232, 189, 99, .35);
}

/* ---- AUTO QUEST CONTROLS & HUD --------------------------------- */
.quest-auto-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: linear-gradient(135deg, rgba(232, 189, 99, 0.15), rgba(212, 114, 26, 0.12));
  border: 1px solid rgba(232, 189, 99, 0.4);
  border-radius: 14px;
  padding: 8px 14px;
  margin-top: 10px;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}
.auto-bar-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}
.auto-badge {
  background: linear-gradient(135deg, #f7d070, #d49526);
  color: #2b1404;
  font-weight: 800;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 6px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  box-shadow: 0 2px 6px rgba(232, 189, 99, 0.4);
}
.auto-desc {
  color: #f7e3af;
  font-weight: 600;
}
.auto-bar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.auto-mode-select-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}
.auto-mode-select {
  background: rgba(18, 12, 8, 0.85);
  color: #ffd700;
  border: 1px solid rgba(232, 189, 99, 0.4);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 12.5px;
  font-weight: 600;
  outline: none;
  cursor: pointer;
}
.auto-mode-select:focus {
  border-color: #f7d070;
  box-shadow: 0 0 8px rgba(247, 208, 112, 0.4);
}
.auto-quest-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 700;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  white-space: nowrap;
}
.auto-quest-btn.start {
  background: linear-gradient(135deg, #f6cf6f, #d59025);
  color: #251203;
  box-shadow: 0 3px 12px rgba(246, 207, 111, 0.4);
}
.auto-quest-btn.start:hover {
  transform: translateY(-1px);
  filter: brightness(1.1);
  box-shadow: 0 4px 16px rgba(246, 207, 111, 0.6);
}
.auto-quest-btn.stop {
  background: linear-gradient(135deg, #ef4444, #b91c1c);
  color: #fff;
  box-shadow: 0 3px 12px rgba(239, 68, 68, 0.4);
}
.auto-quest-btn.stop:hover {
  transform: translateY(-1px);
  filter: brightness(1.1);
}

/* Floating HUD banner when auto is running */
.auto-quest-hud-banner {
  position: fixed;
  top: 72px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 120;
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(22, 14, 8, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1.5px solid #f6cf6f;
  border-radius: 30px;
  padding: 8px 18px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.6), 0 0 16px rgba(246, 207, 111, 0.35);
  color: #fff;
  animation: autoPulseGlow 2.5s infinite ease-in-out;
  pointer-events: auto;
}
.auto-quest-hud-banner[hidden] {
  display: none !important;
}
@keyframes autoPulseGlow {
  0%, 100% { box-shadow: 0 6px 24px rgba(0, 0, 0, 0.6), 0 0 12px rgba(246, 207, 111, 0.3); }
  50% { box-shadow: 0 6px 28px rgba(0, 0, 0, 0.7), 0 0 24px rgba(246, 207, 111, 0.65); border-color: #ffe599; }
}
.auto-pulse-icon {
  font-size: 20px;
  animation: pulseIcon 1.2s infinite alternate;
}
@keyframes pulseIcon {
  0% { transform: scale(0.9); }
  100% { transform: scale(1.2); }
}
.auto-hud-info {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}
.auto-hud-info strong {
  font-size: 13px;
  color: #fce79f;
  font-weight: 700;
}
.auto-hud-info span {
  font-size: 11.5px;
  color: #e2e8f0;
}
.auto-hud-stop-btn {
  background: #dc2626;
  color: #fff;
  border: none;
  border-radius: 20px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.auto-hud-stop-btn:hover {
  background: #ef4444;
  transform: scale(1.05);
}

/* Quick Auto floating button on HUD */
.quick-auto-btn {
  position: absolute;
  right: 12px;
  bottom: 164px;
  height: 38px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, rgba(32, 20, 10, 0.9), rgba(15, 10, 6, 0.95));
  border: 1.5px solid rgba(232, 189, 99, 0.6);
  border-radius: 99px;
  color: #ffd700;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4), 0 0 10px rgba(232, 189, 99, 0.25);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: all 0.2s ease;
  z-index: 15;
}
.quick-auto-btn:hover {
  transform: translateY(-2px);
  border-color: #ffd700;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5), 0 0 16px rgba(255, 215, 0, 0.4);
}
.quick-auto-btn.running {
  background: linear-gradient(135deg, rgba(185, 28, 28, 0.92), rgba(127, 29, 29, 0.95));
  border-color: #f87171;
  color: #fff;
  box-shadow: 0 4px 14px rgba(220, 38, 38, 0.4), 0 0 12px rgba(239, 68, 68, 0.5);
  animation: quickAutoPulse 1.5s infinite ease-in-out;
}
@keyframes quickAutoPulse {
  0%, 100% { transform: scale(1); box-shadow: 0 4px 14px rgba(220, 38, 38, 0.4); }
  50% { transform: scale(1.05); box-shadow: 0 6px 20px rgba(239, 68, 68, 0.7); }
}
.actions button.auto-running {
  border-color: #ffd700 !important;
  box-shadow: 0 0 14px rgba(255, 215, 0, 0.7) !important;
  color: #ffd700 !important;
  animation: autoRunningBtnGlow 1.8s infinite ease-in-out;
}
@keyframes autoRunningBtnGlow {
  0%, 100% { transform: scale(1); box-shadow: 0 0 10px rgba(255, 215, 0, 0.4); }
  50% { transform: scale(1.04); box-shadow: 0 0 18px rgba(255, 215, 0, 0.9); }
}
.quest-tab-content {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  flex: 1;
  min-height: 0;
}
.quest-tab-content[hidden] {
  display: none !important;
}
.quest-status-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: rgba(232, 189, 99, .08);
  border: 1px solid rgba(232, 189, 99, .25);
  border-radius: 12px;
  padding: 8px 14px;
  margin: 12px 0 10px;
  flex-shrink: 0;
}
.quest-countdown {
  font-size: 12.5px;
  color: var(--muted);
}
.quest-countdown strong {
  color: var(--gold);
}
.quest-countdown span {
  font-weight: 700;
  color: #ffd700;
  font-variant-numeric: tabular-nums;
}
.quest-progress-box {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
}
.quest-progress-box strong {
  color: var(--gold);
}
.quest-progress-bar {
  width: 90px;
  height: 8px;
  background: rgba(255, 255, 255, .15);
  border-radius: 99px;
  overflow: hidden;
}
.quest-progress-bar b {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #edc871, #f2d58f);
  border-radius: 99px;
  transition: width .3s ease;
}
.quest-categories {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 6px;
  margin-bottom: 10px;
  flex-shrink: 0;
  scrollbar-width: thin;
}
.cat-chip {
  padding: 5px 11px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(232, 189, 99, .2);
  border-radius: 99px;
  cursor: pointer;
  white-space: nowrap;
  transition: all .15s ease;
}
.cat-chip:hover {
  background: rgba(232, 189, 99, .15);
  color: var(--gold);
}
.cat-chip.active {
  background: rgba(232, 189, 99, .28);
  border-color: var(--gold);
  color: #ffd700;
  font-weight: 700;
}
.quest-list-scroll {
  flex: 1;
  overflow-y: auto;
  padding-right: 4px;
  min-height: 240px;
  max-height: 48vh;
}
.quest-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 10px;
}
.quest-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: rgba(20, 10, 6, .65);
  border: 1px solid rgba(232, 189, 99, .22);
  border-radius: 14px;
  padding: 10px 12px;
  transition: all .18s ease;
}
.quest-card:hover {
  border-color: rgba(232, 189, 99, .45);
  background: rgba(28, 14, 8, .75);
}
.quest-card.completed {
  border-color: #ffd700;
  background: rgba(45, 30, 10, .7);
  box-shadow: 0 0 10px rgba(232, 189, 99, .2);
}
.quest-card.claimed {
  opacity: .62;
  border-color: rgba(255, 255, 255, .1);
}
.quest-card-header {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.quest-check {
  font-size: 15px;
  color: var(--muted);
  flex-shrink: 0;
  line-height: 1.2;
}
.quest-card.completed .quest-check,
.quest-card.claimed .quest-check {
  color: #55e08b;
  font-weight: 700;
}
.quest-title-wrap {
  flex: 1;
  min-width: 0;
}
.quest-card-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.3;
  margin: 0;
}
.quest-badge {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--gold);
  background: rgba(232, 189, 99, .15);
  border: 1px solid rgba(232, 189, 99, .25);
  border-radius: 6px;
  padding: 1px 6px;
  margin-top: 3px;
}
.quest-desc {
  font-size: 12px;
  color: var(--muted);
  margin: 0;
  line-height: 1.35;
}
.quest-progress-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
}
.quest-mini-bar {
  flex: 1;
  height: 6px;
  background: rgba(255, 255, 255, .12);
  border-radius: 99px;
  overflow: hidden;
}
.quest-mini-bar b {
  display: block;
  height: 100%;
  background: var(--gold);
  border-radius: 99px;
  transition: width .2s ease;
}
.quest-progress-num {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}
.quest-reward-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-top: 4px;
  padding-top: 6px;
  border-top: 1px dashed rgba(232, 189, 99, .18);
}
.quest-rewards {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 600;
  color: #ffd700;
}
.quest-rewards span {
  display: flex;
  align-items: center;
  gap: 2px;
}
.quest-btn {
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 700;
  border-radius: 10px;
  cursor: pointer;
  transition: all .15s ease;
  border: none;
}
.quest-btn.action {
  background: rgba(255, 255, 255, .12);
  border: 1px solid rgba(232, 189, 99, .3);
  color: var(--ink);
}
.quest-btn.action:hover {
  background: rgba(232, 189, 99, .25);
  border-color: var(--gold);
}
.quest-btn.claim {
  background: linear-gradient(180deg, #ffd700, #dba02b);
  color: #2c1407;
  border: 1px solid #ffe570;
  box-shadow: 0 0 10px rgba(255, 215, 0, .4);
  animation: pulse-glow 1.5s infinite;
}
@keyframes pulse-glow {
  0%, 100% { transform: scale(1); box-shadow: 0 0 10px rgba(255, 215, 0, .4); }
  50% { transform: scale(1.03); box-shadow: 0 0 16px rgba(255, 215, 0, .7); }
}
.quest-btn.claimed {
  background: transparent;
  color: #55e08b;
  font-weight: 600;
  cursor: default;
  padding: 4px 6px;
}

/* Modal đọc kinh tương tác */
.reading-dialog {
  width: min(520px, calc(100vw - 24px));
  padding: 0;
  border-radius: 20px;
  background: #fdfaf3;
  color: #2c1a0e;
  border: 2px solid #dba02b;
  box-shadow: 0 20px 50px rgba(0, 0, 0, .6);
}
.reading-card {
  position: relative;
  padding: 24px;
}
.reading-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid #d5c4aa;
  background: #fff;
  color: #8c7867;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.reading-close:hover { background: #f3e8d2; color: #3b271b; }
.reading-tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  color: #a46d16;
  background: #faeed4;
  padding: 3px 10px;
  border-radius: 99px;
  margin-bottom: 6px;
}
.reading-header h3 {
  margin: 4px 0 2px;
  font: 700 18px var(--serif);
  color: #3d2311;
}
.reading-sub {
  font-size: 12px;
  color: #877565;
  margin: 0 0 14px;
}
.reading-body {
  background: #fff;
  border: 1px solid #e8dbcb;
  border-radius: 14px;
  padding: 16px;
  line-height: 1.6;
  font-size: 14px;
  color: #3b2618;
  font-family: var(--serif);
  max-height: 40vh;
  overflow-y: auto;
  white-space: pre-line;
}
.reading-footer {
  margin-top: 16px;
  display: flex;
  justify-content: flex-end;
}
.reading-complete-btn {
  background: linear-gradient(180deg, #e3af4f, #c78b27);
  color: #fff;
  border: 0;
  border-radius: 12px;
  padding: 10px 20px;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(199, 139, 39, .35);
}
.reading-complete-btn:hover { background: #b97d1e; }

/* Clickable items on Leaderboard & Offerings */
#levelList li, #meritList li, #offerLog li {
  cursor: pointer;
  border-radius: 6px;
  padding: 3px 6px;
  margin: 1px 0;
  transition: background 0.15s ease, transform 0.1s ease;
}
#levelList li:hover, #meritList li:hover, #offerLog li:hover {
  background: rgba(232, 189, 99, 0.2);
  transform: translateX(2px);
}
#leaderboardBody tr {
  cursor: pointer;
  transition: background 0.15s ease;
}
#leaderboardBody tr:hover {
  background: rgba(232, 189, 99, 0.22) !important;
}

@media (max-width: 1100px) {
  .merit:not([hidden]) { display: block; }
}
@media (max-width: 760px), (pointer: coarse) {
  .joystick { display: block; }
  .hint { display: none; }
}
@media (max-width: 760px) {
  /* --- Top Bar: Profile & System Buttons --- */
  .profile {
    top: 6px;
    left: 6px;
    height: 36px;
    padding: 2px 6px 2px 3px;
    gap: 4px;
    max-width: calc(100vw - 146px);
    width: auto;
    box-sizing: border-box;
  }
  .profile .avatar-box {
    width: 28px;
    height: 28px;
  }
  .profile .name {
    font-size: 11px;
    max-width: 70px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .profile .sub {
    font-size: 8.5px;
    gap: 2px;
  }
  .profile .level-badge {
    padding: 2px 5px;
    font-size: 9.5px;
  }
  .profile .level-badge .lv-num {
    font-size: 10px;
  }

  .top-right {
    top: 6px;
    right: 6px;
    gap: 4px;
  }
  .top-right button {
    width: 30px;
    height: 30px;
  }
  .top-right svg {
    width: 15px;
    height: 15px;
  }

  /* --- Row 2: Feedback & Hall Banner --- */
  .hud-circle-btn-wrap {
    top: 48px;
    left: 8px;
  }
  .hud-circle-btn {
    width: 38px;
    height: 38px;
  }
  .hud-circle-icon-inner {
    font-size: 16px;
  }
  .hud-circle-text {
    font-size: 8.5px;
  }

  .banner {
    top: 48px;
    left: 50%;
    transform: translateX(-50%);
    padding: 3px 14px;
    max-width: calc(100vw - 120px);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .banner h2 {
    font-size: 13.5px;
    line-height: 1.25;
    margin: 0;
  }
  .banner p {
    display: none;
  }

  /* --- Auto Quest HUD Banner on Mobile --- */
  .auto-quest-hud-banner {
    top: 48px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100vw - 110px);
    max-width: 275px;
    padding: 4px 10px;
    border-radius: 99px;
    gap: 6px;
    box-sizing: border-box;
  }
  .auto-pulse-icon {
    font-size: 14px;
    flex: none;
  }
  .auto-hud-info {
    min-width: 0;
    flex: 1;
    overflow: hidden;
  }
  .auto-hud-info strong {
    font-size: 10.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
  }
  .auto-hud-info span {
    font-size: 9.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    color: #e2e8f0;
  }
  .auto-hud-stop-btn {
    padding: 3px 8px;
    font-size: 10px;
    border-radius: 99px;
    flex: none;
  }

  /* --- Notifications & Online count --- */
  .online {
    top: 86px;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 11px;
    padding: 2px 8px;
  }
  .queue-card {
    top: 112px;
    font-size: 11.5px;
    gap: 6px;
    padding-left: 10px;
  }
  .feed {
    top: 140px;
  }

  /* --- Bottom Navigation: Views (Layer 1 - lowest) --- */
  .views {
    bottom: 6px;
    left: 6px;
    right: 6px;
    height: 32px;
    transform: none;
    justify-content: space-between;
    max-width: none;
    padding: 2px;
  }
  .views button {
    padding: 4px 6px;
    font-size: 11px;
  }

  /* --- Bottom Actions: 6 buttons (Layer 2) --- */
  .actions {
    grid-template-columns: repeat(6, 1fr);
    left: 6px;
    right: 6px;
    bottom: 42px;
    height: 50px;
    gap: 4px;
  }
  .actions button {
    height: 48px;
    font-size: 10px;
    border-radius: 10px;
    padding: 3px 2px;
  }
  .actions svg {
    width: 17px;
    height: 17px;
  }

  /* --- Joystick & Chat (Layer 3) --- */
  .joystick {
    left: 8px;
    bottom: 98px;
    width: 94px;
    height: 94px;
  }
  .joystick i {
    left: 27px;
    top: 27px;
    width: 40px;
    height: 40px;
  }

  .chat {
    bottom: 98px;
    left: auto;
    right: 8px;
    width: calc(100vw - 120px);
    max-width: 250px;
    height: 36px;
    min-width: 0;
  }
  .chat input {
    font-size: 11.5px;
    padding: 6px 8px;
  }
  .chat button {
    padding: 0 10px;
    font-size: 11.5px;
  }

  /* --- Quick Auto Button (Layer 4 - above Chat) --- */
  .quick-auto-btn {
    right: 8px;
    bottom: 142px;
    height: 32px;
    padding: 0 10px;
    font-size: 11.5px;
  }

  .niem {
    bottom: 184px;
    left: auto;
    right: 8px;
    width: calc(100vw - 120px);
    max-width: 250px;
    min-width: 0;
  }
  .prompt {
    bottom: 226px;
  }
  .prompt kbd {
    display: none;
  }

  .offer-log {
    display: none !important;
  }
  .merit {
    top: 52px;
    right: 6px;
    width: calc(100vw - 12px);
    max-width: 280px;
  }

  /* --- Task Dialog Mobile --- */
  .quest-dialog {
    width: calc(100vw - 12px) !important;
    max-width: 100vw !important;
    max-height: calc(100dvh - 16px) !important;
    border-radius: 16px !important;
  }
  .quest-dialog-inner {
    padding: 10px 10px 12px !important;
  }
  .quest-title-row {
    position: relative !important;
    padding-right: 34px !important;
    margin-bottom: 8px !important;
  }
  .quest-title-row h3 {
    font-size: 13.5px !important;
    line-height: 1.25 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }
  .quest-dialog-close {
    position: absolute !important;
    right: 0 !important;
    top: -2px !important;
    width: 28px !important;
    height: 28px !important;
    font-size: 14px !important;
  }
  .quest-main-tabs {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 4px !important;
    padding: 3px !important;
  }
  .quest-tab-btn {
    padding: 6px 2px !important;
    font-size: 10.5px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    text-align: center !important;
  }
  .quest-auto-bar {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 6px !important;
    padding: 7px 9px !important;
    margin-top: 6px !important;
  }
  .auto-bar-info {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    width: 100% !important;
  }
  .auto-badge {
    font-size: 10px !important;
    padding: 2px 6px !important;
  }
  .auto-desc {
    font-size: 11px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }
  .auto-bar-actions {
    display: flex !important;
    gap: 6px !important;
    width: 100% !important;
  }
  .auto-mode-select-wrap {
    flex: 1 1 50% !important;
    min-width: 0 !important;
  }
  .auto-mode-select {
    width: 100% !important;
    padding: 5px 6px !important;
    font-size: 11px !important;
    height: 32px !important;
    box-sizing: border-box !important;
  }
  .auto-quest-btn {
    flex: 1 1 50% !important;
    min-width: 0 !important;
    height: 32px !important;
    padding: 0 6px !important;
    font-size: 11px !important;
    justify-content: center !important;
    box-sizing: border-box !important;
  }
  .quest-status-banner {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 4px !important;
    padding: 6px 8px !important;
  }
  .quest-countdown {
    font-size: 11px !important;
    text-align: center !important;
  }
  .quest-progress-box {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 8px !important;
    font-size: 11px !important;
  }
  .quest-progress-bar {
    flex: 1 !important;
    height: 6px !important;
  }
  .quest-categories {
    gap: 4px !important;
    padding-bottom: 4px !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    display: flex !important;
  }
  .quest-cat-pill {
    padding: 4px 8px !important;
    font-size: 10.5px !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
  }
  .items {
    grid-template-columns: repeat(3, 1fr);
  }
  .task-list {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   MÀN HÌNH NIỆM PHẬT & TỤNG KINH VỚI CÁI MÕ (CHUẨN 100% THEO ẢNH MẪU HÌNH 1 & HÌNH 2)
   ========================================================================== */
.chant-overlay {
  position: fixed;
  inset: 0;
  z-index: 150;
  pointer-events: none;
  overflow: hidden;
  animation: chantFadeIn 0.25s ease;
}
.chant-overlay > * {
  pointer-events: auto;
}
.chant-overlay[hidden] {
  display: none !important;
}
@keyframes chantFadeIn {
  from { opacity: 0; transform: scale(1.01); }
  to { opacity: 1; transform: scale(1); }
}
.chant-backdrop {
  position: absolute;
  inset: 0;
  background: transparent;
  pointer-events: none;
}

/* Thông báo nổi trên đầu khi hoàn thành 1 biến kinh (ẩn theo yêu cầu không hiện chữ, chỉ rơi hoa) */
.chant-toast-banner {
  display: none !important;
}
@keyframes chantToastFade {
  from { opacity: 0; transform: translate(-50%, -8px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* ==========================================================================
   KHUNG CÁNH GÀ: NÚT TẮT BÊN TRÁI & CÁI MÕ BÊN PHẢI (CHUẨN ẢNH 2)
   ========================================================================== */
.chant-left-frame {
  position: absolute;
  top: 14px;
  left: 20px;
  z-index: 100;
  pointer-events: auto;
  user-select: none;
}

.chant-right-frame {
  position: absolute;
  bottom: 22px;
  right: 25px;
  width: 290px;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 100;
  pointer-events: auto;
  user-select: none;
  overflow: visible;
}

.chant-side-frame {
  position: absolute;
  top: 14px;
  bottom: 22px;
  left: 20px;
  width: 270px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  z-index: 100;
  pointer-events: auto;
  user-select: none;
}

.chant-frame-top {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0;
  pointer-events: auto;
}

/* Nút Tắt / Rời chiếu tuỳ ý (Ảnh 1) */
.chant-close-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  background: rgba(36, 18, 12, 0.92);
  border: 1.5px solid rgba(240, 186, 84, 0.9);
  border-radius: 999px;
  color: #ffeed0;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  pointer-events: auto;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.65), 0 0 12px rgba(240, 186, 84, 0.35);
  transition: all 0.2s cubic-bezier(0.18, 0.89, 0.32, 1.28);
  user-select: none;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  outline: none;
}
.chant-close-btn .close-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(220, 50, 40, 0.92);
  color: #ffffff;
  font-size: 13px;
  font-weight: 900;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}
.chant-close-btn:hover {
  background: rgba(180, 40, 30, 0.95);
  border-color: #ffd700;
  color: #ffffff;
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.75), 0 0 18px rgba(255, 215, 0, 0.6);
}
.chant-close-btn:active {
  transform: translateY(1px) scale(0.96);
}

.chant-close-x {
  display: none !important;
}

/* Nhóm trung tâm phía trên: Các nút bài kinh & Phụ đề gom gọn gàng lại gần nhau */
.chant-center-top {
  position: absolute;
  top: auto;
  bottom: 226px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  z-index: 100;
  width: 100%;
  max-width: 820px;
  text-align: center;
  pointer-events: none;
}
.chant-pills-bar {
  display: flex;
  gap: 5px;
  align-items: center;
  flex-wrap: nowrap;
  pointer-events: auto;
  transition: opacity 0.2s ease;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x;
  scrollbar-width: none;
  -ms-overflow-style: none;
  width: 100%;
  max-width: 100vw;
  box-sizing: border-box;
  scroll-behavior: smooth;
  scroll-snap-type: x proximity;
  user-select: none;
  -webkit-user-select: none;
  padding: 4px 14px;
  cursor: grab;
}
.chant-pills-bar:active {
  cursor: grabbing;
}
.chant-pills-bar::-webkit-scrollbar {
  display: none;
}
@media (min-width: 720px) {
  .chant-pills-bar {
    justify-content: center;
    overflow-x: visible;
  }
}
@media (max-width: 719px) {
  .chant-pills-bar {
    justify-content: flex-start;
    mask-image: linear-gradient(to right, transparent, black 16px, black calc(100% - 16px), transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, black 16px, black calc(100% - 16px), transparent);
  }
}
.chant-pills-bar.chant-locked {
  pointer-events: none;
  opacity: 0.85;
}
.chant-pills-bar.chant-waiting-mouse .chant-pill {
  animation: pillWaitingPulse 1.6s ease-in-out infinite alternate;
}
@keyframes pillWaitingPulse {
  0% {
    box-shadow: 0 0 4px rgba(232, 189, 99, 0.3);
    transform: translateY(0);
  }
  100% {
    border-color: #ffe066;
    box-shadow: 0 0 14px rgba(255, 215, 0, 0.75);
    transform: translateY(-1.5px);
  }
}
.chant-pill {
  flex-shrink: 0;
  scroll-snap-align: center;
  background: rgba(38, 26, 17, 0.82);
  border: 1px solid rgba(232, 189, 99, 0.35);
  border-radius: 999px;
  padding: 4px 11px;
  color: #ede3d4;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  outline: none;
  -webkit-tap-highlight-color: transparent;
}
.chant-pill:hover {
  background: rgba(232, 189, 99, 0.3);
  border-color: #ffd700;
  color: #ffffff;
}
.chant-pill.active {
  background: #f5ca65;
  border-color: #ffe699;
  color: #1c0e04;
  font-weight: 800;
  box-shadow: 0 0 14px rgba(245, 202, 101, 0.55);
}
.chant-subtitle {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.95);
  margin-top: 3px;
  font-style: normal;
  text-align: center;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9);
  max-width: 92%;
  letter-spacing: 0.25px;
}

.chant-volume-row {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(36, 18, 12, 0.92);
  border: 1.5px solid rgba(240, 186, 84, 0.85);
  border-radius: 999px;
  padding: 0 12px;
  height: 38px;
  box-sizing: border-box;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.65), 0 0 12px rgba(240, 186, 84, 0.25);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  margin: 0;
  position: relative;
  z-index: 100;
  user-select: none;
  pointer-events: auto !important;
  cursor: default;
  transition: all 0.2s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

.chant-volume-row:hover {
  border-color: #ffd700;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.75), 0 0 14px rgba(255, 215, 0, 0.45);
}

.chant-vol-icon {
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  transition: transform 0.15s ease;
  user-select: none;
  pointer-events: auto !important;
  display: flex;
  align-items: center;
  justify-content: center;
}
.chant-vol-icon:hover {
  transform: scale(1.2);
}
.chant-vol-icon:active {
  transform: scale(0.92);
}

.chant-vol-label {
  display: none !important;
}

.chant-vol-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 75px;
  height: 5px;
  border-radius: 99px;
  background: linear-gradient(to right, #ffd700 0%, #ffd700 100%, rgba(255, 235, 170, 0.25) 100%, rgba(255, 235, 170, 0.25) 100%);
  border: 1px solid rgba(245, 195, 75, 0.4);
  cursor: pointer;
  outline: none;
  margin: 0;
  padding: 0;
  touch-action: none;
  pointer-events: auto !important;
  transition: width 0.2s ease;
}

/* Chrome / Safari / Edge / Opera thumb */
.chant-vol-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #ffd700;
  border: 1.5px solid #ffffff;
  box-shadow: 0 0 6px rgba(255, 215, 0, 0.9), 0 1px 4px rgba(0, 0, 0, 0.6);
  cursor: pointer;
  transition: transform 0.12s ease;
  pointer-events: auto !important;
}
.chant-vol-slider::-webkit-slider-thumb:hover,
.chant-vol-slider:active::-webkit-slider-thumb {
  transform: scale(1.25);
  background: #fff066;
  box-shadow: 0 0 10px #ffd700, 0 2px 6px rgba(0, 0, 0, 0.7);
}

/* Firefox thumb */
.chant-vol-slider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #ffd700;
  border: 1.5px solid #ffffff;
  box-shadow: 0 0 6px rgba(255, 215, 0, 0.9), 0 1px 4px rgba(0, 0, 0, 0.6);
  cursor: pointer;
  transition: transform 0.12s ease;
  pointer-events: auto !important;
}
.chant-vol-slider::-moz-range-thumb:hover,
.chant-vol-slider:active::-moz-range-thumb {
  transform: scale(1.25);
  background: #fff066;
}

.chant-vol-val {
  font-size: 11.5px;
  font-weight: 700;
  color: #ffe6a0;
  min-width: 34px;
  text-align: center;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
  user-select: none;
}

.chant-vol-boost-btn {
  background: linear-gradient(135deg, #a85814 0%, #d8962c 100%);
  color: #fff;
  border: 1px solid rgba(255, 230, 150, 0.7);
  border-radius: 99px;
  font-size: 10px;
  font-weight: 800;
  padding: 3px 8px;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  transition: transform 0.15s, filter 0.15s;
  white-space: nowrap;
  pointer-events: auto !important;
  line-height: 1.2;
}

.chant-vol-boost-btn:hover {
  filter: brightness(1.2);
  transform: scale(1.06);
}

.chant-vol-boost-btn:active {
  transform: scale(0.95);
}

/* Nhóm trung tâm phía dưới: Câu kinh chạy Teleprompter & Nút Bắt đầu / Dừng lại */
.chant-center-bottom {
  position: absolute;
  bottom: 50px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  z-index: 200;
  width: 100%;
  max-width: 700px;
  text-align: center;
  pointer-events: none;
}
.chant-lyrics-area {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 6px;
  width: 100%;
  min-height: 98px;
  overflow: hidden;
  user-select: none;
  pointer-events: none;
}
.chant-line {
  transition: all 0.22s cubic-bezier(0.2, 0.8, 0.3, 1);
  line-height: 1.35;
  font-family: var(--serif);
  text-align: center;
  max-width: 95%;
  pointer-events: none;
}
.line-active {
  font-size: 21px;
  font-weight: 800;
  color: #ffd86b;
  text-shadow: 0 0 16px rgba(255, 216, 107, 0.7), 0 2px 4px rgba(0, 0, 0, 0.95);
  letter-spacing: 0.35px;
}
.line-next-1 { font-size: 15px; opacity: 0.8; color: #f0e2cf; }
.line-next-2 { font-size: 13.5px; opacity: 0.52; color: #d2c0aa; }
.line-next-3 { font-size: 12px; opacity: 0.32; color: #a89680; }

/* Nút Bắt đầu tụng kinh */
.chant-start-row {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 3px 0 2px;
  position: relative;
  z-index: 210;
  pointer-events: auto !important;
}
.chant-start-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: linear-gradient(135deg, #f5ca65 0%, #d4982c 100%);
  border: 1.5px solid #ffe699;
  border-radius: 999px;
  padding: 6px 26px;
  color: #1a0f04;
  font-size: 14.5px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45), 0 0 12px rgba(245, 202, 101, 0.45);
  transition: all 0.2s cubic-bezier(0.18, 0.89, 0.32, 1.28);
  outline: none;
  font-family: inherit;
  user-select: none;
  position: relative;
  z-index: 220;
  pointer-events: auto !important;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.chant-start-btn * {
  pointer-events: none !important;
}
.chant-start-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.55), 0 0 16px rgba(255, 220, 120, 0.7);
  background: linear-gradient(135deg, #ffd777 0%, #e5a735 100%);
}
.chant-start-btn:active {
  transform: scale(0.96);
}
.chant-start-btn.is-chanting {
  background: linear-gradient(135deg, #c45b41 0%, #8f2f18 100%);
  border-color: #f7a996;
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45), 0 0 12px rgba(196, 91, 65, 0.4);
}
.chant-start-btn.is-chanting:hover {
  background: linear-gradient(135deg, #d8694d 0%, #a4381e 100%);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.55), 0 0 16px rgba(247, 169, 150, 0.65);
}

/* Cụm Cái Mõ To gấp 3 lần (chuẩn theo ảnh mẫu) đặt trong khung cánh gà */
.chant-wing-mo {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  user-select: none;
  width: 100%;
  margin-bottom: 4px;
  overflow: visible;
}
.chant-mo-assembly {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  pointer-events: auto;
  width: 250px;
  height: 250px;
  overflow: visible;
}
.chant-mo-box {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
  z-index: 2;
  transition: transform 0.08s ease, filter 0.15s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  outline: none;
  line-height: 0;
}
.chant-mo-svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 14px 28px rgba(0, 0, 0, 0.7));
  transition: filter 0.18s ease;
}
.chant-mo-box:active {
  transform: scale(0.96);
}
.chant-mo-assembly.striking .chant-mo-box {
  animation: moBounceStrike 0.22s cubic-bezier(0.2, 0.9, 0.3, 1.25);
}
@keyframes moBounceStrike {
  0% { transform: scale(1) translateY(0); }
  35% { transform: scale(0.98, 1.02) translateY(-3px); }
  70% { transform: scale(1.01, 0.99) translateY(1px); }
  100% { transform: scale(1) translateY(0); }
}

.chant-mo-box:hover .chant-mo-svg {
  filter: drop-shadow(0 0 24px rgba(240, 186, 84, 0.8)) drop-shadow(0 14px 32px rgba(0, 0, 0, 0.8));
}
.chant-mo-assembly.celebrating {
  opacity: 0.55;
  pointer-events: none;
}

/* Que gõ mõ - Đặt thẳng đứng ở dưới hướng lên miệng mõ (chuẩn theo ảnh mẫu) */
.chant-que-box {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
  z-index: 3;
  transform: translateY(0);
  transition: transform 0.12s ease;
  pointer-events: auto;
  line-height: 0;
}
.chant-que-svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.65));
  transition: filter 0.18s ease;
}
.chant-que-box:hover .chant-que-svg {
  filter: drop-shadow(0 0 18px rgba(255, 215, 0, 0.85)) drop-shadow(0 10px 20px rgba(0, 0, 0, 0.65));
}
.chant-mo-assembly.striking .chant-que-box {
  animation: queStrikeVertical 0.22s cubic-bezier(0.2, 0.9, 0.3, 1.25);
}
@keyframes queStrikeVertical {
  0% { transform: translateY(0); }
  35% { transform: translateY(-11px) scale(0.98); }
  70% { transform: translateY(2px) scale(1.01); }
  100% { transform: translateY(0); }
}
.mo-ripple {
  position: absolute;
  top: 15px;
  left: 45px;
  width: 160px;
  height: 120px;
  border-radius: 50%;
  border: 3px solid rgba(255, 215, 0, 0.85);
  opacity: 0;
  pointer-events: none;
}
.mo-ripple.animate {
  animation: moRippleAnim 0.35s ease-out;
}
@keyframes moRippleAnim {
  0% { transform: scale(0.85); opacity: 0.95; }
  100% { transform: scale(1.45); opacity: 0; }
}
.mo-ripple.animate-don {
  animation: moRippleAnimDon 0.25s ease-out;
}
}
@keyframes moRippleAnimDon {
  0% { transform: scale(0.9); opacity: 0.85; }
  100% { transform: scale(1.28); opacity: 0; }
}

/* Ẩn triệt để các mục HUD nền khi đang Niệm Phật tụng kinh */
body.in-chant #views,
body.in-chant .actions,
body.in-chant .top-right,
body.in-chant .chat,
body.in-chant .banner,
body.in-chant #feedbackHubBtnWrap,
body.in-chant .profile {
  opacity: 0 !important;
  pointer-events: none !important;
  visibility: hidden !important;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

@media (max-width: 768px) {
  .chant-left-frame {
    left: 8px;
    top: 8px;
  }
  .chant-right-frame {
    right: 8px;
    bottom: 12px;
    width: auto;
  }
  .chant-side-frame {
    width: auto;
    left: 8px;
    bottom: 12px;
    top: 8px;
  }
  .chant-wing-mo {
    transform: scale(0.65);
    transform-origin: bottom right;
  }
  .chant-close-btn {
    padding: 6px 12px;
    font-size: 12.5px;
  }
}

/* Cột Trái góc đáy: Bộ đếm 0 / 10 và +công đức - Đã ẩn theo yêu cầu người dùng */
.chant-bottom-left {
  display: none !important;
}
.chant-counter-ratio {
  display: flex;
  align-items: baseline;
  gap: 2px;
}
.chant-counter-ratio .curr-num {
  font-size: 32px;
  font-weight: 800;
  color: #ffd86b;
  font-family: var(--font, sans-serif);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
}
.chant-counter-ratio .slash,
.chant-counter-ratio .total-num {
  font-size: 15px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}
.chant-merit-text {
  font-size: 12px;
  font-weight: 700;
  color: #fbd66d;
  margin-top: 3px;
  letter-spacing: 0.2px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
}
.chant-merit-text[hidden] {
  display: none !important;
}

/* Cột Phải góc đáy: Giọng đọc (AI), Mõ tự động, Nhịp (chuẩn như Hình 1) */
.chant-bottom-right {
  position: absolute;
  bottom: 10px;
  right: 18px;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
  user-select: none;
}
.chant-ctrl-row {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: #ffffff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.85);
}
.voice-select-row {
  margin: 1px 0 2px;
}
.chant-voice-select {
  background: rgba(26, 14, 8, 0.85);
  border: 1px solid rgba(232, 189, 99, 0.45);
  border-radius: 6px;
  color: #ffde8a;
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 6px;
  cursor: pointer;
  outline: none;
  max-width: 220px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}
.chant-voice-select:hover {
  border-color: #ffd700;
}
.chant-voice-select option {
  background: #231209;
  color: #ffffff;
}
.chant-chk-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  font-size: 12px;
  color: #ffffff;
  font-weight: 600;
}
.chant-chk-label input[type="checkbox"] {
  accent-color: #0099ff;
  width: 14px;
  height: 14px;
  cursor: pointer;
  margin: 0;
}
.tempo-row {
  display: flex;
  align-items: center;
  gap: 5px;
}
.tempo-label {
  font-size: 11.5px;
  color: #e5d7c3;
}
.chant-tempo-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 75px;
  height: 4px;
  border-radius: 2px;
  background: #0099ff;
  outline: none;
  cursor: pointer;
}
.chant-tempo-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid #007acc;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  cursor: pointer;
}
.chant-tempo-slider::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid #007acc;
  cursor: pointer;
}
.chant-subtip {
  font-size: 10.5px;
  color: #d0c2b0;
  margin-top: 1px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.85);
}

/* ==========================================================================
   HIỆU ỨNG HOA SEN RƠI CÚNG DƯỜNG (RƠI 1 LƯỢT 1S NHANH GỌN, CHUẨN ĐẸP)
   ========================================================================== */
.chant-flower-shower {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 9999;
  pointer-events: none;
  overflow: hidden;
}
.chant-flower-shower[hidden] {
  display: none !important;
}
.flower-petals-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.lotus-petal {
  position: absolute;
  will-change: transform, opacity;
  animation: lotusPetalFall 1.05s linear forwards;
  pointer-events: none;
  user-select: none;
  line-height: 1;
}
@keyframes lotusPetalFall {
  0% {
    transform: translateY(0) translateX(0) rotate(0deg) scale(0.7);
    opacity: 0;
  }
  15% {
    opacity: 1;
    transform: translateY(18vh) translateX(calc(var(--drift, 40px) * 0.35)) rotate(70deg) scale(1.15);
  }
  75% {
    opacity: 0.95;
    transform: translateY(80vh) translateX(calc(var(--drift, 40px) * 0.85)) rotate(var(--rot, 360deg)) scale(1.0);
  }
  100% {
    transform: translateY(105vh) translateX(var(--drift, 40px)) rotate(calc(var(--rot, 360deg) + 60deg)) scale(0.7);
    opacity: 0;
  }
}

/* Hoa sen rơi trực tiếp quanh nhân vật (1 lượt 1s) */
.lotus-petal.targeted {
  position: absolute;
  will-change: transform, opacity;
  animation: lotusPetalFallOnChar 1.05s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
  pointer-events: none;
  user-select: none;
  line-height: 1;
}
@keyframes lotusPetalFallOnChar {
  0% {
    transform: translateY(0) translateX(0) rotate(0deg) scale(0.65);
    opacity: 0;
  }
  15% {
    opacity: 1;
    transform: translateY(calc(var(--char-drop, 260px) * 0.35)) translateX(calc(var(--drift, 0px) * 0.35)) rotate(90deg) scale(1.2);
  }
  75% {
    opacity: 0.95;
    transform: translateY(var(--char-drop, 260px)) translateX(var(--drift, 0px)) rotate(var(--rot, 360deg)) scale(1.0);
  }
  100% {
    transform: translateY(calc(var(--char-drop, 260px) + 70px)) translateX(calc(var(--drift, 0px) + 15px)) rotate(calc(var(--rot, 360deg) + 50deg)) scale(0.6);
    opacity: 0;
  }
}

/* Hào quang hoa sen nở rộ 1s trên nhân vật */
.char-flower-aura {
  position: absolute;
  transform: translate(-50%, -50%);
  font-size: 38px;
  filter: drop-shadow(0 0 16px rgba(255, 215, 0, 0.95)) drop-shadow(0 0 28px rgba(240, 98, 146, 0.85));
  animation: auraPulseBloom 1.05s ease-out forwards;
  pointer-events: none;
  z-index: 10001;
}
@keyframes auraPulseBloom {
  0% { transform: translate(-50%, -50%) scale(0.3); opacity: 0; }
  25% { transform: translate(-50%, -50%) scale(1.35); opacity: 1; }
  75% { transform: translate(-50%, -50%) scale(1.05) translateY(-10px); opacity: 0.9; }
  100% { transform: translate(-50%, -50%) scale(0.6) translateY(-22px); opacity: 0; }
}
.cel-heading {
  font-size: 22px;
  font-weight: 800;
  color: #ffd700;
  letter-spacing: 1px;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.8);
  margin-bottom: 6px;
}
.cel-scr {
  font-size: 15.5px;
  color: #ffffff;
  font-weight: 600;
  margin-bottom: 8px;
}
.cel-reward {
  font-size: 18px;
  font-weight: 800;
  color: #ffde59;
  background: rgba(255, 215, 0, 0.15);
  border: 1px solid rgba(255, 215, 0, 0.4);
  padding: 5px 16px;
  border-radius: 999px;
  display: inline-block;
  margin-bottom: 10px;
  box-shadow: 0 2px 10px rgba(255, 215, 0, 0.3);
}
.cel-desc {
  font-size: 13px;
  color: #fce4ec;
  opacity: 0.9;
  margin-bottom: 8px;
}
.cel-tip {
  font-size: 11.5px;
  color: #d8c2a4;
  font-style: italic;
  opacity: 0.75;
}

@media (max-width: 700px) {
  .chant-container { padding: 16px 12px 16px; }
  .chant-bottom-bar { flex-direction: column; align-items: center; gap: 14px; }
  .chant-bottom-left { text-align: center; max-width: 100%; }
  .chant-bottom-right { align-items: center; max-width: 100%; text-align: center; }
  .line-active { font-size: 21px; }
  .line-next-1 { font-size: 15px; }
}

.chant-counter-row {
  font-size: 13px;
  color: #c4b096;
  margin-top: 4px;
}
.gold-text {
  color: #ffd768;
}

/* Floating badge "+1 Niệm Phật" */
.chant-float-badge {
  position: absolute;
  bottom: 110px;
  font-size: 14px;
  font-weight: 700;
  color: #ffd700;
  background: rgba(30, 15, 6, 0.8);
  border: 1px solid rgba(255, 215, 0, 0.4);
  padding: 4px 10px;
  border-radius: 999px;
  pointer-events: none;
  animation: chantFloatUp 0.8s ease-out forwards;
}
@keyframes chantFloatUp {
  0% { opacity: 1; transform: translateY(0) scale(0.9); }
  100% { opacity: 0; transform: translateY(-40px) scale(1.1); }
}

@media (max-width: 600px) {
  .chant-center-top { bottom: 216px; }
  .chant-center-bottom { bottom: 36px; }
  .chant-pills-bar { gap: 4px; padding: 2px 10px; }
  .chant-pill { padding: 4px 9px; font-size: 11px; }
  .line-active { font-size: 19px; }
  .line-next-1 { font-size: 14.5px; }
  .chant-left-frame { left: 8px; top: 8px; }
  .chant-right-frame { right: 8px; bottom: 10px; width: auto; }
  .chant-side-frame { width: auto; left: 8px; bottom: 10px; top: 8px; }
  .chant-wing-mo { transform: scale(0.62); transform-origin: bottom right; }
  .chant-frame-top { gap: 6px; }
  .chant-close-btn { padding: 5px 12px; font-size: 12px; height: 32px; box-sizing: border-box; }
  .chant-volume-row { height: 32px; padding: 0 8px; gap: 5px; }
  .chant-vol-slider { width: 50px; }
  .chant-vol-val { font-size: 10px; min-width: 26px; }
  .chant-vol-boost-btn { font-size: 9px; padding: 2px 6px; }
}

/* ==========================================================================
   NÚT TRÒN GÓP Ý & GÓP GẠO CÚNG DƯỜNG (THEO ẢNH YÊU CẦU)
   ========================================================================== */
.hud-circle-btn-wrap {
  position: absolute;
  top: 60px;
  left: 12px;
  z-index: 40;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  user-select: none;
  pointer-events: auto;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}
.hud-circle-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #4a2815 0%, #1e0e06 100%);
  border: 2px solid #e8bd63;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.6), 0 0 10px rgba(232, 189, 99, 0.35);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
  padding: 0;
  outline: none;
}
.hud-circle-btn:hover {
  transform: translateY(-2px) scale(1.06);
  border-color: #ffd700;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.7), 0 0 16px rgba(255, 215, 0, 0.6);
}
.hud-circle-btn:active {
  transform: scale(0.94);
}
.hud-circle-icon-inner {
  font-size: 20px;
  line-height: 1;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.6));
}
.hud-circle-text {
  font-size: 10.5px;
  font-weight: 700;
  color: #ffd768;
  letter-spacing: 0.03em;
  text-shadow: 0 1px 3px #000, 0 0 6px rgba(0, 0, 0, 0.9);
  pointer-events: none;
  margin-top: 1px;
}

/* ==========================================================================
   MODAL HỘP THOẠI GÓP Ý & GÓP GẠO THIỆN DUYÊN
   ========================================================================== */
.feedback-modal-dialog {
  max-width: 520px;
  width: 94vw;
  max-height: 90vh;
  background: rgba(26, 12, 7, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1.5px solid #e8bd63;
  border-radius: 18px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.8), 0 0 24px rgba(232, 189, 99, 0.25);
  padding: 0;
  color: var(--ink);
  overflow: hidden;
}
.feedback-modal-dialog form {
  display: flex;
  flex-direction: column;
  max-height: 90vh;
  padding: 16px 20px 20px;
  overflow-y: auto;
  box-sizing: border-box;
}
.fb-modal-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(232, 189, 99, 0.25);
  padding-bottom: 12px;
  margin-bottom: 14px;
}
.fb-modal-title {
  display: flex;
  align-items: center;
  gap: 8px;
}
.fb-icon-title {
  font-size: 24px;
}
.fb-modal-title h3 {
  margin: 0;
  font: 700 18px var(--serif);
  color: var(--gold);
  letter-spacing: 0.02em;
}
.dialog-close {
  background: none;
  border: none;
  color: #cbb292;
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
  padding: 4px 8px;
  border-radius: 8px;
  transition: color 0.15s, background 0.15s;
}
.dialog-close:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

/* Tabs bar */
.fb-tabs-bar {
  display: flex;
  gap: 8px;
  background: rgba(0, 0, 0, 0.35);
  padding: 4px;
  border-radius: 999px;
  border: 1px solid rgba(232, 189, 99, 0.25);
  margin-bottom: 14px;
}
.fb-tab-btn {
  flex: 1;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 600;
  color: #c4b096;
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.18s ease;
}
.fb-tab-btn.active {
  background: linear-gradient(180deg, #edc871 0%, #b88628 100%);
  color: #261106;
  box-shadow: 0 2px 10px rgba(232, 189, 99, 0.4);
}
.tab-emoji {
  font-size: 16px;
}

/* Banner */
.fb-banner-box {
  background: linear-gradient(135deg, rgba(82, 42, 21, 0.6) 0%, rgba(42, 19, 8, 0.8) 100%);
  border: 1px solid rgba(232, 189, 99, 0.3);
  border-radius: 12px;
  padding: 10px 14px;
  margin-bottom: 14px;
}
.fb-banner-main {
  margin: 0 0 3px;
  font-size: 13.5px;
  color: #ffe082;
}
.fb-banner-sub {
  margin: 0;
  font-size: 12px;
  color: #cbb292;
  line-height: 1.4;
}

/* Direct contacts in Feedback modal */
.fb-direct-contacts {
  background: rgba(35, 18, 9, 0.75);
  border: 1px solid rgba(232, 189, 99, 0.35);
  border-radius: 12px;
  padding: 10px 14px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.fb-direct-title {
  font-size: 12px;
  font-weight: 600;
  color: #eed6b6;
  letter-spacing: 0.2px;
  margin: 0;
  white-space: nowrap;
}
.fb-contact-buttons {
  display: flex;
  align-items: center;
  gap: 10px;
}
@media (max-width: 480px) {
  .fb-direct-contacts {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}
.fb-contact-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
  border: 1px solid transparent;
  color: #ffffff !important;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.45);
  box-sizing: border-box;
  flex-shrink: 0;
  padding: 0;
}
.fb-contact-btn:hover {
  transform: translateY(-2px) scale(1.08);
  filter: brightness(1.18);
}
.fb-contact-btn:active {
  transform: translateY(1px) scale(0.96);
}
.fb-contact-btn.btn-phone {
  background: linear-gradient(135deg, #27ae60, #1e8449);
  border-color: rgba(80, 220, 120, 0.5);
}
.fb-contact-btn.btn-phone:hover {
  box-shadow: 0 4px 14px rgba(39, 174, 96, 0.6);
}
.fb-contact-btn.btn-zalo {
  background: linear-gradient(135deg, #0080ff, #0050d0);
  border-color: rgba(100, 180, 255, 0.5);
}
.fb-contact-btn.btn-zalo:hover {
  box-shadow: 0 4px 14px rgba(0, 104, 255, 0.6);
}
.fb-contact-btn.btn-fb {
  background: linear-gradient(135deg, #1877f2, #0d5bbd);
  border-color: rgba(90, 160, 255, 0.5);
}
.fb-contact-btn.btn-fb:hover {
  box-shadow: 0 4px 14px rgba(24, 119, 242, 0.6);
}
.fb-contact-btn.btn-tele {
  background: linear-gradient(135deg, #0088cc, #006699);
  border-color: rgba(100, 200, 255, 0.5);
}
.fb-contact-btn.btn-tele:hover {
  box-shadow: 0 4px 14px rgba(0, 136, 204, 0.65);
}
.fb-contact-btn svg {
  display: block;
  flex-shrink: 0;
}
.fb-contact-btn .phone-ico {
  font-size: 13px;
  display: inline-block;
  animation: phone-wiggle 3s infinite ease-in-out;
}
@keyframes phone-wiggle {
  0%, 85%, 100% { transform: rotate(0); }
  88% { transform: rotate(-15deg); }
  91% { transform: rotate(15deg); }
  94% { transform: rotate(-10deg); }
  97% { transform: rotate(10deg); }
}

/* Section titles */
.fb-section-title {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--gold);
  margin-bottom: 6px;
}

/* Rice presets */
.fb-rice-presets {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  margin-bottom: 12px;
}
.rice-chip {
  background: rgba(45, 23, 12, 0.8);
  border: 1px solid rgba(232, 189, 99, 0.35);
  border-radius: 10px;
  padding: 8px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.rice-chip:hover {
  border-color: #ffd700;
  background: rgba(65, 34, 18, 0.9);
}
.rice-chip.on {
  background: linear-gradient(180deg, #edc871 0%, #b88628 100%);
  border-color: #ffe082;
  box-shadow: 0 2px 10px rgba(232, 189, 99, 0.45);
}
.rice-chip .rice-kg {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
}
.rice-chip.on .rice-kg {
  color: #261106;
}
.rice-chip .rice-cost {
  font-size: 10.5px;
  color: #d1b898;
}
.rice-chip.on .rice-cost {
  color: #3f1e0a;
  font-weight: 600;
}

/* Other row: Viết số tiền để tự động quy đổi thành gạo */
.fb-other-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: rgba(18, 9, 4, 0.7);
  padding: 10px 14px;
  border-radius: 10px;
  border: 1.5px dashed rgba(232, 189, 99, 0.6);
  margin-bottom: 14px;
}
.fb-other-main-line {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.fb-other-main-line label {
  font-size: 13.5px;
  font-weight: 700;
  color: #f7e0b5;
  white-space: nowrap;
}
.rice-input-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.rice-input-wrap input {
  width: 135px;
  padding: 6px 28px 6px 10px;
  background: #120603;
  border: 1.5px solid #d4a74a;
  border-radius: 8px;
  color: #ffffff;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.5px;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.rice-input-wrap input:focus {
  border-color: #ffd700;
  box-shadow: 0 0 8px rgba(255, 215, 0, 0.4), inset 0 2px 4px rgba(0, 0, 0, 0.5);
}
.rice-input-addon {
  position: absolute;
  right: 10px;
  color: #e5b967;
  font-weight: 800;
  font-size: 13px;
  pointer-events: none;
}
.rice-calc-cost {
  color: #ffd700;
  font-weight: 800;
  font-size: 15px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
  white-space: nowrap;
}
.fb-other-sub-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 6px;
  border-top: 1px dashed rgba(232, 189, 99, 0.25);
  font-size: 11.5px;
}
.rice-rate-hint {
  color: #d1b896;
  font-style: italic;
}
.rice-mode-toggle {
  background: rgba(232, 189, 99, 0.15);
  border: 1px solid rgba(232, 189, 99, 0.45);
  color: #ffd700;
  border-radius: 6px;
  padding: 3px 9px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.rice-mode-toggle:hover {
  background: rgba(232, 189, 99, 0.35);
  border-color: #ffd700;
}

/* Field groups */
.fb-field-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 12px;
}
.fb-field-group label {
  font-size: 12.5px;
  font-weight: 600;
  color: #e2c8a2;
}
.fb-field-group input,
.fb-field-group select,
.fb-field-group textarea {
  background: #190a05;
  border: 1px solid rgba(232, 189, 99, 0.4);
  border-radius: 8px;
  padding: 8px 10px;
  font: 13px/1.4 var(--sans);
  color: #fff;
  outline: none;
  transition: border-color 0.15s;
}
.fb-field-group input:focus,
.fb-field-group select:focus,
.fb-field-group textarea:focus {
  border-color: #ffd700;
  box-shadow: 0 0 8px rgba(255, 215, 0, 0.3);
}
.fb-field-group textarea {
  resize: vertical;
  min-height: 75px;
}
.required {
  color: #ff6b6b;
}

/* Methods row */
.fb-methods-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}
.fb-method-radio {
  flex: 1 1 calc(50% - 6px);
  min-width: 140px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(232, 189, 99, 0.25);
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  color: #e2c8a2;
  transition: all 0.2s ease;
  user-select: none;
}
.fb-method-radio:hover {
  background: rgba(232, 189, 99, 0.12);
  border-color: rgba(232, 189, 99, 0.45);
}
.fb-method-radio:has(input[type="radio"]:checked) {
  background: rgba(232, 189, 99, 0.22);
  border-color: #ffd700;
  color: #fff2b2;
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.25);
}
.fb-method-radio input[type="radio"] {
  accent-color: #ffd700;
  cursor: pointer;
  width: 17px;
  height: 17px;
  margin: 0;
  flex-shrink: 0;
}

.bep20-addr-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.bep20-addr-code {
  font-family: monospace;
  font-size: 12px;
  color: #ffd700;
  background: rgba(0, 0, 0, 0.4);
  padding: 3px 6px;
  border-radius: 4px;
  border: 1px solid rgba(255, 215, 0, 0.3);
  word-break: break-all;
  user-select: all;
}
.btn-copy-addr {
  background: linear-gradient(135deg, #d4982c 0%, #b06214 100%);
  color: #ffffff;
  border: 1px solid rgba(255, 230, 150, 0.6);
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  transition: transform 0.15s, filter 0.15s;
}
.btn-copy-addr:hover {
  filter: brightness(1.2);
  transform: scale(1.05);
}
.btn-copy-addr:active {
  transform: scale(0.96);
}
.usdt-hint {
  font-size: 12px;
  color: #8ce3a0;
  font-weight: 500;
  margin-left: 4px;
}

/* Thông báo trừ số dư xu */
.fb-coin-notice {
  background: rgba(232, 189, 99, 0.08);
  border: 1px dashed rgba(232, 189, 99, 0.4);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 14px;
  text-align: center;
}
.fb-coin-notice-title {
  font-size: 15px;
  font-weight: 700;
  color: #ffd700;
  margin-bottom: 6px;
}
.fb-coin-notice-desc {
  font-size: 13px;
  color: #e2c8a2;
  line-height: 1.5;
  margin: 0;
}
.fb-coin-notice-desc strong {
  color: #fff;
}

/* Bank and QR wrap */
.fb-bank-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  background: rgba(18, 10, 5, 0.72);
  border: 1px solid rgba(232, 189, 99, 0.32);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 14px;
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.5), 0 4px 14px rgba(0, 0, 0, 0.4);
}
.fb-qr-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}
.fb-qr-canvas {
  width: 220px;
  height: 220px;
  max-width: min(220px, 68vw);
  max-height: min(220px, 68vw);
  background: #ffffff;
  border-radius: 14px;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6), 0 0 16px rgba(232, 189, 99, 0.3);
  border: 2px solid rgba(232, 189, 99, 0.45);
}
.fb-qr-canvas svg {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  fill: #000000 !important;
  stroke: none !important;
}
.fb-qr-dl-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
  padding: 9px 20px;
  font-size: 13.5px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #a86224 0%, #68340d 100%);
  border: 1px solid rgba(255, 215, 0, 0.6);
  border-radius: 99px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5), 0 0 12px rgba(232, 189, 99, 0.35);
  transition: all 0.2s ease;
  user-select: none;
}
.fb-qr-dl-btn:hover {
  background: linear-gradient(135deg, #c77a30 0%, #7d3f10 100%);
  border-color: #ffd700;
  box-shadow: 0 5px 18px rgba(255, 215, 0, 0.55);
  transform: translateY(-1px);
}
.fb-qr-dl-btn:active {
  transform: translateY(1px);
}
.fb-qr-dl-btn svg,
.dl-icon {
  width: 17px !important;
  height: 17px !important;
  stroke: currentColor !important;
  fill: none !important;
  stroke-width: 2.2 !important;
  flex: none;
}
.fb-qr-tip {
  font-size: 12px;
  color: #dfcca5;
  text-align: center;
  margin-top: 6px;
  font-weight: 500;
  line-height: 1.4;
}
.fb-bank-lines {
  width: 100%;
  box-sizing: border-box;
  background: rgba(0, 0, 0, 0.38);
  border: 1px solid rgba(232, 189, 99, 0.22);
  border-radius: 10px;
  padding: 10px 14px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 14px;
  font-size: 13px;
  margin: 0;
}
.fb-bank-lines dt {
  color: #bfa17d;
  font-weight: 500;
}
.fb-bank-lines dd {
  margin: 0;
  color: #fff;
  font-weight: 600;
  word-break: break-all;
}
.gold-num {
  color: #ffd700 !important;
  font-weight: 700;
  font-size: 14.5px;
}

/* Submit buttons */
.fb-action-row {
  margin: 6px 0 14px;
}
.fb-submit-btn {
  width: 100%;
  padding: 10px 18px;
  border-radius: 10px;
  font: 700 14px var(--sans);
  cursor: pointer;
  transition: all 0.16s ease;
  border: 1px solid transparent;
}
.fb-submit-btn.gao-btn {
  background: linear-gradient(180deg, #edc871 0%, #b88628 100%);
  color: #261106;
  border-color: #ffd768;
  box-shadow: 0 4px 16px rgba(232, 189, 99, 0.45);
}
.fb-submit-btn.gao-btn:hover {
  box-shadow: 0 6px 22px rgba(255, 215, 0, 0.6);
  transform: translateY(-1px);
}
.fb-submit-btn.y-btn {
  background: linear-gradient(180deg, #e5a756 0%, #a6621f 100%);
  color: #1f0d04;
  border-color: #ffc478;
  box-shadow: 0 4px 16px rgba(229, 167, 86, 0.45);
}
.fb-submit-btn.y-btn:hover {
  box-shadow: 0 6px 22px rgba(255, 196, 120, 0.6);
  transform: translateY(-1px);
}

/* Recent contributors list */
.fb-recent-box {
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(232, 189, 99, 0.2);
  border-radius: 10px;
  padding: 10px 12px;
  margin-top: 6px;
}
.fb-recent-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 6px;
}
.fb-recent-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  max-height: 120px;
  overflow-y: auto;
}
.fb-recent-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11.5px;
  color: #cdb48c;
  border-bottom: 1px dashed rgba(232, 189, 99, 0.15);
  padding-bottom: 4px;
}
.fb-recent-item .donor-name {
  color: #fff;
  font-weight: 600;
}
.fb-recent-item .donor-kg {
  color: #ffd700;
  font-weight: 700;
}
.fb-empty-hint {
  font-size: 11.5px;
  color: #9f8668;
  font-style: italic;
  text-align: center;
  padding: 8px 0;
}

@media (max-width: 600px) {
  .hud-circle-btn-wrap {
    top: 50px;
    left: 8px;
  }
  .hud-circle-btn {
    width: 44px;
    height: 44px;
  }
  .hud-circle-icon-inner {
    font-size: 18px;
  }
  .hud-circle-text {
    font-size: 9.5px;
  }
  .fb-rice-presets {
    grid-template-columns: repeat(3, 1fr);
  }
  .fb-bank-wrap {
    flex-direction: column;
    align-items: center;
  }
}
