:root {
    /* Default Dark Mode (Mahogany Retro) */
    --bg-gradient-1: #2a2c33;
    --bg-gradient-2: #0d0d12;
    --wood-base: #3b2210;
    --wood-light: #5c3518;
    --wood-dark: #221206;
    --metal-base: #d4af37; /* Brass gold */
    --metal-highlight: #ffebb0;
    --metal-shadow: #856914;
    --dial-bg: #1a1a1a;
    --dial-glow-off: #24221b;
    --dial-glow-on: #e6b873;
    --dial-glow-shadow: rgba(230, 184, 115, 0.75);
    --grill-base: #1c1511;
    --grill-line: #3b2f27;
    --text-primary: #fff;
    --text-dial: #555;
    --text-dial-on: #1a1005;
    --accent-neon: #00ffcc;
    --accent-red: #e74c3c;
    --surface-glass: rgba(20, 20, 32, 0.85);
    --surface-glass-border: rgba(255, 255, 255, 0.12);
}

[data-theme="light"] {
    /* Light Mode (Birch/Oak Retro) */
    --bg-gradient-1: #d1d5db;
    --bg-gradient-2: #9ca3af;
    --wood-base: #d4a373;
    --wood-light: #e6ccb2;
    --wood-dark: #b5835a;
    --metal-base: #c0c0c0; /* Silver */
    --metal-highlight: #ffffff;
    --metal-shadow: #808080;
    --dial-bg: #e5e5e5;
    --dial-glow-off: #cccccc;
    --dial-glow-on: #b3e6ff; /* Cool blue glow for light mode */
    --dial-glow-shadow: rgba(179, 230, 255, 0.8);
    --grill-base: #e6ccb2;
    --grill-line: #b5835a;
    --text-primary: #1f2937;
    --text-dial: #777;
    --text-dial-on: #003366;
    --surface-glass: rgba(255, 255, 255, 0.88);
    --surface-glass-border: rgba(0, 0, 0, 0.12);
}

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

html {
    font-size: 16px;
    height: 100%;
}

body {
    min-height: 100%;
    width: 100%;
    font-family: 'Oswald', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-gradient-2);
    color: var(--text-primary);
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-font-smoothing: antialiased;
    touch-action: manipulation;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
}
::-webkit-scrollbar-thumb {
    background: var(--metal-shadow);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--metal-base);
}

/* --- Master Mode Switcher --- */
.master-switcher {
    position: fixed;
    top: 14px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    display: inline-flex;
    align-items: center;
    background: rgba(12, 14, 20, 0.88);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid var(--metal-shadow);
    border-radius: 35px;
    padding: 4px;
    box-shadow: 0 6px 25px rgba(0,0,0,0.6), 0 0 12px rgba(212, 175, 55, 0.18);
    max-width: calc(100vw - 28px);
    transition: all 0.3s ease;
}

.master-switcher button {
    background: transparent;
    border: none;
    color: #aaa;
    padding: 8px 18px;
    border-radius: 28px;
    font-family: 'Oswald', sans-serif;
    font-size: clamp(0.85rem, 2vw, 0.95rem);
    font-weight: 500;
    letter-spacing: 0.5px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.master-switcher button:hover {
    color: #fff;
}

.master-switcher button.active {
    background: linear-gradient(135deg, var(--metal-highlight) 0%, var(--metal-base) 50%, var(--metal-shadow) 100%);
    color: #1a1005;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(0,0,0,0.4), inset 0 1px 2px rgba(255,255,255,0.7);
}

/* --- Retro Mode Container --- */
#retroMode {
    position: relative;
    min-height: 100vh;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: clamp(75px, 10vh, 95px) 14px 60px;
    box-sizing: border-box;
    overflow-x: hidden;
}

/* Background Scene */
.room-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 50% 35%, var(--bg-gradient-1) 0%, var(--bg-gradient-2) 75%);
    z-index: 1;
    pointer-events: none;
    transition: background 0.5s ease;
}

.scene {
    position: relative;
    z-index: 2;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(20px, 3vh, 32px);
}

