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

body {
    background: #000;
    overflow: hidden;
    width: 100vw;
    height: 100vh;
    font-family: 'Segoe UI', system-ui, sans-serif;
    color: #fff;
}

/* ---- Background video ---- */
#bg-video {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    object-fit: cover;
    z-index: 0;
}

#vignette {
    position: fixed;
    inset: 0;
    z-index: 1;
    background:
        radial-gradient(ellipse at center, transparent 30%, rgba(0,0,0,0.55) 100%),
        linear-gradient(to bottom, rgba(0,0,0,0.5) 0%, transparent 20%, transparent 70%, rgba(0,0,0,0.75) 100%);
    pointer-events: none;
}

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

/* ---- Top bar ---- */
#top-bar {
    position: absolute;
    top: 0; left: 0; right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 24px 14px;
}

#logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    font-weight: 700;
    text-shadow: 0 2px 8px rgba(0,0,0,0.9);
}

.logo-icon {
    color: #f0c040;
    font-size: 22px;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%       { opacity: 0.6; transform: scale(0.9); }
}

#volume-control {
    position: relative;
    display: flex;
    align-items: center;
    gap: 7px;
    height: 28px;
    pointer-events: all;
}

#mute-btn {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.18);
    color: #fff;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, border-color 0.15s;
    flex-shrink: 0;
}

#mute-btn:hover {
    background: rgba(255,255,255,0.2);
    border-color: rgba(255,255,255,0.28);
}

#mute-btn.muted {
    background: rgba(255,255,255,0.06);
    border-color: rgba(255,255,255,0.1);
    opacity: 0.45;
}

#mute-icon { display: block; pointer-events: none; }

#volume-slider-wrap {
    width: 0;
    opacity: 0;
    overflow: hidden;
    display: flex;
    align-items: center;
    transition: width 0.18s ease, opacity 0.15s ease;
}

#volume-control:hover #volume-slider-wrap {
    width: 92px;
    opacity: 1;
}

@media (hover: none) {
    #volume-control:focus-within #mute-btn {
        background: rgba(255,255,255,0.2);
        border-color: rgba(255,255,255,0.28);
    }

    #volume-control:focus-within #volume-slider-wrap {
        width: 92px;
        opacity: 1;
    }
}

#volume-slider {
    appearance: none;
    -webkit-appearance: none;
    display: block;
    width: 92px;
    height: 18px;
    margin: 0;
    padding: 0;
    background: transparent;
    accent-color: #f0c040;
    cursor: pointer;
}

#volume-slider::-webkit-slider-runnable-track {
    height: 4px;
    border-radius: 999px;
    background: rgba(255,255,255,0.22);
}

#volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    margin-top: -5px;
    border-radius: 50%;
    background: #f0c040;
    border: 2px solid rgba(0,0,0,0.55);
}

#volume-slider::-moz-range-track {
    height: 4px;
    border-radius: 999px;
    background: rgba(255,255,255,0.22);
}

#volume-slider::-moz-range-progress {
    height: 4px;
    border-radius: 999px;
    background: #f0c040;
}

#volume-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #f0c040;
    border: 2px solid rgba(0,0,0,0.55);
    box-sizing: border-box;
}

#live-badge {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 2px;
    color: #fff;
    background: #e53e3e;
    padding: 3px 8px;
    border-radius: 4px;
    animation: blink 2s step-end infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.4; }
}

/* ---- Top right area ---- */
#top-right {
    display: flex;
    align-items: center;
    gap: 12px;
    pointer-events: all;
}

.stat-pill {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 10px;
    padding: 6px 14px;
    min-width: 90px;
}

.stat-label {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.5);
}

.stat-value {
    font-size: 16px;
    font-weight: 700;
    color: #f0c040;
    margin-top: 1px;
}

/* ---- Request button ---- */
#request-btn {
    background: linear-gradient(135deg, #f0c040, #e88020);
    color: #000;
    border: none;
    border-radius: 24px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    letter-spacing: 0.3px;
    box-shadow: 0 4px 16px rgba(240,192,64,0.4);
    transition: transform 0.15s, box-shadow 0.15s;
}

