/* ═══════════════════════════════════════════════════════════════ */
/* VINYL LISTENING ROOM - STYLES                                  */
/* This Leo Sunrise - "...and still return..."                    */
/* ═══════════════════════════════════════════════════════════════ */

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

body {
    font-family: 'Courier New', monospace;
    background: #000;
    color: #fff;
    overflow: hidden;
}

/* ═══════════════════════════════════════════ */
/* SCREEN 1: SIDE SELECTOR                    */
/* ═══════════════════════════════════════════ */

.side-selector {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: #000;
    z-index: 100;
    opacity: 1;
    transition: opacity 1s ease;
}

.side-selector.hidden {
    opacity: 0;
    pointer-events: none;
}

.selector-logo {
    width: 180px;
    max-width: 60vw;
    height: auto;
    filter: invert(1);
    margin-bottom: 16px;
    display: block;
}

.selector-subtitle {
    font-size: 24px;
    margin-bottom: 60px;
    opacity: 0.7;
}

.selector-instruction {
    font-size: 18px;
    margin-bottom: 40px;
    text-transform: uppercase;
    letter-spacing: 3px;
}

.sides-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    margin-bottom: 40px;
}

.side-button {
    width: 200px;
    height: 220px;
    background: #000;
    border: 5px solid #fff;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
}

.side-button:hover {
    transform: translateY(-10px);
}

.side-letter {
    font-size: 72px;
    font-weight: bold;
    margin-bottom: 20px;
}

.side-dot {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-bottom: 20px;
}

.side-color {
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.track-list {
    font-size: 12px;
    opacity: 0.6;
    text-align: center;
    margin-top: 10px;
}

/* Side A - Yellow */
.side-button[data-side="a"] .side-dot { background: #FFD700; }
.side-button[data-side="a"]:hover {
    border-color: #FFD700;
    box-shadow: 0 20px 40px rgba(255, 215, 0, 0.4);
}

/* Side B - Red */
.side-button[data-side="b"] .side-dot { background: #FF4444; }
.side-button[data-side="b"]:hover {
    border-color: #FF4444;
    box-shadow: 0 20px 40px rgba(255, 68, 68, 0.4);
}

/* Side C - Green */
.side-button[data-side="c"] .side-dot { background: #3E5A21; }
.side-button[data-side="c"]:hover {
    border-color: #3E5A21;
    box-shadow: 0 20px 40px rgba(62, 90, 33, 0.4);
}

/* Side D - Blue */
.side-button[data-side="d"] .side-dot { background: #4169E1; }
.side-button[data-side="d"]:hover {
    border-color: #4169E1;
    box-shadow: 0 20px 40px rgba(65, 105, 225, 0.4);
}

/* ═══════════════════════════════════════════ */
/* SCREEN 2: VINYL RITUAL ANIMATION           */
/* ═══════════════════════════════════════════ */

.vinyl-ritual {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 90;
    opacity: 0;
    pointer-events: none;
    transition: opacity 1s ease;
}

.vinyl-ritual.active {
    opacity: 1;
}

.ritual-text {
    font-size: 24px;
    margin-bottom: 60px;
    opacity: 0;
    animation: fadeInOut 2s ease forwards;
}

@keyframes fadeInOut {
    0%   { opacity: 0; transform: translateY(20px); }
    20%  { opacity: 1; transform: translateY(0); }
    80%  { opacity: 1; transform: translateY(0); }
    100% { opacity: 0; transform: translateY(-20px); }
}

.turntable {
    position: relative;
    width: 400px;
    height: 400px;
    opacity: 0;
}

.turntable.show {
    animation: fadeIn 1s ease forwards;
}

@keyframes fadeIn {
    to { opacity: 1; }
}

.platter {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 300px;
    height: 300px;
    border-radius: 50%;
    border: 3px solid #444;
    background: #222;
}

.platter::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #333;
    border: 2px solid #555;
}

.vinyl-record {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) translateX(-500px);
    width: 280px;
    height: 280px;
    border-radius: 50%;
    background: radial-gradient(circle, #1a1a1a 0%, #000 70%);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    opacity: 0;
}

.vinyl-record.slide-in {
    animation: slideIn 2s ease forwards;
}

@keyframes slideIn {
    0%   { transform: translate(-50%, -50%) translateX(-500px); opacity: 0; }
    100% { transform: translate(-50%, -50%) translateX(0); opacity: 1; }
}

.vinyl-record.spinning {
    animation: slideIn 2s ease forwards, spin 2s linear infinite 2s;
}

@keyframes spin {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to   { transform: translate(-50%, -50%) rotate(360deg); }
}

.vinyl-record::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    height: 90%;
    border-radius: 50%;
    background: repeating-radial-gradient(
        circle,
        transparent 0px,
        transparent 2px,
        rgba(255, 255, 255, 0.02) 2px,
        rgba(255, 255, 255, 0.02) 4px
    );
}

.vinyl-label {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100px;
    height: 100px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    font-weight: bold;
    border: 2px solid rgba(255, 255, 255, 0.1);
    background: #FFD700;
    color: #000;
}

.tonearm {
    position: absolute;
    top: 30%;
    right: 10%;
    width: 200px;
    height: 4px;
    background: #666;
    transform-origin: right center;
    transform: rotate(-30deg);
    opacity: 0;
}

.tonearm.show {
    animation: fadeIn 1s ease forwards 1s;
}

.tonearm.drop {
    animation: tonearmDrop 2s ease forwards 3s;
}

@keyframes tonearmDrop {
    to { transform: rotate(0deg); }
}

.tonearm::before {
    content: '';
    position: absolute;
    right: -10px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #888;
}

.tonearm::after {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 15px;
    height: 15px;
    background: #444;
    clip-path: polygon(0 0, 100% 50%, 0 100%);
}

.now-playing {
    position: absolute;
    bottom: 100px;
    font-size: 18px;
    opacity: 0;
}

.now-playing.show {
    animation: fadeIn 1s ease forwards 4s;
}

.ritual-credits {
    position: absolute;
    bottom: 60px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    font-size: 13px;
    line-height: 1.8;
    opacity: 0;
    letter-spacing: 1px;
    white-space: nowrap;
    color: rgba(255, 255, 255, 0.6);
}

.ritual-credits.show {
    animation: fadeIn 1.5s ease forwards;
}

/* ═══════════════════════════════════════════ */
/* SCREEN 3: IMMERSIVE LISTENING              */
/* ═══════════════════════════════════════════ */

.listening-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    opacity: 0;
    pointer-events: none;
    z-index: 80;
    transition: opacity 3s ease;
}

.listening-screen.active {
    opacity: 1;
    pointer-events: all;
}

/* Painting breathes slowly — no ripple, no particles, just life */
@keyframes breathe {
    0%, 100% { transform: scale(1); }
    50%       { transform: scale(1.04); }
}

.painting-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 2s ease;
    transform-origin: center center;
}

.listening-screen.active .painting-background {
    opacity: 1;
    animation: breathe 40s ease-in-out infinite;
}

.painting-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(1px);
}

