/* Stream Control Center - Production Remote v3 */

:root {
    --bg: #0c1015;
    --surface: #151c25;
    --surface2: #1a2433;
    --surface3: #223040;
    --card: #182230;
    --border: #2e3f54;
    --border-bright: #4a6480;
    --text: #f2f5f9;
    --text-secondary: #c0d0e0;
    --text-muted: #8a9db4;
    --accent: #4a9eff;
    --accent-bright: #6eb4ff;
    --accent-glow: rgba(74, 158, 255, 0.18);
    --accent-deep: rgba(74, 158, 255, 0.08);
    --green: #3dd68c;
    --green-bright: #5ae8a4;
    --green-glow: rgba(61, 214, 140, 0.15);
    --yellow: #f0c030;
    --red: #ff5c5c;
    --red-bright: #ff7a7a;
    --red-glow: rgba(255, 92, 92, 0.15);
    --purple: #b388ff;
    --orange: #ff9940;
    --nav-height: 58px;
    --header-height: 50px;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --radius: 12px;
    --radius-sm: 8px;
    --radius-pill: 50px;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.4);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.5);
    --shadow-glow-accent: 0 0 20px rgba(74, 158, 255, 0.2);
    --shadow-glow-green: 0 0 16px rgba(61, 214, 140, 0.2);
    --shadow-glow-red: 0 0 16px rgba(255, 92, 92, 0.2);
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', system-ui, sans-serif;
    font-size: 15px;
    background: var(--bg);
    color: var(--text);
    overflow: hidden;
    touch-action: manipulation;
    -webkit-font-smoothing: antialiased;
}

/* ─── Header ─────────────────────────────────── */

#header {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--header-height);
    background: linear-gradient(180deg, #1a2535 0%, var(--surface) 100%);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    z-index: 100;
    box-shadow: 0 2px 12px rgba(0,0,0,0.35);
}

#profile-select {
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border-bright);
    border-radius: var(--radius-sm);
    padding: 6px 28px 6px 10px;
    font-size: 13px;
    font-weight: 700;
    max-width: 150px;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%238a9db4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    box-shadow: var(--shadow-sm);
}

#stream-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.dot {
    width: 10px; height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    transition: all 0.3s;
}

.dot.offline { background: #556677; }
.dot.live {
    background: var(--red);
    animation: pulse 1.4s ease-in-out infinite;
    box-shadow: 0 0 12px var(--red), 0 0 4px var(--red);
}
.dot.connected {
    background: var(--green);
    box-shadow: 0 0 10px rgba(61, 214, 140, 0.5);
}
.dot.recording {
    background: var(--orange);
    animation: pulse 1.4s ease-in-out infinite;
    box-shadow: 0 0 10px var(--orange);
}

@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }

#status-timer {
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
    font-size: 12px;
    font-weight: 500;
}

/* ─── Toast ──────────────────────────────────── */

#toast-container {
    position: fixed;
    top: calc(var(--header-height) + 10px);
    left: 50%; transform: translateX(-50%);
    z-index: 200;
    display: flex; flex-direction: column; gap: 6px;
    pointer-events: none;
}

.toast {
    background: rgba(26, 36, 51, 0.92);
    color: var(--text);
    border: 1px solid var(--border-bright);
    border-radius: var(--radius);
    padding: 10px 22px;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    animation: toastIn 0.25s ease, toastOut 0.3s ease 1.6s forwards;
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.toast.error { border-color: var(--red); color: var(--red-bright); }
.toast.success { border-color: var(--green); color: var(--green-bright); }

@keyframes toastIn { from { opacity: 0; transform: translateY(-10px) scale(0.95); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-10px) scale(0.95); } }

/* ─── Content Area ───────────────────────────── */