#request-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(240,192,64,0.55);
}

#request-btn:active { transform: translateY(0); }

/* ---- Queue panel (right side) ---- */
/* Height = header(38) + 10×item(46) + pagination(36) = 534px */
#queue-panel {
    position: absolute;
    right: 22px;
    top: 88px;
    width: 256px;
    height: calc(38px + 10 * 46px + 36px); /* = 534px */
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 14px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    pointer-events: all; /* needed: parent #overlay has pointer-events:none */
}

#queue-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px 10px 16px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 2.5px;
    color: rgba(255,255,255,0.45);
    border-bottom: 1px solid rgba(255,255,255,0.08);
    flex-shrink: 0;
    height: 38px;
}

#queue-page-info {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0;
    color: rgba(255,255,255,0.35);
}

#queue-list {
    flex: 1;
    overflow: hidden;
    list-style: none;
    padding: 0;
}

/* Pagination bar */
#queue-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 8px;
    height: 36px;
    border-top: 1px solid rgba(255,255,255,0.08);
    flex-shrink: 0;
}

.page-btn {
    background: none;
    border: 1px solid rgba(255,255,255,0.15);
    color: rgba(255,255,255,0.55);
    border-radius: 6px;
    width: 28px;
    height: 24px;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.15s, color 0.15s, background 0.15s;
    line-height: 1;
}

.page-btn:hover:not(:disabled) {
    border-color: #f0c040;
    color: #f0c040;
    background: rgba(240,192,64,0.08);
}

.page-btn:disabled {
    opacity: 0.2;
    cursor: default;
}

/* Normal queue item — fixed height so 10 items fill exactly the list area */
.queue-item {
    height: 46px;
    padding: 0 16px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    animation: slideDown 0.3s ease;
}

.queue-item:last-child { border-bottom: none; }

/* Paid song flash — pops when a real payment arrives */
.queue-item {
    position: relative;
    overflow: hidden;
}

.queue-item.paid-flash {
    animation: paidSlide 0.5s cubic-bezier(0.22,1,0.36,1) forwards;
}

.queue-item.paid-flash::after {
    content: '';
    position: absolute;
    top: 0; left: -80%;
    width: 60%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(240,192,64,0.35), transparent);
    animation: shimmer 0.7s ease 0.15s forwards;
    pointer-events: none;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes paidSlide {
    0%   { opacity: 0; transform: translateX(-18px); background: rgba(240,192,64,0.0); }
    30%  { background: rgba(240,192,64,0.3); }
    100% { opacity: 1; transform: translateX(0);    background: rgba(240,192,64,0.0); }
}

@keyframes shimmer {
    to { left: 120%; }
}

.queue-item.first-item .q-title { color: #f0c040; }

.q-genre {
    display: inline-block;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #f0c040;
    background: rgba(240,192,64,0.15);
    border-radius: 4px;
    padding: 1px 5px;
    margin-right: 5px;
}

.q-title {
    font-size: 13px;
    font-weight: 500;
    color: rgba(255,255,255,0.9);
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.q-donor {
    font-size: 11px;
    color: rgba(255,255,255,0.45);
    margin-top: 2px;
    display: block;
}

.queue-empty {
    padding: 20px 16px;
    font-size: 12px;
    color: rgba(255,255,255,0.35);
    text-align: center;
}

/* ---- Now playing bar (bottom) ---- */
#now-playing-bar {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    padding: 10px 24px 20px;
}

#now-playing-label {
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 3px;
    color: rgba(255,255,255,0.45);
    margin-bottom: 4px;
}

#now-playing-text {
    font-size: 20px;
    font-weight: 600;
    text-shadow: 0 2px 6px rgba(0,0,0,0.9);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 65vw;
}

#now-playing-text.changing {
    animation: textChange 0.4s ease;
}

@keyframes textChange {
    0%   { opacity: 0; transform: translateY(6px); }
    100% { opacity: 1; transform: translateY(0); }
}

