:root {
    color-scheme: only light;
    forced-color-adjust: none;
    --gold-light: #fff0bd;
    --gold-main: #f5b942;
    --gold-deep: #b87b14;
    --amber-glow: rgba(255, 190, 70, 0.65);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    user-select: none;
    -webkit-user-select: none;
    -webkit-user-drag: none;
}

img, canvas {
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
    user-drag: none;
    pointer-events: none;
}

body, html {
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    background: radial-gradient(circle at center, #1d1308 0%, #070402 100%);
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    color: var(--gold-light);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ================= VIEWPORT WRAPPER ================= */
#viewport-wrapper {
    position: relative;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    box-shadow: 0 0 80px rgba(0, 0, 0, 0.95);
    transition: width 0.55s cubic-bezier(0.22, 1, 0.36, 1),
                height 0.55s cubic-bezier(0.22, 1, 0.36, 1),
                border-radius 0.55s ease;
    background: #0e0904;
}

/* Mặc định ở chế độ TikTok (Mobile/Màn hình dọc): Tràn viền 100% không để viền đen */
#viewport-wrapper.mode-tiktok {
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    border: none;
    border-radius: 0;
    box-shadow: none;
}

/* Khung giả lập viền vàng trang nghiêm chỉ hiển thị khi mở trên Desktop màn hình ngang rộng */
@media (min-width: 901px) and (orientation: landscape) {
    #viewport-wrapper.mode-tiktok {
        width: calc(100vh * 9 / 16);
        height: 96vh;
        border-radius: 22px;
        border: 2px solid rgba(255, 206, 107, 0.45);
        box-shadow: 0 0 60px rgba(255, 175, 45, 0.22), 0 0 120px rgba(0, 0, 0, 0.95);
    }
}

/* ================= CAMERA STAGE (1920x1080) ================= */
#camera-stage {
    position: absolute;
    width: 1920px;
    height: 1080px;
    left: 50%;
    top: 50%;
    transform-origin: center center;
    will-change: transform;
}

.scene-layer {
    position: absolute;
    left: 0;
    top: 0;
    width: 1920px;
    height: 1080px;
    pointer-events: none;
}

/* Layer 1: Background */
#layer-bg {
    z-index: 1;
    background: url('/assets/images/bg.png') center center / cover no-repeat;
    filter: saturate(1.06) contrast(1.03);
}

/* Layer 1b: Volumetric Godrays */
#layer-godrays {
    z-index: 2;
    background:
        radial-gradient(ellipse 65% 55% at 50% 28%, rgba(255, 215, 115, 0.26) 0%, rgba(255, 175, 55, 0.08) 55%, transparent 80%),
        conic-gradient(from 195deg at 52% 12%, transparent 0deg, rgba(255, 224, 130, 0.14) 18deg, transparent 36deg, rgba(255, 215, 120, 0.11) 54deg, transparent 75deg);
    mix-blend-mode: screen;
    animation: pulseRays 7s ease-in-out infinite alternate;
}

@keyframes pulseRays {
    0% { opacity: 0.72; transform: scale(1); }
    100% { opacity: 1; transform: scale(1.03); }
}

/* Layer 2: Halo Canvas */
#halo-canvas {
    z-index: 3;
    mix-blend-mode: screen;
}

/* Layer 3: Shakyamuni Buddha */
#buddha-container {
    position: absolute;
    z-index: 4;
    left: 960px;
    top: 380px;
    width: 470px;
    height: 629px;
    transform: translate(-50%, -50%);
    transform-origin: 50% 85%;
    will-change: transform, filter;
    filter: drop-shadow(0 18px 34px rgba(0, 0, 0, 0.65)) drop-shadow(0 0 28px rgba(255, 195, 70, 0.35));
}

.buddha-img {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
}

#buddha-eyes-closed {
    opacity: 0;
    transition: opacity 0.18s ease-in-out;
}

/* Layer 4: BÀN HƯƠNG ÁN LỄ VẬT (Grand Altar Table) */
#altar-container {
    position: absolute;
    z-index: 6;
    left: 960px;
    top: 642px;
    width: 720px;
    height: 402px;
    transform: translate(-50%, -50%);
    filter: drop-shadow(0 18px 24px rgba(0, 0, 0, 0.8)) drop-shadow(0 0 20px rgba(255, 180, 50, 0.22));
}

