:root {
    --box-shadow: rgba(50, 50, 93, 0.25) 0 30px 60px -12px, rgba(0, 0, 0, 0.3) 0 18px 36px -18px;
    --black-color: #333;
    --gray-color: gray;
    --main-color: #8151e7;
}
.playerbar-bg {
    z-index: 4;
    position: fixed;
    bottom: 2rem;
    left: 0;
    right: 0;
    width: 100%;
    height: 5rem;
    -webkit-transform: translateY(100%);
    -ms-transform: translateY(100%);
    transform: translateY(100%);
    -webkit-transition: all 0.3s linear;
    -o-transition: all 0.3s linear;
    transition: all 0.3s linear;
    opacity: 1;
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
    -webkit-mask: -webkit-gradient(linear, left bottom, left top, color-stop(50%, black), to(transparent));
    -webkit-mask: linear-gradient(0deg, black 50%, transparent);
    background: -webkit-gradient(
        linear,
        left bottom,
        left top,
        color-stop(100%, #1e193c69),
        color-stop(0, transparent)
    );
    background: -o-linear-gradient(bottom, #1e193c69 100%, transparent 0);
    background: linear-gradient(0deg, #1e193c69 100%, transparent 0);
}
.playerbar-wrapper {
left: 0.5rem;
    right: 0.5rem;
  
    width: auto;
   bottom: calc(55px + env(safe-area-inset-bottom));
    
    height: 64px;
    cursor: pointer;
    user-select: none;
    

background:rgba(30, 25, 60, 0.6);
    border-radius: .6rem !important;
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
 
    /* Оставляем тень здесь */
    -webkit-box-shadow: 0 1px 2rem 0 rgba(0, 0, 0, 0.3);
    box-shadow: 0 1px 2rem 0 rgba(0, 0, 0, 0.3);
    perspective: none;
    overflow: visible;
    /* Управление появлением всего плеера (пример: класс .is-shown) */
    transform: translateY(150%); 
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}



.player-cube {
    position: relative;
    width: 100%; 
    height: 100%;
    transform-style: preserve-3d;
    perspective: 5000px; /* Переносим сюда */
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center center -32px;
}

.cube-face {
    position: absolute;
    inset: 0; /* Прижимает ко всем 4 сторонам родителя */
    width: auto; 
    height: auto;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    border-radius: 0.6rem;
    overflow: hidden; /* Важно: обрезает прогресс-бар и фон по скруглению */
    
    /* Основной фон и блюр */
    background: #282249; 
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
}

/* Лицевая сторона */
.face-player {
    transform: rotateX(0deg);
}

/* Обратная сторона (Реклама) */
.face-alt {
    transform: rotateX(180deg);
}

/* Вращение при бездействии */
.player-cube.show-cube {
    transform: rotateX(180deg);
}

.webapp-player.show .playerbar-wrapper,
.webapp-player.show .playerbar-bg {
    -webkit-transform: translateY(0);
    -ms-transform: translateY(0);
    transform: translateY(0);
}

.playerbar-wrapper .container {
    --progress: 0%;
    /* background: #282249; <-- УДАЛЯЕМ, фон должен быть у .cube-face или здесь, но без конфликтов */
    background: transparent; 
    position: relative;
    padding: 8px 12px; /* Настраивай внутренние отступы здесь */
    
    /* УБИРАЕМ ТЕНИ И СКРУГЛЕНИЯ (они уже есть на родителе .cube-face) */
    -webkit-box-shadow: none;
    box-shadow: none;
    border-radius: 0; 
    
    /* ГАРАНТИРУЕМ РАЗМЕР */
    width: 100%;
    max-width: 100% !important;
    height: 100%;
    box-sizing: border-box; 
    overflow: hidden;
    z-index: 1;
    display: flex;
    align-items: center;
}

.playerbar-wrapper .container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--progress);
    background: linear-gradient(90deg, 
        rgba(74, 63, 129, 0.5) 0%, 
        rgba(74, 63, 129, 0.5) 85%, 
        rgba(74, 63, 129, 0) 100%
    );
   
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: -1; 
}

.player-alt-face {
    position: absolute;
    inset: 0;
    width: 100% !important;
    max-width: 100% !important;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.playerbar-wrapper, 
.playerbar-wrapper *, 
.playerbar-wrapper *::before, 
.playerbar-wrapper *::after {
    box-sizing: border-box !important;
}

.song-image {
    position: relative;
    overflow: hidden;
    width: 48px; /* Твой размер иконки */
    height: 48px;
    border-radius: 8px;
}

#mini-cover {
    position: relative;
    z-index: 2;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0; /* Проявится при загрузке */
    transition: opacity 0.3s ease;
}

.playerbar-wrapper .info {
    position: relative;
    overflow: hidden;
}
.playerbar-wrapper .info .song-title {
    display: inline-block;
    width: 100%;
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    overflow: hidden;
    white-space: nowrap;
}
.playerbar-wrapper .info .song-title .song-title-line {
    position: absolute;
    -webkit-animation: marquee 5s linear infinite;
    animation: marquee 5s linear infinite;
    overflow: hidden;
    white-space: nowrap;
}
.playerbar-wrapper .info .song-title .song-title-line span {
    font-size: 14px;
    font-weight: 600;
}
.playerbar-wrapper .info .song-subtitle {
    font-size: 12px;
    font-weight: 400;
    line-height: 12px;
    white-space: nowrap;
    overflow: hidden;
    -o-text-overflow: ellipsis;
    text-overflow: ellipsis;
    opacity: 0.7;
}

.btn-icon-only {
    padding: 0 !important;
    width: 2.5rem;
    height: 2.5rem;
}
.btn {
    display: inline-block;
    font-weight: 400;
    color: #ede9f9;
    text-align: center;
    vertical-align: middle;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    background-color: transparent;
    border: 1px solid transparent;
    padding: 0.625rem 1.5rem;
    font-size: 0.875rem;
    line-height: 1;
    border-radius: 0.45rem;
    -webkit-transition:
        color 0.15s ease-in-out,
        background-color 0.15s ease-in-out,
        border-color 0.15s ease-in-out,
        -webkit-box-shadow 0.15s ease-in-out;
    transition:
        color 0.15s ease-in-out,
        background-color 0.15s ease-in-out,
        border-color 0.15s ease-in-out,
        -webkit-box-shadow 0.15s ease-in-out;
    -o-transition:
        color 0.15s ease-in-out,
        background-color 0.15s ease-in-out,
        border-color 0.15s ease-in-out,
        box-shadow 0.15s ease-in-out;
    transition:
        color 0.15s ease-in-out,
        background-color 0.15s ease-in-out,
        border-color 0.15s ease-in-out,
        box-shadow 0.15s ease-in-out;
    transition:
        color 0.15s ease-in-out,
        background-color 0.15s ease-in-out,
        border-color 0.15s ease-in-out,
        box-shadow 0.15s ease-in-out,
        -webkit-box-shadow 0.15s ease-in-out;
}
.playerbar-wrapper .playbar-body {
    width: 100%;
    position: relative;
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
    display: -ms-grid;
    display: grid;
    -ms-grid-columns: 47px 12px auto 12px 75px;
    grid-template-columns: 47px auto 75px;
    grid-gap: 4px;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-transition: all 0.3s linear;
    -o-transition: all 0.3s linear;
    transition: all 0.3s linear;
}
.playerbar-wrapper .controls {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    height: 29px;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    width: 70px;
    -webkit-box-pack: justify;
    -ms-flex-pack: justify;
    justify-content: space-between;
}
.playerbar-wrapper .controls #play-pause {
    width: 24px;
    height: 24px;
    position: relative;
    z-index: 10;
    cursor: pointer;
}
.playerbar-wrapper .controls #play-pause.player-playing {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='rgba(255,255,255,1)'%3E%3Cpath d='M15 7C15 6.44772 15.4477 6 16 6C16.5523 6 17 6.44772 17 7V17C17 17.5523 16.5523 18 16 18C15.4477 18 15 17.5523 15 17V7ZM7 7C7 6.44772 7.44772 6 8 6C8.55228 6 9 6.44772 9 7V17C9 17.5523 8.55228 18 8 18C7.44772 18 7 17.5523 7 17V7Z'%3E%3C/path%3E%3C/svg%3E");
}
.playerbar-wrapper .controls #play-pause.player-paused {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='rgba(255,255,255,1)'%3E%3Cpath d='M7.75194 5.43872L18.2596 11.5682C18.4981 11.7073 18.5787 12.0135 18.4396 12.252C18.3961 12.3265 18.3341 12.3885 18.2596 12.432L7.75194 18.5615C7.51341 18.7006 7.20725 18.62 7.06811 18.3815C7.0235 18.305 7 18.2181 7 18.1296V5.87061C7 5.59446 7.22386 5.37061 7.5 5.37061C7.58853 5.37061 7.67547 5.39411 7.75194 5.43872Z'%3E%3C/path%3E%3C/svg%3E");
}
#play-pause * {
    pointer-events: none;
}

