* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
    margin: 0;
    font-family: Arial, sans-serif;
    color: #f3efe5;
    background: linear-gradient(0deg, #5a2032 0%, #3f2748 50%, #2a2f52 100%);
    background-attachment: fixed;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
main { flex: 1; }
.kontener { width: min(980px, 92%); margin: 0 auto; }
.naglowek-strony { position: sticky; top: 0; z-index: 10; background: #171c3b; }
.pasek-nawigacji { min-height: 62px; display: flex; align-items: center; justify-content: space-between; }
.logo-strony { color: #ffe0a2; text-decoration: none; font-weight: 700; }
.przycisk-menu { display: none; background: #d9b065; border: 0; border-radius: 6px; padding: 8px 10px; }
.menu-glowne { display: flex; gap: 8px; flex-wrap: wrap; }
.menu-glowne a { color: #f2ebd8; text-decoration: none; padding: 6px 9px; border-radius: 6px; }
.menu-glowne a:hover { background: rgba(255,255,255,0.12); }
.sekcja-glowna, .sekcja-czasu, .sekcja-tresci { padding: 34px 0; }
.sekcja-1, .sekcja-2, .sekcja-3 { background: transparent; }
h1, h2, h3 { margin-top: 0; }
h2 { color: #ffd894; }
.wstep { color: #f9e8c4; }
.wstep-ladowanie {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.45s ease, transform 0.45s ease;
}
.wstep-ladowanie.wstep-ladowanie-aktywne {
    opacity: 1;
    transform: translateY(0);
}
.szybkie-linki { display: flex; gap: 8px; flex-wrap: wrap; }
.szybkie-linki a { color: #fff; text-decoration: none; border: 1px solid rgba(255,255,255,0.28); border-radius: 999px; padding: 5px 10px; }
.ramy-czasowe { display: inline-block; padding: 6px 10px; border-radius: 6px; background: rgba(0,0,0,0.2); }
.karty { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.karta { background: rgba(22, 23, 43, 0.86); border: 1px solid rgba(255,255,255,0.13); border-radius: 8px; padding: 14px; color: #f3efe5; }
.karta-postaci {
    cursor: pointer;
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
.karta-postaci:hover { transform: translateY(-2px); border-color: #ffd894; box-shadow: 0 8px 22px rgba(0, 0, 0, 0.2); }
.karta-postaci-zdjecie {
    margin: -4px -4px 12px;
    border-radius: 8px;
    overflow: hidden;
    background: #1d2039;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 160px;
}
.karta-postaci-zdjecie img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    display: block;
}
.karta-postaci:focus-visible {
    outline: 2px solid #ffd894;
    outline-offset: 2px;
}
.opis-postaci {
    margin: 0;
    line-height: 1.6;
}
.karta-epoki { width: 100%; text-align: left; cursor: pointer; font: inherit; }
.karta-epoki.active { border-color: #ffd894; }
.podglad-epoki { margin-top: 12px; max-width: 560px; }
.formularz-szukania { display: grid; grid-template-columns: 2fr 1fr auto; gap: 10px; }
.formularz-szukania label { display: grid; gap: 6px; }
.formularz-szukania input, .formularz-szukania select {
    background: #171a34; color: #f3efe5; border: 1px solid rgba(255,255,255,0.2); border-radius: 6px; padding: 8px;
}
.przycisk-akcji { background: #d9b065; color: #211807; border: 0; border-radius: 6px; padding: 8px 10px; text-decoration: none; font-weight: 700; display: inline-block; }
.dwie-kolumny { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 16px; }
.obraz-ramka { margin: 0; border-radius: 8px; overflow: hidden; background: #1d2039; }
.obraz-ramka img { width: 100%; height: 240px; object-fit: cover; object-position: center; display: block; cursor: zoom-in; }
.lista-ostatnich { padding-left: 20px; }
.lista-wynikow { display: grid; gap: 10px; }
.meta-wyniku { color: #f1d59d; }
.stopka-strony { background: #121735; padding: 18px 0; }
.pojawienie, .przejscie-sekcji, [data-stopniowanie] { opacity: 0; transform: translateY(12px); transition: 0.4s; }
.pojawienie.widoczne, .przejscie-sekcji.w-widoku, [data-stopniowanie].widoczne-stopniowanie { opacity: 1; transform: translateY(0); }
.podglad-zdjecia {
    position: fixed; inset: 0; display: none; align-items: center; justify-content: center;
    background: rgba(0,0,0,0.82); z-index: 999; padding: 20px;
}
.podglad-zdjecia.open { display: flex; }
.podglad-zdjecia img { max-width: min(1000px, 92vw); max-height: 86vh; border-radius: 10px; }
.modal-postaci {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(5, 7, 18, 0.8);
    z-index: 1000;
}
.modal-postaci.open {
    display: flex;
}
.modal-postaci-karta {
    width: min(760px, 94vw);
    max-height: 85vh;
    overflow-y: auto;
    background: linear-gradient(165deg, rgba(26, 29, 56, 0.98), rgba(18, 20, 40, 0.98));
    border: 1px solid rgba(255, 216, 148, 0.45);
    border-radius: 16px;
    padding: 26px 24px;
    box-shadow: 0 16px 50px rgba(0, 0, 0, 0.45);
    text-align: center;
}
.modal-postaci-tytul {
    margin-bottom: 10px;
    font-size: clamp(1.7rem, 3vw, 2.4rem);
    color: #ffe0a2;
}
.modal-postaci-okres {
    margin-bottom: 16px;
}
.modal-postaci-opis {
    margin: 0;
    line-height: 1.7;
    font-size: clamp(1.05rem, 2.2vw, 1.32rem);
    color: #f8efdd;
}
.modal-postaci-zdjecie {
    width: min(260px, 78%);
    max-height: 220px;
    object-fit: contain;
    object-position: center;
    border-radius: 12px;
    border: 1px solid rgba(255, 216, 148, 0.35);
    margin-bottom: 16px;
    background: #1d2039;
}
@media (max-width: 860px) {
    .przycisk-menu { display: inline-block; }
    .menu-glowne { display: none; position: absolute; left: 0; right: 0; top: 62px; padding: 10px 4%; background: #171c3b; flex-direction: column; }
    .menu-glowne.open { display: flex; }
    .formularz-szukania, .dwie-kolumny { grid-template-columns: 1fr; }
}