#altar-container img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Layer 4b: Scroll Layer (Mặt trước bàn thờ, nằm SAU người quỳ để người che sớ theo phối cảnh 3D) */
#scroll-layer {
    z-index: 7;
    pointer-events: none;
}

/* Layer 5: Worshippers Canvas (Center Mat + 10 Meditation Mats) */
#worshippers-canvas {
    z-index: 8;
}

/* Layer 5b: Nameplates Layer */
#nameplates-layer {
    z-index: 9;
    pointer-events: none;
}

/* SỚ VÀNG CẦU AN - CHIẾU THƯ HOÀNG KIM MỞ 2 BÊN */
.golden-prayer-scroll {
    position: absolute;
    left: 960px;
    top: 705px;
    transform: translate(-50%, -50%) scale(0.92);
    width: 480px;
    height: 176px;
    opacity: 0;
    pointer-events: none;
    z-index: 1;
    clip-path: inset(0 50% 0 50%);
    transition: clip-path 0.75s cubic-bezier(0.22, 1, 0.36, 1),
                transform 0.65s cubic-bezier(0.22, 1, 0.36, 1),
                opacity 0.4s ease;
    color-scheme: only light !important;
    forced-color-adjust: none !important;
}

.golden-prayer-scroll.visible {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
    clip-path: inset(0 0% 0 0%);
}

.golden-prayer-scroll.dissolving {
    opacity: 0;
    transform: translate(-50%, -58%) scale(0.68);
    filter: brightness(2.4) drop-shadow(0 0 38px rgba(255, 225, 95, 0.95));
    transition: all 0.65s cubic-bezier(0.4, 0, 0.2, 1);
}

.scroll-bg-container {
    position: relative;
    width: 100%;
    height: 100%;
    color-scheme: only light !important;
}

.scroll-bg-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    filter: drop-shadow(0 14px 28px rgba(0, 0, 0, 0.85)) drop-shadow(0 0 18px rgba(255, 205, 75, 0.35));
}

.scroll-content-inner {
    position: absolute;
    left: 14%;
    right: 14%;
    top: 16%;
    bottom: 15%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden;
    padding: 0 10px;
    color-scheme: only light !important;
    forced-color-adjust: none !important;
}

.scroll-title {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 2px;
    color: #8b1e0f !important; /* Chữ Sớ Cầu An Công Đức màu nâu đỏ son trang nghiêm */
    -webkit-text-fill-color: #8b1e0f !important;
    text-transform: uppercase;
    margin-top: 0;
    margin-bottom: 2px;
    text-shadow: none !important;
    color-scheme: only light !important;
    forced-color-adjust: none !important;
}

.scroll-donor-name {
    font-size: 18px;
    font-weight: 800;
    color: #000000 !important; /* Tên màu đen tuyền rõ nét trên nền sớ vàng */
    -webkit-text-fill-color: #000000 !important;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 95%;
    text-shadow: none !important;
    color-scheme: only light !important;
    forced-color-adjust: none !important;
}

.scroll-wish {
    font-size: 13px;
    color: #4a2605 !important; /* Lời nguyện màu nâu đầm ấm, tương phản cao */
    -webkit-text-fill-color: #4a2605 !important;
    font-style: italic;
    font-weight: 700;
    line-height: 1.25;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 95%;
    text-shadow: none !important;
    color-scheme: only light !important;
    forced-color-adjust: none !important;
}

.scroll-footer-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 1px;
    color-scheme: only light !important;
    forced-color-adjust: none !important;
}

.scroll-mini-tag {
    font-size: 9.5px;
    font-weight: 700;
    color: #522906 !important;
    -webkit-text-fill-color: #522906 !important;
    background: rgba(255, 235, 175, 0.75) !important;
    border: 0.8px solid rgba(165, 95, 20, 0.45);
    padding: 1px 7px;
    border-radius: 8px;
    color-scheme: only light !important;
    forced-color-adjust: none !important;
}