.app-player-container {
    will-change: transform, opacity;
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
      transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.3s ease;
    background-color: #1E193C;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 900;
    padding-bottom: env(safe-area-inset-bottom);
    overflow: hidden;
    pointer-events: none;
    visibility: hidden; 
    opacity: 0;

}

/* Принудительно задаем transition для активного состояния */
.app-player-container.player-to-playbar {
    visibility: visible;
    pointer-events: auto;
}

.open-player-btn, 
.btn-closeplayer,
.playerbar-wrapper {
    -webkit-tap-highlight-color: transparent; /* Убирает синий квадрат при нажатии на iOS */
    touch-action: manipulation; /* Оптимизирует обработку касаний */
    cursor: pointer;
}

/* --- Исправленная обложка для корректного Scale --- */

.player-dragging {
    -webkit-transition: none !important;
    -o-transition: none !important;
    transition: none !important;
}
.app-player-container .swiper-wrapper {
    position: fixed !important;
}
.app-player-grid {
    padding: 12px;
    height: 100%;
}
.app-player-header {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    margin: 3px 0 24px;
    padding-left: 0.225rem;
    padding-right: 0.225rem;
}
.app-player-header .now-playing {
    -webkit-box-flex: 1;
    -ms-flex-positive: 1;
    flex-grow: 1;
    text-align: center;
    color: #ede9f9;
    font-weight: 600;
}
.app-player-content {
    display: -ms-grid;
    display: grid;
    -ms-grid-rows: auto 100px 250px;
    grid-template-rows: auto 250px;
    grid-gap: 100px;
    height: 100%;
}

