/* ===== ОБЩИЕ СТИЛИ ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #0f0f0f 0%, #1a1a2e 100%);
    color: #fff;
    overflow: hidden;
}

.radio-container {
    display: flex;
    height: 100vh;
    width: 100%;
    gap: 0;
}

/* ===== ЛЕВАЯ ПАНЕЛЬ - ТЕКСТ ПЕСНИ ===== */
.lyrics-panel {
    width: 280px;
    background: rgba(0, 0, 0, 0.9);
    border-right: 2px solid #ff4444;
    padding: 30px 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.8);
    scrollbar-width: thin;
    scrollbar-color: #ff4444 #0a0a0a;
}

.lyrics-panel::-webkit-scrollbar {
    width: 6px;
}

.lyrics-panel::-webkit-scrollbar-track {
    background: #0a0a0a;
}

.lyrics-panel::-webkit-scrollbar-thumb {
    background: #ff4444;
    border-radius: 3px;
}

.lyrics-header {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 68, 68, 0.3);
}

.station-brand-badge {
    width: 100%;
    min-height: 44px;
    border-radius: 8px;
    background: rgba(12, 12, 12, 0.9);
    border: 1px solid rgba(255, 210, 120, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    overflow: hidden;
}

.station-brand-badge img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.station-brand-fallback {
    display: none;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #f4d38b;
    padding: 10px 12px;
    text-align: center;
}

.station-brand-badge.fallback .station-brand-fallback {
    display: block;
}

.lyrics-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 6px;
    color: #ff4444;
    line-height: 1.3;
}

.lyrics-artist {
    font-size: 13px;
    color: #888;
}

.lyrics-scroll {
    flex: 1;
    overflow-y: auto;
    font-size: 12px;
    line-height: 1.8;
    color: #d0d0d0;
    font-style: italic;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* ===== ОСНОВНАЯ ПЛАСТИНКА НА ВЕСЬ ЭКРАН ===== */
.main-turntable {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 40px;
    position: relative;
    background: linear-gradient(135deg, rgba(20, 20, 40, 0.8) 0%, rgba(15, 15, 30, 0.9) 100%);
}

/* Виджет 5 последних песен (в зоне слева от пластинки) */
.recent-history-widget {
    position: absolute;
    top: 28px;
    left: 24px;
    width: 260px;
    min-height: 220px;
    padding: 16px 14px 12px;
    background: rgba(5, 8, 28, 0.55);
    border: 1px solid rgba(255, 68, 68, 0.5);
    border-radius: 14px;
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(4px);
    z-index: 5;
}

.recent-history-title {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: #ff4444;
    margin-bottom: 12px;
}

.recent-history-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.recent-history-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 8px;
    border-radius: 8px;
    background: rgba(255, 68, 68, 0.08);
}

.recent-history-number {
    min-width: 20px;
    font-size: 12px;
    font-weight: 700;
    color: #ff4444;
}

.recent-history-song {
    min-width: 0;
}