/* --- Radio Cabinet (Wood Shell) --- */
.radio-cabinet {
    width: min(94vw, 900px);
    margin: 0 auto;
    background-color: var(--wood-base);
    background-image: 
        linear-gradient(90deg, rgba(0,0,0,0.35) 0%, transparent 18%, transparent 82%, rgba(0,0,0,0.35) 100%),
        repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0,0,0,0.06) 2px, rgba(0,0,0,0.06) 4px);
    border-radius: clamp(14px, 2.5vw, 22px);
    box-shadow: 
        inset 0 10px 20px rgba(255,255,255,0.06),
        inset 0 -20px 30px rgba(0,0,0,0.65),
        0 25px 45px rgba(0,0,0,0.75),
        0 8px 16px rgba(0,0,0,0.45);
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: background-color 0.5s ease, box-shadow 0.3s ease;
}

/* Metallic Trims */
.trim {
    width: 100%;
    background: linear-gradient(to bottom, var(--metal-highlight) 0%, var(--metal-base) 50%, var(--metal-shadow) 100%);
    box-shadow: 0 2px 5px rgba(0,0,0,0.5);
    z-index: 10;
}
.trim-top {
    height: 12px;
    border-radius: clamp(14px, 2.5vw, 22px) clamp(14px, 2.5vw, 22px) 0 0;
}
.trim-bottom {
    height: 14px;
    border-radius: 0 0 clamp(8px, 2vw, 14px) clamp(8px, 2vw, 14px);
}

/* Top Controls Section */
.top-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    padding: 10px clamp(14px, 3vw, 28px);
    background: rgba(0,0,0,0.45);
    border-bottom: 2px solid var(--metal-shadow);
}

.control-group {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--metal-highlight);
    font-size: clamp(0.8rem, 1.8vw, 0.9rem);
    letter-spacing: 1px;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 24px;
    flex-shrink: 0;
}
.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #444;
    transition: .3s;
    border: 1px solid rgba(0,0,0,0.4);
}
.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: var(--metal-highlight);
    transition: .3s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.4);
}
input:checked + .slider {
    background-color: var(--metal-base);
}
input:checked + .slider:before {
    transform: translateX(24px);
}
.slider.round {
    border-radius: 24px;
}
.slider.round:before {
    border-radius: 50%;
}

/* Search Group */
.search-group {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1 1 240px;
    justify-content: center;
}
.search-group input {
    background: rgba(255,255,255,0.1);
    border: 1px solid var(--metal-shadow);
    color: #fff;
    padding: 6px 12px;
    border-radius: 5px;
    font-family: 'Oswald', sans-serif;
    font-size: 0.9rem;
    outline: none;
    width: 100%;
    max-width: 260px;
    min-width: 120px;
    transition: border-color 0.2s, background 0.2s;
}
.search-group input:focus {
    border-color: var(--metal-highlight);
    background: rgba(255,255,255,0.18);
}
.search-group input::placeholder {
    color: rgba(255, 255, 255, 0.45);
    font-style: italic;
}
[data-theme="light"] .search-group input {
    color: #111;
    background: rgba(0, 0, 0, 0.08);
}
[data-theme="light"] .search-group input::placeholder {
    color: rgba(0, 0, 0, 0.45);
}

.search-group button {
    background: linear-gradient(to bottom, var(--metal-highlight), var(--metal-base));
    color: #1a1005;
    border: 1px solid var(--metal-shadow);
    padding: 6px 14px;
    border-radius: 5px;
    font-family: 'Oswald', sans-serif;
    font-weight: 700;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.4);
    white-space: nowrap;
    transition: transform 0.1s, box-shadow 0.1s;
    min-height: 34px;
}
.search-group button:hover {
    filter: brightness(1.08);
}
.search-group button:active {
    transform: scale(0.96);
}

/* Region Toggle */
.region-toggle {
    display: inline-flex;
    border-radius: 5px;
    overflow: hidden;
    border: 1px solid var(--metal-shadow);
}
.region-toggle button {
    background: #222;
    color: #aaa;
    border: none;
    padding: 5px 12px;
    cursor: pointer;
    font-family: 'Oswald', sans-serif;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s ease;
    min-height: 32px;
}
.region-toggle button:hover {
    color: #fff;
}
.region-toggle button.active {
    background: var(--metal-base);
    color: #1a1005;
    font-weight: 700;
    box-shadow: inset 0 1px 3px rgba(255,255,255,0.4);
}