/* COMPACT SLIM NAME LABEL ON TOP OF HEAD */
.head-name-label {
    position: absolute;
    transform: translate(-50%, -100%);
    background: rgba(18, 11, 4, 0.72);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 205, 90, 0.45);
    border-radius: 14px;
    padding: 2px 8px;
    font-size: 11px;
    color: #ffe8ab;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.6);
    transition: top 0.08s linear, left 0.08s linear, opacity 0.35s ease;
}

.head-name-label.is-center {
    font-size: 12px;
    border-color: #ffd659;
    background: rgba(45, 25, 6, 0.85);
    box-shadow: 0 0 12px rgba(255, 200, 60, 0.4);
}

.head-name-label.is-you {
    background: linear-gradient(135deg, rgba(135, 75, 10, 0.88), rgba(65, 35, 4, 0.92));
    border: 1.5px solid #ffda6a;
    color: #ffffff;
    box-shadow: 0 0 14px rgba(255, 205, 75, 0.65);
    transform: translate(-50%, -100%) scale(1.06);
}

.head-name-label.is-vip {
    border-color: #ffd700;
    color: #fff2b8;
    background: rgba(58, 30, 5, 0.88);
}

.head-name-label.is-top-devotee {
    background: linear-gradient(135deg, rgba(85, 45, 8, 0.9), rgba(150, 85, 12, 0.94));
    border: 1.5px solid #ffda6a;
    color: #ffffff;
    box-shadow: 0 0 12px rgba(255, 205, 75, 0.55);
}

.head-name-label .tag-pts {
    color: #ffd872;
    font-size: 9px;
    font-weight: 500;
    opacity: 0.95;
    margin-left: 2px;
}

/* Layer 6: Particles & Layer 7: Vignette */
#particles-canvas { z-index: 10; }
#layer-vignette {
    z-index: 11;
    background: radial-gradient(ellipse 88% 84% at 50% 48%, transparent 58%, rgba(8, 4, 1, 0.62) 100%);
}

/* ================= 100% PURE TRANSPARENT BOTTOM CORNERS (NO BACKGROUND BOXES, THIN ELEGANT TEXT) ================= */

/* BOTTOM-LEFT: HÀNG ĐỢI THỈNH LỄ (PURE FLOATING TEXT, CANH SÁT MÉP TRÁI) */
#queue-widget {
    position: absolute;
    left: 16px;
    bottom: 16px;
    width: 200px;
    z-index: 30;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    pointer-events: auto;
    text-align: left;
}

#my-queue-status {
    font-size: 9px;
    font-weight: 500;
    color: #ffe6a0;
    line-height: 1.25;
    margin-bottom: 4px;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.95), 0 0 8px rgba(0, 0, 0, 0.85);
    padding-bottom: 2px;
}

#my-queue-status strong {
    color: #ffd872;
    font-weight: 600;
}

#queue-list-container {
    display: flex;
    flex-direction: column;
    gap: 2.5px;
    max-height: 115px;
    overflow-y: hidden;
}

.queue-item {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 4px;
    background: transparent !important;
    border: none !important;
    padding: 0;
    font-size: 8px;
    font-weight: 300;
    line-height: 1.25;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.95);
    color: rgba(255, 246, 225, 0.82);
}

.queue-rank {
    font-weight: 600;
    font-size: 8px;
    color: #ffca57;
    width: 13px;
    flex-shrink: 0;
}

.queue-name {
    font-weight: 400;
    font-size: 8px;
    color: #fff9e6;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 86px;
}

.queue-pts {
    font-size: 7.5px;
    font-weight: 600;
    color: #ffd872;
    margin-left: auto;
    flex-shrink: 0;
    opacity: 0.92;
}

.pts-pill {
    background: rgba(185, 115, 20, 0.45);
    border: 1px solid rgba(255, 215, 100, 0.4);
    color: #ffe699;
    padding: 0.5px 3px;
    border-radius: 3px;
    font-size: 7.5px;
    font-weight: 600;
    margin-left: 2px;
}

.queue-item.is-you .queue-name {
    color: #ffe07a;
    font-weight: 600;
}

.queue-source {
    font-size: 7.5px;
    color: rgba(255, 220, 130, 0.7);
    margin-left: 2px;
    flex-shrink: 0;
}

