:root {
    --bg-1: #0f1a24;
    --bg-2: #1d2f42;
    --card: rgba(255, 255, 255, 0.96);
    --text: #1b2632;
    --accent: #d72616;
    --accent-dark: #a51b0f;
    --line: #d9d0bf;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    color: #e7edf4;
    background: radial-gradient(circle at 15% 15%, #294a67, transparent 45%),
        radial-gradient(circle at 85% 85%, #132133, transparent 42%),
        linear-gradient(145deg, var(--bg-1), var(--bg-2));
}

body.has-app-bg {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.player-page {
    min-height: 100vh;
    display: flex;
    align-items: stretch;
    justify-content: center;
    padding: 1rem 0.8rem 1.2rem;
}

.player-card {
    width: min(520px, 100%);
    min-height: calc(100dvh - 2.2rem);
    background: transparent;
    border: none;
    border-radius: 20px;
    padding: 0.5rem 0.4rem 1rem;
    box-shadow: none;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.player-card.has-custom-bg {
    background: transparent;
}

.player-card h1 {
    margin: 0;
    font-size: 1.45rem;
}

.player-title-image {
    display: block;
    max-width: 88%;
    max-height: 96px;
    object-fit: contain;
    margin: 0.2rem auto 0.55rem;
}

audio {
    display: none;
}

.actions {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.9rem;
    margin-top: clamp(1.1rem, 5.6vh, 3.5rem);
}

.player-message {
    margin: 0.7rem auto 0;
    min-height: 1.4rem;
    max-width: 92%;
    font-size: 0.9rem;
    line-height: 1.35;
    color: rgba(231, 237, 244, 0.95);
    text-align: center;
}

button {
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 14px;
    background: rgba(14, 28, 46, 0.5);
    color: #fff;
    padding: 0.62rem;
    font-weight: 700;
    cursor: pointer;
    backdrop-filter: blur(2px);
    transform: none !important;
    transition: background-color 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    appearance: none;
    -webkit-appearance: none;
}

button:hover {
    background-color: rgba(31, 58, 88, 0.62);
}

button:active,
button:focus,
button:focus-visible,
.app-icon-button:hover,
.app-icon-button:active,
.app-icon-button:focus,
.app-icon-button:focus-visible {
    transform: none !important;
}

.app-icon-button {
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    min-height: 74px;
    width: 74px;
    font-size: 0.82rem;
    line-height: 1;
    white-space: nowrap;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.app-icon-button.has-bg-image {
    text-indent: -9999px;
}

#togglePlayBtn {
    width: 98px;
    min-height: 98px;
    border-radius: 999px;
    background: rgba(14, 28, 46, 0.5);
    border-color: rgba(255, 255, 255, 0.28);
    box-shadow: 0 0 0 1px rgba(104, 157, 247, 0.4), 0 0 36px rgba(59, 130, 246, 0.2);
    transform: none !important;
    transition: none !important;
    filter: none !important;
    opacity: 1 !important;
    background-size: 66% !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
}

#reconnectBtn {
    width: 72px;
    min-height: 72px;
    border-radius: 18px;
    background: rgba(14, 28, 46, 0.5);
    border-color: rgba(255, 255, 255, 0.28);
    transform: none !important;
    transition: none !important;
    filter: none !important;
    opacity: 1 !important;
    background-size: 62% !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
}

#togglePlayBtn:hover,
#togglePlayBtn:active,
#togglePlayBtn:focus,
#togglePlayBtn:focus-visible,
#reconnectBtn:hover,
#reconnectBtn:active,
#reconnectBtn:focus,
#reconnectBtn:focus-visible {
    transform: none !important;
    filter: none !important;
    background-color: rgba(14, 28, 46, 0.5) !important;
    border-color: rgba(255, 255, 255, 0.28) !important;
    opacity: 1 !important;
}

#newsBtn,
#shareBtn {
    background-color: rgba(14, 28, 46, 0.5);
    border-color: rgba(255, 255, 255, 0.28);
}

#newsBtn:hover,
#newsBtn:active,
#newsBtn:focus,
#newsBtn:focus-visible,
#shareBtn:hover,
#shareBtn:active,
#shareBtn:focus,
#shareBtn:focus-visible {
    transform: none !important;
    filter: none !important;
    background-color: rgba(14, 28, 46, 0.5) !important;
    border-color: rgba(255, 255, 255, 0.28) !important;
    opacity: 1 !important;
}

#togglePlayBtn:hover,
#togglePlayBtn:active,
#togglePlayBtn:focus,
#togglePlayBtn:focus-visible {
    box-shadow: 0 0 0 1px rgba(104, 157, 247, 0.4), 0 0 36px rgba(59, 130, 246, 0.2) !important;
}

.player-ads {
    margin-top: clamp(2.2rem, 9vh, 6.2rem);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.player-ads img {
    width: min(350px, 92%);
    border-radius: 8px;
    border: none;
    object-fit: contain;
    max-height: 170px;
    background: transparent;
}

.player-bottom-actions {
    margin-top: auto;
    padding-top: clamp(0.65rem, 2.8vh, 1.8rem);
    padding-bottom: max(0.25rem, calc(env(safe-area-inset-bottom) * 0.45));
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.85rem;
    flex-wrap: wrap;
}

.bottom-action-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.32rem;
}

.bottom-action-label {
    font-size: 0.78rem;
    font-weight: 700;
    color: rgba(226, 236, 247, 0.92);
    letter-spacing: 0.02em;
    text-align: center;
    line-height: 1;
}

#installBtn {
    background: #166534;
    text-indent: 0;
    width: auto;
    min-height: 48px;
    padding: 0.62rem 1rem;
}

#installBtn:hover {
    background: #14532d;
}

.hint {
    margin: 0.9rem auto 0;
    color: rgba(231, 237, 244, 0.92);
    font-size: 0.89rem;
    max-width: 460px;
    display: none;
}

@media (max-width: 560px) {
    .player-page {
        padding-top: 0.65rem;
        padding-bottom: 0.9rem;
    }

    .player-card {
        min-height: calc(100dvh - 1.55rem);
    }

    .player-title-image {
        max-width: 96%;
        max-height: 84px;
    }

    #togglePlayBtn {
        width: 92px;
        min-height: 92px;
        background-size: 64% !important;
    }

    #reconnectBtn {
        width: 68px;
        min-height: 68px;
        background-size: 60% !important;
    }

    .player-ads {
        margin-top: clamp(2.1rem, 11vh, 6rem);
        gap: 0.75rem;
    }

    .player-bottom-actions {
        margin-top: auto;
        padding-top: clamp(0.55rem, 2.4vh, 1.4rem);
        padding-bottom: max(0.2rem, calc(env(safe-area-inset-bottom) * 0.35));
        gap: 0.7rem;
    }

    .bottom-action-label {
        font-size: 0.74rem;
    }

    .hint {
        font-size: 0.84rem;
    }
}
