:root {
    --bg-dark: #0a0a0c;
    --glass-card: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.06);
    --neon-purple: #9d00ff;
    --neon-purple-hover: #b644ff;
    --text-main: #ffffff;
    --text-muted: #8e8e93;
    --text-purple: #dca8ff;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

/* Klasa zapobiegająca animacjom podczas skalowania okna */
.no-transitions * {
    transition: none !important;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
    padding-bottom: 100px; /* Zostawiamy miejsce na dolny odtwarzacz */
}

/* --- ZABEZPIECZENIE OBRAZKÓW --- */
img {
    -webkit-user-drag: none;     
    user-drag: none;             
    -webkit-touch-callout: none; 
    user-select: none;           
    pointer-events: none;        /* <--- KLUCZ DO SUKCESU */
}

/* --- WSPÓLNY KONTENER (KLUCZ DO WYRÓWNANIA) --- */
.container {
    max-width: 1100px;
    margin: 0 auto;
    width: 100%;
    padding: 0 2rem;
}

/* Tło Liquid Glass */
.liquid-bg {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    z-index: -1;
    overflow: hidden;
}
.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(140px);
    opacity: 0.4;
    animation: float 20s infinite alternate ease-in-out;
}
.blob-1 { width: 600px; height: 600px; background: #490080; top: -10%; left: -10%; }
.blob-2 { width: 500px; height: 500px; background: var(--neon-purple); bottom: 10%; right: -5%; animation-delay: -7s; }

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(60px, 40px) scale(1.15); }
}

/* --- HEADER --- */
header {
    background: rgba(10, 10, 12, 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    height: 80px; /* <--- NOWA WYSOKOŚĆ */
    position: sticky;
    top: 0;
    z-index: 100;
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: flex-start; /* <--- To trzyma logo i menu po lewej na desktopie! */
    gap: 3rem; /* Odstęp między logo a menu */
    height: 100%;
}

/* Przycisk hamburgera domyślnie ukryty (na komputerach) */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-main);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.2s;
}
.mobile-menu-btn:hover {
    color: var(--neon-purple);
}
/* Styl dla linku zawierającego logo */
.brand {
    display: flex;
    align-items: center;
    height: 100%;
    text-decoration: none; /* usuwa podkreślenie linku, jeśli logo nie załaduje się */
}

/* Styl dla samego obrazka logo */
.brand-logo {
    height: 50px; /* Dostosuj tę wartość, aby logo wyglądało dobrze w pasku 60px */
    width: auto;  /* Automatyczna szerokość zachowuje proporcje */
    display: block; /* Usuwa dziwne marginesy pod obrazkiem */
    /* Jeśli logo jest za jasne/ciemne, możesz użyć filtra, np.: */
    /* filter: brightness(1.1); */
}

nav { 
    display: flex; 
    gap: 1.5rem; 
    height: 100%; 
    position: static; 
    background: none; 
}
nav a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    padding: 0 0.5rem;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
}
nav a:hover, nav a.active {
    color: #fff;
    border-bottom-color: var(--neon-purple);
}
nav a i { margin-right: 8px; font-size: 0.85rem; }

/* --- GŁÓWNA TREŚĆ --- */
.main-content {
    margin-top: 2rem;
    margin-bottom: 2rem;
}
.station-header {
    font-size: 2.6rem;
    font-weight: 700;
    margin-bottom: 0.2rem;
}
.station-tagline {
    color: var(--text-muted);
    font-size: 1.05rem;
    margin-bottom: 2.5rem;
}

