:root {
    --blue: #0084ff;
    --dark: #02060f;
    --glass: rgba(255, 255, 255, 0.05);
    --text: #f1f5f9;
}

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

body {
    background: var(--dark);
    color: var(--text);
    font-family: 'Plus Jakarta Sans', sans-serif;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header & Search/Lang Fix */
.main-header {
    padding: 15px 0;
    background: rgba(2, 6, 15, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--glass);
    top: 0;
    z-index: 1000;
}

.nav-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    height: 50px;
}

.header-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

/* Fixed Search & Lang CSS */
input#stationSearch.search-input {
    background: var(--glass);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    padding: 10px 15px;
    border-radius: 10px;
    width: 180px;
    transition: 0.3s;
}

input#stationSearch.search-input:focus {
    width: 220px;
    border-color: var(--blue);
    outline: none;
}

button#langToggle.lang-switch {
    background: var(--blue);
    color: white;
    border: none;
    padding: 10px 18px;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.2s;
}

button#langToggle.lang-switch:hover {
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(0, 132, 255, 0.4);
}

/* Station Cards */
.hero-block {
    padding: 60px 0 30px;
    text-align: center;
}

.live-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 900;
    background: rgba(0, 132, 255, 0.1);
    color: var(--blue);
    padding: 4px 12px;
    border-radius: 20px;
    margin-bottom: 10px;
}

.station-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}

.station-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass);
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: 0.3s;
}

.station-card:hover {
    border-color: var(--blue);
    transform: translateY(-5px);
}

.station-card img {
    width: 110px;
    height: 110px;
    border-radius: 15px;
    background: white;
    padding: 8px;
    margin-bottom: 15px;
}

/* Footer Alignment Fix */
.site-footer {
    background: #01040a;
    border-top: 1px solid var(--glass);
    padding: 60px 0 160px;
    margin-top: 80px;
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 30px;
}

.footer-col {
    flex: 1;
    min-width: 200px;
}

.footer-logo {
    height: 65px;
    margin-bottom: 15px;
}

.footer-link {
    color: #94a3b8;
    text-decoration: none;
    font-size: 0.9rem;
}

.dev-brand {
    color: var(--blue);
    font-weight: 800;
    text-decoration: none;
    font-size: 1.1rem;
}

/* Player Fix */
.player-bar {
    position: fixed;
    bottom: 20px;
    left: 0;
    width: 100%;
    z-index: 2000;
    padding: 0 15px;
}

.player-flex {
    max-width: 850px;
    margin: 0 auto;
    background: rgba(15, 23, 42, 0.98);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.track-display {
    display: flex;
    align-items: center;
    flex: 1;
}

.station-art {
    width: 55px;
    height: 55px;
    border-radius: 10px;
    background-color: #111;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.track-text {
    margin-left: 15px;
}

.status-line {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    color: #94a3b8;
}

.dot {
    width: 6px;
    height: 6px;
    background: #444;
    border-radius: 50%;
}

.controls-display {
    display: flex;
    align-items: center;
    gap: 20px;
}

.play-trigger {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--blue);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.volume-wrap {
    display: flex;
    align-items: center;
}

#volRange {
    width: 80px;
    accent-color: var(--blue);
}

@media (max-width: 768px) {
    .header-actions {
        gap: 8px;
    }

    input#stationSearch.search-input {
        width: 100px;
        font-size: 0.8rem;
    }

    .station-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .station-card img {
        width: 80px;
        height: 80px;
    }

    #volRange {
        width: 50px;
    }
}

.active .dot {
    background: #00ff88;
    box-shadow: 0 0 10px #00ff88;
}
/* Final polish: retain the existing palette, typography and layout. */
[hidden] {
    display: none !important;
}

.icon {
    display: inline-block;
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    vertical-align: middle;
}

.icon-link {
    vertical-align: middle;
}

.icon-link .icon {
    margin-right: 6px;
}

.icon-link span {
    vertical-align: middle;
}

.support-button:hover {
    background-color: #ffe633 !important;
}

.report-button:hover {
    background-color: #cc0000 !important;
}

:where(a, button, input, summary):focus-visible {
    outline: 2px solid var(--blue);
    outline-offset: 4px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

button#langToggle, input#stationSearch {
    min-height: 44px;
}

