/* =========================================================
   TABLET UI — separate editable styles
   Breakpoint: 768px–1024px.
   Править планшетный интерфейс здесь.
   Mobile: css/mobile.css | Desktop: css/desktop.css
========================================================= */

/* =========================================================
   MOBILE UI — FINAL CLEAN STYLES
   Hard Rock FM mobile player
========================================================= */

.mobile-layout {
    font-family: 'Arial Black', 'Arial', sans-serif;
}

@media (min-width: 768px) and (max-width: 1024px) {

    /* -----------------------------------------------------
       Bottom controls
    ----------------------------------------------------- */

    .mobile-bottom-controls {
        padding: 14px 18px calc(14px + env(safe-area-inset-bottom));
        gap: 18px;
    }

    .mobile-control-btn {
        font-size: 15px;
        gap: 8px;
        border: 1px solid transparent;
        border-radius: 16px;
        transition: background .25s ease, box-shadow .25s ease, transform .2s ease, color .2s ease, border-color .2s ease;
    }

    .mobile-control-btn i,
    .mobile-control-btn svg {
        width: 22px;
        height: 22px;
        font-size: 22px;
        transition: transform .2s ease, filter .2s ease;
    }

    .mobile-control-btn.is-active {
        color: #fff;
        background: transparent;
        border-color: transparent;
        box-shadow: none;
        transform: translateY(-2px);
        position: relative;
        padding-bottom: 12px;
    }

    .mobile-control-btn.is-active::after {
        content: '';
        position: absolute;
        bottom: 4px;
        left: 50%;
        transform: translateX(-50%);
        width: 40px;
        height: 5px;
        border-radius: 999px;
        background: rgba(255, 72, 64, .9);
    }

    .mobile-control-btn.is-active svg,
    .mobile-control-btn.is-active img {
        filter: drop-shadow(0 0 10px rgba(255,45,32,.65));
        transform: scale(1.15);
    }

    .mobile-control-btn.is-active span {
        color: #fff;
        text-shadow: 0 0 12px rgba(255,45,32,.55);
        font-weight: 800;
    }

    /* -----------------------------------------------------
       Play / Pause button — deeper hard-rock red
    ----------------------------------------------------- */

    .mobile-play-btn {
        position: relative;
        width: 72px;
        height: 72px;
        border-radius: 50%;
        border: 1px solid rgba(255,255,255,.08);
        background: linear-gradient(180deg, #ff4a42 0%, #ff2d20 100%);
        box-shadow: 0 0 22px rgba(255,45,32,.42);
        color: #fff;
        display: flex;
        align-items: center;
        justify-content: center;
        overflow: hidden;
        transition: transform .18s ease, box-shadow .25s ease, background .25s ease;
        -webkit-tap-highlight-color: transparent;
    }

    .mobile-play-btn i,
    .mobile-play-btn svg {
        position: relative;
        z-index: 2;
        color: #fff;
        font-size: 30px;
    }

    .mobile-play-btn:hover {
        background: linear-gradient(180deg, #ff5a52 0%, #ff382b 100%);
        box-shadow: 0 0 28px rgba(255,45,32,.52);
    }

    .mobile-play-btn:active {
        transform: scale(.96);
        box-shadow: 0 0 14px rgba(255,59,48,.28);
    }

    .mobile-play-btn::before {
        content: '';
        position: absolute;
        inset: -6px;
        z-index: 0;
        border-radius: 50%;
        background: radial-gradient(circle, rgba(255,45,32,.28) 0%, rgba(255,45,32,0) 70%);
        pointer-events: none;
    }

    /* -----------------------------------------------------
       Mobile metadata marquee
    ----------------------------------------------------- */

    .mobile-marquee {
        -webkit-mask-image: linear-gradient(to right, transparent 0, #000 9%, #000 91%, transparent 100%);
        mask-image: linear-gradient(to right, transparent 0, #000 9%, #000 91%, transparent 100%);
    }

    .mobile-song-artist,
    .mobile-song-name {
        display: inline-block;
        white-space: nowrap;
        vertical-align: bottom;
        max-width: none;
        overflow: visible;
        text-overflow: clip;
        will-change: transform;
    }

    .mobile-marquee-wrapper {
        display: inline-flex;
        white-space: nowrap;
        will-change: transform;
    }

    .mobile-marquee-wrapper > span {
        padding-right: 2.5em;
    }

    /* -----------------------------------------------------
       Air playlist bottom sheet
    ----------------------------------------------------- */

    .mobile-bottom-sheet.is-history-mode {
        display: flex;
        flex-direction: column;
        max-height: min(86dvh, 740px);
        touch-action: none;
    }

    .mobile-bottom-sheet.is-history-mode .mobile-sheet-body {
        overflow: hidden;
        display: flex;
        flex-direction: column;
        min-height: 0;
        max-height: calc(min(86dvh, 740px) - 82px);
    }

    .mobile-bottom-sheet.is-history-mode .mobile-sheet-history {
        display: flex;
        flex-direction: column;
        min-height: 0;
        width: 100%;
        margin-bottom: 12px;
    }

    .mobile-bottom-sheet.is-history-mode .mobile-sheet-history h3 {
        margin-bottom: clamp(10px, 2.8vw, 14px);
        font-size: clamp(18px, 5vw, 22px);
        line-height: 1.15;
    }

    .mobile-history-status {
        padding: 12px 10px;
        border-radius: 14px;
        background: rgba(255,255,255,.055);
        color: rgba(255,255,255,.72);
        font-size: clamp(13px, 3.5vw, 14px);
        text-align: center;
    }

    .mobile-history-status[hidden],
    .mobile-history-status:empty {
        display: none !important;
        padding: 0 !important;
        margin: 0 !important;
        border: 0 !important;
        background: transparent !important;
    }

    .mobile-history-list {
        display: flex;
        flex-direction: column;
        gap: clamp(10px, 2.8vw, 14px);
        min-height: 0;
        max-height: min(58dvh, 500px);
        overflow-y: auto;
        overscroll-behavior: contain;
        touch-action: pan-y;
        -webkit-overflow-scrolling: touch;
        padding: 2px 2px 8px;
    }

    .mobile-history-list::before,
    .mobile-history-list::after {
        content: none !important;
        display: none !important;
    }

    /* -----------------------------------------------------
       Air playlist cards — readable adaptive layout
    ----------------------------------------------------- */

    .mobile-history-item {
        display: grid;
        grid-template-columns: clamp(58px, 16vw, 74px) minmax(0, 1fr) auto;
        align-items: center;
        box-sizing: border-box;
        gap: clamp(12px, 3.2vw, 16px);
        min-height: clamp(82px, 21vw, 96px);
        padding: clamp(12px, 3.2vw, 15px);
        border-radius: clamp(18px, 4.6vw, 22px);
        background:
            linear-gradient(135deg, rgba(255,255,255,.105), rgba(255,255,255,.035)),
            radial-gradient(circle at 12% 0%, rgba(255,45,32,.16), transparent 52%);
        border: 1px solid rgba(255,255,255,.095);
        box-shadow:
            0 10px 28px rgba(0,0,0,.24),
            inset 0 1px 0 rgba(255,255,255,.06);
    }

    .mobile-history-cover {
        display: block;
        align-self: center;
        justify-self: start;
        width: clamp(58px, 16vw, 74px);
        height: clamp(58px, 16vw, 74px);
        flex: 0 0 auto;
        border-radius: clamp(14px, 3.8vw, 18px);
        object-fit: cover;
        background: rgba(255,255,255,.08);
        box-shadow:
            0 10px 22px rgba(0,0,0,.34),
            0 0 0 1px rgba(255,255,255,.08);
    }

    .mobile-history-meta {
        align-self: center;
        min-width: 0;
        min-height: clamp(58px, 16vw, 74px);
        display: flex;
        flex-direction: column;
        justify-content: center;
        gap: clamp(5px, 1.4vw, 7px);
    }

    .mobile-history-artist,
    .mobile-history-title {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .mobile-history-artist {
        color: rgba(255,255,255,.96);
        font-size: clamp(15px, 4.25vw, 18px);
        font-weight: 850;
        line-height: 1.15;
        letter-spacing: .01em;
    }

    .mobile-history-title {
        color: rgba(255,255,255,.74);
        font-size: clamp(14px, 3.8vw, 16px);
        font-weight: 650;
        line-height: 1.24;
    }

    .mobile-history-time {
        align-self: center;
        justify-self: end;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        box-sizing: border-box;
        min-width: clamp(52px, 13vw, 62px);
        min-height: clamp(28px, 7vw, 34px);
        padding: clamp(6px, 1.6vw, 8px) clamp(8px, 2.2vw, 11px);
        border-radius: 999px;
        background: rgba(19,19,19,.18);
        border: 1px solid rgba(133,133,133,.34);
        color: rgba(255,255,255,.92);
        font-size: clamp(13px, 3.5vw, 15px);
        font-weight: 800;
        line-height: 1;
        text-align: center;
        white-space: nowrap;
        font-variant-numeric: tabular-nums;
        box-shadow: 0 0 16px rgba(255,45,32,.13);
    }

    /* -----------------------------------------------------
       About / Help bottom sheet
    ----------------------------------------------------- */

    .mobile-bottom-sheet.is-about-mode {
        max-height: min(76dvh, 620px);
    }

    .mobile-bottom-sheet.is-about-mode .mobile-sheet-body {
        overflow-y: auto;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
        touch-action: pan-y;
    }

    .mobile-sheet-about {
        width: 100%;
    }

    .mobile-sheet-about h3 {
        margin-bottom: 12px;
    }

    .mobile-about-card {
        display: grid;
        grid-template-columns: clamp(58px, 17vw, 74px) minmax(0, 1fr);
        gap: 13px;
        align-items: center;
        padding: 13px;
        border-radius: 20px;
        background: linear-gradient(180deg, rgba(255,255,255,.075), rgba(255,255,255,.035));
        border: 1px solid rgba(255,255,255,.08);
        box-shadow: 0 14px 36px rgba(0,0,0,.22);
    }

    .mobile-about-logo {
        width: clamp(58px, 17vw, 74px);
        height: clamp(58px, 17vw, 74px);
        border-radius: 18px;
        object-fit: cover;
        background: rgba(255,255,255,.08);
        box-shadow: 0 10px 24px rgba(0,0,0,.28);
    }

    .mobile-about-text {
        min-width: 0;
    }

    .mobile-about-text strong {
        display: block;
        margin-bottom: 5px;
        color: rgba(255,255,255,.96);
        font-size: clamp(16px, 4.5vw, 19px);
        font-weight: 900;
        letter-spacing: .01em;
    }

    .mobile-about-text p {
        margin: 0;
        color: rgba(255,255,255,.68);
        font-size: clamp(12px, 3.45vw, 14px);
        line-height: 1.45;
        font-weight: 600;
    }

    .mobile-about-socials {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 10px;
        margin-top: 14px;
    }

    .mobile-about-social {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 7px;
        min-height: clamp(72px, 21vw, 88px);
        padding: 12px 8px;
        border-radius: 18px;
        text-decoration: none;
        color: rgba(255,255,255,.92);
        background: rgba(255,255,255,.06);
        border: 1px solid rgba(255,255,255,.08);
        box-shadow: 0 10px 24px rgba(0,0,0,.18);
        -webkit-tap-highlight-color: transparent;
        transition: transform .18s ease, background .2s ease, border-color .2s ease, box-shadow .2s ease;
    }

    .mobile-about-social:active {
        transform: scale(.96);
    }

    .mobile-about-social svg {
        width: clamp(25px, 7vw, 31px);
        height: clamp(25px, 7vw, 31px);
        fill: currentColor;
        stroke: currentColor;
        stroke-width: 1.8;
    }

    .mobile-about-social span {
        font-size: clamp(11px, 3.2vw, 13px);
        font-weight: 800;
        line-height: 1;
        white-space: nowrap;
    }

    .mobile-about-vk {
        background: linear-gradient(180deg, rgba(0,119,255,.24), rgba(0,119,255,.10));
        border-color: rgba(0,119,255,.26);
    }

    .mobile-about-telegram {
        background: linear-gradient(180deg, rgba(42,171,238,.24), rgba(42,171,238,.10));
        border-color: rgba(42,171,238,.26);
    }

    .mobile-about-site {
        background: linear-gradient(180deg, rgba(255,45,32,.22), rgba(255,45,32,.09));
        border-color: rgba(255,45,32,.24);
    }
}

@media (max-width: 380px) {

    .mobile-history-list {
        gap: 9px;
        max-height: min(56dvh, 470px);
    }

    .mobile-history-item {
        grid-template-columns: clamp(54px, 15vw, 60px) minmax(0, 1fr) auto;
        gap: 10px;
        min-height: 76px;
        padding: 10px;
        border-radius: 17px;
    }

    .mobile-history-cover {
        width: clamp(54px, 15vw, 60px);
        height: clamp(54px, 15vw, 60px);
        border-radius: 13px;
    }

    .mobile-history-meta {
        min-height: clamp(54px, 15vw, 60px);
        gap: 4px;
    }

    .mobile-history-artist {
        font-size: clamp(14px, 4.1vw, 16px);
    }

    .mobile-history-title {
        font-size: clamp(13px, 3.7vw, 14px);
    }

    .mobile-history-time {
        min-width: 48px;
        min-height: 28px;
        padding: 5px 7px;
        font-size: 12px;
    }

    .mobile-about-card {
        grid-template-columns: 54px minmax(0, 1fr);
        gap: 10px;
        padding: 11px;
        border-radius: 18px;
    }

    .mobile-about-logo {
        width: 54px;
        height: 54px;
        border-radius: 15px;
    }

    .mobile-about-socials {
        gap: 8px;
    }

    .mobile-about-social {
        border-radius: 16px;
        padding-left: 6px;
        padding-right: 6px;
    }
}



/* =========================================================
   MOBILE HEADER LOGO SCALE
========================================================= */

.mobile-header-logo,
.mobile-logo,
.mobile-top-logo,
.mobile-station-title {

    font-size: clamp(22px, 6vw, 30px);

    font-weight: 800;

    letter-spacing: .08em;

    line-height: 1;

    text-transform: uppercase;
}

/* API facts panel */
.mobile-facts-current {
    display: grid;
    gap: 6px;
    margin: 8px 0 14px;
    padding: 14px 16px;
    border-radius: 16px;
    background: rgba(255, 255, 255, .06);
    border: 1px solid rgba(255, 255, 255, .08);
}

.mobile-fact-row {
    display: flex;
    align-items: center;
    gap: 10px;
    line-height: 1.35;
}

.mobile-fact-icon {
    flex: 0 0 18px;
    width: 18px;
    height: 18px;
    color: rgba(255, 72, 64, .85);
    opacity: .9;
}

.mobile-facts-current strong {
    font-size: 14px;
    font-weight: 800;
    line-height: 1.25;
    color: rgba(255,255,255,.96);
}

.mobile-facts-current span {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.35;
    color: rgba(255,255,255,.85);
}

.mobile-facts-current small {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.35;
    color: #fff;
}

.mobile-facts-current strong {
    font-size: 14px;
    line-height: 1.25;
}

.mobile-facts-current span {
    font-size: 13px;
    line-height: 1.35;
    opacity: .88;
}



.mobile-facts-list {
    margin: 0;
    padding-left: 18px;
}

.mobile-facts-list li {
    margin: 0 0 8px;
    line-height: 1.45;
}

.mobile-bottom-sheet.is-facts-mode .mobile-sheet-head strong {
    display: none;
}

.mobile-bottom-sheet.is-facts-mode .mobile-sheet-head {
    justify-content: flex-end;
}


/* =========================================================
   MOBILE PLAYLIST AS FULL SCREEN
========================================================= */

@media (min-width: 768px) and (max-width: 1024px) and (pointer: coarse) {
    .mobile-playlist-screen {
        display: none;
        flex: 1 1 auto;
        min-height: 0;
        height: 100%;
        margin-bottom: clamp(12px, 3.2dvh, 28px);
        padding: clamp(16px, 4vw, 22px);
        border-radius: 28px;
        background: linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.035));
        border: 1px solid rgba(255,255,255,.10);
        box-shadow: 0 22px 70px rgba(0,0,0,.42);
        backdrop-filter: blur(18px);
        -webkit-backdrop-filter: blur(18px);
        overflow: hidden;
        flex-direction: column;
    }

    .mobile-layout.is-playlist-mode .mobile-player-shell {
        display: none !important;
    }

    .mobile-layout.is-playlist-mode .mobile-playlist-screen {
        display: flex !important;
    }

    .mobile-playlist-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 14px;
        flex: 0 0 auto;
        margin-bottom: clamp(14px, 4vw, 20px);
        padding-bottom: 14px;
        border-bottom: 1px solid rgba(255,255,255,.10);
    }

    .mobile-playlist-kicker {
        margin-bottom: 4px;
        color: rgba(255,255,255,.58);
        font-size: 11px;
        font-weight: 850;
        letter-spacing: .16em;
        text-transform: uppercase;
    }

    .mobile-playlist-head h2 {
        margin: 0;
        color: #fff;
        font-size: clamp(18px, 5vw, 34px);
        line-height: 1.05;
        font-weight: 950;
        letter-spacing: -.03em;
    }

    .mobile-playlist-refresh {
        width: 46px;
        height: 46px;
        flex: 0 0 46px;
        border: 1px solid rgba(255,255,255,.12);
        border-radius: 50%;
        background: rgba(0,0,0,.26);
        color: #fff;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        -webkit-tap-highlight-color: transparent;
    }

    .mobile-playlist-refresh svg {
        width: 22px;
        height: 22px;
        fill: none;
        stroke: currentColor;
        stroke-width: 1.9;
        stroke-linecap: round;
        stroke-linejoin: round;
    }

    .mobile-playlist-screen .mobile-history-status {
        flex: 0 0 auto;
        margin-bottom: 12px;
    }

    .mobile-playlist-screen .mobile-history-list {
        flex: 1 1 auto;
        min-height: 0;
        max-height: none !important;
        padding: 2px 2px calc(18px + env(safe-area-inset-bottom));
        overflow-y: auto;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
        touch-action: pan-y;
    }

    .mobile-layout.is-playlist-mode .mobile-bottom-controls {
        z-index: 10000 !important;
    }
}

@media (min-width: 768px) and (max-width: 1024px) and (orientation: landscape) and (pointer: coarse) {
    .mobile-playlist-screen {
        border-radius: 24px;
        padding: 12px 14px;
        margin-bottom: 12px;
    }

    .mobile-playlist-head {
        margin-bottom: 10px;
        padding-bottom: 10px;
    }

    .mobile-playlist-head h2 {
        font-size: clamp(20px, 4vw, 28px);
    }
}

/* =========================================================
   Mobile listening settings sheet
========================================================= */
@media (min-width: 768px) and (max-width: 1024px) {
    .mobile-bottom-sheet.is-settings-mode {
        max-height: min(72dvh, 560px);
    }

    .mobile-bottom-sheet.is-settings-mode .mobile-sheet-body {
        overflow-y: auto;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
        touch-action: pan-y;
    }

    .mobile-sheet-settings {
        width: 100%;
    }

    .mobile-sheet-settings h3 {
        margin: 0 0 16px;
        color: rgba(255,255,255,.96);
        font-size: clamp(19px, 5.1vw, 23px);
        line-height: 1.15;
        font-weight: 900;
        letter-spacing: -.01em;
    }

    .mobile-quality-card,
    .mobile-volume-card {
        padding: clamp(14px, 4vw, 18px);
        border-radius: 22px;
        background: linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.035));
        border: 1px solid rgba(255,255,255,.1);
        box-shadow: 0 16px 36px rgba(0,0,0,.24);
    }

    .mobile-quality-card {
        margin-bottom: 14px;
    }

    .mobile-setting-label {
        margin-bottom: 10px;
        color: rgba(255,255,255,.72);
        font-size: 13px;
        font-weight: 800;
        letter-spacing: .08em;
        text-transform: uppercase;
    }

    .mobile-quality-toggle {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 9px;
        padding: 5px;
        border-radius: 18px;
        background: rgba(0,0,0,.25);
        border: 1px solid rgba(255,255,255,.08);
    }

    .mobile-quality-option {
        min-height: 62px;
        padding: 10px 8px;
        border: 1px solid transparent;
        border-radius: 15px;
        background: transparent;
        color: rgba(255,255,255,.68);
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 4px;
        text-align: center;
        transition: background .2s ease, color .2s ease, border-color .2s ease, box-shadow .2s ease, transform .16s ease;
        -webkit-tap-highlight-color: transparent;
    }

    .mobile-quality-option:active {
        transform: scale(.97);
    }

    .mobile-quality-option.is-active {
        background: linear-gradient(180deg, rgba(255,72,64,.95), rgba(255,45,32,.92));
        border-color: rgba(255,255,255,.18);
        color: #fff;
        box-shadow: 0 0 22px rgba(255,45,32,.34), inset 0 1px 0 rgba(255,255,255,.22);
    }

    .mobile-quality-title {
        font-size: clamp(15px, 4.1vw, 17px);
        font-weight: 950;
        line-height: 1.05;
    }

    .mobile-quality-subtitle {
        color: rgba(255,255,255,.66);
        font-size: 11px;
        font-weight: 800;
        line-height: 1.1;
    }

    .mobile-quality-option.is-active .mobile-quality-subtitle {
        color: rgba(255,255,255,.84);
    }

    .mobile-volume-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 14px;
        margin-bottom: 12px;
    }

    .mobile-volume-head .mobile-setting-label {
        margin-bottom: 0;
    }

    .mobile-volume-value {
        min-width: 54px;
        padding: 6px 10px;
        border-radius: 999px;
        background: rgba(255,45,32,.16);
        border: 1px solid rgba(255,45,32,.28);
        color: rgba(255,255,255,.92);
        font-size: 13px;
        font-weight: 900;
        text-align: center;
        font-variant-numeric: tabular-nums;
    }

    .mobile-volume-range {
        --mobile-volume: 100%;
        width: 100%;
        height: 34px;
        margin: 0;
        appearance: none;
        -webkit-appearance: none;
        background: transparent;
        cursor: pointer;
    }

    .mobile-volume-range::-webkit-slider-runnable-track {
        height: 8px;
        border-radius: 999px;
        background: linear-gradient(to right, #ff2d20 0%, #ff2d20 var(--mobile-volume), rgba(255,255,255,.16) var(--mobile-volume), rgba(255,255,255,.16) 100%);
        box-shadow: inset 0 1px 1px rgba(0,0,0,.28);
    }

    .mobile-volume-range::-webkit-slider-thumb {
        -webkit-appearance: none;
        width: 24px;
        height: 24px;
        margin-top: -8px;
        border-radius: 50%;
        background: #fff;
        border: 4px solid #ff2d20;
        box-shadow: 0 6px 18px rgba(0,0,0,.34), 0 0 14px rgba(255,45,32,.28);
    }

    .mobile-volume-range::-moz-range-track {
        height: 8px;
        border-radius: 999px;
        background: rgba(255,255,255,.16);
    }

    .mobile-volume-range::-moz-range-progress {
        height: 8px;
        border-radius: 999px;
        background: #ff2d20;
    }

    .mobile-volume-range::-moz-range-thumb {
        width: 18px;
        height: 18px;
        border-radius: 50%;
        background: #fff;
        border: 4px solid #ff2d20;
        box-shadow: 0 6px 18px rgba(0,0,0,.34), 0 0 14px rgba(255,45,32,.28);
    }

    .mobile-donate-card {
        margin-top: 14px;
        padding: clamp(14px, 4vw, 18px);
        border-radius: 22px;
        background: linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.035));
        border: 1px solid rgba(255,255,255,.1);
        box-shadow: 0 16px 36px rgba(0,0,0,.24);
    }

    .mobile-donate-button {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
        width: 100%;
        padding: 14px 18px;
        border-radius: 16px;
        background: linear-gradient(180deg, rgba(255,72,64,.95), rgba(255,45,32,.92));
        border: 1px solid rgba(255,255,255,.18);
        color: #fff;
        text-decoration: none;
        font-size: clamp(15px, 4.1vw, 17px);
        font-weight: 900;
        letter-spacing: .02em;
        transition: transform .16s ease, box-shadow .2s ease;
        -webkit-tap-highlight-color: transparent;
    }

    .mobile-donate-button:active {
        transform: scale(.97);
    }

    .mobile-donate-icon {
        width: 22px;
        height: 22px;
        flex-shrink: 0;
    }
}

