:root {
  --bg: #0b0f14;
  --accent: #ff0077;
  --text: #ffffff;
}

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

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

.nav {
    display: flex;
    justify-content: center;
    gap: 2rem;
    padding: 1rem;
    background: #111;
}

/* обычное состояние */
.nav a {
    color: white;
    text-decoration: none;
    display: inline-block;   /* важно для scale */
    transition: transform 0.3s ease;
}

/* при наведении */
.nav a:hover {
    transform: scale(1.2);
    text-shadow: 0 0 8px #ff2e63;
}

/* ===== Список треков ===== */

.tracks-page {
    max-width: 900px;
    margin: auto;
    padding: 2rem;
    padding-bottom: 140px;
}

.track {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid #222;
    padding-bottom: 1rem;
    width: 100%;
}

.track-main {
    flex: 1;
    min-width: 0; /* 💥 фикс переполнения */
}

.track-main h3 {
    font-size: 14px;
    line-height: 1.3;

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ===== ПРОГРЕСС КАК SOUNDCLOUD ===== */

.track-wave {
    width: 100%;
    height: 12px;

    /* 🔥 фон (не проиграно) */
    background: #2a2a2a;

    border-radius: 6px;
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

/* ✅ проигранная часть */
.track-wave::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: var(--progress, 0%);

    /* 🔥 неоновый градиент */
    background: linear-gradient(90deg, #00ff88, #00ffaa);

    border-radius: 6px;

    /* glow */
    box-shadow:
        0 0 6px #00ff88,
        0 0 15px #00ff88,
        0 0 25px #00ffaa;

    transition: width 0.4s ease, opacity 0.4s ease;
}

/* 🔥 hover — усиливаем эффект */
.track-wave:hover::after {
    box-shadow:
        0 0 10px #00ff88,
        0 0 25px #00ff88,
        0 0 40px #00ffaa;
}

/* ===== hover preview ===== */

.hover-time {
    position: absolute;
    top: -25px;
    left: 0;
    transform: translateX(-50%);
    background: #00ff88;
    color: black;
    font-size: 12px;
    padding: 2px 6px;
    border-radius: 4px;
    pointer-events: none;
    opacity: 0;
    transition: 0.2s;
}

.track-wave:hover .hover-time {
    opacity: 1;
}

/* ===== Затухание прогреса ===== */
.track-wave.fading::after {
    opacity: 0;
}

/* ===== кнопки треков ===== */

.play-btn {
    width: 50px;
    height: 50px;

    border-radius: 50%;
    border: 1px solid rgba(255, 46, 99, 0.5);

    background: rgba(255, 46, 99, 0.1);
    color: #ff2e63;

    cursor: pointer;
    font-size: 18px;

    display: flex;
    align-items: center;
    justify-content: center;

    position: relative;
    transition: 0.3s ease;
}

.play-btn:hover {
    background: #ff2e63;
    color: white;

    box-shadow:
        0 0 10px #ff2e63,
        0 0 25px #ff2e63;

    transform: scale(1.1);
}

/* активный трек */
.track.active .play-btn {
    background: #00ff88;
    color: black;

    box-shadow:
        0 0 10px #00ff88,
        0 0 25px #00ff88,
        0 0 40px #00ffaa;
}

/* ===== download кнопка ===== */

.download-btn {
    width: 50px;
    height: 50px;
    flex-shrink: 0; /* 💥 запрещаем сжатие */

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 50%;
    border: 1px solid rgba(255, 46, 99, 0.5);

    background: rgba(255, 46, 99, 0.1);
    color: #ff2e63;

    font-size: 20px;
    text-decoration: none;

    position: relative;
    transition: 0.3s ease;
}

.download-btn:hover {
    background: #ff2e63;
    color: white;

    box-shadow:
        0 0 10px #ff2e63,
        0 0 25px #ff2e63,
        0 0 40px #ff2e63;

    transform: scale(1.15);
}

/* ===== глобальный плеер ===== */

.global-player {
    position: fixed;
    bottom: 0;
    width: 100%;

    display: flex;
    gap: 20px;
    padding: 15px;

    background: rgba(20,20,30,0.85);
    backdrop-filter: blur(20px);

    border-top: 1px solid rgba(0,255,136,0.3);
}

/* обложка */
#cover {
    width: 90px;
    height: 90px;
    object-fit: cover;
    border-radius: 10px;
}

/* ===== кнопки плеера ===== */

.controls button {
    background: rgba(255, 46, 99, 0.15);
    border: 1px solid rgba(255, 46, 99, 0.4);
    color: #ff2e63;

    width: 50px;          /* 💥 фикс размер */
    height: 50px;
    padding: 0;           /* 💥 УБРАЛИ padding */

    margin: 5px;

    border-radius: 50%;
    cursor: pointer;

    display: flex;        /* 💥 центрирование */
    align-items: center;
    justify-content: center;

    backdrop-filter: blur(10px);
    transition: 0.3s;
}

.controls button svg {
    width: 22px;
    height: 22px;
    display: block;
}

.controls button:active {
    transform: scale(0.9);
}

/* Этот стиль применится только там, где есть мышка */
@media (hover: hover) and (pointer: fine) {
    .controls button:hover {
        background: #ff2e63;
        color: white;
    }
}

.controls button:hover {
    background: #ff2e63;
    color: white;
}

/* 💥 только при нажатии */
.controls button.tap-active {
    background: #ff2e63;
    color: white;

    box-shadow:
        0 0 10px #ff2e63,
        0 0 25px #ff2e63;

    transform: scale(0.9);
}

.controls {
    display: flex;
    align-items: center;
    flex-direction: row; /* 💥 ГЛАВНОЕ */
    gap: 8px;
}

/* выделяем play */
#global-play.playing {
    background: #00ff88;
    color: black;

    box-shadow:
        0 0 12px #00ff88,
        0 0 30px #00ffaa;

    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 10px #00ff88; }
    50% { box-shadow: 0 0 30px #00ffaa; }
    100% { box-shadow: 0 0 10px #00ff88; }
}

/* ===== громкость ===== */

#volume {
    -webkit-appearance: none;
    width: 120px;
    height: 6px;
    border-radius: 10px;

    background: linear-gradient(90deg, #ff2e63, #ff8a00);

    outline: none;
    cursor: pointer;

    transition: 0.3s;
}

/* glow при наведении */
#volume:hover {
    box-shadow:
        0 0 8px #ff2e63,
        0 0 20px #ff2e63;
}

#volume::-webkit-slider-thumb {
    -webkit-appearance: none;

    width: 18px;
    height: 18px;
    border-radius: 50%;

    background: white;
    border: 2px solid #ff2e63;

    cursor: pointer;

    box-shadow:
        0 0 10px #ff2e63,
        0 0 20px #ff2e63;

    transition: 0.2s;
}