/* --- Radio Front Split --- */
.radio-front {
    display: flex;
    padding: clamp(16px, 3.5vw, 32px);
    gap: clamp(20px, 3.5vw, 40px);
    align-items: stretch;
}

/* Speaker Section */
.speaker-section {
    flex: 1.1;
    background: var(--wood-dark);
    border-radius: 10px;
    padding: 12px;
    box-shadow: inset 0 5px 15px rgba(0,0,0,0.85);
    position: relative;
    display: flex;
    min-height: 220px;
    transition: background 0.5s ease;
}

.speaker-grill {
    width: 100%;
    height: 100%;
    min-height: 180px;
    background-color: var(--grill-base);
    background-image: 
        linear-gradient(45deg, var(--grill-line) 25%, transparent 25%, transparent 75%, var(--grill-line) 75%, var(--grill-line)), 
        linear-gradient(45deg, var(--grill-line) 25%, transparent 25%, transparent 75%, var(--grill-line) 75%, var(--grill-line));
    background-size: 10px 10px;
    background-position: 0 0, 5px 5px;
    border-radius: 6px;
    box-shadow: inset 0 0 35px rgba(0,0,0,0.9);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.5s ease;
}

.brand-badge {
    position: absolute;
    bottom: 14px;
    right: 14px;
    background: linear-gradient(135deg, var(--metal-highlight) 0%, var(--metal-base) 50%, var(--metal-shadow) 100%);
    padding: 4px 14px;
    border-radius: 3px;
    font-family: 'Playfair Display', serif;
    font-style: italic;
    font-weight: 700;
    font-size: clamp(0.95rem, 2vw, 1.2rem);
    color: #33250b;
    box-shadow: 2px 2px 6px rgba(0,0,0,0.6), inset 1px 1px 2px rgba(255,255,255,0.8);
    pointer-events: none;
}

/* Controls Section */
.controls-section {
    flex: 1.2;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 16px;
}

/* Tuning Display */
.dial-display-container {
    background: #111;
    padding: 10px;
    border-radius: 8px;
    box-shadow: inset 0 5px 12px rgba(0,0,0,0.9), 0 2px 0 rgba(255,255,255,0.1);
    border: 3px solid var(--wood-dark);
}

.dial-display {
    min-height: 135px;
    background-color: var(--dial-glow-off);
    border-radius: 4px;
    position: relative;
    overflow: hidden;
    transition: background-color 0.5s ease, box-shadow 0.5s ease;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 10px 14px;
}

.dial-display.on {
    background-color: var(--dial-glow-on);
    box-shadow: inset 0 0 45px var(--dial-glow-shadow), 0 0 18px rgba(230, 184, 115, 0.45);
}

.dial-glass {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(135deg, rgba(255,255,255,0.28) 0%, transparent 45%, transparent 100%);
    z-index: 10;
    pointer-events: none;
}

/* Live On Air Badge inside dial */
.live-indicator {
    position: absolute;
    top: 8px;
    left: 10px;
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 1px;
    color: #555;
    z-index: 15;
    transition: color 0.3s ease;
}

.dial-display.on .live-indicator {
    color: #b71c1c;
}

.live-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #555;
    transition: background 0.3s ease;
}

.dial-display.on .live-dot {
    background: #e74c3c;
    box-shadow: 0 0 6px #e74c3c;
    animation: livePulse 1.2s infinite alternate ease-in-out;
}

@keyframes livePulse {
    0% { opacity: 0.4; transform: scale(0.9); }
    100% { opacity: 1; transform: scale(1.15); }
}

.frequencies {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 8px;
    position: relative;
    top: -4px;
    font-family: 'Oswald', sans-serif;
    color: var(--text-dial);
    font-weight: 700;
    font-size: clamp(0.9rem, 2.2vw, 1.2rem);
    opacity: 0.55;
    transition: opacity 0.5s ease, color 0.5s ease;
}

.dial-display.on .frequencies {
    opacity: 1;
    color: var(--text-dial-on);
}

.fm-label {
    position: absolute;
    right: 10px;
    bottom: -22px;
    font-size: 0.85rem;
    opacity: 0.6;
    font-weight: 700;
}