#progress-wrap {
    margin-top: 8px;
    width: min(65vw, 700px);
    height: 3px;
    background: rgba(255,255,255,0.18);
    border-radius: 2px;
    overflow: hidden;
}

#progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #f0c040, #ff6b6b);
    border-radius: 2px;
    transition: width 1s linear;
}

.np-genre {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #f0c040;
    background: rgba(240,192,64,0.18);
    border-radius: 5px;
    padding: 2px 7px;
    margin-right: 8px;
    vertical-align: middle;
}

/* ---- Start hint (autoplay blocked) ---- */
#start-hint {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 50;
    background: rgba(0,0,0,0.75);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 30px;
    padding: 10px 22px;
    font-size: 14px;
    font-weight: 600;
    color: #f0c040;
    pointer-events: none;
    animation: hintPulse 2s ease-in-out infinite;
}

@keyframes hintPulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.5; }
}

/* ---- Connection status dot ---- */
#conn-dot {
    position: fixed;
    bottom: 14px;
    right: 16px;
    z-index: 20;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #48bb78;
    box-shadow: 0 0 6px #48bb78;
    transition: background 0.4s, box-shadow 0.4s;
}

#conn-dot.disconnected {
    background: #e53e3e;
    box-shadow: 0 0 6px #e53e3e;
}

/* ========================================
   REQUEST SONGS PANEL
   ======================================== */

#panel-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 90;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
}

#panel-backdrop.open { display: block; }

#request-panel {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%) translateY(100%);
    z-index: 100;
    width: min(520px, 96vw);
    max-height: 88vh;
    background: #141414;
    border-radius: 20px 20px 0 0;
    border: 1px solid rgba(255,255,255,0.12);
    border-bottom: none;
    display: flex;
    flex-direction: column;
    transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
    overflow: hidden;
}

#request-panel.open {
    transform: translateX(-50%) translateY(0);
}

#panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 20px 14px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    flex-shrink: 0;
}

#panel-title {
    font-size: 17px;
    font-weight: 700;
    color: #f0c040;
}

#panel-close {
    background: rgba(255,255,255,0.08);
    border: none;
    color: rgba(255,255,255,0.6);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
}

#panel-close:hover { background: rgba(255,255,255,0.15); color: #fff; }

#panel-body {
    overflow-y: auto;
    padding: 0 0 8px;
    flex: 1;
}

#panel-body::-webkit-scrollbar { width: 4px; }
#panel-body::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.15);
    border-radius: 2px;
}

.panel-section {
    padding: 16px 20px 8px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.panel-section:last-child { border-bottom: none; }

.panel-section-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 2px;
    color: rgba(255,255,255,0.4);
    margin-bottom: 10px;
    text-transform: uppercase;
}

/* Background thumbnails */
.bg-grid {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
}

.bg-grid::-webkit-scrollbar { display: none; }

.bg-thumb {
    position: relative;
    width: 80px;
    height: 50px;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid transparent;
    cursor: pointer;
    flex-shrink: 0;
    background: #2a2a2a;
    transition: border-color 0.2s, transform 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bg-thumb img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(60%);
    transition: filter 0.2s;
}

.bg-num {
    position: relative;
    z-index: 1;
    font-size: 16px;
    font-weight: 700;
    color: rgba(255,255,255,0.5);
}

.bg-thumb.selected {
    border-color: #f0c040;
    transform: scale(1.05);
}

.bg-thumb.selected img { filter: grayscale(0%); }
.bg-thumb.selected .bg-num { color: #f0c040; }

.bg-thumb:not(.selected):hover { border-color: rgba(240,192,64,0.4); }

/* Genre pills */
.genre-scroll {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
}

.genre-scroll::-webkit-scrollbar { display: none; }

.genre-pill {
    padding: 8px 16px;
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.15);
    background: rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.7);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: all 0.15s;
    text-transform: capitalize;
}

.genre-pill:hover { border-color: rgba(240,192,64,0.5); color: #f0c040; }

.genre-pill.selected {
    background: rgba(240,192,64,0.15);
    border-color: #f0c040;
    color: #f0c040;
}

/* Song count */
.count-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 8px 0;
}