main {
    position: fixed;
    top: var(--header-height);
    bottom: calc(var(--nav-height) + var(--safe-bottom));
    left: 0; right: 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

.tab-panel { display: none; padding: 14px; padding-bottom: 28px; }
.tab-panel.active { display: block; }

/* ─── Bottom Nav ─────────────────────────────── */

#bottom-nav {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: calc(var(--nav-height) + var(--safe-bottom));
    padding-bottom: var(--safe-bottom);
    background: linear-gradient(0deg, #111820 0%, var(--surface) 100%);
    border-top: 1px solid var(--border);
    display: flex;
    z-index: 100;
    box-shadow: 0 -2px 12px rgba(0,0,0,0.3);
}

.nav-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    border: none;
    background: transparent;
    color: #5a7088;
    font-size: 10px;
    font-weight: 700;
    cursor: pointer;
    padding: 6px 0;
    transition: all 0.2s;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    position: relative;
}

.nav-btn .nav-icon {
    font-size: 20px;
    line-height: 1;
    width: 36px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s;
}

.nav-btn.active {
    color: var(--accent-bright);
}

.nav-btn.active .nav-icon {
    background: var(--accent-glow);
    box-shadow: 0 0 12px rgba(74, 158, 255, 0.15);
}

.nav-btn:active { color: var(--accent); }

/* ─── SCENES TAB ─────────────────────────────── */

.grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 14px;
}

.scene-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 72px;
    padding: 14px 10px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: linear-gradient(145deg, var(--surface2) 0%, var(--surface) 100%);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.18s ease;
    word-break: break-word;
    line-height: 1.25;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.scene-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.03) 0%, transparent 60%);
    pointer-events: none;
}

.scene-btn:active { transform: scale(0.95); }

.scene-btn.current {
    border-color: var(--accent);
    background: linear-gradient(145deg, rgba(74, 158, 255, 0.18) 0%, rgba(74, 158, 255, 0.06) 100%);
    color: #fff;
    font-weight: 700;
    box-shadow: var(--shadow-glow-accent), var(--shadow-sm);
}

.scene-btn.current::before {
    background: linear-gradient(135deg, rgba(74, 158, 255, 0.08) 0%, transparent 50%);
}

.stream-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
}

.ctrl-btn {
    flex: 1;
    padding: 13px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: linear-gradient(145deg, var(--surface2) 0%, var(--surface) 100%);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    box-shadow: var(--shadow-sm);
}

.ctrl-btn:active { transform: scale(0.95); }

.stream-btn.active {
    border-color: var(--red);
    background: linear-gradient(145deg, rgba(255, 92, 92, 0.2) 0%, rgba(255, 92, 92, 0.06) 100%);
    color: var(--red-bright);
    box-shadow: var(--shadow-glow-red), var(--shadow-sm);
}

.record-btn.active {
    border-color: var(--orange);
    background: linear-gradient(145deg, rgba(255, 153, 64, 0.2) 0%, rgba(255, 153, 64, 0.06) 100%);
    color: var(--orange);
}

.ctrl-icon { font-size: 14px; }

.stats-bar {
    font-size: 11px;
    color: var(--text-muted);
    text-align: center;
    padding: 2px 0;
}

/* Quick actions - hidden */
.quick-actions { display: none; }

/* ─── SOURCE PANEL ───────────────────────────── */

.source-panel {
    margin-top: 12px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.source-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    cursor: pointer;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    user-select: none;
    background: linear-gradient(180deg, rgba(255,255,255,0.02) 0%, transparent 100%);
}

.source-panel-header strong {
    color: var(--text-secondary);
    text-transform: none;
    letter-spacing: 0;
    font-size: 13px;
}

.arrow {
    font-size: 10px;
    color: var(--text-muted);
    transition: transform 0.25s;
}

.source-list {
    border-top: 1px solid var(--border);
    max-height: 600px;
    overflow-y: auto;
    transition: max-height 0.3s ease;
}

.source-list.collapsed {
    max-height: 0;
    border-top: none;
    overflow: hidden;
}

.source-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    border-bottom: 1px solid rgba(46, 63, 84, 0.4);
    transition: all 0.15s;
}

.source-row:last-child { border-bottom: none; }
.source-row:active { background: rgba(74, 158, 255, 0.04); }