.tuning-needle {
    position: absolute;
    top: 10px;
    bottom: 38px;
    width: 3px;
    background: #c0392b;
    left: 10%;
    box-shadow: 1px 0 4px rgba(0,0,0,0.6);
    z-index: 5;
    transition: left 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.tuning-needle::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    width: 7px;
    height: 7px;
    background: #e74c3c;
    border-radius: 50%;
    box-shadow: 0 0 4px #e74c3c;
}

.station-info {
    position: absolute;
    bottom: 8px;
    left: 0;
    width: 100%;
    text-align: center;
    font-family: 'VT323', monospace;
    color: var(--text-dial-on);
    opacity: 0;
    transition: opacity 0.5s ease;
    text-shadow: 0 0 5px rgba(255,255,255,0.5);
    padding: 0 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dial-display.on .station-info {
    opacity: 1;
}
.station-name {
    font-size: clamp(1.15rem, 2.5vw, 1.45rem);
    letter-spacing: 1px;
    overflow: hidden;
    text-overflow: ellipsis;
}
.station-freq {
    font-size: clamp(0.95rem, 2vw, 1.15rem);
    opacity: 0.85;
}

/* Route to Deck Buttons */
.deck-routing-controls {
    position: absolute;
    top: 6px;
    right: 8px;
    display: flex;
    gap: 6px;
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 20;
}

.dial-display.on .deck-routing-controls:not(.hidden) {
    opacity: 1;
}

.deck-routing-controls button {
    background: rgba(0, 0, 0, 0.72);
    color: var(--metal-highlight);
    border: 1px solid var(--metal-shadow);
    border-radius: 4px;
    padding: 3px 8px;
    font-family: 'Oswald', sans-serif;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.5);
    transition: background 0.2s, transform 0.1s;
    min-height: 26px;
}

.deck-routing-controls button:hover {
    background: rgba(0, 0, 0, 0.9);
    border-color: var(--metal-highlight);
    transform: translateY(-1px);
}

.deck-routing-controls button:active {
    transform: scale(0.95);
}

/* Knobs */
.knobs-container {
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 8px 12px;
    gap: 12px;
}

.knob-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.knob-group label {
    font-size: clamp(0.75rem, 1.8vw, 0.85rem);
    color: var(--metal-highlight);
    letter-spacing: 1.5px;
    text-shadow: 1px 1px 2px #000;
    opacity: 0.85;
    font-weight: 700;
}

.knob {
    width: clamp(56px, 12vw, 70px);
    height: clamp(56px, 12vw, 70px);
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #555 0%, #222 70%, #111 100%);
    border: 3px solid var(--metal-shadow);
    box-shadow: 0 5px 10px rgba(0,0,0,0.7), inset 0 2px 5px rgba(255,255,255,0.25);
    position: relative;
    cursor: pointer;
    outline: none;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--metal-highlight);
    font-size: clamp(1rem, 2.5vw, 1.25rem);
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.2s;
    touch-action: manipulation;
}

.knob:hover {
    border-color: var(--metal-highlight);
}

.knob:active {
    transform: scale(0.94) translateY(2px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.7), inset 0 2px 5px rgba(255,255,255,0.3);
}

.power-knob .knob-indicator {
    width: 4px;
    height: 14px;
    background: #e74c3c;
    position: absolute;
    top: 8px;
    border-radius: 2px;
    transition: transform 0.3s ease;
    box-shadow: 0 0 6px #e74c3c;
}

.power-knob.active {
    transform: rotate(90deg);
}

.tuning-knob span {
    text-shadow: 1px 1px 2px #000;
}

/* --- DJ Prompt Section --- */
.dj-prompt-container {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-top: 4px;
}

.dj-prompt-btn {
    background: linear-gradient(135deg, #ff00cc 0%, #333399 100%);
    color: white;
    border: 2px solid rgba(255,255,255,0.6);
    padding: clamp(10px, 2.5vw, 14px) clamp(20px, 4vw, 32px);
    border-radius: 30px;
    font-family: 'Oswald', sans-serif;
    font-size: clamp(0.95rem, 2.2vw, 1.15rem);
    font-weight: 700;
    letter-spacing: 0.5px;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(0,0,0,0.5), 0 0 15px rgba(255, 0, 204, 0.35);
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s;
    text-align: center;
}

.dj-prompt-btn:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 25px rgba(255,0,204,0.5);
    filter: brightness(1.1);
}