.recent-history-track {
    font-size: 12px;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.recent-history-artist {
    font-size: 10px;
    color: #a5a5a5;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ===== ТУРНТЕЙБЛ / ПЛАСТИНКА ===== */
.turntable-wrapper {
    width: min(100%, 600px);
    height: auto;
    max-width: 600px;
    max-height: 600px;
    aspect-ratio: 1 / 1;
    flex: 0 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
    perspective: 1000px;
    margin-bottom: 40px;
    transform: translateY(10px);
}

.turntable {
    position: relative;
    width: 100%;
    height: 100%;
    aspect-ratio: 1 / 1;
    animation: spin 20s linear infinite;
    cursor: pointer;
}

.turntable:hover {
    filter: brightness(1.1);
}

@keyframes spin {
    0% { transform: rotateZ(0deg); }
    100% { transform: rotateZ(360deg); }
}

.turntable.paused {
    animation-play-state: paused;
}

.vinyl-record {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #333, #000);
    box-shadow: 
        0 30px 80px rgba(0, 0, 0, 0.9),
        inset -3px -3px 15px rgba(0, 0, 0, 0.8),
        inset 3px 3px 15px rgba(255, 255, 255, 0.1);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.vinyl-record::before {
    content: '';
    position: absolute;
    width: 80%;
    height: 80%;
    border-radius: 50%;
    background: repeating-radial-gradient(
        circle at center,
        #1a1a1a 0px,
        #1a1a1a 2px,
        #0a0a0a 2px,
        #0a0a0a 4px
    );
}

.vinyl-label {
    position: absolute;
    width: 54%;
    height: 54%;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff2f36, #d10000);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 22px rgba(255, 50, 50, 0.48);
    z-index: 2;
}

.label-inner {
    width: 88%;
    height: 88%;
    border-radius: 50%;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.2);
    position: relative;
    padding: 0;
    text-align: center;
    overflow: hidden;
}

.label-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 50% 38%;
    transform: scale(1.12);
    display: block;
    filter: contrast(1.06) saturate(0.92);
}

.label-inner.photo-fallback {
    background: radial-gradient(circle, #8b5e27 0%, #3d2a18 100%);
}

/* ===== КОНТРОЛЫ ПЛАСТИНКИ ===== */
.turntable-controls {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.control-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #ff4444 0%, #cc0000 100%);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 6px 20px rgba(255, 68, 68, 0.4);
    font-size: 0;
}

.control-btn:hover {
    transform: scale(1.15);
    box-shadow: 0 8px 30px rgba(255, 68, 68, 0.6);
}

.control-btn:active {
    transform: scale(0.95);
}

.control-btn svg {
    width: 28px;
    height: 28px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .turntable-wrapper {
        width: min(100%, 450px);
        max-width: 450px;
        max-height: 450px;
        margin-bottom: 30px;
        transform: translateY(6px);
    }

    .lyrics-panel {
        width: 240px;
        padding: 20px 15px;
    }

    .lyrics-title {
        font-size: 16px;
    }

    .recent-history-widget {
        width: 220px;
    }

    .station-brand-fallback {
        font-size: 11px;
    }
}

@media (max-width: 768px) {
    html, body {
        height: auto;
        min-height: 100%;
        overflow-x: hidden;
        overflow-y: auto;
    }

    .radio-container {
        flex-direction: column;
        height: auto;
        min-height: 100vh;
    }

    .lyrics-panel {
        width: 100%;
        height: auto;
        border-right: none;
        border-bottom: 2px solid #ff4444;
        padding: 20px;
        max-height: 200px;
    }

    .main-turntable {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas:
            'history'
            'controls'
            'record';
        justify-items: center;
        align-content: flex-start;
        row-gap: 12px;
        justify-content: flex-start;
        padding: 20px;
        padding-bottom: calc(32px + env(safe-area-inset-bottom, 0px));
    }

    .recent-history-widget {
        grid-area: history;
        position: static;
        width: 100%;
        min-height: auto;
        margin-bottom: 0;
    }

    .turntable-wrapper {
        grid-area: record;
        width: min(100%, 350px);
        max-width: 350px;
        max-height: 350px;
        margin-bottom: 0;
        transform: none;
    }

    .turntable-controls {
        grid-area: controls;
        margin-bottom: 0;
    }

    .control-btn {
        width: 50px;
        height: 50px;
    }

    .control-btn svg {
        width: 24px;
        height: 24px;
    }
}

@media (max-width: 480px) {
    .lyrics-panel {
        max-height: 132px;
        padding: 14px 14px 12px;
    }

    .main-turntable {
        row-gap: 10px;
        padding: 12px 12px calc(22px + env(safe-area-inset-bottom, 0px));
    }

    .lyrics-title {
        font-size: 14px;
    }

    .recent-history-widget {
        margin-bottom: 10px;
        padding: 10px 10px 9px;
    }

    .recent-history-title {
        margin-bottom: 9px;
        font-size: 11px;
    }

    .turntable-wrapper {
        width: min(100%, 220px);
        max-width: 220px;
        max-height: 220px;
        margin-bottom: 12px;
        transform: none;
    }

    .turntable-controls {
        gap: 16px;
        margin-bottom: 0;
    }

    .control-btn {
        width: 44px;
        height: 44px;
    }

    .control-btn svg {
        width: 20px;
        height: 20px;
    }

    .label-brand-fallback {
        font-size: 8px;
    }
}