/* =========================================================
   MOBILE FINAL FIX — metadata clean + no bottom overlap
   2026-05-29
   These rules are intentionally placed at the very end.
========================================================= */
@media (min-width: 768px) and (max-width: 1024px) and (pointer: coarse) {
    .mobile-layout,
    .mobile-layout * {
        box-sizing: border-box;
    }

    .mobile-layout {
        /* The bottom panel is fixed, so the main card needs real reserved space. */
        font-family: 'Arial Black', 'Arial', sans-serif;
        padding-top: max(10px, env(safe-area-inset-top)) !important;
        padding-left: 14px !important;
        padding-right: 14px !important;
        padding-bottom: calc(126px + env(safe-area-inset-bottom)) !important;
        gap: 0 !important;
    }

    .mobile-player-shell {
        height: auto !important;
        min-height: 0 !important;
        flex: 1 1 auto !important;
        margin-bottom: 0 !important;
        overflow: hidden !important;
    }

    .mobile-player-main {
        flex: 1 1 auto !important;
        min-height: 0 !important;
        padding-bottom: clamp(12px, 2.6dvh, 20px) !important;
    }

    .mobile-bottom-controls {
        left: 12px !important;
        right: 12px !important;
        bottom: max(8px, env(safe-area-inset-bottom)) !important;
        min-height: clamp(88px, 12dvh, 104px) !important;
        z-index: 10000 !important;
    }

    /* Fully remove the old card look from current-track metadata. */
    .mobile-track-card,
    .mobile-track-card::before,
    .mobile-track-card::after,
    .mobile-now-label,
    .mobile-now-label::before,
    .mobile-now-label::after,
    .mobile-marquee,
    .mobile-marquee::before,
    .mobile-marquee::after {
        background: transparent !important;
        background-image: none !important;
        border: 0 !important;
        outline: 0 !important;
        box-shadow: none !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
    }

    .mobile-track-card {
        width: 100% !important;
        max-width: 420px !important;
        margin: clamp(10px, 2.2dvh, 16px) auto 0 !important;
        padding: 0 14px !important;
        border-radius: 0 !important;
        text-align: center !important;
    }

    .mobile-now-label {
        display: block !important;
        width: auto !important;
        height: auto !important;
        min-height: 0 !important;
        margin: 0 0 7px !important;
        padding: 0 !important;
        color: rgba(255,255,255,.58) !important;
        line-height: 1.15 !important;
    }
}