.dj-prompt-btn:active {
    transform: scale(0.97);
}

/* --- DJ Mixer Panel --- */
.dj-mixer-panel {
    width: min(94vw, 900px);
    margin: 0 auto;
    background: var(--wood-dark);
    border: 2px solid var(--metal-shadow);
    border-radius: 16px;
    padding: clamp(16px, 3vw, 24px);
    box-shadow: inset 0 5px 15px rgba(0,0,0,0.8), 0 12px 28px rgba(0,0,0,0.65);
    display: flex;
    flex-direction: column;
    gap: 20px;
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.dj-mixer-panel.hidden {
    display: none;
    opacity: 0;
    transform: translateY(20px);
}

.mixer-header h2 {
    color: var(--metal-highlight);
    text-align: center;
    font-family: 'Playfair Display', serif;
    font-style: italic;
    font-size: clamp(1.3rem, 3vw, 1.7rem);
    border-bottom: 1px solid var(--metal-shadow);
    padding-bottom: 10px;
}

/* Decks Split */
.mixer-decks {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    background: rgba(0,0,0,0.35);
    padding: clamp(12px, 2.5vw, 20px);
    border-radius: 10px;
}

.deck {
    flex: 1;
    background: #111;
    padding: 14px;
    border-radius: 8px;
    border: 2px solid var(--metal-shadow);
    text-align: center;
    box-shadow: inset 0 2px 10px rgba(0,0,0,0.9);
    min-width: 0; /* allows text truncation inside flex child */
}

.deck h3 {
    color: var(--metal-highlight);
    margin-bottom: 8px;
    font-size: 0.95rem;
    letter-spacing: 1px;
}

.deck-display {
    background: var(--dial-glow-off);
    color: var(--text-dial-on);
    font-family: 'VT323', monospace;
    font-size: 1.15rem;
    padding: 8px 10px;
    border-radius: 4px;
    margin-bottom: 14px;
    min-height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.5);
    transition: background 0.3s, box-shadow 0.3s;
}

.deck-display span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    width: 100%;
}

.deck-display.active {
    background: var(--dial-glow-on);
    box-shadow: inset 0 0 15px var(--dial-glow-shadow);
}

