.player-volume {
    display: flex;
    align-items: center;
    width: 100%;
    gap: 8px;
}

#btn-mute,
#btn-loop {
    flex: 0 0 45px;
    height: 30px;

     border: none;
    border-radius: 5px;

    background: #725265;
    color: #fff;

    cursor: pointer;
}
#btn-loop.active {
    background: #777;
    color: white;
}


/*#volume {
    flex: 1;
    min-width: 0;
}*/
.player-title {
    width: 100%;
    text-align: center;
    font-size: 16px;
    margin-top: 5px;
}

.player-time {
    width: 100%;
    text-align: center;
    font-size: 18px;
    color: #fff;
}
#music-player {

     position: sticky;
      top: 60px;
    z-index: 1000;

   width: 100%;
    max-width: 480px;
    margin: 0 auto;


    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 1px;


    box-sizing: border-box;

    padding: 10px;

   background:
        repeating-linear-gradient(
            90deg,
            #2b1712 0px,
            #2b1712 3px,
            #3a2118 6px,
            #24110d 9px,
            #684132 13px
        ) !important;

    border: 1px solid #5b4035;

    box-shadow:
        inset 0 0 25px rgba(0, 0, 0, 0.6),
        0 2px 8px rgba(0, 0, 0, 0.6);

    border-radius: 6px;
}



/* Кнопки управления */
.player-controls {
    display: flex;
    width: 100%;
    gap: 5px;

    background: #463840;
    padding: 1px;
    border-radius: 6px;
    box-sizing: border-box;
}

.player-controls button {
    flex: 1;
    height: 45px;

    border: none;
    border-radius: 5px;

    background: #725265;
    color: #fff;

    cursor: pointer;
}

/* Название песни */
.player-title {
    width: 100%;
    text-align: center;
}

#track-title {
    display: block;
    width: 100%;
    color: #fff;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

/* Строка времени и прогресса */
.player-progress,
.player-volume {
    display: flex;
    align-items: center;
    width: 100%;
    gap: 8px;
}

/* Ползунок прогресса */

.progress-container,
.volume-container {
    width: 100%;
    box-sizing: border-box;
}

.progress-container {
    margin-top: 8px;
}

.volume-container {
    margin-top: 18px;
}

/* Сам ползунок */
#progress,
#volume {
    display: block;
    width: 100%;
    height: 8px;
    margin: 0;
    padding: 0;
    cursor: pointer;
    accent-color: #ffffff;
    z-index: 2;
     position: relative;
}

/* Шкала с цифрами */
.range-scale {
    display: flex;
    justify-content: space-between;
    width: 100%;
    margin-top: 7px;
    padding: 0;
    box-sizing: border-box;

    color: #ca9696;
    font-size: 11px;
    line-height: 1;
}

/* Делаем деления */
.range-scale span {
    position: relative;
    text-align: center;
    min-width: 20px;
}

/* Вертикальная рисочка над каждой цифрой */
.range-scale span::before {
    content: "";
    display: block;
    width: 2px;
    height: 8px;
    margin: -7px auto 3px;
    z-index: 0;
    background: #fff;
}

/* Последняя/первая цифра не должны вылезать */
.range-scale span:first-child {
    text-align: left;
}

.range-scale span:last-child {
    text-align: right;
}

.range-scale span:first-child::before {
    margin-left: 0;
}

.range-scale span:last-child::before {
    margin-right: 0;
}



/* Громкость */
/*.player-volume {
    display: flex;
    align-items: center;
    width: 100%;
    gap: 8px;
}
*/
/*#volume {
    flex: 1;
    min-width: 0;
}*/



/* =========================
   ПЛЕЙЛИСТ
   ========================= */

#playlist {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    width: 100%;
    box-sizing: border-box;
    padding: 10px;


    /*
     width: 100%;
    max-width: 500px;
    margin: 0 auto;
    margin-top: 15px;
    padding: 0;
    list-style: none;*/
}