.app-player-content .sections {
    position: absolute;
    width: auto;
    bottom: 0;
    left: 0;
    right: 0;
    padding-left: 1rem;
    padding-right: 1rem;
    margin-bottom: 3rem;
}
.app-player-content .song-info {
    margin-bottom: 16px;
    display: -ms-grid;
    display: grid;
    -ms-grid-columns: auto 40px;
    grid-template-columns: auto 40px;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    -ms-flex-line-pack: center;
    align-content: center;
}
.app-player-content .song-info .song-info-title {
    overflow: hidden;
}
.app-player-content .song-info .song-title {
    display: inline-block;
    width: 100%;
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    overflow: hidden;
    white-space: nowrap;
}
.app-player-content .song-info .song-subtitle {
    font-size: 14px;
    font-weight: 400;
    white-space: nowrap;
    overflow: hidden;
    -o-text-overflow: ellipsis;
    text-overflow: ellipsis;
    opacity: 0.7;
}
.app-player-content .song-info-btn {
    text-align: right;
}
.app-player-content .song-info-btn i {
    font-size: 30px;
}
.app-player-content .timeline {
    padding: 0 5px;
    margin-bottom: 5px;
}

.app-player-content .sections .controls {
    margin: 2rem 0 1rem;
    display: -ms-grid;
    display: grid;
    -ms-grid-columns: 1fr 1rem 1fr 1rem 1fr 1rem 1fr 1rem 1fr;
    grid-template-columns: repeat(5, 1fr);
    grid-column-gap: 1rem;
    justify-items: center;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
}
.app-player-container .btn-closeplayer {
    position: absolute;
    background: #1e193c;
    padding-top: 10px;
    padding-left: 12px;
    width: 24px;
    height: 24px;
    z-index: 100;
    top: 0;
}
.app-player-container .btn-closeplayer i {
    font-size: 1.6rem;
}


