/* ════════════════════════════════════════
   DESIGN TOKENS — Stagelight (Tokyo Neon)
   ════════════════════════════════════════ */
:root {
  --pink:      #F0459B;
  --pink-dim:  rgba(240,69,155,.35);
  --pink-glow: rgba(240,69,155,.12);
  --cyan:      #38D6FF;
  --cyan-dim:  rgba(56,214,255,.3);
  --cyan-glow: rgba(56,214,255,.08);
  --bg-deep:   #08080F;
  --bg-panel:  rgba(10,10,18,.72);
  --bg-card:   rgba(255,255,255,.035);
  --bg-hover:  rgba(255,255,255,.05);
  --text-1:    #EEEDF4;
  --text-2:    rgba(238,237,244,.5);
  --text-3:    rgba(238,237,244,.3);
  --border:    rgba(255,255,255,.08);
  --r-xs: 8px; --r-sm: 11px; --r-md: 12px; --r-lg: 14px;
  --font-d: 'Orbitron', sans-serif;
  --font-b: 'Archivo', sans-serif;
  --font-m: 'Space Mono', monospace;
  --t: .2s ease;
}

/* ════════════════════════════════════════
   RESET
   ════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
    font-family: var(--font-b);
    background: var(--bg-deep);
    color: var(--text-1);
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
}
button { cursor: pointer; font-family: var(--font-b); border: none; background: none; }
input  { font-family: var(--font-b); }
.hidden { display: none !important; }

/* ════════════════════════════════════════
   AMBIENT ORBS
   ════════════════════════════════════════ */
.bg-orbs {
    position: fixed; inset: 0;
    pointer-events: none; z-index: 0; overflow: hidden;
}
.orb { position: absolute; border-radius: 50%; filter: blur(90px); }
.orb-1 {
    width: 700px; height: 700px;
    background: radial-gradient(circle, var(--pink) 0%, transparent 65%);
    top: -280px; right: -180px; opacity: .16;
    animation: d1 20s ease-in-out infinite;
}
.orb-2 {
    width: 600px; height: 600px;
    background: radial-gradient(circle, var(--cyan) 0%, transparent 65%);
    bottom: -220px; left: -150px; opacity: .12;
    animation: d2 25s ease-in-out infinite;
}
@keyframes d1 { 0%,100%{transform:translate(0,0)} 50%{transform:translate(-50px,70px)} }
@keyframes d2 { 0%,100%{transform:translate(0,0)} 50%{transform:translate(60px,-60px)} }

/* ════════════════════════════════════════
   ROOT LAYOUT
   ════════════════════════════════════════ */
.app-container {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-rows: 1fr 92px;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}
.main-row {
    display: flex;
    min-height: 0;
    position: relative;
}
/* Subtle edge hint that the queue can be revealed by hovering the right edge */
.app-container.queue-collapsed .main-row::after {
    content: '';
    position: absolute; top: 0; right: 0;
    width: 3px; height: 100%;
    background: linear-gradient(180deg, transparent, var(--pink-dim), transparent);
    opacity: .5;
    pointer-events: none;
    transition: opacity var(--t);
}
.app-container.queue-collapsed.queue-peek .main-row::after { opacity: 0; }

/* ════════════════════════════════════════
   LEFT PANEL — Library
   ════════════════════════════════════════ */
.panel-left {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 384px;
    flex-shrink: 0;
    min-width: 0;
    padding: 22px 18px 18px;
    background: var(--bg-panel);
    -webkit-backdrop-filter: blur(30px);
    backdrop-filter: blur(30px);
    border-right: 1px solid var(--border);
    overflow: hidden;       /* panel itself never scrolls */
    transition: width .3s ease, padding .3s ease, border-color .3s ease;
}
.app-container.panel-collapsed .panel-left,
.app-container.tv-mode .panel-left {
    width: 0;
    padding-left: 0;
    padding-right: 0;
    border-color: transparent;
}

/* Wordmark */
.app-header { flex-shrink: 0; }
.app-logo   { display: flex; align-items: center; gap: 10px; user-select: none; }
.logo-badge {
    width: 34px; height: 34px; flex-shrink: 0;
    border-radius: 9px;
    background: linear-gradient(135deg, var(--pink), var(--cyan));
    display: flex; align-items: center; justify-content: center;
    font-size: 16px; line-height: 1; color: #fff;
}
.app-title    { font-family: var(--font-d); font-size: 15px; font-weight: 900; letter-spacing: .06em; white-space: nowrap; }
.title-accent { color: var(--pink); text-shadow: 0 0 14px rgba(240,69,155,.8), 0 0 36px var(--pink-dim); }