.lyrics-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    max-width: 800px;
    padding: 40px;
    z-index: 2;
}

.lyric-line {
    font-size: 32px;
    margin: 20px 0;
    opacity: 0;
    display: none;
    transition: all 0.5s ease;
    text-shadow:
        0 0 20px rgba(0, 0, 0, 0.9),
        0 0 40px rgba(0, 0, 0, 0.7),
        2px 2px 4px rgba(0, 0, 0, 1);
}

.lyric-line.active {
    opacity: 1;
    display: block;
    font-size: 42px;
    font-weight: bold;
}

.lyric-line.hidden {
    display: none;
}

.song-title-display {
    position: absolute;
    top: 60px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 24px;
    font-weight: bold;
    opacity: 0;
    z-index: 3;
    text-shadow: 0 0 20px rgba(0, 0, 0, 0.9);
    transition: opacity 0.5s ease;
}

.song-title-display.show {
    opacity: 1;
}

/* Mini Vinyl Indicator */
.mini-vinyl {
    position: fixed;
    bottom: 40px;
    left: 40px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #000;
    border: 3px solid #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: spin 3s linear infinite;
    z-index: 3;
}

.mini-vinyl-label {
    font-size: 20px;
    font-weight: bold;
    color: #FFD700;
}

/* Controls */
.listening-controls {
    position: fixed;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
    z-index: 3;
    max-width: 90%;
}

.control-btn {
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid #fff;
    color: #fff;
    padding: 15px 30px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 2px;
    transition: all 0.3s ease;
}

.control-btn.small {
    padding: 10px 15px;
    font-size: 12px;
}