.app-player-container .playlist-body {
    flex: 1;
    min-height: 0;
    height: auto;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: none;
    overscroll-behavior-y: contain;
    touch-action: pan-x pan-y;
    position: relative;
    
    /* Плавный скролл для мобилок */
    -webkit-overflow-scrolling: touch;

    /* Создаем маску: прозрачно (0%) -> черный (10%) -> черный (90%) -> прозрачно (100%) */
    /* В CSS масках черный цвет означает 100% видимость, прозрачный — 0% */
    -webkit-mask-image: linear-gradient(to bottom, 
        transparent 0%, 
        black 8%, 
        black 92%, 
        transparent 100%
    );
    mask-image: linear-gradient(to bottom, 
        transparent 0%, 
        black 8%, 
        black 92%, 
        transparent 100%
    );

    padding: 20px 5px 20px 0;
    margin-bottom: 40px;
}

.app-player-grid:has(> .playlist-body) { padding-bottom: 0; }

/* Скрываем стандартный скроллбар или делаем его очень тонким, 
   чтобы он не конфликтовал с маской */
.app-player-container .playlist-body::-webkit-scrollbar {
    display: none;
}

.app-player-container .playlist-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.app-player-container #playlist-empty {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -ms-flex-direction: column;
    flex-direction: column;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    text-align: center;
}
.app-player-container #playlist-empty img {
    width: 250px;
    height: auto;
}
.player-leave-active {
    -webkit-transition: all 0.5s;
    -o-transition: all 0.5s;
    transition: all 0.5s;
}
.playbar-to-player {
    -webkit-transition: all 0.8s;
    -o-transition: all 0.8s;
    transition: all 0.8s;
    -webkit-transform: translateY(90vh) !important;
    -ms-transform: translateY(90vh) !important;
    transform: translateY(90vh) !important;
    opacity: 0;
}
.player-to-playbar {
    -webkit-transition: all 0.5s;
    -o-transition: all 0.5s;
    transition: all 0.5s;
    -webkit-transform: translateY(0);
    -ms-transform: translateY(0);
    transform: translateY(0);
    opacity: 0;
}
.playbar-leave-active {
    opacity: 1;
    -webkit-transition: all 0.8s;
    -o-transition: all 0.8s;
    transition: all 0.8s;
}