.source-row.dragging {
    opacity: 0.3;
    background: var(--accent-deep);
}

.source-drag-handle {
    font-size: 12px;
    color: #4a6480;
    cursor: grab;
    padding: 6px 4px;
    flex-shrink: 0;
    touch-action: none;
    user-select: none;
    transition: all 0.15s;
}

.source-row:hover .source-drag-handle,
.source-drag-handle:active { color: var(--accent); cursor: grabbing; }

.source-icon {
    font-size: 13px;
    width: 18px;
    text-align: center;
    color: var(--text-muted);
    flex-shrink: 0;
}

.source-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.source-reorder {
    display: flex;
    gap: 3px;
    flex-shrink: 0;
}

.source-reorder button {
    width: 28px;
    height: 28px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text-muted);
    font-size: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: all 0.12s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.source-reorder button:active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
    transform: scale(0.88);
    box-shadow: var(--shadow-glow-accent);
}

.source-toggle {
    padding: 5px 14px;
    border-radius: var(--radius-pill);
    border: 1px solid;
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
    min-width: 48px;
    text-align: center;
    flex-shrink: 0;
    margin-left: auto;
    transition: all 0.15s;
    letter-spacing: 0.5px;
}

.source-toggle.on {
    background: var(--green-glow);
    border-color: var(--green);
    color: var(--green-bright);
    box-shadow: 0 0 10px rgba(61, 214, 140, 0.12);
}

.source-toggle.off {
    background: transparent;
    border-color: var(--border);
    color: #5a7088;
}

.source-toggle:active { transform: scale(0.9); }

/* ─── QUEUE TAB ──────────────────────────────── */

.now-playing {
    background: linear-gradient(135deg, rgba(74, 158, 255, 0.1) 0%, rgba(74, 158, 255, 0.03) 100%);
    border: 1px solid var(--accent);
    border-radius: var(--radius);
    padding: 14px;
    margin-bottom: 12px;
    box-shadow: var(--shadow-glow-accent), var(--shadow-sm);
}

.now-playing.hidden { display: none; }

.np-label {
    font-size: 10px;
    font-weight: 800;
    color: var(--accent-bright);
    letter-spacing: 2.5px;
    margin-bottom: 6px;
    text-transform: uppercase;
}

.np-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.np-next {
    width: 100%;
    padding: 11px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--green);
    background: linear-gradient(135deg, rgba(61, 214, 140, 0.15) 0%, rgba(61, 214, 140, 0.05) 100%);
    color: var(--green-bright);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.12s;
    box-shadow: var(--shadow-glow-green);
}

.np-next:active { transform: scale(0.97); filter: brightness(1.2); }

.queue-controls { margin-bottom: 12px; }

.add-url-row { display: flex; gap: 8px; margin-bottom: 8px; }

.add-url-row input {
    flex: 1;
    padding: 11px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    box-shadow: inset 0 1px 4px rgba(0,0,0,0.2);
    transition: all 0.15s;
}

.add-url-row input::placeholder { color: #5a7088; }
.add-url-row input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow), inset 0 1px 4px rgba(0,0,0,0.2);
}

.icon-btn {
    width: 46px; height: 46px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--accent);
    background: linear-gradient(145deg, rgba(74, 158, 255, 0.2) 0%, rgba(74, 158, 255, 0.08) 100%);
    color: var(--accent-bright);
    font-size: 22px;
    font-weight: 700;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.12s;
    box-shadow: var(--shadow-sm);
}

.icon-btn:active { transform: scale(0.9); background: var(--accent); color: #fff; }

.add-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    color: var(--text-muted);
}

.add-options label { display: flex; align-items: center; gap: 6px; cursor: pointer; }

.text-btn {
    background: none;
    border: none;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    transition: all 0.12s;
}

.text-btn.danger { color: var(--red); }
.text-btn.danger:active { background: var(--red-glow); }

