/* --- КИБЕРПАНК СБРОС СТИЛЕЙ --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    -webkit-tap-highlight-color: transparent; /* Убираем синюю рамку на мобилках в TG */
}

body {
    background-color: #0d0f12; /* Глубокий темно-серый, почти черный */
    color: #e2e8f0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

/* --- ГЛАВНЫЙ КОНТЕЙНЕР (АДАПТИВ) --- */
.player-container {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 420px; /* Идеально под экран смартфона в Telegram */
    gap: 24px;
}

/* На ПК разворачиваем в горизонтальный вид, если экран большой */
@media (min-width: 768px) {
    .player-container {
        flex-direction: row;
        max-width: 800px;
        align-items: flex-start;
    }
}

/* --- БУМБОКС (КОРПУС МАГНИТОФОНА) --- */
.boombox {
    background: #1a1d24;
    border: 4px solid #2d323f;
    border-radius: 24px;
    padding: 24px;
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.5),
                inset 0 4px 0 rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    gap: 20px;
    flex: 1;
}

/* --- КАССЕТОПРИЁМНИК (ДЕКА) --- */
.cassette-deck {
    background: #111318;
    border: 3px solid #252932;
    border-radius: 16px;
    height: 180px;
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    perspective: 800px; /* Для будущей 3D-анимации открытия */
}

/* --- САМА КАССЕТА --- */
.cassette {
    background: #252932;
    border: 2px solid #3e4555;
    border-radius: 12px;
    width: 100%;
    height: 100%;
    position: relative;
    padding: 12px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.4s ease, opacity 0.4s ease;
}

/* Наклейка на кассету */
.cassette-label {
    background: linear-gradient(135deg, #ff007f, #7928ca); /* Яркий неоновый градиент */
    border-radius: 6px;
    padding: 8px;
    height: 60px;
    display: flex;
    align-items: center;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.3);
}

.track-info {
    width: 100%;
    overflow: hidden;
}

.track-title {
    font-size: 14px;
    font-weight: bold;
    color: #fff;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

.track-artist {
    font-size: 11px;
    color: #cbd5e1;
    margin-top: 2px;
}

/* --- БОБИНЫ (КРУТИЛКИ) --- */
.reels {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-bottom: 10px;
}

.reel {
    width: 45px;
    height: 45px;
    background: #111318;
    border: 4px dashed #00f2fe; /* Мятно-неоновые насечки для видимости вращения */
    border-radius: 50%;
    position: relative;
    box-shadow: 0 0 10px rgba(0, 242, 254, 0.2);
}

/* Центральная дырка бобины */
.reel::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 15px;
    height: 15px;
    background: #252932;
    border-radius: 50%;
}

/* Анимация вращения бобин */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Класс активации вращения (будем вешать через JS) */
.spinning {
    animation: spin 3s linear infinite;
}

/* --- МУЛЬТЯШНЫЕ КНОПКИ УПРАВЛЕНИЯ --- */
.controls {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.btn {
    background: #252932;
    border: none;
    border-bottom: 5px solid #111318; /* Имитация толщины кнопки */
    color: #94a3b8;
    padding: 14px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    flex: 1;
    transition: all 0.1s ease;
}

.btn:active {
    border-bottom-width: 1px;
    transform: translateY(4px); /* Кнопка физически вдавливается */
    color: #fff;
}

/* Выделенная кнопка Play */
.btn-play {
    background: #2e3d30;
    border-bottom-color: #162217;
    color: #4ade80; /* Зеленый неоновый неон */
}

.btn-play:active {
    box-shadow: 0 0 15px rgba(74, 222, 128, 0.4);
}

/* --- СПИСОК ТРЕКОВ (ПЛЕЙЛИСТ) --- */
.playlist-container {
    background: #1a1d24;
    border: 3px solid #2d323f;
    border-radius: 20px;
    padding: 20px;
    flex: 1;
    max-height: 280px;
    overflow-y: auto;
}

.playlist-container h3 {
    font-size: 16px;
    margin-bottom: 12px;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.playlist {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.playlist-item {
    background: #222630;
    padding: 12px 16px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s ease, transform 0.1s ease;
}

.playlist-item:hover {
    background: #2d323f;
}

.playlist-item:active {
    transform: scale(0.98);
}

/* Подсветка текущего играющего трека */
.playlist-item.active {
    background: #2a2438;
    border-left: 4px solid #ff007f;
}

.playlist-item.active .item-title {
    color: #ff007f;
    font-weight: bold;
}

.item-title {
    font-size: 14px;
    color: #e2e8f0;
}

.item-artist {
    font-size: 11px;
    color: #64748b;
    margin-top: 2px;
}

/* --- КЛАССЫ ДЛЯ ЭФФЕКТА СМЕНЫ КАССЕТЫ (JS) --- */
.deck-open .cassette {
    transform: rotateX(45deg) translateY(-20px) scale(0.9);
    opacity: 0.3;
}


/* --- НОВЫЕ ЭЛЕМЕНТЫ УПРАВЛЕНИЯ --- */
.timeline-container {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #111318;
    padding: 8px 12px;
    border-radius: 8px;
}

.time-display {
    font-size: 11px;
    font-family: monospace;
    color: #64748b;
    min-width: 32px;
}

/* Стилизация ползунков (Progress & Volume) */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    background: #252932;
    height: 6px;
    border-radius: 3px;
    outline: none;
    width: 100%;
    cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #00f2fe; /* Неоновый кругляшок */
    box-shadow: 0 0 8px #00f2fe;
}

/* Ряд кнопок и громкости */
.controls-row {
    display: flex;
    align-items: center;
    gap: 16px;
}

.controls {
    flex: 2;
}

.volume-container {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #111318;
    padding: 10px;
    border-radius: 12px;
    flex: 1;
}

.volume-container label {
    font-size: 14px;
}

.volume-slider {
    max-width: 70px;
}

/* --- СТИЛИ ДЛЯ ДЕРЕВА АЛЬБОМОВ --- */
.album-block {
    margin-bottom: 16px;
    background: #222630;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #2d323f;
}

.album-header {
    background: #2d323f;
    padding: 10px 14px;
    font-size: 13px;
    font-weight: bold;
    color: #00f2fe;
    display: flex;
    align-items: center;
    gap: 8px;
}

.album-tracks {
    list-style: none;
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.playlist-item {
    background: transparent;
    padding: 8px 12px;
}

/* Улучшение под мобильные пальцы */
@media (max-width: 768px) {
    .player-container {
        max-width: 100%;
        padding: 0;
    }
    .boombox {
        padding: 16px;
    }
    .playlist-item {
        padding: 14px 12px; /* Увеличиваем кликабельную зону для пальцев */
    }
}

/* Маленькая обложка прямо на кассете */
.cassette-cover-art {
    width: 44px;
    height: 44px;
    border-radius: 4px;
    object-fit: cover;
    margin-right: 10px;
    border: 1px solid rgba(255,255,255,0.2);
}

/* Обложка альбома в медиатеке */
.media-album-cover {
    width: 28px;
    height: 28px;
    border-radius: 4px;
    object-fit: cover;
}

/* Кнопка сворачивания */
.album-header {
    cursor: pointer;
    user-select: none;
    justify-content: space-between;
}

.album-header-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.album-toggle-icon {
    transition: transform 0.2s ease;
}

/* Класс для свернутого состояния */
.album-block.collapsed .album-tracks {
    display: none;
}

.album-block.collapsed .album-toggle-icon {
    transform: rotate(-90deg); /* Поворачиваем стрелочку */
}