/* BOTTOM-RIGHT: ĐẠO TRÀNG LIVE CHAT & FORM (CANH SÁT MÉP PHẢI, TEXT MỎNG) */
#chat-widget {
    position: absolute;
    right: 16px;
    bottom: 16px;
    width: 320px;
    z-index: 30;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    pointer-events: auto;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

#chat-feed {
    max-height: 125px;
    overflow-y: hidden;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: flex-end;
    gap: 3px;
    margin-bottom: 8px;
    width: 100%;
}

.chat-bubble {
    font-size: 10.5px;
    font-weight: 300;
    line-height: 1.35;
    padding: 1px 0;
    background: transparent !important;
    border: none !important;
    text-align: right;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.95);
    color: rgba(255, 248, 235, 0.88);
    word-break: break-word;
}

.chat-user-name {
    font-weight: 600;
    color: #ffdf85;
    font-size: 10.5px;
    margin-right: 4px;
}

.chat-source-tag {
    font-size: 9px;
    color: #c9ad7d;
    margin-right: 4px;
}

.chat-msg-text {
    color: #fffaf0;
    font-weight: 300;
}

.chat-bubble.is-wish .chat-msg-text {
    color: #ffe59c;
}

.chat-bubble.is-wish .chat-msg-text strong {
    color: #ffd872;
    font-weight: 500;
}

/* PRAYER MODAL POPUP (Overlay & Card) */
.prayer-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(8, 4, 1, 0.72);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    transition: opacity 0.25s ease, visibility 0.25s ease;
    padding: 16px;
}

.prayer-modal-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.prayer-modal-card {
    position: relative;
    width: 100%;
    max-width: 350px;
    background: linear-gradient(145deg, rgba(32, 19, 7, 0.96), rgba(16, 9, 3, 0.98));
    border: 1px solid rgba(255, 215, 110, 0.55);
    border-radius: 14px;
    padding: 20px 22px;
    box-shadow: 0 16px 45px rgba(0, 0, 0, 0.85), 0 0 25px rgba(255, 200, 60, 0.2);
    text-align: center;
    color: #fff6db;
    animation: modalPopIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalPopIn {
    0% { transform: scale(0.92); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.modal-close-btn {
    position: absolute;
    top: 10px;
    right: 12px;
    background: transparent;
    border: none;
    color: rgba(255, 220, 140, 0.65);
    font-size: 16px;
    cursor: pointer;
    line-height: 1;
    padding: 4px;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.modal-close-btn:hover {
    color: #ffd872;
    background: rgba(255, 200, 60, 0.2);
}

.modal-header {
    margin-bottom: 14px;
}

.modal-lotus-icon {
    font-size: 24px;
    display: inline-block;
    margin-bottom: 4px;
    filter: drop-shadow(0 0 8px rgba(255, 215, 110, 0.7));
}

.modal-title {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: #ffe8a3;
    letter-spacing: 0.5px;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.7);
}

.modal-subtitle {
    margin: 4px 0 0;
    font-size: 10.5px;
    color: rgba(255, 235, 190, 0.7);
    font-weight: 300;
}

.modal-body {
    display: flex;
    flex-direction: column;
    gap: 11px;
    text-align: left;
}

.modal-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.modal-label {
    font-size: 11px;
    font-weight: 500;
    color: #ffd872;
}

.gender-selector {
    display: flex;
    gap: 6px;
    align-items: center;
}

.gender-pill {
    background: rgba(22, 12, 5, 0.65);
    border: 1px solid rgba(255, 205, 90, 0.35);
    border-radius: 12px;
    padding: 4px 12px;
    color: rgba(255, 235, 185, 0.75);
    font-size: 10.5px;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.2s ease;
    outline: none;
    line-height: 1.2;
}

.gender-pill:hover {
    border-color: #ffd872;
    color: #fff9e6;
}

.gender-pill.active {
    background: linear-gradient(135deg, rgba(195, 115, 15, 0.85), rgba(135, 70, 10, 0.9));
    border-color: #ffd872;
    color: #ffffff;
    font-weight: 600;
    box-shadow: 0 0 8px rgba(255, 195, 60, 0.45);
}

.name-input-wrapper {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
}

.modal-field input[type="text"] {
    width: 100%;
    box-sizing: border-box;
    background: rgba(14, 8, 3, 0.7);
    border: 1px solid rgba(255, 205, 90, 0.45);
    border-radius: 6px;
    padding: 7px 10px;
    color: #fff6db;
    font-size: 11px;
    outline: none;
    box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.6);
    transition: border-color 0.2s ease;
}

.modal-field input[type="text"]:focus {
    border-color: #ffd75e;
    box-shadow: 0 0 8px rgba(255, 215, 100, 0.35);
}

.modal-field .name-input-wrapper input[type="text"] {
    padding-right: 28px;
}

.clear-btn {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: rgba(255, 220, 130, 0.65);
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.clear-btn:hover {
    color: #ffffff;
    background: rgba(255, 200, 60, 0.35);
}

.clear-btn.hidden {
    display: none;
}

.modal-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 6px;
}

.btn-modal-submit {
    background: linear-gradient(135deg, #d98a16 0%, #8f4f05 100%);
    border: 1px solid #ffd872;
    color: #fff8e0;
    font-size: 12px;
    font-weight: 600;
    padding: 8px 14px;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.6), 0 0 10px rgba(255, 195, 60, 0.3);
    transition: all 0.2s ease;
}

.btn-modal-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.7), 0 0 16px rgba(255, 215, 100, 0.5);
    border-color: #fff0b8;
}