/* Platform filter */
.platform-filter {
    display: flex;
    gap: 6px;
    margin-bottom: 10px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.platform-filter::-webkit-scrollbar { display: none; }

.plat-btn {
    flex-shrink: 0;
    padding: 7px 16px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s;
}

.plat-btn.active {
    border-color: var(--accent);
    background: var(--accent-glow);
    color: var(--accent-bright);
    box-shadow: 0 0 10px rgba(74, 158, 255, 0.1);
}

.plat-btn:active { transform: scale(0.94); }

/* Playlist loaders */
.playlist-loaders { display: flex; gap: 6px; margin-bottom: 12px; }

.loader-btn {
    flex: 1;
    padding: 9px 6px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--green);
    background: var(--green-glow);
    color: var(--green-bright);
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.12s;
    white-space: nowrap;
    box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}

.loader-btn[data-load="all"] { flex: 2; }

.loader-btn.yt { border-color: var(--red); color: var(--red-bright); background: var(--red-glow); }
.loader-btn.od { border-color: var(--accent); color: var(--accent-bright); background: var(--accent-glow); }
.loader-btn.bc { border-color: var(--yellow); color: var(--yellow); background: rgba(240, 192, 48, 0.1); }

.loader-btn:active { transform: scale(0.94); filter: brightness(1.25); }
.loader-btn:disabled { opacity: 0.35; }

.queue-list { display: flex; flex-direction: column; gap: 6px; }

.queue-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 12px;
    border-radius: var(--radius-sm);
    background: var(--card);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.12s;
    box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}

.queue-item:active { background: var(--surface3); }

.queue-item.playing {
    border-color: var(--accent);
    background: linear-gradient(135deg, rgba(74, 158, 255, 0.08) 0%, var(--card) 100%);
    box-shadow: 0 0 12px rgba(74, 158, 255, 0.08);
}

.queue-item.played { opacity: 0.3; }

.queue-item .qi-info { flex: 1; min-width: 0; }

.queue-item .qi-title {
    font-size: 13px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.queue-item .qi-meta {
    font-size: 11px;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-top: 3px;
}

.queue-item .qi-platform {
    font-size: 9px;
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid;
    font-weight: 700;
    margin-left: 4px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.queue-item .qi-remove {
    color: #5a7088;
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 4px 8px;
    flex-shrink: 0;
    transition: color 0.12s;
}

.queue-item .qi-remove:active { color: var(--red); }

.empty-state {
    text-align: center;
    color: var(--text-muted);
    padding: 44px 20px;
    font-size: 14px;
}

/* ─── TEXT TAB ───────────────────────────────── */

.text-group {
    margin-bottom: 14px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow-sm);
}

.text-group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.text-group-header h3,
.text-group h3 {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 700;
    margin-bottom: 0;
}

.vis-toggle {
    padding: 5px 14px;
    border-radius: var(--radius-pill);
    border: 1px solid;
    font-size: 10px;
    font-weight: 800;
    cursor: pointer;
    letter-spacing: 0.5px;
    transition: all 0.15s;
}

.vis-toggle.on {
    background: var(--green-glow);
    border-color: var(--green);
    color: var(--green-bright);
    box-shadow: 0 0 8px rgba(61, 214, 140, 0.1);
}

.vis-toggle.off {
    background: transparent;
    border-color: var(--border);
    color: #5a7088;
}

.vis-toggle:active { transform: scale(0.9); }

.vis-dot { font-size: 8px; vertical-align: middle; }
.vis-dot.on { color: var(--green); }
.vis-dot.off { color: #5a7088; }

.text-field { margin-bottom: 12px; }

.text-field label {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.text-field input {
    width: 100%;
    padding: 11px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    box-shadow: inset 0 1px 4px rgba(0,0,0,0.2);
    transition: all 0.15s;
}

.text-field input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow), inset 0 1px 4px rgba(0,0,0,0.2);
}

.text-actions { display: flex; gap: 8px; margin-top: 14px; }

.text-actions button {
    flex: 1;
    padding: 11px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.12s;
    box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}

.text-actions button:active { transform: scale(0.96); }

.text-actions .btn-update {
    border-color: var(--accent);
    color: var(--accent-bright);
    background: var(--accent-deep);
}

.text-actions .btn-clear {
    border-color: var(--border);
    color: var(--text-muted);
}

/* ─── AUDIO TAB ──────────────────────────────── */

.audio-source {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 10px;
    box-shadow: var(--shadow-sm);
}

.audio-source .as-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.audio-source .as-name {
    font-size: 15px;
    font-weight: 700;
}

.mute-btn {
    padding: 6px 16px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.12s;
}

.mute-btn.muted {
    border-color: var(--red);
    color: var(--red-bright);
    background: var(--red-glow);
    box-shadow: var(--shadow-glow-red);
}

.volume-row { display: flex; align-items: center; gap: 12px; }

.volume-slider {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    border-radius: 3px;
    background: var(--border);
    outline: none;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none; appearance: none;
    width: 24px; height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-bright) 0%, var(--accent) 100%);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(74, 158, 255, 0.35);
}