/* Основной контейнер-окно */
/* 1. Главный контейнер должен занимать всю доступную высоту */
.player-viewport {
    width: 100%;
    height: 100%; /* Или 100vh, если это мобильное приложение на весь экран */
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

/* 2. Контейнер экранов должен растягиваться и заполнять viewport */
.player-screens {
    flex: 1; /* Занимает всё свободное место */
    display: flex;
    width: 100%;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x; 
}

/* 3. Каждый экран должен быть на всю высоту */
.screen {
    min-width: 100%;
    height: 100%;
    scroll-snap-align: start;
    position: relative; /* Обязательно: теперь absolute внутри будет двигаться вместе с экраном */
    overflow: hidden;
}

.playlist-drag-handle {
    flex: 0 0 32px;
    width: 32px;
    min-height: 44px;
    border: 0;
    background: transparent;
    color: inherit;
    font-size: 24px;
    cursor: grab;
    touch-action: none;
    user-select: none;
}
#playlist > .list__item {
    grid-template-columns: 24px 48px minmax(0, 1fr) 24px;
    gap: 6px;
    align-items: center;
}
#playlist > .list__item > .playlist-drag-handle { width: 24px; min-width: 0; padding: 0; }
#playlist > .list__item > .list__option { padding-left: 0; justify-content: center; }
.playlist-drag-handle:focus-visible { outline: 2px solid #b19eea; border-radius: 6px; }
.playlist-dragging { opacity: .65; background: rgba(177, 158, 234, .15); }
.playlist-dragging .playlist-drag-handle { cursor: grabbing; }
.player-repeat { position: relative; }
.resume-modal__heading { font-weight: bold; text-align: center; }
.resume-modal__info { text-align: left; }
.resume-modal__cover { flex-shrink: 0; object-fit: cover; }
.resume-modal__info-text { min-width: 0; }
.resume-modal__message { color: #b19eea; font-size: 14px; text-align: center; }
.resume-modal__buttons { display: flex; flex-direction: column; gap: 10px; }
.resume-modal__start { color: #fff !important; }
/* 4. Твоя сетка внутри экрана (app-player-grid) */
.app-player-grid {
    display: flex;
    flex-direction: column;
    height: 100%; /* Обязательно */
    justify-content: space-between; /* Распределяет хедер, контент и кнопки */
    padding-bottom: 40px; /* Место под точки пагинации */
}


/* Скрываем скроллбар */
.player-screens::-webkit-scrollbar {
    display: none;
}

.app-player-content .sections {
    position: absolute;
    width: 100%; /* Замени auto на 100%, чтобы padding работал корректно */
    bottom: 0;
    left: 0;
    padding: 0 1rem;
    margin-bottom: 4rem; /* Оставь место под пагинацию (точки) */
    box-sizing: border-box; /* Чтобы padding не раздувал ширину */
}
/* Пагинация */
.player-pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    padding: 10px 0;
    position: absolute;
    bottom: 0;
    width: 100%;
    pointer-events: none;
}

.dot {
    width: 7px;
    height: 7px;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: auto;
}

.dot.active {
    background: #F0A959;
    background: linear-gradient(90deg, rgba(240, 169, 89, 1) 0%, rgba(243, 139, 110, 1) 50%, rgba(244, 110, 146, 1) 100%);
    transform: scale(1.2);
    width: 14px; /* Эффект "гусеницы" */
    border-radius: 7px;
}

/* Класс для плавности, когда палец отпущен */
.player-dragging {
    transition: none !important;
}

/* Убираем конфликты с ползунком громкости/времени */
input[type="range"] {
    touch-action: none;
}

/* Контейнер заголовка */
.song-title {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    width: 100%;
    /* Добавляем маску с более мягким переходом */
    mask-image: linear-gradient(to right, transparent 0%, black 5%, black 95%, transparent 100%);
    -webkit-mask-image: linear-gradient(to right, transparent 0%, black 5%, black 95%, transparent 100%);
    
    /* Убираем возможные конфликты */
    box-sizing: border-box; 
}

.marquee-content {
    display: inline-block;
    will-change: transform;
    transition: transform 0.5s ease;
}

.song-subtitle, .marquee-content {
    padding-left:0.25rem;
}

/* Класс анимации "Пинг-понг" */
.run-ping-pong {
    animation: marquee-ping-pong 8s ease-in-out infinite alternate;
    animation-delay: 1s; /* Пауза в начале перед движением */
}

@keyframes marquee-ping-pong {
    0%, 15% { transform: translateX(0); } /* Стоим в начале */
    85%, 100% { transform: translateX(var(--travel-distance)); } /* Стоим в конце */
}


/* Контейнер всей секции */
.player-controls-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px; /* Расстояние между основным и нижним рядом */
}

/* Верхний ряд: кнопки управления */
.main-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 15px;
}

/* ЦЕНТРАЛЬНАЯ КНОПКА (Play/Pause) */
.btn-play-pause {
    width: 70px;
    height: 70px;
    background: #F0A959;
    background: linear-gradient(90deg, rgba(240, 169, 89, 1) 0%, rgba(243, 139, 110, 1) 50%, rgba(244, 110, 146, 1) 100%);
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

#play-pause.player-paused .play-svg{
    display: block !important;
}
#play-pause.player-playing .pause-svg{
    display: block !important;
}

/* Кнопки ВПЕРЕД/НАЗАД */
.btn-prev, .btn-next {
    width: 50px;
    height: 50px;
    background: transparent;
    color: #fff;
    border: none;
    font-size: 24px;
}

.btn-skip {
    width: 40px;
    height: 40px;
    background: transparent;
    color: rgba(255, 255, 255, 0.6); 
    border: none;
    font-size: 18px;
}

.secondary-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%; 
}

.btn-opt {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.5);
    border: none;
    height: 45px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: bold;
    min-width: 60px;
}

/* Активное состояние для Repeat и Shuffle */
.player-repeat-on, .player-shuffle-on {
    color: #F0A959 !important;
}
.main-controls svg {
    width: 100%;
    height: 100%;
    fill: currentColor; /* Позволяет управлять цветом через color у кнопки */
}

/* Переключение иконок Play/Pause в зависимости от состояния аудиодвижка */
.player-play-pause.player-playing .play-svg {
    display: none;
}
.player-play-pause.player-playing .pause-svg {
    display: block;
}

/* Специфические размеры для SVG внутри кнопок */
.btn-play-pause svg {
    width: 40px;
    height: 40px;
}