@media (max-width: 380px) and (pointer: coarse) {
    .mobile-layout {
        padding-bottom: calc(120px + env(safe-area-inset-bottom)) !important;
    }

    .mobile-bottom-controls {
        min-height: 86px !important;
    }
}

/* =========================================================
   MOBILE SETTINGS: compact quality switcher final polish
   ========================================================= */
@media (min-width: 768px) and (max-width: 1024px) and (pointer: coarse) {
    .mobile-sheet-settings h3 {
        margin-bottom: 12px !important;
        font-size: clamp(18px, 4.8vw, 21px) !important;
        letter-spacing: -.02em !important;
    }

    .mobile-quality-card,
    .mobile-volume-card {
        padding: 13px 14px !important;
        border-radius: 18px !important;
        background: linear-gradient(180deg, rgba(255,255,255,.07), rgba(255,255,255,.03)) !important;
        border: 1px solid rgba(255,255,255,.10) !important;
        box-shadow: 0 10px 24px rgba(0,0,0,.22) !important;
    }

    .mobile-quality-card {
        margin-bottom: 12px !important;
    }

    .mobile-setting-label {
        margin-bottom: 8px !important;
        font-size: 11px !important;
        line-height: 1.1 !important;
        letter-spacing: .075em !important;
    }

    .mobile-quality-toggle {
        position: relative !important;
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 4px !important;
        padding: 4px !important;
        min-height: 50px !important;
        border-radius: 16px !important;
        background: rgba(0,0,0,.34) !important;
        border: 1px solid rgba(255,255,255,.075) !important;
        box-shadow: inset 0 1px 2px rgba(0,0,0,.32) !important;
    }

    .mobile-quality-option {
        min-height: 42px !important;
        height: 42px !important;
        padding: 6px 8px !important;
        border-radius: 12px !important;
        border: 1px solid transparent !important;
        background: transparent !important;
        color: rgba(255,255,255,.64) !important;
        box-shadow: none !important;
        gap: 2px !important;
    }

    .mobile-quality-option.is-active {
        background: linear-gradient(180deg, #ff4a43 0%, #f1271f 100%) !important;
        border-color: rgba(255,255,255,.18) !important;
        color: #fff !important;
        box-shadow: 0 8px 18px rgba(255,45,32,.28), inset 0 1px 0 rgba(255,255,255,.22) !important;
    }

    .mobile-quality-title {
        font-size: clamp(13px, 3.65vw, 15px) !important;
        font-weight: 900 !important;
        line-height: 1 !important;
        letter-spacing: -.01em !important;
        white-space: nowrap !important;
    }

    .mobile-quality-subtitle {
        font-size: 9px !important;
        font-weight: 800 !important;
        line-height: 1 !important;
        opacity: .72 !important;
        color: rgba(255,255,255,.62) !important;
        white-space: nowrap !important;
    }

    .mobile-quality-option.is-active .mobile-quality-subtitle {
        color: rgba(255,255,255,.88) !important;
        opacity: .95 !important;
    }

    .mobile-volume-head {
        margin-bottom: 10px !important;
    }

    .mobile-volume-value {
        min-width: 52px !important;
        height: 30px !important;
        padding: 0 10px !important;
        border-radius: 999px !important;
        font-size: 13px !important;
        line-height: 30px !important;
    }

    .mobile-volume-range {
        height: 26px !important;
    }

    .mobile-donate-card {
        margin-top: 12px !important;
        padding: 13px 14px !important;
        border-radius: 18px !important;
        background: linear-gradient(180deg, rgba(255,255,255,.07), rgba(255,255,255,.03)) !important;
        border: 1px solid rgba(255,255,255,.10) !important;
        box-shadow: 0 10px 24px rgba(0,0,0,.22) !important;
    }

    .mobile-donate-button {
        padding: 12px 16px !important;
        border-radius: 14px !important;
        font-size: clamp(14px, 3.9vw, 16px) !important;
    }

    .mobile-donate-icon {
        width: 20px !important;
        height: 20px !important;
    }
}

/* =========================================================
   MOBILE PLAYLIST SCREEN — spacing + clean cards final fix
   2026-05-29
========================================================= */
@media (min-width: 768px) and (max-width: 1024px) and (pointer: coarse) {
    /* The playlist screen is inside the same fixed-bottom mobile layout.
       Keep the same visible gap as the listening screen and prevent overlap. */
    .mobile-layout.is-playlist-mode {
        padding-bottom: calc(132px + env(safe-area-inset-bottom)) !important;
    }

    .mobile-layout.is-playlist-mode .mobile-playlist-screen {
        height: auto !important;
        min-height: 0 !important;
        flex: 1 1 auto !important;
        margin-bottom: 18px !important;
        padding-bottom: 14px !important;
        overflow: hidden !important;
    }

    .mobile-layout.is-playlist-mode .mobile-history-list {
        padding: 2px 4px 22px !important;
        gap: 12px !important;
    }

    /* Playlist track cards: no red/diagonal gradient, one calm dark color. */
    .mobile-playlist-screen .mobile-history-item,
    .mobile-bottom-sheet .mobile-history-item {
        display: grid !important;
        grid-template-columns: 66px minmax(0, 1fr) auto !important;
        align-items: center !important;
        column-gap: 13px !important;
        min-height: 86px !important;
        padding: 10px 12px !important;
        border-radius: 18px !important;
        background: rgba(34, 34, 42, .94) !important;
        background-image: none !important;
        border: 1px solid rgba(255,255,255,.075) !important;
        box-shadow: 0 10px 24px rgba(0,0,0,.24) !important;
    }

    .mobile-playlist-screen .mobile-history-cover,
    .mobile-bottom-sheet .mobile-history-cover {
        width: 58px !important;
        height: 58px !important;
        align-self: center !important;
        justify-self: center !important;
        margin: 0 !important;
        border-radius: 14px !important;
        object-fit: cover !important;
        box-shadow: 0 8px 18px rgba(0,0,0,.30) !important;
    }

    .mobile-playlist-screen .mobile-history-meta,
    .mobile-bottom-sheet .mobile-history-meta {
        align-self: center !important;
        justify-self: stretch !important;
        min-height: 58px !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
        gap: 5px !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    .mobile-playlist-screen .mobile-history-artist,
    .mobile-playlist-screen .mobile-history-title,
    .mobile-bottom-sheet .mobile-history-artist,
    .mobile-bottom-sheet .mobile-history-title {
        display: block !important;
        max-width: 100% !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .mobile-playlist-screen .mobile-history-artist,
    .mobile-bottom-sheet .mobile-history-artist {
        font-size: clamp(15px, 4.25vw, 18px) !important;
        line-height: 1.12 !important;
        font-weight: 850 !important;
    }

    .mobile-playlist-screen .mobile-history-title,
    .mobile-bottom-sheet .mobile-history-title {
        font-size: clamp(13px, 3.75vw, 16px) !important;
        line-height: 1.15 !important;
        font-weight: 650 !important;
        color: rgba(255,255,255,.72) !important;
    }

    .mobile-playlist-screen .mobile-history-time,
    .mobile-bottom-sheet .mobile-history-time {
        align-self: center !important;
        justify-self: end !important;
        margin: 0 !important;
    }
}

@media (max-width: 380px) and (pointer: coarse) {
    .mobile-playlist-screen .mobile-history-item,
    .mobile-bottom-sheet .mobile-history-item {
        grid-template-columns: 60px minmax(0, 1fr) auto !important;
        min-height: 78px !important;
        padding: 9px 10px !important;
        column-gap: 10px !important;
    }

    .mobile-playlist-screen .mobile-history-cover,
    .mobile-bottom-sheet .mobile-history-cover {
        width: 52px !important;
        height: 52px !important;
        border-radius: 13px !important;
    }

    .mobile-playlist-screen .mobile-history-meta,
    .mobile-bottom-sheet .mobile-history-meta {
        min-height: 52px !important;
        gap: 4px !important;
    }
}

/* =========================================================
   MOBILE LIVE PILL — adaptive text scale
   ========================================================= */
@media (min-width: 768px) and (max-width: 1024px) and (pointer: coarse) {
    .mobile-live-pill {
        min-width: clamp(86px, 24vw, 120px);
        height: clamp(34px, 5vw, 42px);
        padding: 0 clamp(14px, 4vw, 22px);
        font-size: clamp(0.95rem, 4.4vw, 1.3rem);
        font-weight: 900;
        letter-spacing: 0.12em;
    }
}



/* =========================================================
   TABLET DEVICE ROUTING AND SPACING
   These rules intentionally override desktop.css on touch tablets.
========================================================= */
@media (min-width: 768px) and (max-width: 1024px) and (pointer: coarse) {
    .desktop-layout,
    .player.desktop-layout,
    .visualizer,
    .header {
        display: none !important;
    }

    .mobile-layout {
        display: flex !important;
        min-height: 100dvh !important;
        padding-left: clamp(24px, 5vw, 54px) !important;
        padding-right: clamp(24px, 5vw, 54px) !important;
        padding-bottom: calc(132px + env(safe-area-inset-bottom)) !important;
    }

    .mobile-player-shell {
        max-width: 680px !important;
        width: 100% !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }

    .mobile-cover-card {
        width: clamp(320px, 48vw, 480px) !important;
        height: clamp(320px, 48vw, 480px) !important;
    }

    .mobile-track-card {
        max-width: 620px !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }

    .mobile-bottom-controls {
        left: clamp(28px, 6vw, 72px) !important;
        right: clamp(28px, 6vw, 72px) !important;
        max-width: 720px !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }
}
