* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --text-primary: #e8e6e3;
    --text-secondary: #7a7875;
    --text-dim: #4a4845;
    --accent: #6b8f9e;
    --accent-warm: #9e7b6b;
    --glow: rgba(107, 143, 158, 0.15);
}

body {
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    height: 100vh;
    overflow: hidden;
    position: relative;
}

#weather-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

.static-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
    opacity: 0.03;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(255, 255, 255, 0.03) 2px,
        rgba(255, 255, 255, 0.03) 4px
    );
    animation: staticFlicker 0.15s infinite;
}

@keyframes staticFlicker {
    0%, 100% { opacity: 0.03; }
    50% { opacity: 0.05; }
}

.app {
    position: relative;
    z-index: 2;
    max-width: 1100px;
    margin: 0 auto;
    padding: 32px 32px 16px;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Station Header */
.station-header {
    text-align: center;
    margin-bottom: 24px;
    flex-shrink: 0;
}

.frequency {
    font-family: 'Space Mono', monospace;
    color: var(--text-dim);
    font-size: 12px;
    letter-spacing: 8px;
    margin-bottom: 8px;
}

.freq-number {
    color: var(--accent);
    text-shadow: 0 0 20px var(--glow);
}

.station-name {
    font-family: 'Space Mono', monospace;
    font-size: 40px;
    font-weight: 700;
    letter-spacing: 12px;
    color: var(--text-primary);
    text-shadow: 0 0 40px var(--glow);
    margin-bottom: 4px;
}

.station-tagline {
    font-size: 12px;
    letter-spacing: 6px;
    text-transform: lowercase;
    color: var(--text-secondary);
    font-weight: 300;
}

.broadcast-time {
    font-family: 'Space Mono', monospace;
    font-size: 10px;
    color: var(--text-dim);
    margin-top: 8px;
    letter-spacing: 2px;
}

.tune-in-hint {
    font-family: 'Space Mono', monospace;
    font-size: 10px;
    color: var(--accent);
    margin-top: 6px;
    letter-spacing: 3px;
    opacity: 0.6;
    animation: pulse 2s ease-in-out infinite;
}

.tune-in-hint.hidden {
    display: none;
}

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

/* Two Column Layout */
.two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    flex: 1;
    min-height: 0;
}