.btn-prev svg, .btn-next svg {
    width: 32px;
    height: 32px;
}

.btn-skip svg {
    width: 18px;
    height: 18px;
}

.btn-opt svg {
    width: 24px;
    height: 24px;
    fill: rgba(255, 255, 255, 0.5);
    transition: fill 0.3s ease;
}

.app-player-content .player-duration-time, .app-player-content .player-current-time{
    font-weight: bold;
}

/* Подсветка активных режимов */
.player-repeat-on svg,
.player-shuffle-on svg {
    fill: #F0A959;
}

/* Контейнер слайдера */
.slider {
    position: relative;
    width: 100%;
    height: 16px; /* Увеличим высоту контейнера для удобства выравнивания */
    display: flex;
    align-items: center;
}
.player-seek-preview {
    position: absolute;
    bottom: calc(100% + 8px);
    transform: translateX(-50%);
    padding: 4px 8px;
    border-radius: 8px;
    background: #f0a959;
    color: #1e193c;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
    pointer-events: none;
    z-index: 20;
}
.player-seek-preview[hidden] { display: none; }
#playerScreens.player-seeking { touch-action: none; scroll-snap-type: none; }
.btn-play-pause.player-loading > svg { visibility: hidden; }
.btn-play-pause.player-loading::after {
    content: '';
    position: absolute;
    width: 26px;
    height: 26px;
    border: 3px solid rgba(255,255,255,.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: player-loading-spin .8s linear infinite;
}
@keyframes player-loading-spin { to { transform: rotate(360deg); } }

/* Базовый сброс для инпута */
.slider input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    background: transparent !important; /* Убираем стандартный фон */
    position: absolute;
    z-index: 10;
    margin: 0;
    outline: none;
}

/* Общие стили для полосок прогресса */
.slider progress {
    -webkit-appearance: none;
    appearance: none;
    position: absolute;
    width: 100%;
    height: 3px; /* Чуть увеличим для видимости */
    border: none;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1); /* ЦВЕТ ПУСТОЙ ДОРОЖКИ ТЕПЕРЬ ТУТ */
}

/* 1. Цвет ПУСТОЙ ДОРОЖКИ (для Chrome/Safari) */
.slider progress::-webkit-progress-bar {
    background: rgba(255, 255, 255, 0.1); 
    border-radius: 10px;
}

/* 2. БУФЕРИЗАЦИЯ (Загружено) */
.player-buffered-progress {
    z-index: 1;
}
.player-buffered-progress::-webkit-progress-value {
    background: rgba(255, 255, 255, 0.3) !important; /* ПОЛУПРОЗРАЧНЫЙ БЕЛЫЙ */
    border-radius: 10px;
}
.player-buffered-progress::-moz-progress-bar {
    background: rgba(255, 255, 255, 0.3) !important;
}

/* 3. ПРОИГРАНО (Градиент) */
.player-song-played-progress {
    z-index: 2;
    background: transparent !important;
}
.player-song-played-progress::-webkit-progress-value {
    background: linear-gradient(90deg, #F0A959 0%, #F46E92 100%) !important;
    border-radius: 10px;
}
.player-song-played-progress::-moz-progress-bar {
    background: linear-gradient(90deg, #F0A959 0%, #F46E92 100%) !important;
}

/* 4. ТОЧКА (Thumb) */
.slider input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 16px;
    width: 16px;
    border-radius: 50%;
    background: #ffffff;
    cursor: pointer;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
    margin-top: -6px; /* Центровка: (высота track 4px / 2) - (высота точки 16px / 2) */
    position: relative;
    z-index: 20;
}

/* Дорожка инпута (делаем её прозрачной, чтобы видеть progress под ней) */
.slider input[type="range"]::-webkit-slider-runnable-track {
    width: 100%;
    height: 3px;
    cursor: pointer;
    background: transparent;
}


/* Таймер сна */
.circular-slider-container {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 20px 0;
}

.circular-slider {
    width: 280px;
    height: 280px;
    touch-action: none; /* Важно для мобилок */
    user-select: none;
}

.ring-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.1);
    stroke-width: 6;
}

#btn-player-down {
    display: flex;
    align-items: center;
    justify-content: center;
}