.count-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.2);
    background: rgba(255,255,255,0.08);
    color: #fff;
    font-size: 22px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}

.count-btn:hover { background: rgba(240,192,64,0.2); border-color: #f0c040; }

.count-display {
    text-align: center;
    min-width: 110px;
}

#song-count-num {
    display: block;
    font-size: 32px;
    font-weight: 700;
    color: #fff;
    line-height: 1;
}

.count-sub {
    font-size: 13px;
    color: #f0c040;
    font-weight: 600;
    margin-top: 2px;
    display: block;
}

/* Order summary */
#order-summary {
    font-size: 13px;
    color: rgba(255,255,255,0.55);
    margin-bottom: 12px;
    min-height: 18px;
}

/* QR button */
#qr-btn {
    width: 100%;
    padding: 14px;
    border-radius: 12px;
    border: none;
    background: linear-gradient(135deg, #f0c040, #e88020);
    color: #000;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.15s, transform 0.15s;
}

#qr-btn:hover  { opacity: 0.9; transform: translateY(-1px); }
#qr-btn:active { transform: translateY(0); }
#qr-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* Panel footer */
#panel-footer {
    padding: 12px 20px 16px;
    font-size: 12px;
    color: rgba(255,255,255,0.3);
    text-align: center;
}

#panel-footer a {
    color: rgba(255,255,255,0.4);
    text-decoration: none;
}

#panel-footer a:hover { color: rgba(255,255,255,0.7); }

/* ---- VIEW 2: QR ---- */
#panel-qr {
    display: flex;
    flex-direction: column;
    height: 100%;
}

#panel-qr.hidden { display: none; }
#panel-select.hidden { display: none; }

#qr-view-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px 14px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    flex-shrink: 0;
}

#qr-cancel-btn {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    color: rgba(255,255,255,0.7);
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

#qr-cancel-btn:hover { background: rgba(255,255,255,0.15); color: #fff; }

#qr-view-title {
    font-size: 17px;
    font-weight: 700;
    color: #f0c040;
}

#panel-close-qr {
    background: rgba(255,255,255,0.08);
    border: none;
    color: rgba(255,255,255,0.6);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}

#panel-close-qr:hover { background: rgba(255,255,255,0.15); color: #fff; }

#qr-view-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 28px 20px 32px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.97); }
    to   { opacity: 1; transform: scale(1); }
}

#qr-img {
    width: 220px;
    height: 220px;
    border-radius: 16px;
    background: #fff;
    padding: 8px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}

#qr-summary-text {
    font-size: 15px;
    font-weight: 700;
    color: #f0c040;
    text-align: center;
}

/* Payment status indicator */
#qr-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: rgba(255,255,255,0.55);
}

#qr-status.confirmed {
    color: #68d391;
}

#qr-status.confirmed .status-dot {
    background: #68d391;
    box-shadow: 0 0 8px #68d391;
    animation: none;
}

#qr-status.cancelled,
#qr-status.expired,
#qr-status.rejected {
    color: #f0c040;
}

#qr-status.cancelled .status-dot,
#qr-status.expired .status-dot,
#qr-status.rejected .status-dot {
    background: #f0c040;
    box-shadow: 0 0 8px rgba(240,192,64,0.8);
    animation: none;
}

#qr-status.error {
    color: #fc8181;
}

#qr-status.error .status-dot {
    background: #fc8181;
    box-shadow: 0 0 8px rgba(252,129,129,0.8);
    animation: none;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,0.4);
    flex-shrink: 0;
    animation: statusPulse 1.5s ease-in-out infinite;
}

@keyframes statusPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%       { opacity: 0.4; transform: scale(0.8); }
}

#qr-hint {
    font-size: 14px;
    color: rgba(255,255,255,0.6);
    text-align: center;
}