#volume::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

/* ===== инфо о треке ===== */

.player-info {
    margin-left: 20px; /* 💥 отступ от обложки */
}

#waveform {
    width: 100%;
    height: 50px;
}

.time {
    color: #aaa;
}

/* ===== мобильная версия ===== */
@media (max-width: 768px) {

    .global-player {
        display: grid;
        grid-template-columns: 85px 1fr;
        grid-template-rows: auto auto;
        align-items: center;
        column-gap: 12px; 
        padding: 10px 15px;
        background: #111;
        position: fixed;
        bottom: 0; left: 0; width: 100%;
        z-index: 9999;
    }

    #cover {
        grid-row: 1 / 3;
        grid-column: 1;
        width: 85px;
        height: 85px;
        border-radius: 10px;
        object-fit: cover;
    }

    /* ===== ОКНО ДЛЯ ТЕКСТА ===== */
    .player-info {
        grid-row: 2;
        grid-column: 2;

        width: 100%;
        overflow: hidden;
        position: relative;

        margin-left: 8px; /* 💥 ОТСТУП ОТ КАРТИНКИ */

        /* 🔥 красивое затухание по краям */
        -webkit-mask-image: linear-gradient(to right, transparent 0%, black 20px, black calc(100% - 20px), transparent 100%);
        mask-image: linear-gradient(to right, transparent 0%, black 20px, black calc(100% - 20px), transparent 100%);
    }

    /* ===== WRAPPER (движется) ===== */
    #track-wrapper {
        display: flex;
        width: max-content;
        gap: 80px; /* чуть больше расстояние */
        font-size: 14px;
        will-change: transform; /* плавный старт */
    }

    /* 🚀 анимация */
    .global-player.is-playing #track-wrapper {
        animation: scroll-loop 10s linear infinite;
    }

    @keyframes scroll-loop {
        0% {
            transform: translateX(0);
        }
        100% {
            transform: translateX(-50%);
        }
    }

    .time {
        display: block;
        font-size: 11px;
        opacity: 0.6;
        margin-left: 10px;
        margin-top: 4px;
    }

    #volume,
    #waveform {
        display: none !important;
    }
}