#btn-player-down .player-icon-state {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
}

#btn-player-down .progress-container {
    flex: 0 0 20px;
}

#btn-player-down .progress-ring {
    width: 20px;
    height: 20px;
}

.ring-progress {
    fill: none;
    stroke: #F0A959;
    stroke-width: 6;
    stroke-linecap: round;
    /* Убрали переход отсюда, чтобы не было задержки при ручном движении */
    transition: none; 
}

/* Этот класс можно добавлять, если нужно плавное перемещение программно */
.ring-progress.is-animating {
    transition: stroke-dashoffset 0.2s ease-out;
}

.knob {
    fill: #F0A959;
    cursor: pointer;
    /* Убираем любые переходы и для точки */
    transition: none; 
}

.sleep-timer-container{
    padding: 10px;
}

.svg-mark {
    fill: rgba(255, 255, 255, 0.4);
    font-size: 13px;
    font-family: Arial, sans-serif;
    font-weight: 500;
}

.timer-display-text {
    fill: #fff;
    font-size: 38px;
    font-weight: bold;
    font-family: sans-serif;
}

/* Стили заголовка и кнопки запуска */
.timer-title { text-align: center; color: #fff; margin-bottom: 15px; margin-top: 0;}
.timer-option { display: flex; justify-content: space-between; align-items: center; color: #fff; padding: 0 20px; }

.btn-start-timer {
    width: 100%;
    height: 55px;
    border-radius: 20px;
    border: none;
    color: #fff;
    font-weight: bold;
    font-size: 18px;
    margin-top: 20px;
    cursor: pointer;
    background: linear-gradient(90deg, 
        rgba(240, 169, 89, 1) 0%, 
        rgba(243, 139, 110, 1) 25%, 
        rgba(244, 110, 146, 1) 50%, 
        rgba(243, 139, 110, 1) 75%, 
        rgba(240, 169, 89, 1) 100%
    );
    background-size: 200% 100%; /* Растягиваем фон */
    background-position: 0% 0%;  /* Начальная позиция (Старт) */
    box-shadow: 0 10px 20px rgba(255, 152, 0, 0.3);
    transition: background-position 0.5s ease, transform 0.2s, box-shadow 0.3s;
}

/* Состояние "Стоп" (Активен) */
.btn-start-timer.active {
    background-position: 100% 0%; /* Смещаем градиент, имитируя 270deg */
    box-shadow: 0 10px 20px rgba(244, 110, 146, 0.4);
}

/* Эффект нажатия (микро-взаимодействие) */
.btn-start-timer:active {
    transform: scale(0.98);
}

/* Состояние кнопки при активном таймере */
#open-sleep-timer.is-active {
    border: 1px solid #F0A959 !important; /* Твой фирменный желтый */
    transition: all 0.3s ease;
}

/* Фикс, чтобы текст внутри не прилипал к краям */
#open-sleep-timer {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.timer-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.timer-option span {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
    font-weight: bold;
}

/* Стили переключателя */
.switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider-switch {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255, 255, 255, 0.1);
    transition: .4s;
    border-radius: 20px;
}

.slider-switch:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider-switch {
    background: #F0A959;
    background: linear-gradient(90deg, rgba(240, 169, 89, 1) 0%, rgba(243, 139, 110, 1) 50%, rgba(244, 110, 146, 1) 100%);
}

input:checked + .slider-switch:before {
    transform: translateX(20px);
}


.cover-content{
    display: flex;
    align-items: center;
    justify-content: center;
}

.cover {
    position: relative;
    width: 95%;
    height: auto;
    aspect-ratio: 1;
    margin: 20px auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.app-player-content .cover {
    width: 100%;
    padding: 2rem;
    box-sizing: border-box;
}

#big-cover-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 15px;
    overflow: hidden; /* Чтобы блюр не вылезал */
  
    /* --- ТВОЯ АНИМАЦИЯ ТЕПЕРЬ ТУТ --- */
    opacity: 0;
    transform: scale(0.8);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s ease;

}

.cover-inner {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 15px;
    overflow: hidden; /* Чтобы блюр не вылезал */
    box-shadow: 0 1px 2rem 0 rgba(0, 0, 0, .3);

}