.btn-modal-skip {
    background: transparent;
    border: none;
    color: rgba(255, 230, 170, 0.65);
    font-size: 11px;
    cursor: pointer;
    padding: 4px;
    transition: color 0.2s ease;
    text-align: center;
}

.btn-modal-skip:hover {
    color: #ffd872;
    text-decoration: underline;
}

/* BONG BÓNG LỜI NGUYỆN GỌN GÀNG TRONG CHAT WIDGET */
.prayer-bubble-btn {
    display: none;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, rgba(32, 18, 6, 0.9), rgba(18, 9, 3, 0.95));
    border: 1px solid rgba(255, 215, 110, 0.55);
    border-radius: 20px;
    padding: 5px 12px;
    color: #fff6db;
    font-size: 10.5px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.65), 0 0 10px rgba(255, 200, 60, 0.3);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    animation: bubbleGlow 3s infinite ease-in-out;
}

.prayer-bubble-btn.is-visible {
    display: inline-flex !important;
}

.prayer-bubble-btn:hover {
    transform: scale(1.06);
    border-color: #ffd872;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.8), 0 0 16px rgba(255, 215, 100, 0.55);
}

.bubble-icon {
    font-size: 13px;
    filter: drop-shadow(0 0 4px rgba(255, 200, 60, 0.7));
}

.bubble-text {
    letter-spacing: 0.3px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

@keyframes bubbleGlow {
    0%, 100% {
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.65), 0 0 8px rgba(255, 200, 60, 0.25);
        border-color: rgba(255, 215, 110, 0.5);
    }
    50% {
        box-shadow: 0 4px 18px rgba(0, 0, 0, 0.75), 0 0 16px rgba(255, 215, 100, 0.55);
        border-color: rgba(255, 230, 140, 0.85);
    }
}

/* SPECIFIC RESPONSIVE OVERRIDES FOR TIKTOK 9:16 VERTICAL (TRÁNH CHỒNG ĐÈ TRUNG TÂM) */
#viewport-wrapper.mode-tiktok #queue-widget {
    left: 8px;
    bottom: 12px;
    width: 125px;
    max-width: 125px;
}

#viewport-wrapper.mode-tiktok #my-queue-status {
    font-size: 8px;
    line-height: 1.2;
}

#viewport-wrapper.mode-tiktok .queue-item {
    font-size: 7.5px;
    gap: 3px;
}

#viewport-wrapper.mode-tiktok .queue-rank {
    font-size: 7.5px;
    width: 11px;
}

#viewport-wrapper.mode-tiktok #queue-widget .queue-name {
    font-size: 7.5px;
    max-width: 78px;
}

/* KHÔNG HIỂN THỊ ĐIỂM SỐ TRÊN MOBI / TIKTOK ĐỂ GỌN GÀNG, KHÔNG RỐI MẮT */
#viewport-wrapper.mode-tiktok #queue-widget .queue-pts,
#viewport-wrapper.mode-tiktok #queue-widget .pts-pill {
    display: none !important;
}