/* Sekcja Odtwarzacza (Live) */
.hero-player {
    display: flex;
    gap: 3rem;
    align-items: center;
    margin-bottom: 2.5rem;
    background: transparent; 
}
/* Kontener główny - centruje SVG i okładkę */
.artwork-container {
    position: relative;
    width: 220px;
    height: 220px;
    flex-shrink: 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Style dla okręgu postępu */
.progress-ring {
    position: absolute;
    top: 0;
    left: 0;
    transform: rotate(-90deg); /* Obracamy o 90 stopni w lewo, aby pasek startował od samej góry */
    width: 100%;
    height: 100%;
}
.progress-ring__background {
    stroke: rgba(255, 255, 255, 0.04);
}
.progress-ring__circle {
    stroke: var(--neon-purple);
    stroke-linecap: round; /* Zaokrąglone końcówki paska postępu */
    transition: stroke-dashoffset 0.5s ease; /* Płynna animacja napełniania */
}

/* Zmniejszamy koło z okładką, by zmieścił się pasek postępu */
.circle-art {
    width: 200px; 
    height: 200px;
    border-radius: 50%;
    background: linear-gradient(135deg, #151518, #300054);
    border: 1px solid rgba(255,255,255,0.05);
    box-shadow: 0 0 25px rgba(157, 0, 255, 0.15);
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    z-index: 2; /* Nad paskiem postępu */
}

/* Style dla samych obrazków wewnątrz kontenerów */
.show-art-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.station-badge {
    position: absolute;
    bottom: 5px; 
    right: 5px;
    width: 45px; 
    height: 45px;
    background: #000000;
    border-radius: 50%;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    z-index: 3; 
    border: 1px solid var(--glass-border);
    /* Usuwamy stąd display: flex, ponieważ wyrównanie musi przejść na tag <picture> */
}

/* Nowy blok: Wyrównujemy tag <picture>, który jest bezpośrednim rodzicem obrazka */
.station-badge picture {
    display: flex;
    justify-content: center;  /* Idealne wyśrodkowanie w poziomie */
    align-items: flex-end;    /* Przyklejenie do dołu, by góra mogła wystawać */
    width: 100%;
    height: 100%;
    overflow: visible;        /* Pozwala obrazkowi wyjść poza ramy czarnego kółka */
}

.badge-icon-img {
    width: auto;
    max-width: 90%;           /* Bezpieczna szerokość w poziomie */
    height: 130%;             /* Wysokość sprawiająca, że logo wystaje w górę */       
    object-fit: contain;
    object-position: bottom center; /* Wymuszenie pozycji na dole i w centrum */
    padding-bottom: 4px;      /* Delikatny odstęp od dolnej krawędzi */
}

.live-metadata { flex-grow: 1; }
.live-status {
    font-size: 0.85rem; text-transform: uppercase;
    font-weight: 700; letter-spacing: 1px; color: var(--text-purple);
    display: flex; align-items: center; gap: 8px; margin-bottom: 0.5rem;
}
.live-dot {
    width: 7px; height: 7px;
    background-color: var(--neon-purple); border-radius: 50%;
    animation: pulse 1.5s infinite;
}
@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(157, 0, 255, 0.7); }
    70% { box-shadow: 0 0 0 8px rgba(157, 0, 255, 0); }
    100% { box-shadow: 0 0 0 0 rgba(157, 0, 255, 0); }
}
.show-title { font-size: 2.2rem; font-weight: 700; line-height: 1.2; margin-bottom: 0.4rem; }
.host-title { font-size: 1.2rem; color: var(--text-muted); margin-bottom: 1.5rem; }

.bbc-play-btn {
    background-color: #ff6a00; 
    color: #fff;
    border: none;
    padding: 0.85rem 2.5rem;
    font-size: 1.1rem;
    font-weight: 700;
    border-radius: 4px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    transition: opacity 0.2s;
}
.bbc-play-btn:hover { opacity: 0.9; }