#playlist li {
    position: relative;

    padding: 6px 10px 6px 28px;

    cursor: pointer;

    border-radius: 4px;
    display: flex;
    transition: background-color .2s;
    align-items: center;
}

/*
#playlist li {
    display: flex;
    align-items: center;
}
*/
#playlist li > span {
    flex: 1;
    min-width: 0;

    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

#playlist li > a {
    flex: 0 0 28px;

    text-align: center;

    color: #838b81;
    text-decoration: none;

    font-size: 18px;
    font-weight: bold;

    opacity: 0.7;

    cursor: pointer;

    transition:
        opacity 0.15s ease,
        transform 0.15s ease;
}

#playlist li > a:hover {
    color: #404d11;
    opacity: 1;
    transform: scale(1.5);
}

/* Наведение */
#playlist li:hover {
    background: #e8e8e8;
}

/* Текущий трек */
#playlist li.active {
    background: #695165;
    color: #fff;
    font-weight: bold;
}

/* Наведение на текущий трек */
#playlist li.active:hover {
    background: #8d74a5;
}

/* Значок текущего трека */
#playlist li::before {
    content: "🎵";
    position: absolute;
    left: 5px;
    width: 14px;
}

#playlist li.active::before {
    content: "▶";
}


#progress,
#volume {
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
}

/* Дорожка Chrome / Edge / Firefox */

#progress::-webkit-slider-runnable-track,
#volume::-webkit-slider-runnable-track {
    height: 6px;
    background: #999;
}

#progress::-moz-range-track,
#volume::-moz-range-track {
    height: 6px;
    background: #999;
}

/* Квадратный бегунок Chrome / Edge */

#progress::-webkit-slider-thumb,
#volume::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;

    width: 10px;
    height: 30px;

    margin-top: -15px;

     background: #4d4343;
    border: 1px solid #837979;
    border-radius: 0;
    z-index: 3;
    cursor: pointer;
}

/* Квадратный бегунок Firefox */

#progress::-moz-range-thumb,
#volume::-moz-range-thumb {
   width: 10px;
    height: 30px;

    margin-top: -15px;

     background: #4d4343;
    border: 1px solid #837979;
    border-radius: 0;
    z-index: 3;
    cursor: pointer;
}
.cassette-deck {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 85%; /* регулируем ширину здесь */
    margin: 0 auto;

    gap: 18px;
    padding: 8px 0;

    background: #0f0f0f;
    border-radius: 14px;

    box-sizing: border-box;
}

.cassette {
    position: relative;

    width: 180px;
    height: 90px;

    background: #292b27;
    border: 2px solid #777;
    border-radius: 4px;

    box-sizing: border-box;
}

/* Окошко кассеты — матовое стекло */
.cassette::before {
    content: "©VD";
    position: absolute;

    left: 28px;
    right: 28px;
    top: 18px;
    bottom: 18px;

    background: #292323;
    backdrop-filter: blur(2px);

    border: 1px solid rgb(73, 8, 27);
    border-radius: 8px;

    z-index: 0;
    display: flex;
align-items: center;
justify-content: center;
color: #fff;
}
.cassette-label {
    position: absolute;
    left: 4px;
    right: 4px;
    top: 3px;
    bottom: 4px;

    z-index: 2;
    overflow: hidden;
}

.cassette-label img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}



/* Магнитная лента */
.cassette-tape {
    position: absolute;

    left: 0;
    top: 0;

    width: 100%;
    height: 100%;

    z-index: 1;

    overflow: visible;
}



.cassette.playing .cassette-tape {
    animation: tape-wobble 1.4s ease-in-out infinite;
}

.cassette-tape path {
    fill: none;

    stroke: #8a8281;
    stroke-width: 3;

    stroke-linecap: round;
}