@media (max-width: 768px) {
    #queue-widget .queue-pts,
    #queue-widget .pts-pill {
        display: none !important;
    }
}

#viewport-wrapper.mode-tiktok #chat-widget {
    right: 8px;
    bottom: 12px;
    width: 175px;
    max-width: 175px;
}

#viewport-wrapper.mode-tiktok #chat-widget #chat-feed {
    max-height: 80px;
}

#viewport-wrapper.mode-tiktok .prayer-bubble-btn {
    padding: 4px 10px;
    font-size: 9.5px;
    border-radius: 16px;
}

#viewport-wrapper.mode-tiktok .prayer-modal-card {
    max-width: 295px;
    padding: 16px 18px;
}

#viewport-wrapper.mode-tiktok .modal-title {
    font-size: 14.5px;
}

#viewport-wrapper.mode-tiktok .modal-field input[type="text"] {
    font-size: 10.5px;
    padding: 6px 8px;
}

#viewport-wrapper.mode-tiktok .btn-modal-submit {
    font-size: 11px;
    padding: 7px 12px;
}

/* NÚT BẬT/TẮT NHẠC Ở GIAO DIỆN 9:16 (TIKTOK/MOBILE): NHỎ GỌN, BỎ CHỮ 'NHẠC THIỀN' */
#viewport-wrapper.mode-tiktok .quick-audio-btn {
    top: 10px;
    right: 10px;
    padding: 3.5px 8px;
    font-size: 10px;
    font-weight: 700;
    border-radius: 14px;
    gap: 3px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.7);
}

#viewport-wrapper.mode-tiktok .quick-audio-btn .audio-btn-icon {
    font-size: 11px;
}

#viewport-wrapper.mode-tiktok .quick-audio-btn .audio-btn-prefix {
    display: none !important;
}

#viewport-wrapper.mode-tiktok .audio-track-ticker {
    top: 33px;
    right: 10px;
    width: 150px;
    height: 18px;
}

#viewport-wrapper.mode-tiktok .audio-track-ticker .ticker-scroll-text {
    font-size: 9.5px;
}

/* QUICK AUDIO TOGGLE BUTTON */
.quick-audio-btn {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 40;
    background: linear-gradient(135deg, rgba(168, 102, 16, 0.95) 0%, rgba(92, 50, 6, 0.96) 100%);
    border: 1.5px solid #ffd872;
    color: #fffbe6;
    padding: 6px 14px;
    border-radius: 22px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.3px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.8), 0 0 14px rgba(255, 210, 85, 0.55);
    transition: all 0.25s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.quick-audio-btn:hover {
    border-color: #ffffff;
    background: linear-gradient(135deg, rgba(212, 134, 24, 0.98) 0%, rgba(128, 72, 10, 0.98) 100%);
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.85), 0 0 20px rgba(255, 220, 110, 0.8);
    transform: scale(1.05);
}

.quick-audio-btn.muted {
    opacity: 1;
    filter: none;
    background: linear-gradient(135deg, rgba(48, 28, 10, 0.94) 0%, rgba(28, 16, 5, 0.96) 100%);
    border: 1.5px solid #ffaa44;
    color: #ffe299;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.8), 0 0 10px rgba(255, 170, 68, 0.45);
}

.quick-audio-btn.need-click {
    background: linear-gradient(135deg, rgba(220, 130, 20, 0.98) 0%, rgba(140, 60, 6, 0.98) 100%) !important;
    border: 2px solid #ffffff !important;
    color: #ffffff !important;
    animation: pulse-audio-cta 1.6s ease-in-out infinite !important;
}

@keyframes pulse-audio-cta {
    0% {
        transform: scale(1);
        box-shadow: 0 0 10px rgba(255, 215, 0, 0.7);
    }
    50% {
        transform: scale(1.08);
        box-shadow: 0 0 24px rgba(255, 215, 0, 1), 0 4px 16px rgba(0, 0, 0, 0.9);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 10px rgba(255, 215, 0, 0.7);
    }
}

/* MARQUEE TICKER: TÊN BÀI HÁT ĐANG PHÁT (KHÔNG LÀM BACKGROUND) */
.audio-track-ticker {
    position: absolute;
    top: 48px;
    right: 14px;
    z-index: 40;
    width: 240px;
    max-width: calc(100vw - 28px);
    height: 22px;
    background: transparent !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border: none !important;
    box-shadow: none !important;
    display: flex;
    align-items: center;
    padding: 0;
    gap: 5px;
    overflow: hidden;
    pointer-events: none;
}