.station-card {
    min-width: 0;
    position: relative;
}

.station-card h2 {
    font-size: 1.17em;
}

.station-select {
    width: 100%;
    min-height: 44px;
    display: flex;
    flex-direction: column;
    align-items: center;
    border: 0;
    padding: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

/* The whole original card remains a touch target. */
.station-select span {
    overflow-wrap: anywhere;
}

.station-select::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 20px;
}

.station-card:focus-within {
    outline: 2px solid var(--blue);
    outline-offset: 3px;
}

.station-select:focus-visible {
    outline: none;
}

.station-card.is-current {
    border-color: var(--blue);
}

.station-card.is-playing {
    box-shadow: 0 0 16px rgba(0, 132, 255, 0.18);
}

.equalizer {
    position: absolute;
    top: 14px;
    right: 14px;
    color: var(--blue);
    visibility: hidden;
}

.is-playing .equalizer {
    visibility: visible;
}

.eq-bar {
    transform-origin: center 20px;
    animation: equalize 0.8s ease-in-out infinite alternate;
    animation-play-state: paused;
}

.is-playing .eq-bar {
    animation-play-state: running;
}

.eq-bar:nth-child(2) {
    animation-delay: -0.4s;
}

.eq-bar:nth-child(3) {
    animation-delay: -0.2s;
}

@keyframes equalize {
    from { transform: scaleY(0.35); }
    to { transform: scaleY(1); }
}

.intro-text, .radio-info p, .search-empty {
    color: #94a3b8;
    line-height: 1.8;
}

.intro-text {
    max-width: 700px;
    margin: 16px auto 0;
    font-size: 0.9rem;
}

.radio-info {
    margin-top: 36px;
    font-size: 0.9rem;
}

.radio-info h2 {
    font-size: 1.15rem;
    margin-bottom: 12px;
}

.faq-item + .faq-item {
    margin-top: 18px;
}

.faq-item h3 {
    font-size: 0.95rem;
    margin-bottom: 6px;
}

.search-empty {
    text-align: center;
    padding: 30px 0;
}

.footer-heading {
    font-size: 1rem;
}

.track-display, .track-text {
    min-width: 0;
}

.station-art {
    flex: 0 0 55px;
    object-fit: contain;
}

.active-name {
    font-size: 1rem;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.player-message {
    max-width: 300px;
    color: #94a3b8;
    font-size: 0.75rem;
    line-height: 1.5;
    margin-top: 4px;
}

.controls-display {
    gap: 8px;
    flex-shrink: 0;
    margin-left: 12px;
}

.player-control {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    min-width: 44px;
    height: 44px;
    background: transparent;
    color: var(--text);
    border: 0;
    border-radius: 50%;
    cursor: pointer;
    touch-action: manipulation;
}

.player-control:hover {
    background: var(--glass);
}

.play-trigger {
    flex-shrink: 0;
    touch-action: manipulation;
}

#volRange {
    min-height: 44px;
    cursor: pointer;
}

.spinner {
    animation: spin 0.9s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.player-flex[data-state="connecting"] .dot {
    background: var(--blue);
}

.player-flex[data-state="error"] .dot {
    background: #94a3b8;
}

@media (max-width: 600px) {
    .player-bar {
        bottom: max(12px, env(safe-area-inset-bottom));
    }

    .player-flex {
        flex-wrap: wrap;
        padding: 12px;
        gap: 10px;
    }

    .track-display {
        flex-basis: 100%;
    }

    .controls-display {
        width: 100%;
        justify-content: space-between;
        margin-left: 0;
        gap: 4px;
    }

    .player-message {
        max-width: none;
    }

    .site-footer {
        padding-bottom: calc(250px + env(safe-area-inset-bottom));
    }

    .nav-wrapper {
        gap: 10px;
    }

    .brand {
        flex-shrink: 1;
        min-width: 0;
    }

    .nav-logo {
        max-width: 100%;
        object-fit: contain;
    }

    input#stationSearch.search-input:focus {
        width: 100px;
    }

    button#langToggle.lang-switch {
        padding-inline: 12px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation: none !important;
        transition: none !important;
    }
}

@media (max-width: 380px) {
    .station-card {
        padding-inline: 16px;
    }
}