/* Ramówka / Kafelki Up Next */
.schedule-row {
    display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; margin-bottom: 2rem;
    border-top: 1px solid var(--glass-border);
    border-bottom: 1px solid var(--glass-border);
    padding: 1.5rem 0;
}
.schedule-card { display: flex; gap: 1.2rem; align-items: center; }
.schedule-thumb {
    width: 70px; height: 70px; background: #1c1c22;
    display: flex; justify-content: center; align-items: center;
    color: rgba(255,255,255,0.2); font-size: 1.5rem; flex-shrink: 0;
}
.schedule-card .time { font-size: 0.8rem; font-weight: 700; color: #ff6a00; text-transform: uppercase; margin-bottom: 0.2rem; }
.schedule-card .title { font-weight: 700; font-size: 1.05rem; margin-bottom: 0.1rem; }
.schedule-card .desc { font-size: 0.85rem; color: var(--text-muted); line-height: 1.3; }

.promo-text { color: var(--text-muted); font-size: 0.95rem; line-height: 1.5; margin-bottom: 2.5rem; }

/* Ostatnio Grane utwory */
.recent-section h3 { font-size: 1.8rem; font-weight: 700; margin-bottom: 1.5rem; }
.tracks-table { width: 100%; border-collapse: collapse; }
.tracks-table th { text-align: left; color: var(--text-muted); font-weight: 500; font-size: 0.9rem; padding-bottom: 1rem; border-bottom: 1px solid var(--glass-border); }
.track-row { border-bottom: 1px solid rgba(255,255,255,0.04); }
.track-row td { padding: 1rem 0; vertical-align: middle; }
.track-meta-cell { display: flex; align-items: center; gap: 1rem; }
.track-num { color: var(--text-muted); font-size: 0.9rem; width: 20px; }
.track-img { width: 45px; height: 45px; background: #18181f; display: flex; align-items: center; justify-content: center; color: rgba(255,255,255,0.1); }
.track-name { font-weight: 700; font-size: 1rem; }
.now-playing-tag { font-size: 0.7rem; color: #ff6a00; font-weight: 900; display: block; margin-bottom: 3px; letter-spacing: 1px;}
.artist-name { color: var(--text-muted); font-size: 1rem; }

/* --- STICKY BOTTOM PLAYER --- */
.bottom-player {
    position: fixed;
    bottom: 0; left: 0; width: 100%;
    height: 80px;
    background: rgba(10, 10, 12, 0.95);
    backdrop-filter: blur(20px);
    border-top: 1px solid var(--glass-border);
    z-index: 1000;
}

.bottom-player-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    gap: 2rem;
}

.bp-info { display: flex; align-items: center; gap: 1rem; width: 300px; }
.bp-thumb { width: 50px; height: 50px; border-radius: 50%; background: #222; border: 2px solid rgba(255,255,255,0.1); }
.bp-text-title { font-weight: 700; font-size: 0.95rem; }
.bp-text-desc { font-size: 0.8rem; color: var(--text-muted); }

.bp-controls {
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
}
.progress-bar-container {
    position: absolute;
    top: -2px; left: 0; width: 100%; height: 3px;
    background: rgba(255,255,255,0.1);
}
.progress-bar-fill {
    width: 100%; height: 100%;
    background: #ff6a00; 
}

.bp-btn { background: none; border: none; font-size: 1.2rem; cursor: pointer; color: var(--text-muted); transition: color 0.2s;}
.bp-btn:hover { color: #fff; }
.bp-play { 
    width: 45px; height: 45px; border-radius: 50%; border: 2px solid #fff; 
    display: flex; justify-content: center; align-items: center; color: #fff; 
}

.bp-extra { display: flex; align-items: center; gap: 1rem; width: 300px; justify-content: flex-end;}
.bp-live-tag { color: #00ffaa; font-weight: 700; font-size: 0.8rem; display: flex; align-items: center; gap: 5px; }
.bp-live-tag i { font-size: 0.6rem; }

.volume-box { display: flex; align-items: center; gap: 8px; }
.volume-box i { color: var(--text-muted); font-size: 0.85rem; }
.volume-box input { -webkit-appearance: none; width: 80px; background: rgba(255,255,255,0.2); height: 4px; border-radius: 2px; }
.volume-box input::-webkit-slider-thumb { -webkit-appearance: none; width: 10px; height: 10px; border-radius: 50%; background: #fff; cursor: pointer; }

/* --- SYSTEM PODSTRON (SPA) --- */
.page-view {
    display: none !important; /* Twarda blokada pustej przestrzeni */
    padding-top: 1rem;
    padding-bottom: 4rem;
}

.page-view.active-view {
    display: block !important; 
    animation: subpageFadeIn 0.4s ease forwards;
}

.page-content {
    background: var(--glass-card);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 3rem;
    margin-top: 2rem;
}

.page-content h1 {
    font-size: 2.5rem;
    font-weight: 900;
    margin-bottom: 1.5rem;
    color: var(--text-main);
}

.page-content p {
    color: var(--text-muted);
    font-size: 1.1rem;
    line-height: 1.6;
}

/* --- STYLE DLA OKŁADEK W HISTORII --- */
.track-cover-img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Ucina nadmiar, zachowując proporcje kwadratu */
    border-radius: 4px; /* Delikatne zaokrąglenie rogów okładki */
}

/* Usuwamy domyślne tło kontenera, by nie prześwitywało za okładką */
.track-img {
    background: transparent; 
}

/* --- STYLE DLA OKŁADEK W SEKCJI UP NEXT --- */
.schedule-thumb {
    overflow: hidden; /* Sprawia, że obrazek nie wylewa się poza zaokrąglone rogi klocka */
    padding: 0 !important; /* Usuwamy ewentualny wewnętrzny odstęp, który miały ikony */
    background: transparent !important; /* Usuwamy sztuczne tło */
}

.schedule-thumb-img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Gwarantuje, że obrazek idealnie wypełni kwadrat bez zniekształceń */
}

/* --- STYLE DLA MINIATURKI W DOLNYM PLAYERZE --- */
.bp-thumb {
    overflow: hidden; /* Obcina obrazek do krawędzi zaokrąglonego kwadratu */
}

.bp-thumb-img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Zachowuje idealne proporcje miniatury */
}

/* ==========================================
   SEKCJA RECENT TRACKS (HISTORIA)
   ========================================== */

/* --- USTAWIENIA DLA DESKTOPU (Zawijanie tekstu do nowej linii) --- */
.tracks-table {
    width: 100%;
    table-layout: auto; /* Pozwalamy tabeli naturalnie oddychać i dopasowywać się do tekstu */
    border-collapse: collapse;
}

.tracks-table th {
    text-align: left;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-muted, #8e8e93);
    font-weight: 500;
}

/* Wymuszamy, aby pierwsza kolumna z utworem była szersza (np. 60%) */
.tracks-table th:nth-child(1) { width: 60%; }
.tracks-table th:nth-child(2) { width: 40%; }

.tracks-table td {
    padding: 12px 10px 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    vertical-align: middle;
}

/* --- KOREKTA DLA DŁUGICH TEKSTÓW (Brak ucinania) --- */
.track-name, .artist-name-desktop, .artist-name-mobile {
    white-space: normal; /* ZMIANA: Zezwalamy na przechodzenie tekstu do nowej linii */
    word-break: break-word; /* Zabezpieczenie przed ekstremalnie długimi ciągami znaków (np. linkami) */
    line-height: 1.3; /* Poprawia czytelność zawiniętego tekstu */
}

/* Flexbox do wyrównania okładki i tekstów */
.track-meta-flex {
    display: flex;
    align-items: center; /* Trzyma okładkę na środku wiersza */
    gap: 15px;
}

.track-num {
    width: 25px;
    text-align: right;
    color: var(--text-muted, #8e8e93);
    flex-shrink: 0;
}

.track-img {
    width: 50px;
    height: 50px;
    flex-shrink: 0;
    background-color: #333;
    border-radius: 4px;
}

/* Ustawienia bloku z tekstem (Tytuł utworu) */
.track-titles {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.artist-name-mobile {
    display: none;
}

/* --- AKTUALIZACJA KONTENERA OKŁADKI --- */
.track-img {
    width: 50px;
    height: 50px;
    flex-shrink: 0;
    background-color: #333;
    border-radius: 4px;
    position: relative; /* Niezbędne do absolutnego pozycjonowania equalizera */
    overflow: hidden;   /* Sprawia, że przyciemnienie nie wylewa się poza zaokrąglone rogi */
}

/* --- ANIMACJA EQUALIZERA (NOW PLAYING) --- */
.playing-anim-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5); /* Eleganckie przyciemnienie okładki */
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px; /* Odstępy między słupkami */
    z-index: 2;
}

.playing-anim-overlay span {
    display: block;
    width: 4px;
    height: 16px;
    background-color: #fff; /* Kolor słupków (możesz zmienić np. na fioletowy z motywu) */
    border-radius: 2px;
    transform-origin: bottom; /* Ważne: słupki rosną od dołu, nie od środka */
    animation: equalizerBounce 0.8s infinite alternate ease-in-out;
}

/* Opóźnienia sprawiają, że słupki skaczą asynchronicznie */
.playing-anim-overlay span:nth-child(1) { animation-delay: 0.0s; }
.playing-anim-overlay span:nth-child(2) { animation-delay: 0.3s; }
.playing-anim-overlay span:nth-child(3) { animation-delay: 0.6s; }

/* Definicja skakania */
@keyframes equalizerBounce {
    0%   { transform: scaleY(0.3); }
    100% { transform: scaleY(1.0); }
}

/* --- USTAWIENIA DLA URZĄDZEŃ MOBILNYCH --- */
@media (max-width: 768px) {
    .tracks-table thead,
    .artist-name-desktop {
        display: none !important;
    }

    .tracks-table, 
    .tracks-table tbody, 
    .tracks-table tr, 
    .tracks-table td {
        display: block;
        width: 100%;
    }

    .tracks-table td {
        padding: 12px 0;
    }

    .artist-name-mobile {
        display: block;
        color: var(--text-muted, #8e8e93);
        font-size: 0.9em;
        margin-top: 3px;
    }
    
    .track-name {
        font-weight: 500;
        font-size: 1.05em;
    }
}

@keyframes subpageFadeIn {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}


@media (max-width: 850px) {
    .hero-player { flex-direction: column; text-align: left; align-items: flex-start;}
    .schedule-row { grid-template-columns: 1fr; }
    .bp-info, .bp-extra { display: none; } 

    /* --- WERSJA MOBILNA NAWIGACJI --- */
    
    .header-inner {
        justify-content: space-between; /* Zmienia układ: Logo po lewej, hamburger po prawej */
        gap: 0;
    }

    .mobile-menu-btn {
        display: block; /* Pokazujemy hamburger */
    }

nav {
        /* 1. ZAMIAST display: none; UŻYWAMY TYCH WŁAŚCIWOŚCI: */
        visibility: hidden;
        opacity: 0;
        transform: translateY(-20px); /* Menu startuje lekko uniesione do góry */
        pointer-events: none; /* Zapobiega przypadkowemu kliknięciu w ukryte menu */
        
        /* 2. DODAJEMY PŁYNNE PRZEJŚCIE (ANIMACJĘ): */
        transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;

        /* Reszta Twoich stylów zostaje bez zmian */
        position: absolute;
        top: 80px;
        left: 0;
        width: 100%;
        background: rgba(10, 10, 12, 0.98);
        backdrop-filter: blur(20px);
        flex-direction: column;
        height: auto;
        padding: 1rem 0;
        border-bottom: 1px solid var(--glass-border);
        box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    }

    nav.active {
        /* ZAMIAST display: flex; UŻYWAMY TYCH WŁAŚCIWOŚCI: */
        visibility: visible;
        opacity: 1;
        transform: translateY(0); /* Menu gładko opada na swoje miejsce */
        pointer-events: auto; /* Z powrotem włączamy klikalność */
    }
    
    /* Mały bonus: Płynne podświetlenie przycisku hamburgera */
    .mobile-menu-btn i {
        transition: transform 0.2s ease, opacity 0.2s ease;
    }

    nav a {
        padding: 1rem 2rem;
        border-bottom: none;
        border-left: 3px solid transparent;
        font-size: 1.1rem;
    }

    nav a:hover, nav a.active {
        border-bottom-color: transparent;
        border-left-color: var(--neon-purple);
        background: rgba(255, 255, 255, 0.02);
    }
}

/* ==========================================
   WYŚRODKOWANIE HERO PLAYER NA MOBILE
   ========================================== */
@media (max-width: 768px) {
    .hero-player {
        display: flex;
        flex-direction: column;
        align-items: center; /* Środkuje okładkę i kontener z tekstami */
        text-align: center;  /* Wymusza wyśrodkowanie tekstów */
    }

    .live-metadata {
        display: flex;
        flex-direction: column;
        align-items: center; /* Środkuje przycisk Play i wskaźnik LIVE */
        margin-top: 1.5rem;  /* Odstęp między okładką a tekstami na telefonie */
    }

    .live-status {
        justify-content: center; /* Upewnia się, że czerwona kropka i tekst "Live" są na środku */
        width: 100%;
    }
    
    /* Opcjonalnie: lekkie zmniejszenie głównego tytułu na małych ekranach dla lepszej proporcji */
    .hero-player .show-title {
        font-size: 2rem;
        margin-top: 0.5rem;
    }
}