.audio-track-ticker .ticker-disc-icon {
    font-size: 12px;
    color: #ffd872;
    flex-shrink: 0;
    display: inline-block;
    animation: spin-wheel 10s linear infinite;
    line-height: 1;
    filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.95));
}

.audio-track-ticker .ticker-content-box {
    flex: 1;
    overflow: hidden;
    white-space: nowrap;
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
    mask-image: linear-gradient(to right, transparent, black 6px, black calc(100% - 6px), transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, black 6px, black calc(100% - 6px), transparent);
}

.audio-track-ticker .ticker-scroll-text {
    display: inline-block;
    font-size: 11.5px;
    font-weight: 600;
    color: #fff6d6;
    letter-spacing: 0.2px;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.98), 0 0 8px rgba(0, 0, 0, 0.9);
    padding-left: 100%;
    animation: ticker-scroll 16s linear infinite;
}

.audio-track-ticker.muted {
    display: none !important;
}

@keyframes ticker-scroll {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-100%);
    }
}

@keyframes spin-wheel {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

#blessing-toast {
    display: none !important;
}

/* DIRECTOR CONTROL PANEL */
#director-panel {
    position: fixed;
    right: 18px;
    top: 18px;
    width: 320px;
    max-height: calc(100vh - 36px);
    overflow-y: auto;
    background: rgba(18, 12, 6, 0.92);
    backdrop-filter: blur(14px);
    border: 1px solid rgba(245, 185, 66, 0.35);
    border-radius: 14px;
    padding: 14px;
    z-index: 100;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.85);
    transition: transform 0.35s ease, opacity 0.35s ease;
}

#director-panel.hidden {
    transform: translateX(360px);
    opacity: 0;
    pointer-events: none;
}

#toggle-panel-btn {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 101;
    background: rgba(28, 18, 8, 0.85);
    border: 1px solid var(--gold-main);
    color: var(--gold-light);
    padding: 7px 12px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 11.5px;
    font-weight: 600;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.7);
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(245, 185, 66, 0.25);
    padding-bottom: 8px;
    margin-bottom: 10px;
}

.panel-header h3 { font-size: 14px; color: #ffd875; }
.section-title {
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #c99b49;
    margin: 10px 0 5px 0;
    font-weight: 700;
}

.btn-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

.btn {
    background: linear-gradient(180deg, rgba(68, 44, 14, 0.9) 0%, rgba(38, 24, 7, 0.95) 100%);
    border: 1px solid rgba(245, 185, 66, 0.42);
    color: #ffeaad;
    padding: 6px 8px;
    border-radius: 7px;
    font-size: 11.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.18s ease;
    text-align: center;
}

.btn:hover {
    background: linear-gradient(180deg, rgba(105, 68, 20, 0.95) 0%, rgba(58, 36, 10, 0.98) 100%);
    border-color: #ffd269;
    transform: translateY(-1px);
}

.btn.active {
    background: linear-gradient(180deg, #e09b22 0%, #9c6209 100%);
    color: #fff;
    border-color: #fff0b8;
    box-shadow: 0 0 12px rgba(245, 185, 66, 0.55);
}

.btn.full-width { grid-column: span 2; }
.btn.primary-action {
    background: linear-gradient(135deg, #d98a16 0%, #8f4f05 100%);
    border-color: #ffda7b;
    color: #fff8e0;
}

.slider-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-size: 11.5px;
    margin: 5px 0;
    color: #e6c88a;
}

.slider-row input[type="range"] {
    flex: 1;
    accent-color: #f5b942;
    cursor: pointer;
}

.bgm-select {
    background: rgba(30, 18, 5, 0.9);
    border: 1px solid rgba(255, 205, 90, 0.5);
    color: #ffe6aa;
    border-radius: 5px;
    padding: 3px 6px;
    font-size: 11px;
    outline: none;
    max-width: 175px;
    cursor: pointer;
}

.bgm-select option {
    background: #241407;
    color: #ffe8b5;
}