/* Катушки */
.reel {
    position: absolute;

    top: 25px;

    width: 32px;
    height: 32px;

    background: #777;
    border: 4px solid #444;
    border-radius: 50%;

    box-sizing: border-box;

    z-index: 2;
}

/* Левая */
.reel-left {
    left: 25px;
}

/* Правая */
.reel-right {
    right: 25px;
}

/* Центральное отверстие */
.reel span {
    position: absolute;

    left: 50%;
    top: 50%;

    width: 8px;
    height: 8px;

    transform: translate(-50%, -50%);

    background: #292b27;
    border-radius: 50%;
}

/* Лопасти катушки */
.reel::before,
.reel::after {
    content: "";

    position: absolute;

    left: 50%;
    top: 50%;

    width: 2px;
    height: 24px;

    background: #3d121c;

    transform: translate(-50%, -50%);
}

.reel::after {
    transform:
        translate(-50%, -50%)
        rotate(90deg);
}
@keyframes cassette-spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(-360deg);
    }
}

.cassette.playing .reel {
    animation: cassette-spin 1.2s linear infinite;
}


.speaker {
    width: 42px;
    height: 90px;

    background: #41443c;

    border: 2px solid #777;
    border-radius: 5px;

    box-sizing: border-box;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

/*здесь лапмочки в динамиках*/
.speaker-lamp {
    position: absolute;

    left: 50%;
    top: 50%;

    width: 10px;
    height: 10px;

    transform: translate(-50%, -50%);

    background: #263326;

    border: 1px solid #151815;
    border-radius: 50%;

    box-shadow: none;

    z-index: 10;
}

/* Левая лампа */
.speaker-left .speaker-lamp {
    animation: lamp-left 1.2s infinite;
}

/* Правая лампа */
.speaker-right .speaker-lamp {
    animation: lamp-right 1.2s infinite;
}

/* Лампы работают только при воспроизведении */

.cassette-deck.playing .speaker-lamp {
    animation: lamp-blink 1.2s infinite;
}

.cassette-deck.playing .speaker-right .speaker-lamp {
    animation-delay: -0.6s;
}

@keyframes lamp-blink {

    0%, 100% {
        background: #263326;
        box-shadow: none;
    }

    20%, 45% {
        background: #39ff66;

        box-shadow:
            0 0 4px #39ff66,
            0 0 10px #39ff66,
            0 0 16px rgba(57, 255, 102, 0.7);
    }
}



.cassette-deck.playing .speaker-lamp {
    animation: lamp-blink 1.2s infinite;
}

.cassette-deck.playing .speaker-right .speaker-lamp {
    animation-delay: -0.6s;
}

.speaker-grille {
    position: relative;

    width: 28px;
    height: 42px;

    background:
        repeating-linear-gradient(
            0deg,
            #292b27 0px,
            #292b27 3px,
            #55584d 3px,
            #55584d 5px
        );

    border: 2px solid #292b27;
    border-radius: 3px;
}

.speaker-grille::after {
    content: "";

    position: absolute;

    left: 50%;
    top: 50%;

    width: 12px;
    height: 12px;

    transform: translate(-50%, -50%);

    border: 2px solid #777;
    border-radius: 50%;
}
/*общий контейнер*/
.slider-row {
    width: 100%;
    margin-top: 8px;
}
/*шкала*/
.scale {
    position: relative;

    width: 100%;
    height: 18px;

    color: #4b3d3d;
    font-size: 11px;

    user-select: none;
}

/*шкала времени*/
.time-scale {
    display: flex;
    justify-content: space-between;
    z-index: 1;

    margin-top: 3px;
     position: relative;
}
/*ретро шкала деление на самой дорожке*/
.time-scale::before {
    content: "";

    position: absolute;

    left: 0;
    right: 0;

    top: -12px;

    height: 6px;

    background:
        repeating-linear-gradient(
            to right,
            #4b4d45 0,
            #4b4d45 1px,
            transparent 1px,
            transparent 5%
        );

    pointer-events: none;
}