/* Source toggle */
.source-toggle {
    flex-shrink: 0;
    display: flex;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 50px;
    padding: 4px; gap: 4px;
}
.toggle-option { flex: 1; }
.toggle-option input[type="radio"] { position: absolute; opacity: 0; width: 0; height: 0; }
.toggle-label {
    display: flex; align-items: center; justify-content: center; gap: 6px;
    padding: 8px 10px; border-radius: 50px;
    font-size: 12.5px; font-weight: 600; color: var(--text-2);
    transition: all var(--t); cursor: pointer; user-select: none;
}
.toggle-option input:checked + .toggle-label {
    background: linear-gradient(135deg, var(--pink), #c2185b);
    color: #fff;
    box-shadow: 0 0 18px var(--pink-dim);
}

/* Search */
.search-wrapper {
    flex-shrink: 0;
    position: relative; display: flex; align-items: center;
}
.search-wrapper:has(#searchInput.hidden) { display: none; }
.search-icon {
    position: absolute; left: 14px;
    width: 16px; height: 16px; color: var(--text-3);
    pointer-events: none; transition: color var(--t);
}
.search-wrapper:focus-within .search-icon { color: var(--pink); }
.search-input {
    width: 100%;
    padding: 13px 40px 13px 42px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    color: var(--text-1); font-size: 13.5px; outline: none;
    transition: border-color var(--t), box-shadow var(--t);
}
.search-input::placeholder { color: var(--text-3); }
.search-input:focus {
    border-color: var(--pink);
    box-shadow: 0 0 0 3px var(--pink-glow), 0 0 24px var(--pink-glow);
}
.search-keycap {
    position: absolute; right: 13px;
    font-family: var(--font-m); font-size: 10px; color: var(--text-3);
    border: 1px solid var(--border); border-radius: 4px;
    padding: 1px 5px; pointer-events: none;
}
.search-clear {
    position: absolute; right: 11px;
    width: 22px; height: 22px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%; color: var(--text-2); transition: all var(--t);
}
.search-clear:hover { background: var(--bg-hover); color: var(--text-1); }

/* Local file section */
.local-section {
    flex-shrink: 0;
    display: flex; flex-direction: column; gap: 8px;
    padding: 14px;
    background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--r-md);
}
.file-btn {
    display: flex; align-items: center; justify-content: center; gap: 7px;
    padding: 9px 14px;
    border: 1px solid var(--border); border-radius: var(--r-xs);
    color: var(--text-2); font-size: 12.5px; font-weight: 600;
    transition: all var(--t);
}
.file-btn:hover { border-color: var(--pink); color: var(--text-1); background: var(--pink-glow); }
.file-name {
    font-size: 11.5px; color: var(--text-2); font-style: italic;
    text-align: center; padding: 5px 8px;
    background: rgba(0,0,0,.25); border-radius: var(--r-xs);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.file-name.file-name-selected { font-style: normal; font-weight: 600; color: var(--text-1); }
.load-btn {
    padding: 10px;
    background: linear-gradient(135deg, var(--pink), #c2185b);
    border-radius: var(--r-xs);
    color: #fff; font-size: 13px; font-weight: 700;
    box-shadow: 0 0 20px var(--pink-dim); transition: all var(--t);
}
.load-btn:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 4px 28px var(--pink-dim); }
.load-btn:disabled { opacity: .35; cursor: not-allowed; box-shadow: none; }

/* Search history */
.history-container { flex-shrink: 0; display: flex; flex-wrap: wrap; gap: 5px; min-height: 4px; }
.search-history-item {
    padding: 4px 11px;
    background: var(--bg-card); border: 1px solid var(--border); border-radius: 50px;
    font-size: 11.5px; font-weight: 500; color: var(--text-2);
    cursor: pointer; user-select: none; transition: all var(--t); white-space: nowrap;
}
.search-history-item:hover { border-color: var(--pink); color: var(--pink); background: var(--pink-glow); }

/* Results header */
.results-header {
    flex-shrink: 0;
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 2px;
}
.results-label { font-family: var(--font-m); font-size: 10px; letter-spacing: .22em; color: var(--text-3); }
.results-page  { font-family: var(--font-m); font-size: 10px; color: var(--text-3); }

/* Song list — the ONLY scrolling element in the left panel */
.song-list {
    flex: 1;
    min-height: 0;          /* allows shrinking below content height */
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
    scrollbar-width: thin;
    scrollbar-color: var(--pink-dim) transparent;
}
.song-list::-webkit-scrollbar       { width: 3px; }
.song-list::-webkit-scrollbar-track { background: transparent; }
.song-list::-webkit-scrollbar-thumb { background: var(--pink-dim); border-radius: 3px; }

.song-item {
    flex-shrink: 0;
    display: flex; align-items: center; gap: 10px;
    padding: 8px;
    background: transparent; border: 1px solid transparent; border-radius: var(--r-md);
    cursor: pointer;
    transition: background var(--t), border-color var(--t);
}
.song-item:hover { background: var(--bg-hover); border-color: rgba(240,69,155,.3); }
.song-item.playing {
    background: linear-gradient(90deg, rgba(240,69,155,.1), rgba(56,214,255,.05));
    border: 1px solid rgba(240,69,155,.3);
}
.song-thumb {
    width: 88px; height: 50px; flex-shrink: 0;
    border-radius: 8px; object-fit: cover;
    background: linear-gradient(135deg,#33243c,#17202f);
}
.song-item-body { flex: 1; min-width: 0; }
.song-item-title  { font-size: 13px; font-weight: 600; color: var(--text-1); line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.song-item-meta   { display: flex; align-items: center; gap: 8px; margin-top: 3px; }
.song-item-artist { font-size: 11px; font-weight: 500; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.song-item-dur    { font-family: var(--font-m); font-size: 10.5px; color: var(--text-3); flex-shrink: 0; }
.song-item-playing-tag {
    display: none; flex-shrink: 0;
    font-family: var(--font-m); font-size: 9.5px; letter-spacing: .05em; color: var(--cyan);
    text-shadow: 0 0 8px var(--cyan-dim);
}
.song-item.playing .song-item-playing-tag { display: inline; }
.song-add {
    width: 26px; height: 26px; flex-shrink: 0;
    border-radius: 50%; border: 1px solid var(--border);
    color: var(--text-2); background: transparent;
    display: flex; align-items: center; justify-content: center;
    font-size: 15px; line-height: 1;
    transition: all var(--t);
}
.song-add:hover { border-color: var(--cyan); color: var(--cyan); box-shadow: 0 0 10px var(--cyan-dim); }
.song-list-empty  { text-align: center; color: var(--text-3); font-size: 13px; line-height: 1.7; padding: 40px 16px; }

/* Pagination */
.pagination { flex-shrink: 0; display: flex; gap: 8px; }
.page-btn {
    flex: 1; display: flex; align-items: center; justify-content: center; gap: 5px;
    padding: 9px 12px;
    background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--r-xs);
    color: var(--text-2); font-size: 12px; font-weight: 600;
    transition: all var(--t);
}
.page-btn:hover:not(:disabled) { border-color: var(--pink); color: var(--pink); background: var(--pink-glow); }
.page-btn:disabled { opacity: .28; cursor: not-allowed; }

/* ════════════════════════════════════════
   CENTER PANEL — Stage
   ════════════════════════════════════════ */
.panel-right {
    display: flex;
    flex-direction: column;
    gap: 16px;
    flex: 1;
    min-width: 0;
    padding: 26px 32px 20px;
    overflow: hidden;
}

/* Now playing header */
.now-playing-header {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 12px;
}
.now-playing-text { flex: 1; min-width: 0; }
.now-playing-label {
    display: block; margin-bottom: 4px;
    font-family: var(--font-d); font-size: 9px; font-weight: 700;
    letter-spacing: .22em; color: var(--pink);
    text-shadow: 0 0 12px var(--pink); user-select: none;
}
.song-title-display {
    font-size: 18px; font-weight: 700; color: var(--text-1); line-height: 1.3;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mic-chip {
    flex-shrink: 0;
    font-family: var(--font-m); font-size: 10.5px; color: var(--cyan);
    border: 1px solid var(--cyan-dim); border-radius: 50px;
    padding: 4px 11px; white-space: nowrap;
}

/* Panel toggle button */
.panel-toggle-btn {
    flex-shrink: 0;
    width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r-xs);
    color: var(--text-2);
    transition: all var(--t);
}
.panel-toggle-btn:hover {
    border-color: var(--pink);
    color: var(--pink);
    background: var(--pink-glow);
}
@media (max-width: 860px) { .panel-toggle-btn { display: none; } }

/* Video — grows to fill all remaining height */
.video-container {
    flex: 1;
    min-height: 0;          /* allows shrinking */
    position: relative;
    overflow: hidden;
    border-radius: var(--r-lg);
    border: 1px solid var(--border);
    background: #000;
    box-shadow: 0 0 60px rgba(240,69,155,.08), 0 0 120px rgba(56,214,255,.05), 0 20px 60px rgba(0,0,0,.5);
}
.video-container iframe {
    position: absolute;
    inset: 0;
    width: 100%; height: 100%;
    border-radius: var(--r-lg);
}
.fullscreen-btn {
    position: absolute; bottom: 12px; right: 12px; z-index: 10;
    width: 34px; height: 34px;
    background: rgba(0,0,0,.65);
    -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,.12); border-radius: var(--r-xs);
    color: rgba(255,255,255,.85);
    display: flex; align-items: center; justify-content: center;
    opacity: 0; transition: opacity var(--t), background var(--t);
}
.video-container:hover .fullscreen-btn { opacity: 1; }
.fullscreen-btn:hover { background: rgba(240,69,155,.7); border-color: var(--pink); }
.fs-icon { width: 16px; height: 16px; }
.video-container:fullscreen                 { border-radius: 0; }
.video-container:fullscreen iframe          { border-radius: 0; }
.video-container:fullscreen .fullscreen-btn { opacity: 1; }

/* Fullscreen search toggle button (bottom-left, mirrors fullscreen-btn style) */
.fs-search-toggle {
    position: absolute; bottom: 12px; left: 12px; z-index: 10;
    width: 34px; height: 34px;
    background: rgba(0,0,0,.65);
    -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,.12); border-radius: var(--r-xs);
    color: rgba(255,255,255,.85);
    display: flex; align-items: center; justify-content: center;
    opacity: 0; transition: opacity var(--t), background var(--t);
}
.video-container:hover .fs-search-toggle         { opacity: 1; }
.video-container:fullscreen .fs-search-toggle    { opacity: 1; }
.fs-search-toggle:hover { background: rgba(240,69,155,.7); border-color: var(--pink); }

/* Fullscreen search panel (slides in from left, inside videoContainer) */
.fs-search-panel {
    position: absolute;
    top: 0; left: 0;
    width: 300px; height: 100%;
    background: var(--bg-panel);
    -webkit-backdrop-filter: blur(24px); backdrop-filter: blur(24px);
    border-right: 1px solid var(--border);
    transform: translateX(-100%);
    transition: transform .3s ease;
    z-index: 20;
    display: flex; flex-direction: column;
}
.fs-search-panel.fs-open,
.fs-search-panel.fs-search-peek { transform: translateX(0); box-shadow: 12px 0 40px rgba(0,0,0,.55); }

/* Subtle edge hint that the quick search can be revealed by hovering the left edge */
.video-container:has(.fs-search-panel:not(.fs-open):not(.fs-search-peek))::before {
    content: '';
    position: absolute; top: 0; left: 0;
    width: 3px; height: 100%;
    background: linear-gradient(180deg, transparent, var(--cyan-dim), transparent);
    opacity: .5;
    pointer-events: none;
    z-index: 15;
}

/* Fullscreen queue toggle button (bottom-right, next to fullscreen-btn) */
.fs-queue-toggle {
    position: absolute; bottom: 12px; right: 54px; z-index: 10;
    width: 34px; height: 34px;
    background: rgba(0,0,0,.65);
    -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,.12); border-radius: var(--r-xs);
    color: rgba(255,255,255,.85);
    display: flex; align-items: center; justify-content: center;
    opacity: 0; transition: opacity var(--t), background var(--t);
}
.video-container:hover .fs-queue-toggle      { opacity: 1; }
.video-container:fullscreen .fs-queue-toggle { opacity: 1; }
.fs-queue-toggle:hover { background: rgba(240,69,155,.7); border-color: var(--pink); }

/* Fullscreen up-next overlay (slides in from right, inside videoContainer) */
.fs-queue-panel {
    position: absolute;
    top: 0; right: 0;
    width: 300px; height: 100%;
    padding: 20px 18px;
    background: var(--bg-panel);
    -webkit-backdrop-filter: blur(24px); backdrop-filter: blur(24px);
    border-left: 1px solid var(--border);
    transform: translateX(100%);
    transition: transform .3s ease;
    z-index: 20;
    display: flex; flex-direction: column; gap: 12px;
}
.fs-queue-panel.fs-queue-open,
.fs-queue-panel.fs-queue-peek { transform: translateX(0); box-shadow: -12px 0 40px rgba(0,0,0,.55); }
.fs-queue-header { flex-shrink: 0; display: flex; align-items: center; justify-content: space-between; }

/* Subtle edge hint that the queue can be revealed by hovering the right edge */
.video-container:has(.fs-queue-panel:not(.fs-queue-open):not(.fs-queue-peek))::after {
    content: '';
    position: absolute; top: 0; right: 0;
    width: 3px; height: 100%;
    background: linear-gradient(180deg, transparent, var(--pink-dim), transparent);
    opacity: .5;
    pointer-events: none;
    z-index: 15;
}

.fs-search-bar {
    flex-shrink: 0;
    display: flex; align-items: center; gap: 8px;
    padding: 16px 14px;
    border-bottom: 1px solid var(--border);
}
.fs-search-icon {
    flex-shrink: 0; width: 15px; height: 15px; color: var(--text-3);
}
.fs-search-input {
    flex: 1; background: none; border: none; outline: none;
    color: var(--text-1); font-family: var(--font-b); font-size: 13.5px;
}
.fs-search-input::placeholder { color: var(--text-3); }
.fs-search-close {
    flex-shrink: 0; width: 24px; height: 24px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%; color: var(--text-2); transition: all var(--t);
}
.fs-search-close:hover { background: var(--bg-hover); color: var(--text-1); }

.fs-search-results {
    flex: 1; min-height: 0;
    overflow-y: auto;
    display: flex; flex-direction: column; gap: 4px;
    padding: 10px;
    scrollbar-width: thin;
    scrollbar-color: var(--pink-dim) transparent;
}
.fs-search-results::-webkit-scrollbar       { width: 3px; }
.fs-search-results::-webkit-scrollbar-track { background: transparent; }
.fs-search-results::-webkit-scrollbar-thumb { background: var(--pink-dim); border-radius: 3px; }

.fs-search-panel .queue-add-prompt {
    flex-shrink: 0;
    margin: 0 10px 10px;
}

/* Lyrics — borderless three-line display */
.lyrics-display {
    flex-shrink: 0;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    text-align: center;
    gap: 4px;
    padding: 6px 32px;
}
.lyric-prev, .lyric-next {
    font-family: var(--font-b);
    font-size: 15px; font-weight: 500; color: var(--text-3);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%;
    transition: opacity .15s ease;
}
.lyric-current {
    font-family: var(--font-m);
    font-size: 28px; font-weight: 700; color: #fff;
    text-shadow: 0 0 24px rgba(240,69,155,.6), 0 0 60px rgba(240,69,155,.25);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%;
    transition: opacity .15s ease;
}
.app-container.tv-mode .lyric-current { font-size: 42px; }

/* ════════════════════════════════════════
   RIGHT PANEL — Up Next Queue
   ════════════════════════════════════════ */
.panel-queue {
    width: 312px;
    flex-shrink: 0;
    display: flex; flex-direction: column; gap: 12px;
    padding: 24px 20px 18px;
    background: var(--bg-panel);
    -webkit-backdrop-filter: blur(30px); backdrop-filter: blur(30px);
    border-left: 1px solid var(--border);
    overflow: hidden;
    transition: width .3s ease, padding .3s ease, border-color .3s ease;
}
.app-container.queue-collapsed .panel-queue,
.app-container.tv-mode .panel-queue {
    width: 0;
    padding-left: 0;
    padding-right: 0;
    border-color: transparent;
}
/* Hover-reveal: peeks the queue back in as an overlay without affecting layout */
.app-container.queue-collapsed.queue-peek .panel-queue {
    position: absolute;
    top: 0; right: 0;
    height: 100%;
    width: 312px;
    padding: 24px 20px 18px;
    border-color: var(--border);
    box-shadow: -12px 0 40px rgba(0,0,0,.55);
    z-index: 30;
}
.queue-header { flex-shrink: 0; display: flex; align-items: center; justify-content: space-between; }
.queue-title  { font-family: var(--font-m); font-size: 10px; letter-spacing: .22em; color: var(--text-3); }
.queue-count  {
    font-family: var(--font-m); font-size: 10.5px; color: #fff;
    background: linear-gradient(135deg, var(--pink), var(--cyan));
    border-radius: 50px; padding: 2px 9px;
    box-shadow: 0 0 12px var(--pink-dim);
}
.queue-list {
    flex: 1; min-height: 0;
    overflow-y: auto;
    display: flex; flex-direction: column; gap: 6px;
    scrollbar-width: thin;
    scrollbar-color: var(--pink-dim) transparent;
}
.queue-list::-webkit-scrollbar       { width: 3px; }
.queue-list::-webkit-scrollbar-track { background: transparent; }
.queue-list::-webkit-scrollbar-thumb { background: var(--pink-dim); border-radius: 3px; }
.queue-item {
    flex-shrink: 0;
    display: flex; align-items: center; gap: 10px;
    padding: 8px;
    border-radius: var(--r-sm);
    background: var(--bg-card); border: 1px solid var(--border);
    cursor: grab;
    transition: opacity var(--t), border-color var(--t);
}
.queue-item.dragging { opacity: .4; }
.queue-item:hover { border-color: rgba(240,69,155,.25); }
.queue-num { flex-shrink: 0; width: 14px; text-align: center; font-family: var(--font-m); font-size: 12px; color: var(--pink); }
.queue-item-body { flex: 1; min-width: 0; }
.queue-item-title { font-size: 13.5px; font-weight: 600; color: var(--text-1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.queue-item-singer { display: flex; align-items: center; gap: 5px; margin-top: 2px; font-size: 11.5px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.queue-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 6px var(--cyan); flex-shrink: 0; }
.queue-remove {
    flex-shrink: 0; width: 20px; height: 20px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%; color: var(--text-3); font-size: 14px;
    transition: all var(--t);
}
.queue-remove:hover { color: var(--pink); background: var(--pink-glow); }
.queue-handle { flex-shrink: 0; color: var(--text-3); font-size: 12px; cursor: grab; user-select: none; }
.queue-empty { text-align: center; color: var(--text-3); font-size: 12.5px; padding: 30px 10px; line-height: 1.6; }
.queue-add-prompt {
    flex-shrink: 0;
    display: flex; flex-direction: column; gap: 8px;
    padding: 10px;
    background: var(--bg-card); border: 1px solid var(--pink-dim); border-radius: var(--r-md);
}
.queue-singer-input {
    padding: 8px 10px;
    background: rgba(0,0,0,.25); border: 1px solid var(--border); border-radius: var(--r-xs);
    color: var(--text-1); font-size: 12.5px; outline: none;
}
.queue-singer-input:focus { border-color: var(--pink); }
.queue-add-prompt-actions { display: flex; gap: 8px; }
.queue-prompt-btn { flex: 1; padding: 7px; border-radius: var(--r-xs); font-size: 12px; font-weight: 700; }
.queue-prompt-add { background: linear-gradient(135deg, var(--pink), #c2185b); color: #fff; }
.queue-prompt-cancel { background: var(--bg-hover); color: var(--text-2); border: 1px solid var(--border); }
.queue-add-btn {
    flex-shrink: 0;
    padding: 10px;
    border: 1px dashed var(--border); border-radius: var(--r-md);
    color: var(--text-2); font-size: 12.5px; font-weight: 600;
    transition: all var(--t);
}
.queue-add-btn:hover { border-color: var(--pink); color: var(--pink); background: var(--pink-glow); }
.queue-hint { flex-shrink: 0; text-align: center; font-family: var(--font-m); font-size: 10px; color: var(--text-3); }

.queue-header-right { display: flex; align-items: center; gap: 8px; }
.queue-phone { margin-left: 3px; font-size: 10px; }
.queue-item-guest { border-color: rgba(56,214,255,.18); }

/* ════════════════════════════════════════
   PARTY MODE (host)
   ════════════════════════════════════════ */
.party-btn {
    font-family: var(--font-m); font-size: 10.5px; color: var(--cyan);
    border: 1px solid var(--cyan-dim); border-radius: 50px;
    padding: 3px 10px; white-space: nowrap;
    transition: all var(--t);
}
.party-btn:hover { background: var(--cyan-glow); border-color: var(--cyan); }
.party-btn.active { color: #fff; background: rgba(56,214,255,.16); border-color: var(--cyan); box-shadow: 0 0 12px var(--cyan-dim); }

.party-card { position: relative; max-width: 400px; max-height: 92vh; overflow-y: auto; padding: 30px 28px 26px; }
.party-close {
    position: absolute; top: 12px; right: 12px;
    width: 30px; height: 30px; border-radius: 50%;
    color: var(--text-2); font-size: 20px; line-height: 1;
    transition: all var(--t);
}
.party-close:hover { color: var(--pink); background: var(--pink-glow); }
.party-hero { font-size: 40px; margin-bottom: 12px; }
.party-subtitle { font-size: 13px; font-weight: 600; color: var(--text-2); }
.party-qr {
    width: 220px; height: 220px; margin: 6px auto 14px;
    padding: 10px; background: #fff; border-radius: var(--r-lg);
    box-shadow: 0 0 40px var(--pink-dim);
}
.party-qr svg { width: 100%; height: 100%; display: block; }
.party-code-row { font-family: var(--font-m); font-size: 12px; color: var(--text-2); letter-spacing: .1em; }
.party-code {
    display: inline-block; margin-left: 6px;
    font-family: var(--font-d); font-size: 28px; font-weight: 900; letter-spacing: .18em;
    color: var(--text-1); text-shadow: 0 0 18px var(--pink-dim);
}
.party-url { margin-top: 4px; font-family: var(--font-m); font-size: 11px; color: var(--text-3); word-break: break-all; }
.party-fair {
    display: flex; align-items: flex-start; gap: 8px; margin: 18px 0 14px;
    text-align: left; font-size: 12px; color: var(--text-2); cursor: pointer;
}
.party-fair input { margin-top: 2px; accent-color: var(--pink); }
.party-members-head { text-align: left; font-family: var(--font-m); font-size: 10.5px; letter-spacing: .12em; color: var(--text-3); margin-bottom: 6px; }
.party-members { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 18px; }
.party-member {
    display: flex; align-items: center; gap: 4px;
    padding: 3px 4px 3px 10px; border-radius: 50px;
    background: var(--bg-card); border: 1px solid var(--border);
    font-size: 12px; color: var(--text-1);
}
.party-members-empty { font-size: 12px; color: var(--text-3); }
.party-actions { display: flex; gap: 8px; }
.party-end-btn { background: transparent; color: var(--pink); border: 1px solid var(--pink-dim); }
.party-end-btn:hover { background: var(--pink-glow); }

/* Mini invite badge inside the video (survives fullscreen) */
.fs-party-badge {
    position: absolute; top: 14px; right: 14px; z-index: 12;
    display: flex; align-items: center; gap: 10px;
    padding: 8px 12px 8px 8px;
    background: rgba(0,0,0,.7);
    -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
    border: 1px solid var(--cyan-dim); border-radius: var(--r-md);
    color: var(--text-1); text-align: left;
    box-shadow: 0 0 24px rgba(0,0,0,.5);
}
.fs-party-qr { width: 64px; height: 64px; padding: 3px; background: #fff; border-radius: 6px; flex-shrink: 0; }
.fs-party-qr svg { width: 100%; height: 100%; display: block; }
.fs-party-text { display: flex; flex-direction: column; gap: 2px; }
.fs-party-label { font-size: 11px; color: var(--text-2); }
.fs-party-code { font-family: var(--font-d); font-size: 20px; font-weight: 900; letter-spacing: .16em; }
.video-container:fullscreen .fs-party-qr { width: 110px; height: 110px; }
.video-container:fullscreen .fs-party-code { font-size: 28px; }

/* Toasts */
.toast-host {
    position: fixed; top: 18px; left: 50%; transform: translateX(-50%);
    z-index: 300; display: flex; flex-direction: column; align-items: center; gap: 8px;
    pointer-events: none; width: max-content; max-width: calc(100vw - 32px);
}
.toast {
    padding: 10px 18px; border-radius: 50px;
    background: rgba(10,10,18,.92); border: 1px solid var(--cyan-dim);
    color: var(--text-1); font-size: 13px; font-weight: 600;
    box-shadow: 0 10px 30px rgba(0,0,0,.5);
    animation: toast-in .25s ease;
    transition: opacity .4s ease, transform .4s ease;
}
.toast-error { border-color: var(--pink); }
.toast-out { opacity: 0; transform: translateY(-8px); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* ════════════════════════════════════════
   DISCOVER (host left panel + guest phone tab) — Spotify-style
   ════════════════════════════════════════ */
.panel-left.discover-mode > .search-wrapper,
.panel-left.discover-mode > .history-container,
.panel-left.discover-mode > .results-header,
.panel-left.discover-mode > .song-list,
.panel-left.discover-mode > .pagination { display: none; }
.discover-panel {
    flex: 1; min-height: 0; overflow-y: auto;
    scrollbar-width: thin; scrollbar-color: var(--pink-dim) transparent;
    margin-right: -6px; padding-right: 6px;
}
.d-home { display: flex; flex-direction: column; gap: 26px; padding-bottom: 8px; }
.d-section { display: flex; flex-direction: column; gap: 10px; }
.d-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.d-section-title { font-size: 17px; font-weight: 800; letter-spacing: -.01em; color: var(--text-1); }
.d-show-all { font-size: 12px; font-weight: 700; color: var(--text-2); }
.d-show-all:hover { color: var(--text-1); text-decoration: underline; }
.d-eyebrow { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: rgba(255,255,255,.75); }
.d-empty { color: var(--text-3); font-size: 12.5px; padding: 18px 4px; }

/* Chart cover card */
.d-hero {
    position: relative; overflow: hidden;
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 18px; border-radius: 10px; text-align: left;
    background: linear-gradient(135deg, #7B2CBF 0%, #C2185B 100%);
    box-shadow: 0 10px 30px rgba(123,44,191,.25);
    transition: transform var(--t), box-shadow var(--t);
}
.d-hero:hover { transform: translateY(-1px); box-shadow: 0 14px 36px rgba(123,44,191,.35); }
.d-hero-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.d-hero-title { font-size: 22px; font-weight: 800; line-height: 1.1; letter-spacing: -.02em; color: #fff; }
.d-hero-sub { font-size: 11.5px; color: rgba(255,255,255,.8); }
.d-mosaic {
    flex-shrink: 0; width: 84px; height: 84px;
    display: grid; grid-template-columns: 1fr 1fr; gap: 2px;
    border-radius: 6px; overflow: hidden;
    box-shadow: 0 6px 18px rgba(0,0,0,.35);
    transform: rotate(6deg) translateX(4px);
}
.d-mosaic-cell { background: rgba(0,0,0,.25) center / cover no-repeat; }

/* Track rows */
.d-tracks { display: flex; flex-direction: column; }
.song-item.d-track {
    display: flex; align-items: center; gap: 12px;
    padding: 6px 8px; margin: 0 -8px;
    border: none; border-radius: 6px; background: transparent;
}
.song-item.d-track:hover { background: rgba(255,255,255,.07); border: none; }
.song-item.d-track.playing { background: rgba(255,255,255,.07); border: none; }
.song-item.d-track.playing .d-track-title { color: var(--pink); }
.d-track-num {
    flex-shrink: 0; width: 18px; text-align: right;
    font-size: 13px; font-weight: 600; color: var(--text-2); font-variant-numeric: tabular-nums;
}
.d-track-cover {
    width: 44px; height: 44px; flex-shrink: 0;
    border-radius: 4px; object-fit: cover; background: #282828;
}
.d-track-body { flex: 1; min-width: 0; }
.d-track-title { font-size: 14px; font-weight: 600; color: var(--text-1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.d-track-meta  { margin-top: 2px; font-size: 12px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.d-track-add {
    flex-shrink: 0; width: 32px; height: 32px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: var(--text-2); border: 1px solid rgba(255,255,255,.18);
    opacity: .75; transition: all var(--t);
}
.d-track:hover .d-track-add { opacity: 1; }
.d-track-add:hover { color: #fff; border-color: #fff; transform: scale(1.06); }

/* Mood / genre tiles */
.d-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.d-tile {
    position: relative; overflow: hidden;
    height: 76px; padding: 12px; border-radius: 8px;
    display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
    background: var(--tile); text-align: left;
    transition: transform var(--t), filter var(--t);
}
.d-tile::after { /* the tilted "cover" in the corner, Spotify browse-tile style */
    content: ''; position: absolute; right: -14px; bottom: -10px;
    width: 52px; height: 52px; border-radius: 4px;
    background: linear-gradient(135deg, rgba(255,255,255,.35), rgba(255,255,255,.05));
    box-shadow: 0 4px 12px rgba(0,0,0,.25);
    transform: rotate(25deg);
}
.d-tile:hover { transform: translateY(-1px); filter: brightness(1.08); }
.d-tile-title { position: relative; z-index: 1; font-size: 15px; font-weight: 800; color: #fff; line-height: 1.2; }
.d-tile-sub   { position: relative; z-index: 1; font-size: 11.5px; font-weight: 600; color: rgba(255,255,255,.8); }

/* List view (playlist page) */
.d-listview { display: flex; flex-direction: column; gap: 6px; }
.d-list-header {
    display: flex; flex-direction: column; gap: 4px;
    margin: 0 -8px; padding: 12px 8px 18px; border-radius: 10px 10px 0 0;
    background: linear-gradient(180deg, var(--tint, #7B2CBF) 0%, transparent 100%);
}
.d-back {
    width: 32px; height: 32px; margin-bottom: 18px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: rgba(0,0,0,.35); color: #fff;
}
.d-back:hover { background: rgba(0,0,0,.55); }
.d-list-title { font-size: 28px; font-weight: 800; line-height: 1.1; letter-spacing: -.02em; color: #fff; }
.d-list-count { font-size: 12px; color: rgba(255,255,255,.75); min-height: 16px; }

/* Search | Discover toggle icons */
.toggle-label svg { flex-shrink: 0; }

/* Inline "who's singing?" box beside a + button */
.add-popover {
    position: fixed; z-index: 250; width: 260px;
    display: flex; flex-direction: column; gap: 10px;
    padding: 12px;
    background: #181822; border: 1px solid rgba(255,255,255,.12); border-radius: 10px;
    box-shadow: 0 16px 40px rgba(0,0,0,.6);
    animation: toast-in .15s ease;
}
.add-popover-title { font-size: 12px; font-weight: 600; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.add-popover-input {
    padding: 9px 11px; border-radius: 6px;
    background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12);
    color: var(--text-1); font-size: 14px; outline: none;
}
.add-popover-input:focus { border-color: var(--pink); }
.add-popover-actions { display: flex; justify-content: flex-end; gap: 8px; }
.add-popover-cancel, .add-popover-confirm { padding: 7px 12px; border-radius: 50px; font-size: 12.5px; font-weight: 700; }
.add-popover-cancel { color: var(--text-2); }
.add-popover-cancel:hover { color: var(--text-1); }
.add-popover-confirm { background: var(--pink); color: #fff; }
.add-popover-confirm:hover { filter: brightness(1.1); }

/* Checkmark flash on a + right after its song was queued */
.song-add.just-added, .d-track-add.just-added {
    font-size: 0; color: var(--cyan); border-color: var(--cyan); opacity: 1;
    box-shadow: 0 0 12px var(--cyan-dim);
}
.just-added > svg { display: none; }
.song-add.just-added::after, .d-track-add.just-added::after { content: '✓'; font-size: 15px; font-weight: 700; }

/* ════════════════════════════════════════
   TV DISPLAY MODE (/tv) — the TV plays, a phone is the remote
   ════════════════════════════════════════ */
.tv-rail, .tv-idle, .tv-upnext, .tv-start { display: none; }

/* TV browsers report anything from 960×540 to 1920×1080, so every TV size is
   calc(N * var(--u)): N px on a 1280×720 screen, scaled to fit the actual one.
   Overlays use top/right/bottom/left rather than `inset` (older TV Chromium). */
body.tv-display { --u: calc(100vh / 720); }
@supports (width: min(1px, 2px)) {
    body.tv-display { --u: min(calc(100vh / 720), calc(100vw / 1280)); }
}

body.tv-display .app-container { grid-template-rows: 1fr; grid-template-columns: minmax(0, 1fr); }
body.tv-display .app-container:fullscreen { background: var(--bg-deep); } /* element-level fullscreen fallback */
body.tv-display .transport,
body.tv-display .panel-left,
body.tv-display .panel-toggle-btn,
body.tv-display .fs-search-toggle,
body.tv-display .fs-search-panel,
body.tv-display .fs-queue-toggle,
body.tv-display .fs-queue-panel,
body.tv-display .fullscreen-btn,
body.tv-display .fs-party-badge,
body.tv-display .party-btn,
body.tv-display .queue-add-btn,
body.tv-display .queue-hint,
body.tv-display .queue-add-prompt,
body.tv-display .queue-remove,
body.tv-display .queue-handle { display: none !important; }
body.tv-display .main-row::after,
body.tv-display .video-container::after { display: none !important; } /* edge hover hints */

body.tv-display .panel-right {
    padding: calc(28 * var(--u)) calc(24 * var(--u)) calc(28 * var(--u)) calc(32 * var(--u));
    gap: calc(16 * var(--u));
}
body.tv-display .now-playing-header { gap: calc(12 * var(--u)); }
body.tv-display .song-title-display { font-size: calc(30 * var(--u)); }
body.tv-display .now-playing-label { font-size: calc(13 * var(--u)); margin-bottom: calc(4 * var(--u)); }
body.tv-display .mic-chip { font-size: calc(16 * var(--u)); padding: calc(7 * var(--u)) calc(16 * var(--u)); }
body.tv-display .video-container { border-radius: calc(14 * var(--u)); }
body.tv-display .video-container iframe { top: 0; left: 0; border-radius: calc(14 * var(--u)); }
body.tv-display .lyrics-display { gap: calc(4 * var(--u)); padding: calc(6 * var(--u)) calc(32 * var(--u)); }
body.tv-display .lyric-prev,
body.tv-display .lyric-next { font-size: calc(15 * var(--u)); }
body.tv-display .lyric-current { font-size: calc(42 * var(--u)); }

/* The up-next rail is always visible on the TV (no hover on a TV). */
body.tv-display .panel-queue,
body.tv-display .app-container.queue-collapsed .panel-queue,
body.tv-display .app-container.tv-mode .panel-queue {
    position: relative; width: calc(400 * var(--u));
    padding: calc(32 * var(--u)) calc(26 * var(--u)) calc(26 * var(--u));
    gap: calc(12 * var(--u));
    border-color: var(--border); box-shadow: none;
}
body.tv-display .queue-title { font-size: calc(14 * var(--u)); }
body.tv-display .queue-count { font-size: calc(14 * var(--u)); padding: calc(3 * var(--u)) calc(12 * var(--u)); }
body.tv-display .queue-list { gap: calc(6 * var(--u)); }
body.tv-display .queue-item { padding: calc(12 * var(--u)); gap: calc(10 * var(--u)); border-radius: calc(11 * var(--u)); cursor: default; }
body.tv-display .queue-num { font-size: calc(16 * var(--u)); width: calc(20 * var(--u)); }
body.tv-display .queue-item-title { font-size: calc(18 * var(--u)); }
body.tv-display .queue-item-singer { font-size: calc(15 * var(--u)); margin-top: calc(2 * var(--u)); gap: calc(5 * var(--u)); }
body.tv-display .queue-phone { font-size: calc(13 * var(--u)); }
body.tv-display .queue-empty { font-size: 0; padding: calc(30 * var(--u)) calc(10 * var(--u)); }
body.tv-display .queue-empty::after { content: 'Add songs from your phone — scan the code below'; font-size: calc(16 * var(--u)); }

body.tv-display .tv-rail {
    flex-shrink: 0; display: flex; align-items: center; gap: calc(16 * var(--u));
    padding: calc(14 * var(--u)); border-radius: calc(14 * var(--u));
    background: var(--bg-card); border: 1px solid var(--border);
}
.tv-rail-qr { width: calc(120 * var(--u)); height: calc(120 * var(--u)); flex-shrink: 0; padding: calc(6 * var(--u)); background: #fff; border-radius: calc(8 * var(--u)); }
.tv-rail-qr svg, .tv-idle-qr svg { width: 100%; height: 100%; display: block; }
.tv-rail-text { display: flex; flex-direction: column; gap: calc(4 * var(--u)); min-width: 0; }
.tv-rail-label { font-size: calc(14 * var(--u)); color: var(--text-2); }
.tv-rail-code { font-family: var(--font-d); font-size: calc(34 * var(--u)); font-weight: 900; letter-spacing: .14em; }
.tv-rail-remote { font-size: calc(13 * var(--u)); color: var(--text-3); }

/* Idle screen inside the video area */
body.tv-display .tv-idle:not(.hidden) {
    position: absolute; top: 0; right: 0; bottom: 0; left: 0; z-index: 14;
    display: flex; align-items: center; justify-content: center; gap: calc(56 * var(--u));
    padding: calc(40 * var(--u));
    background: radial-gradient(circle at 30% 40%, rgba(240,69,155,.22), transparent 60%),
                radial-gradient(circle at 75% 70%, rgba(56,214,255,.16), transparent 55%), #0b0b14;
}
.tv-idle-qr { width: calc(320 * var(--u)); height: calc(320 * var(--u)); flex-shrink: 0; padding: calc(14 * var(--u)); background: #fff; border-radius: calc(18 * var(--u)); box-shadow: 0 0 calc(60 * var(--u)) var(--pink-dim); }
.tv-idle-text { max-width: calc(560 * var(--u)); min-width: 0; }
.tv-idle-title { font-size: calc(46 * var(--u)); font-weight: 800; line-height: 1.15; letter-spacing: -.01em; }
.tv-idle-title span { font-size: calc(28 * var(--u)); font-weight: 700; color: var(--text-2); }
.tv-idle-sub { margin-top: calc(18 * var(--u)); font-size: calc(22 * var(--u)); color: var(--text-2); line-height: 1.5; }

/* "Up next — get ready" card between songs */
body.tv-display .tv-upnext:not(.hidden) {
    position: absolute; top: 0; right: 0; bottom: 0; left: 0; z-index: 16;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: calc(18 * var(--u));
    padding: calc(40 * var(--u)); text-align: center;
    background: linear-gradient(135deg, #7B2CBF 0%, #C2185B 100%);
    animation: toast-in .3s ease;
}
.tv-upnext-label { font-size: calc(22 * var(--u)); font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: rgba(255,255,255,.8); }
.tv-upnext-title { font-size: calc(54 * var(--u)); font-weight: 800; line-height: 1.15; max-width: 90%; }
.tv-upnext-singer { font-size: calc(30 * var(--u)); color: rgba(255,255,255,.9); }
.tv-upnext-singer span { font-weight: 800; color: #fff; }

/* Start screen (needs one OK press) */
body.tv-display .tv-start:not(.hidden) {
    position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 400;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: calc(48 * var(--u));
    background: radial-gradient(circle at 50% 40%, rgba(240,69,155,.25), transparent 60%), var(--bg-deep);
}
.tv-start-logo { display: flex; align-items: center; gap: calc(18 * var(--u)); font-family: var(--font-d); font-size: calc(44 * var(--u)); font-weight: 900; letter-spacing: .04em; }
.tv-start-logo .logo-badge { width: calc(64 * var(--u)); height: calc(64 * var(--u)); font-size: calc(32 * var(--u)); border-radius: calc(16 * var(--u)); }
.tv-start-button {
    padding: calc(26 * var(--u)) calc(56 * var(--u)); border-radius: calc(60 * var(--u));
    background: linear-gradient(135deg, var(--pink), #c2185b); color: #fff;
    font-size: calc(30 * var(--u)); font-weight: 800;
    box-shadow: 0 0 calc(40 * var(--u)) var(--pink-dim);
    outline: none;
}
.tv-start-button:focus { box-shadow: 0 0 0 calc(6 * var(--u)) #fff, 0 0 calc(60 * var(--u)) var(--pink); }
.tv-start-button:disabled { opacity: .6; }
.tv-start-error { min-height: calc(28 * var(--u)); font-size: calc(22 * var(--u)); color: var(--pink); }

body.tv-display .toast-host { top: calc(18 * var(--u)); gap: calc(8 * var(--u)); }
body.tv-display .toast { padding: calc(10 * var(--u)) calc(18 * var(--u)); font-size: calc(15 * var(--u)); }

/* ════════════════════════════════════════
   TRANSPORT BAR
   ════════════════════════════════════════ */
.transport {
    display: flex; align-items: center; gap: 18px;
    padding: 0 28px;
    border-top: 1px solid var(--border);
    background: rgba(11,11,20,.85);
    -webkit-backdrop-filter: blur(24px); backdrop-filter: blur(24px);
}
.transport-btn {
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%; flex-shrink: 0; color: var(--text-2);
    transition: all var(--t);
}
.transport-ghost { width: 40px; height: 40px; background: var(--bg-hover); border: 1px solid var(--border); }
.transport-ghost:hover, .transport-ghost.active { border-color: var(--pink); color: var(--pink); background: var(--pink-glow); }
.transport-play {
    width: 54px; height: 54px;
    background: linear-gradient(135deg, var(--pink), #c2185b);
    color: #fff;
    box-shadow: 0 0 26px rgba(240,69,155,.45);
}
.transport-play:hover { transform: scale(1.06); }
.transport-play:active { transform: scale(1.02); }
.transport-btn:disabled { opacity: .35; cursor: not-allowed; transform: none !important; box-shadow: none !important; }
.seek-wrap { flex: 1; display: flex; align-items: center; gap: 12px; min-width: 0; }
.time-elapsed, .time-duration { flex-shrink: 0; width: 38px; font-family: var(--font-m); font-size: 12px; color: var(--text-2); }
.time-duration { text-align: right; }
.seek-bar { flex: 1; position: relative; height: 4px; border-radius: 3px; background: rgba(255,255,255,.09); cursor: pointer; }
.seek-fill { position: absolute; left: 0; top: 0; height: 100%; width: 0%; border-radius: 3px; background: linear-gradient(90deg, var(--pink), var(--cyan)); box-shadow: 0 0 10px var(--pink-dim); }
.seek-thumb {
    position: absolute; top: 50%; left: 0%;
    width: 13px; height: 13px; border-radius: 50%;
    background: #fff; box-shadow: 0 0 8px var(--cyan-dim), 0 0 2px rgba(0,0,0,.4);
    transform: translate(-50%, -50%); pointer-events: none;
}
.volume-control { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.vol-icon { width: 16px; height: 16px; color: var(--text-3); flex-shrink: 0; }
.vol-icon-loud { color: var(--text-2); }
.vol-slider {
    -webkit-appearance: none; appearance: none;
    width: 88px; height: 3px;
    background: var(--border); border-radius: 3px; outline: none; cursor: pointer;
}
.vol-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 13px; height: 13px;
    background: var(--pink); border-radius: 50%;
    box-shadow: 0 0 10px var(--pink-dim); transition: transform var(--t);
}
.vol-slider:hover::-webkit-slider-thumb { transform: scale(1.25); }
.vol-slider::-moz-range-thumb {
    width: 13px; height: 13px;
    background: var(--pink); border: none; border-radius: 50%;
    box-shadow: 0 0 10px var(--pink-dim); cursor: pointer;
}

/* ════════════════════════════════════════
   MODAL
   ════════════════════════════════════════ */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.72);
    -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
    display: flex; align-items: center; justify-content: center;
    z-index: 200;
}
.modal-card {
    background: var(--bg-deep); border: 1px solid var(--border); border-radius: var(--r-lg);
    padding: 36px 32px 32px; max-width: 380px; width: 90%;
    text-align: center;
    box-shadow: 0 30px 80px rgba(0,0,0,.6);
}
.modal-icon {
    display: flex; align-items: center; justify-content: center;
    width: 56px; height: 56px;
    background: var(--pink-glow); border: 1px solid var(--pink-dim);
    border-radius: 50%; margin: 0 auto 18px; color: var(--pink);
}
.modal-title   { font-size: 18px; font-weight: 700; color: var(--text-1); margin-bottom: 10px; }
.modal-message { font-size: 13.5px; color: var(--text-2); line-height: 1.65; margin-bottom: 26px; }
.modal-close-btn {
    padding: 10px 30px;
    background: linear-gradient(135deg, var(--pink), #c2185b);
    border-radius: 50px; color: #fff; font-size: 13px; font-weight: 700;
    box-shadow: 0 0 20px var(--pink-dim); transition: all var(--t);
}
.modal-close-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 28px var(--pink-dim); }

/* ════════════════════════════════════════
   RESPONSIVE ≤ 860 px
   ════════════════════════════════════════ */
@media (max-width: 860px) {
    html, body { overflow: auto; }

    .app-container {
        grid-template-rows: 1fr auto;
        width: 100%;
        height: auto;
        overflow: visible;
    }

    .main-row {
        flex-direction: column;
    }

    .panel-left {
        width: 100%;
        height: auto;
        max-height: 55vh;
        overflow-y: auto;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }

    .panel-right {
        height: auto;
        overflow: visible;
    }

    .panel-queue { display: none; }

    /* Restore aspect-ratio trick since panel-right no longer has a fixed height */
    .video-container {
        flex: none;
        min-height: unset;
        aspect-ratio: 16 / 9;
    }

    .transport { flex-wrap: wrap; height: auto; padding: 10px 16px; }

    .vol-slider { width: 70px; }
    .lyric-current { font-size: 20px; }
}

@media (max-width: 480px) {
    .panel-left  { padding: 16px 14px; }
    .panel-right { padding: 14px; gap: 10px; }
    .transport-play  { width: 48px; height: 48px; }
    .transport-ghost { width: 36px; height: 36px; }
    .vol-slider { width: 56px; }
}