/* Only show "Open in Xaman" on touch/mobile devices */
#qr-link {
    display: none;
    font-size: 14px;
    color: #f0c040;
    text-decoration: none;
    font-weight: 700;
    padding: 10px 24px;
    border: 1px solid rgba(240,192,64,0.4);
    border-radius: 20px;
    transition: background 0.15s;
}

@media (pointer: coarse) {
    #qr-link { display: inline-block; }
}

#qr-link:hover { background: rgba(240,192,64,0.12); }

/* ========================================
   MOBILE RESPONSIVE
   ======================================== */

/* Queue toggle / close — hidden on desktop */
#queue-toggle-btn { display: none; }
#queue-close-btn  { display: none; }

/* Queue backdrop — hidden by default */
#queue-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9;
    background: rgba(0,0,0,0.35);
}

#queue-backdrop.open { display: block; }

@media (max-width: 640px) {
    /* --- Top bar --- */
    #top-bar { padding: 10px 12px 8px; }
    #logo { font-size: 16px; gap: 7px; flex-shrink: 0; }
    .logo-icon { font-size: 17px; }
    .logo-text { white-space: nowrap; }
    #live-badge { font-size: 9px; letter-spacing: 1.5px; padding: 2px 5px; }
    #volume-control { height: 24px; gap: 0; }
    #mute-btn { width: 24px; height: 24px; }
    #volume-slider-wrap {
        position: absolute;
        left: 50%;
        top: 31px;
        width: 0;
        padding: 0;
        transform: translateX(-50%);
        background: rgba(0,0,0,0.72);
        border: 1px solid rgba(255,255,255,0.12);
        border-radius: 999px;
        backdrop-filter: blur(10px);
        box-shadow: 0 8px 22px rgba(0,0,0,0.28);
    }
    #volume-control:hover #volume-slider-wrap {
        width: 96px;
        padding: 6px 10px;
    }
    #volume-slider { width: 76px; }

    @media (hover: none) {
        #volume-control:focus-within #volume-slider-wrap {
            width: 96px;
            padding: 6px 10px;
        }
    }

    #top-right { gap: 8px; }

    /* Hide stat pill — count moves to the toggle button */
    .stat-pill { display: none; }

    /* Shorter request button */
    #request-btn { padding: 9px 14px; font-size: 13px; }

    /* --- Now playing --- */
    #now-playing-text { font-size: 16px; max-width: 90vw; }

    /* --- Queue panel: hidden off-screen right by default --- */
    #queue-panel {
        right: 0;
        top: 58px;
        width: min(260px, 82vw);
        height: min(calc(38px + 10 * 46px + 36px), calc(100vh - 58px - 68px));
        border-radius: 14px 0 0 14px;
        transform: translateX(110%);
        transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
        z-index: 10;
    }

    #queue-panel.mobile-open {
        transform: translateX(0);
    }

    #queue-list { overflow-y: auto; }

    /* --- Queue toggle button --- */
    #queue-toggle-btn {
        display: flex;
        align-items: center;
        gap: 5px;
        position: absolute;
        right: 0;
        top: 70px;
        background: rgba(0,0,0,0.65);
        backdrop-filter: blur(8px);
        border: 1px solid rgba(255,255,255,0.14);
        border-right: none;
        color: rgba(255,255,255,0.85);
        border-radius: 20px 0 0 20px;
        padding: 7px 10px 7px 10px;
        font-size: 12px;
        font-weight: 600;
        cursor: pointer;
        pointer-events: all;
        transition: background 0.15s, color 0.15s;
    }

    #queue-toggle-btn.open {
        color: #f0c040;
        border-color: rgba(240,192,64,0.4);
        background: rgba(0,0,0,0.8);
    }

    /* --- Close button inside queue header --- */
    #queue-close-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        background: rgba(255,255,255,0.08);
        border: none;
        color: rgba(255,255,255,0.55);
        width: 22px;
        height: 22px;
        border-radius: 50%;
        font-size: 12px;
        cursor: pointer;
        flex-shrink: 0;
        transition: background 0.15s, color 0.15s;
    }

    #queue-close-btn:hover { background: rgba(255,255,255,0.18); color: #fff; }
}