.deck-controls .play-pause-btn {
    background: radial-gradient(circle at top left, #444, #111);
    color: var(--metal-highlight);
    border: 2px solid var(--metal-shadow);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.15rem;
    box-shadow: 0 4px 8px rgba(0,0,0,0.5);
    transition: transform 0.15s, border-color 0.2s;
    touch-action: manipulation;
}

.deck-controls .play-pause-btn:hover {
    border-color: var(--metal-highlight);
}
.deck-controls .play-pause-btn:active {
    transform: scale(0.92);
}

/* Crossfader */
.fader-section {
    flex: 0.9;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 0 8px;
    min-width: 0;
}

.fader-section label {
    color: var(--metal-highlight);
    font-size: 0.85rem;
    letter-spacing: 2px;
    font-weight: 700;
}

.crossfader-input {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 12px;
    background: #000;
    border-radius: 6px;
    outline: none;
    border: 1px solid #444;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.8);
    cursor: pointer;
}

.crossfader-input::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 42px;
    background: linear-gradient(to bottom, #dedede 0%, #888 60%, #555 100%);
    border: 2px solid #222;
    border-radius: 4px;
    cursor: ew-resize;
    box-shadow: 0 3px 6px rgba(0,0,0,0.6), inset 0 1px 1px #fff;
    transition: transform 0.1s;
}

.crossfader-input::-webkit-slider-thumb:hover {
    transform: scaleY(1.05);
}

.fader-labels {
    display: flex;
    justify-content: space-between;
    width: 100%;
    color: var(--metal-highlight);
    font-weight: 700;
    font-size: 0.85rem;
    padding: 0 4px;
}

/* Playlist Section */
.playlist-section {
    background: rgba(0,0,0,0.4);
    padding: 14px;
    border-radius: 8px;
    border: 1px solid var(--metal-shadow);
}

.playlist-section h3 {
    color: var(--metal-highlight);
    margin-bottom: 10px;
    font-size: 1.05rem;
    text-align: center;
    letter-spacing: 1px;
}

.playlist-list {
    list-style: none;
    max-height: 170px;
    overflow-y: auto;
    padding-right: 6px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.playlist-item {
    background: rgba(255,255,255,0.06);
    padding: 8px 12px;
    border-radius: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #ccc;
    font-size: clamp(0.85rem, 2vw, 0.95rem);
    gap: 10px;
    transition: background 0.2s;
}

.playlist-item:hover {
    background: rgba(255,255,255,0.12);
}

.playlist-item span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

.playlist-item div {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.load-btn {
    background: var(--metal-base);
    color: #1a1005;
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-family: 'Oswald', sans-serif;
    font-weight: 700;
    font-size: 0.8rem;
    transition: background 0.2s, transform 0.1s;
    min-height: 30px;
    touch-action: manipulation;
}

.load-btn:hover {
    background: var(--metal-highlight);
}
.load-btn:active {
    transform: scale(0.95);
}

/* --- Globe Mode Container --- */
#globeMode {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    background: #000010;
    z-index: 50;
    overflow: hidden;
}

#globeViz {
    width: 100%;
    height: 100%;
}

/* Globe UI Overlay (Bottom HUD / Bottom Sheet) */
.globe-ui-overlay {
    position: absolute;
    bottom: clamp(20px, 4vh, 40px);
    left: clamp(16px, 4vw, 40px);
    background: rgba(14, 16, 26, 0.92);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid rgba(0, 255, 204, 0.3);
    border-radius: 18px;
    padding: 18px 20px;
    width: clamp(340px, 32vw, 430px);
    max-width: calc(100vw - 32px);
    box-shadow: 0 14px 40px rgba(0,0,0,0.85), 0 0 25px rgba(0, 255, 204, 0.18);
    display: flex;
    flex-direction: column;
    align-items: stretch;
    color: #fff;
    z-index: 60;
    transition: opacity 0.35s ease, transform 0.35s ease;
}

.globe-ui-overlay.hidden {
    opacity: 0;
    transform: translateY(24px);
    pointer-events: none;
}

.globe-station-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.globe-close-btn {
    position: absolute;
    top: 8px;
    right: 10px;
    background: transparent;
    border: none;
    color: #888;
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s, transform 0.2s;
    width: 28px;
    height: 28px;
    z-index: 5;
}

.globe-close-btn:hover {
    color: #fff;
    transform: scale(1.1);
}

.globe-station-info {
    flex: 1;
    overflow: hidden;
    padding-right: 12px;
}

.globe-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 1px;
    color: #00ffcc;
    margin-bottom: 6px;
    font-family: 'Oswald', sans-serif;
}

.pulse-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #00ffcc;
    box-shadow: 0 0 8px #00ffcc;
    animation: livePulse 1.2s infinite alternate ease-in-out;
}

#globeStationName {
    font-family: 'Playfair Display', serif;
    font-size: clamp(1.2rem, 2.5vw, 1.45rem);
    margin-bottom: 4px;
    color: #00ffcc;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-shadow: 0 0 10px rgba(0,255,204,0.45);
}