.volume-val {
    font-size: 13px;
    color: var(--text-muted);
    min-width: 40px;
    text-align: right;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}

.media-section {
    margin-top: 16px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow-sm);
}

.media-section h3 {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 700;
    margin-bottom: 14px;
}

.media-controls input {
    width: 100%;
    padding: 11px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    margin-bottom: 10px;
    box-shadow: inset 0 1px 4px rgba(0,0,0,0.2);
}

.media-controls input:focus { outline: none; border-color: var(--accent); }

.media-buttons { display: flex; gap: 8px; }
.media-buttons .ctrl-btn { flex: 1; }

/* ─── SFX TAB ────────────────────────────────── */

.sfx-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 14px;
    box-shadow: var(--shadow-sm);
}

.sfx-header label {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 700;
    flex-shrink: 0;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.sfx-header .volume-slider { flex: 1; }

#sfx-volume-val {
    font-size: 13px;
    color: var(--text-muted);
    min-width: 40px;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}

.sfx-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.sfx-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 84px;
    padding: 14px 8px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: linear-gradient(145deg, var(--surface2) 0%, var(--surface) 100%);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.12s;
    text-align: center;
    word-break: break-word;
    line-height: 1.2;
    box-shadow: var(--shadow-sm);
}

.sfx-btn .sfx-icon { font-size: 26px; line-height: 1; }

.sfx-btn:active { transform: scale(0.88); filter: brightness(1.4); }

.sfx-btn.playing { animation: sfxPulse 0.25s ease; }

@keyframes sfxPulse {
    0% { transform: scale(1); }
    50% { transform: scale(0.85); filter: brightness(1.6); }
    100% { transform: scale(1); }
}

/* ─── Utility ────────────────────────────────── */

.hidden { display: none; }

main::-webkit-scrollbar { width: 3px; }
main::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
main::-webkit-scrollbar-track { background: transparent; }

.loading::after {
    content: '';
    display: inline-block;
    width: 14px; height: 14px;
    border: 2px solid var(--text-muted);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin-left: 6px;
    vertical-align: middle;
}

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

/* Confirm modal */
.confirm-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.82);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 300;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.confirm-box {
    background: linear-gradient(145deg, var(--surface2) 0%, var(--surface) 100%);
    border: 1px solid var(--border-bright);
    border-radius: 16px;
    padding: 28px 24px;
    max-width: 300px;
    width: 85%;
    text-align: center;
    box-shadow: var(--shadow-lg);
}

.confirm-box p {
    margin-bottom: 22px;
    font-size: 16px;
    font-weight: 600;
}

.confirm-box .confirm-actions { display: flex; gap: 10px; }

.confirm-box button {
    flex: 1;
    padding: 12px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--card);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.12s;
    box-shadow: var(--shadow-sm);
}

.confirm-box .btn-confirm-yes {
    border-color: var(--red);
    color: var(--red-bright);
    background: var(--red-glow);
}

.confirm-box button:active { transform: scale(0.95); }