.col-left {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.col-right {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Now Playing */
.now-playing {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 24px;
    background: var(--bg-secondary);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.vinyl-container {
    flex-shrink: 0;
}

.vinyl {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    position: relative;
    background: conic-gradient(
        from 0deg,
        #1a1a1a, #2a2a2a, #1a1a1a, #2a2a2a,
        #1a1a1a, #2a2a2a, #1a1a1a, #2a2a2a
    );
    display: flex;
    align-items: center;
    justify-content: center;
    animation: spin 3s linear infinite;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
}

.vinyl.paused {
    animation-play-state: paused;
}

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

.vinyl-label {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.vinyl-text {
    font-family: 'Space Mono', monospace;
    font-size: 5px;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--bg-primary);
}

.album-art {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.album-art.visible {
    opacity: 0.7;
}

/* EQ Bars */
.eq-bars {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 2px;
    height: 20px;
    margin-top: 6px;
}

.eq-bars span {
    display: block;
    width: 3px;
    background: var(--accent);
    border-radius: 1px;
    opacity: 0.6;
    animation: eqBounce 0.8s ease-in-out infinite alternate;
}

.eq-bars span:nth-child(1) { animation-duration: 0.7s; height: 30%; }
.eq-bars span:nth-child(2) { animation-duration: 0.5s; height: 60%; animation-delay: 0.1s; }
.eq-bars span:nth-child(3) { animation-duration: 0.8s; height: 45%; animation-delay: 0.05s; }
.eq-bars span:nth-child(4) { animation-duration: 0.6s; height: 80%; animation-delay: 0.15s; }
.eq-bars span:nth-child(5) { animation-duration: 0.9s; height: 55%; animation-delay: 0.08s; }
.eq-bars span:nth-child(6) { animation-duration: 0.55s; height: 90%; animation-delay: 0.12s; }
.eq-bars span:nth-child(7) { animation-duration: 0.75s; height: 70%; animation-delay: 0.02s; }
.eq-bars span:nth-child(8) { animation-duration: 0.65s; height: 50%; animation-delay: 0.18s; }
.eq-bars span:nth-child(9) { animation-duration: 0.85s; height: 75%; animation-delay: 0.07s; }
.eq-bars span:nth-child(10) { animation-duration: 0.5s; height: 40%; animation-delay: 0.13s; }
.eq-bars span:nth-child(11) { animation-duration: 0.7s; height: 65%; animation-delay: 0.09s; }
.eq-bars span:nth-child(12) { animation-duration: 0.6s; height: 35%; animation-delay: 0.16s; }

@keyframes eqBounce {
    0% { transform: scaleY(0.3); }
    100% { transform: scaleY(1); }
}

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

.dj-intro {
    font-size: 11px;
    color: var(--text-dim);
    font-style: italic;
    margin-bottom: 6px;
    font-weight: 300;
    line-height: 1.5;
}

.track-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 4px;
    line-height: 1.3;
    transition: color 0.2s;
}

.track-title:hover {
    color: var(--accent);
}

.track-artist {
    font-size: 13px;
    color: var(--accent);
    margin-bottom: 6px;
}

.track-mood {
    font-size: 10px;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 3px;
}

/* Weather Controls */
.controls {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.weather-btn {
    background: var(--bg-secondary);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    padding: 10px 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.3s ease;
    color: var(--text-secondary);
}

.weather-btn:hover {
    border-color: rgba(107, 143, 158, 0.3);
    background: rgba(107, 143, 158, 0.05);
}

.weather-btn.active {
    border-color: var(--accent);
    background: rgba(107, 143, 158, 0.1);
    color: var(--text-primary);
    box-shadow: 0 0 20px var(--glow);
}

.weather-icon {
    font-size: 18px;
}

.weather-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-family: 'Space Mono', monospace;
}

/* Playlist */
.playlist-section {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

.playlist-header {
    font-family: 'Space Mono', monospace;
    font-size: 11px;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: var(--text-dim);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.playlist {
    list-style: none;
}

.playlist li {
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.02);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: var(--text-secondary);
    transition: color 0.2s;
}

.playlist li:hover {
    color: var(--text-primary);
}

.playlist li .song-name {
    font-weight: 400;
}

.playlist li .song-artist {
    font-size: 11px;
    color: var(--text-dim);
}

/* History */
.history-section {
    flex-shrink: 0;
}

.history-header {
    font-family: 'Space Mono', monospace;
    font-size: 11px;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: var(--text-dim);
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
}

.history-header:hover {
    color: var(--text-secondary);
}

.chevron {
    font-size: 10px;
    transition: transform 0.2s;
}

.chevron.open {
    transform: rotate(90deg);
}

.history-list {
    list-style: none;
    max-height: 200px;
    overflow-y: auto;
    transition: max-height 0.3s ease, opacity 0.3s ease;
}

.history-list.collapsed {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
}

.history-list li {
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.02);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: var(--text-secondary);
    transition: color 0.2s;
}

.history-list li:hover {
    color: var(--text-primary);
}

.history-artist {
    color: var(--text-dim);
    font-weight: 300;
}

.history-meta {
    font-size: 10px;
    color: var(--text-dim);
    font-family: 'Space Mono', monospace;
    white-space: nowrap;
    margin-left: 8px;
}

.history-empty {
    color: var(--text-dim);
    font-style: italic;
    font-size: 11px;
    padding: 8px 0;
}

/* Host Message */
.host-section {
    margin-top: auto;
}

.host-message {
    font-size: 12px;
    color: var(--text-secondary);
    font-style: italic;
    line-height: 1.6;
    font-weight: 300;
}

/* Atmosphere Mixer */
.atmosphere-mixer {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.mixer-label {
    font-family: 'Space Mono', monospace;
    font-size: 9px;
    letter-spacing: 3px;
    color: var(--text-dim);
    white-space: nowrap;
    flex-shrink: 0;
}

.mixer-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 3px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

.mixer-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    box-shadow: 0 0 8px var(--glow);
}

.mixer-slider::-moz-range-thumb {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    border: none;
    box-shadow: 0 0 8px var(--glow);
}

/* Spotify Embed */
.spotify-embed-container {
    border-radius: 12px;
    overflow: hidden;
    display: none;
}

.spotify-embed-container.visible {
    display: block;
    padding: 16px;
    background: var(--bg-secondary);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.spotify-embed-container.visible::before {
    content: "NOW PLAYING";
    display: block;
    font-family: 'Space Mono', monospace;
    font-size: 10px;
    letter-spacing: 3px;
    color: var(--accent);
    margin-bottom: 12px;
}

/* Footer */
.station-footer {
    text-align: center;
    padding-top: 12px;
    flex-shrink: 0;
}

.station-sig {
    font-family: 'Space Mono', monospace;
    font-size: 9px;
    color: var(--text-dim);
    letter-spacing: 3px;
}

/* Weather-specific themes */
body.weather-rain {
    --accent: #6b8f9e;
    --glow: rgba(107, 143, 158, 0.15);
}

body.weather-storm {
    --accent: #9e6b9e;
    --glow: rgba(158, 107, 158, 0.15);
}

body.weather-fog {
    --accent: #8a8a7e;
    --glow: rgba(138, 138, 126, 0.15);
}

body.weather-snow {
    --accent: #9eaab8;
    --glow: rgba(158, 170, 184, 0.15);
}

body.weather-clear {
    --accent: #b89e6b;
    --glow: rgba(184, 158, 107, 0.15);
}

/* Fullscreen */
.fullscreen-btn {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 10;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: var(--text-dim);
    font-size: 18px;
    width: 36px;
    height: 36px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    line-height: 1;
}

.fullscreen-btn:hover {
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.08);
}

.fullscreen-overlay {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 5;
    padding: 32px;
    pointer-events: none;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.6));
}

body.is-fullscreen .app {
    display: none;
}

body.is-fullscreen .fullscreen-overlay {
    display: block;
}

body.is-fullscreen .fullscreen-btn {
    z-index: 10;
}

.fs-track-info {
    text-align: left;
}

.fs-track-title {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.fs-track-artist {
    font-size: 14px;
    color: var(--accent);
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

/* Lightning flash */
.lightning-flash {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(200, 200, 255, 0.1);
    z-index: 3;
    pointer-events: none;
    animation: flash 0.2s ease-out forwards;
}

@keyframes flash {
    0% { opacity: 1; }
    100% { opacity: 0; }
}

/* Responsive — stack on mobile */
@media (max-width: 768px) {
    body {
        height: auto;
        overflow: auto;
    }

    .app {
        height: auto;
        padding: 24px 16px;
        max-width: 600px;
    }

    .two-col {
        grid-template-columns: 1fr;
    }

    .station-name {
        font-size: 28px;
        letter-spacing: 8px;
    }

    .controls {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }

    .weather-btn {
        flex-direction: column;
        gap: 4px;
        padding: 10px 12px;
    }

    .now-playing {
        flex-direction: column;
        text-align: center;
    }
}