/* Когда большой плеер открыт — анимируем весь контейнер */
.big-player-open #big-cover-wrapper {
    opacity: 1;
    transform: scale(1);
}


#big-cover {
    position: relative;
    z-index: 2;
    width: 100%;
    height: 100%;
    border-radius: 15px;
    object-fit: cover;
    /* Картинка всегда видна, мы просто меняем её SRC */
    transition: filter 0.3s ease; 
}
.blurhash-bg.mini {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: 100% 100%;
    background-repeat: no-repeat;
    background-position: center;
    z-index: 1;
    filter: blur(15px);
    transform: scale(1.2);
    transition: opacity 0.8s ease-in-out;
}

.player-play-pause, .player-next, .player-prev, #speed-control {
    position: relative;
    z-index: 10;
    pointer-events: auto !important;
}

#playerScreens {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch; /* Важно для плавности */
    scrollbar-width: none; /* Скрыть скроллбар */
}

#playerScreens::-webkit-scrollbar {
    display: none;
}

.screen {
    flex: 0 0 100%; /* Каждый экран на всю ширину */
    scroll-snap-align: start;
    pointer-events: auto; /* Разрешаем взаимодействие внутри экрана */
}

@media (orientation: landscape) {
    .app-player-grid {
        padding: 12px max(16px, env(safe-area-inset-right)) 28px max(16px, env(safe-area-inset-left));
        min-height: 0;
    }
    .app-player-header { flex: 0 0 auto; margin: 0 0 8px; }
    .app-player-content {
        flex: 1;
        min-height: 0;
        height: auto;
        grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
        grid-template-rows: minmax(0, 1fr);
        gap: clamp(12px, 3vw, 32px);
        align-items: center;
    }
    .app-player-content .cover-content { min-width: 0; min-height: 0; height: 100%; }
    .app-player-content .cover {
        width: min(100%, calc(100vh - 100px), 320px);
        width: min(100%, calc(100dvh - 100px), 320px);
        height: auto;
        aspect-ratio: 1;
        margin: 0;
    }
    .app-player-content .sections {
        position: static;
        width: auto;
        min-width: 0;
        max-height: 100%;
        margin: 0;
        padding: 0;
        overflow-x: hidden;
        overflow-y: auto;
        scrollbar-width: none;
        overscroll-behavior: contain;
        touch-action: pan-y;
    }
    .app-player-content .sections::-webkit-scrollbar { display: none; }
    .app-player-content .song-info { grid-template-columns: minmax(0, 1fr) 32px; margin-bottom: 10px; }
    .app-player-content .timeline { margin-bottom: 12px; }
    .app-player-content .player-controls-section { gap: 12px; }
    .app-player-content .main-controls { gap: 4px; }
    .app-player-content .btn-play-pause { width: 56px; height: 56px; flex-shrink: 0; }
    .app-player-content .btn-prev, .app-player-content .btn-next { width: 40px; height: 44px; }
    .app-player-content .btn-skip { width: 32px; height: 40px; }
    .app-player-content .secondary-controls { gap: 6px; }
    .app-player-content .secondary-controls .btn-opt { min-width: 0; flex: 1; height: 40px; }
}

.app-player-content button.disabled,
.app-player-content button:disabled,
.app-player-content #btn-player-fav.disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

/* В портрете обложка занимает только место, оставшееся над управлением. */
@media (orientation: portrait) {
    .app-player-grid {
        min-height: 0;
        box-sizing: border-box;
        padding-bottom: calc(36px + env(safe-area-inset-bottom, 0px));
    }
    .app-player-header {
        flex: 0 0 auto;
        margin: 0 0 12px;
    }
    .app-player-content {
        flex: 1;
        min-height: 0;
        height: auto;
        grid-template-rows: minmax(0, 1fr) auto;
        gap: 12px;
    }
    .app-player-content .cover-content {
        min-width: 0;
        min-height: 0;
        container-type: size;
    }
    .app-player-content .cover {
        width: min(100%, calc(100vh - 320px));
        width: min(100%, calc(100dvh - 320px));
        margin: 0;
    }
    .app-player-content .sections {
        position: static;
        width: 100%;
        min-width: 0;
        margin: 0;
        padding: 0;
    }
    @supports (width: 1cqh) {
        .app-player-content .cover {
            width: min(100%, 100cqh);
        }
    }
}