.globe-location {
    font-size: 0.95rem;
    color: #bbb;
    font-family: 'Oswald', sans-serif;
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.globe-tags {
    font-size: 0.8rem;
    color: #888;
    font-family: 'VT323', monospace;
    text-transform: uppercase;
    letter-spacing: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.globe-controls {
    flex-shrink: 0;
}

.globe-btn {
    background: rgba(0, 255, 204, 0.12);
    color: #00ffcc;
    border: 2px solid #00ffcc;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    font-size: 1.25rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 0 15px rgba(0,255,204,0.25);
    touch-action: manipulation;
}

.globe-btn:hover {
    background: rgba(0, 255, 204, 0.28);
    box-shadow: 0 0 22px rgba(0,255,204,0.5);
    transform: scale(1.06);
}

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

/* Quick Tech Hubs Bar */
.globe-hubs-bar {
    position: absolute;
    top: 66px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(10, 12, 22, 0.85);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    padding: 6px 14px;
    border-radius: 30px;
    border: 1px solid rgba(0, 255, 204, 0.25);
    box-shadow: 0 6px 20px rgba(0,0,0,0.6);
    max-width: calc(100vw - 20px);
    overflow-x: auto;
    white-space: nowrap;
}

.globe-hubs-bar::-webkit-scrollbar {
    display: none;
}

.hubs-label {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 1px;
    color: #00ffcc;
    font-family: 'Oswald', sans-serif;
    margin-right: 2px;
}

.hub-pill {
    background: rgba(255, 255, 255, 0.08);
    color: #ccc;
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.82rem;
    font-family: 'Oswald', sans-serif;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.hub-pill:hover, .hub-pill.active {
    background: rgba(0, 255, 204, 0.25);
    color: #fff;
    border-color: #00ffcc;
    transform: translateY(-1px);
    box-shadow: 0 0 10px rgba(0, 255, 204, 0.35);
}

/* Contextual Geo-Targeted SaaS Card */
.globe-saas-card {
    margin-top: 12px;
    background: linear-gradient(135deg, rgba(28, 20, 48, 0.92) 0%, rgba(14, 28, 42, 0.92) 100%);
    border: 1px solid rgba(175, 82, 222, 0.45);
    border-radius: 12px;
    padding: 12px 14px;
    position: relative;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.15), 0 4px 15px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: all 0.3s ease;
}

.globe-saas-card:hover {
    border-color: rgba(0, 255, 204, 0.6);
    box-shadow: 0 0 18px rgba(175, 82, 222, 0.3);
}

.saas-badge-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.saas-badge-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.saas-badge {
    background: linear-gradient(90deg, #ff00cc, #7928ca);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 1px;
    padding: 2px 8px;
    border-radius: 10px;
    text-transform: uppercase;
    font-family: 'Oswald', sans-serif;
}

.saas-location-tag {
    font-size: 0.75rem;
    color: #00ffcc;
    font-family: 'Oswald', sans-serif;
    font-weight: 500;
}

/* Micro-Carousel Controls */
.saas-carousel-nav {
    display: flex;
    align-items: center;
    gap: 5px;
    background: rgba(0, 0, 0, 0.4);
    padding: 2px 6px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.saas-nav-btn {
    background: transparent;
    border: none;
    color: #aaa;
    font-size: 0.95rem;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    padding: 0 4px;
    transition: color 0.2s, transform 0.1s;
    user-select: none;
}

.saas-nav-btn:hover {
    color: #00ffcc;
    transform: scale(1.2);
}

.saas-dots {
    display: flex;
    align-items: center;
    gap: 4px;
}

.saas-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: all 0.25s ease;
}

.saas-dot.active {
    background: #00ffcc;
    box-shadow: 0 0 6px #00ffcc;
    width: 14px;
    border-radius: 4px;
}

.saas-content {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.saas-content.switching {
    opacity: 0;
    transform: translateY(4px);
}

.saas-icon {
    font-size: 1.5rem;
    background: rgba(255, 255, 255, 0.08);
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.saas-info {
    flex: 1;
    min-width: 0;
}

.saas-name-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 2px;
}

.saas-name-row h4 {
    font-family: 'Oswald', sans-serif;
    font-size: 1.05rem;
    color: #fff;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.saas-category {
    font-size: 0.7rem;
    color: #bbb;
    font-family: 'VT323', monospace;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.saas-info p {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 0.76rem;
    color: #ccc;
    line-height: 1.35;
}

.saas-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 4px;
    gap: 8px;
}

.saas-auto-timer-pill {
    font-size: 0.65rem;
    color: #888;
    font-family: 'VT323', monospace;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.saas-cta-btn {
    background: linear-gradient(135deg, #00ffcc 0%, #00aa88 100%);
    color: #00221a;
    padding: 5px 12px;
    border-radius: 18px;
    font-family: 'Oswald', sans-serif;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 255, 204, 0.3);
    cursor: pointer;
}

.saas-cta-btn:hover {
    filter: brightness(1.15);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(0, 255, 204, 0.5);
}

.globe-loading {
    position: absolute;
    bottom: 20px;
    right: 20px;
    color: #00ffcc;
    font-family: 'VT323', monospace;
    font-size: 1.2rem;
    text-shadow: 0 0 6px #00ffcc;
    animation: pulse 1.5s infinite;
    z-index: 60;
    background: rgba(0, 0, 0, 0.65);
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid rgba(0, 255, 204, 0.3);
}

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

.hidden {
    display: none !important;
}

/* ==========================================================================
   RESPONSIVE DESIGN BREAKPOINTS (Senior UI/UX Responsive Architecture)
   ========================================================================== */

/* --- Tablet Breakpoint (<= 860px) --- */
@media (max-width: 860px) {
    .radio-front {
        flex-direction: column;
        gap: 20px;
        padding: 20px;
    }

    .speaker-section {
        min-height: 140px;
        height: 140px;
        flex: none;
    }

    .speaker-grill {
        min-height: 110px;
    }

    .brand-badge {
        bottom: 10px;
        right: 12px;
        font-size: 1rem;
        padding: 3px 10px;
    }

    .controls-section {
        gap: 14px;
    }

    .mixer-decks {
        gap: 12px;
        padding: 14px;
    }
}

/* --- Mobile Breakpoint (<= 640px) --- */
@media (max-width: 640px) {
    #retroMode {
        padding: 70px 10px 40px;
    }

    .master-switcher {
        top: 10px;
        padding: 3px;
        border-radius: 25px;
    }

    .master-switcher button {
        padding: 7px 14px;
        font-size: 0.85rem;
        gap: 4px;
    }

    .radio-cabinet {
        border-radius: 14px;
    }

    .trim-top {
        border-radius: 14px 14px 0 0;
        height: 10px;
    }
    .trim-bottom {
        border-radius: 0 0 10px 10px;
        height: 12px;
    }

    /* Wrap top controls on mobile */
    .top-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        padding: 10px 14px;
    }

    .top-controls > div {
        justify-content: space-between;
    }

    .search-group {
        order: 2;
        width: 100%;
        flex: 1 1 100%;
    }

    .search-group input {
        max-width: none;
        flex: 1;
    }

    .speaker-section {
        height: 110px;
        min-height: 110px;
        padding: 8px;
    }
    .speaker-grill {
        min-height: 90px;
    }

    .radio-front {
        padding: 14px;
        gap: 14px;
    }

    .dial-display-container {
        padding: 8px;
    }

    .dial-display {
        min-height: 120px;
        padding: 8px 10px;
    }

    .frequencies {
        font-size: 0.95rem;
    }

    .fm-label {
        bottom: -18px;
        font-size: 0.75rem;
    }

    .station-name {
        font-size: 1.15rem;
    }

    .deck-routing-controls {
        top: 4px;
        right: 4px;
        gap: 4px;
    }

    .deck-routing-controls button {
        padding: 2px 6px;
        font-size: 0.7rem;
        min-height: 24px;
    }

    /* Knobs sizing on mobile */
    .knobs-container {
        padding: 6px;
        gap: 8px;
    }

    .knob {
        width: 58px;
        height: 58px;
    }

    /* DJ Mixer Stacking on Mobile */
    .mixer-decks {
        flex-direction: column;
        gap: 14px;
    }

    .deck {
        width: 100%;
    }

    .fader-section {
        width: 100%;
        padding: 8px 4px;
    }

    .crossfader-input {
        height: 14px;
    }

    .crossfader-input::-webkit-slider-thumb {
        width: 28px;
        height: 44px;
    }

    .playlist-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .playlist-item div {
        width: 100%;
        justify-content: flex-end;
    }

    /* Globe Overlay Mobile Bottom Sheet */
    .globe-ui-overlay {
        left: 12px;
        right: 12px;
        bottom: 14px;
        width: calc(100vw - 24px);
        max-width: none;
        padding: 16px;
        border-radius: 14px;
    }

    #globeStationName {
        font-size: 1.2rem;
    }

    .globe-btn {
        width: 46px;
        height: 46px;
        font-size: 1.1rem;
    }

    .globe-loading {
        bottom: auto;
        top: 60px;
        right: 12px;
        font-size: 1rem;
    }
}

/* --- Very Small Devices (<= 380px) --- */
@media (max-width: 380px) {
    .master-switcher button {
        padding: 6px 10px;
        font-size: 0.78rem;
    }

    .frequencies {
        font-size: 0.85rem;
    }

    .knob {
        width: 52px;
        height: 52px;
    }

    .deck-routing-controls button {
        font-size: 0.65rem;
        padding: 2px 4px;
    }
}