.control-btn:hover {
    background: #fff;
    color: #000;
}

.control-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.progress-info {
    font-size: 16px;
    background: rgba(0, 0, 0, 0.8);
    padding: 15px 30px;
    border: 2px solid #fff;
}

.exit-hint {
    position: fixed;
    top: 40px;
    right: 40px;
    font-size: 14px;
    opacity: 0.5;
    text-transform: uppercase;
    letter-spacing: 2px;
    z-index: 3;
}

/* ═══════════════════════════════════════════ */
/* UNMUTE OVERLAY (Mobile)                    */
/* ═══════════════════════════════════════════ */

.unmute-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 200;
}

.unmute-overlay.show {
    display: flex;
}

.unmute-button {
    background: #FFD700;
    color: #000;
    border: 5px solid #fff;
    padding: 30px 60px;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    font-family: 'Courier New', monospace;
}

/* ═══════════════════════════════════════════ */
/* MOBILE — all overrides in one clean block  */
/* ═══════════════════════════════════════════ */

@media (max-width: 768px) {

    /* ── Selector ── */

    /* Allow selector to scroll if content taller than viewport */
    .side-selector {
        justify-content: flex-start;
        padding-top: 40px;
        overflow-y: auto;
    }

    .selector-logo {
        width: 160px;
        margin-bottom: 12px;
    }

    .selector-subtitle {
        font-size: 18px;
        margin-bottom: 20px;
    }

    .selector-instruction {
        font-size: 14px;
        margin-bottom: 20px;
    }

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

    .side-button {
        width: 140px;
        height: 160px;
        overflow: hidden;
        padding: 12px 8px;
        justify-content: space-evenly;
    }

    .side-letter {
        font-size: 36px;
        margin-bottom: 0;
    }

    .side-dot {
        width: 24px;
        height: 24px;
        min-height: 24px;
        border-radius: 50%;
        margin-bottom: 0;
    }

    .side-color {
        font-size: 11px;
    }

    .track-list {
        display: none;
    }

    /* ── Ritual ── */

    .turntable {
        width: 300px;
        height: 300px;
    }

    .platter {
        width: 220px;
        height: 220px;
    }

    .vinyl-record {
        width: 200px;
        height: 200px;
    }

    /* Credits wrap on mobile instead of overflowing */
    .ritual-credits {
        white-space: normal;
        width: 90vw;
        font-size: 11px;
        bottom: 20px;
    }

    /* ── Listening — lyrics ── */

    .lyric-line {
        display: none;
    }

    .lyric-line.active {
        display: block;
        font-size: 22px;
        font-weight: bold;
        line-height: 1.4;
        padding: 0 30px;
        max-width: 100%;
    }

    .lyrics-overlay {
        top: 45%;
        padding: 20px;
        max-width: 100%;
    }

    .song-title-display {
        font-size: 16px;
        top: 40px;
    }

    /* ── Listening — controls ── */

    /* Hide desktop hint */
    .exit-hint {
        display: none;
    }

    /* Full controls hidden by default — revealed on tap */
    .listening-controls {
        flex-direction: column;
        gap: 8px;
        bottom: 80px;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.4s ease;
    }

    .listening-controls.controls-visible {
        opacity: 1;
        pointer-events: all;
    }

    /* Hide skip buttons on mobile */
    .control-btn.small {
        display: none;
    }

    .control-btn {
        padding: 10px 24px;
        font-size: 12px;
    }

    .progress-info {
        font-size: 13px;
        padding: 10px 20px;
    }

    /* Persistent play/pause circle — always visible */
    #playPauseBtn {
        display: flex !important;
        align-items: center;
        justify-content: center;
        position: fixed;
        bottom: 24px;
        left: 50%;
        transform: translateX(-50%);
        width: 52px;
        height: 52px;
        padding: 0;
        border-radius: 50%;
        border: 2px solid rgba(255, 255, 255, 0.7);
        background: rgba(0, 0, 0, 0.6);
        font-size: 18px;
        letter-spacing: 0;
        z-index: 10;
        opacity: 1 !important;
        pointer-events: all !important;
    }

    /* Mini vinyl — clear of play button */
    .mini-vinyl {
        bottom: 20px;
        left: 20px;
        width: 44px;
        height: 44px;
    }

    .mini-vinyl-label {
        font-size: 16px;
    }
}
