html { scroll-behavior: smooth; }
body { margin: 0; min-width: 120px; background-color: rgb(216, 235, 221); overflow-x: hidden; }

@keyframes animacja_tla {
    0%   { transform: translate(0px, -50%) scaleY(1); opacity: 0.5; }
    70%  { transform: translate(0px, 2.3vh) scaleY(1.06) scaleX(1.02); opacity: 1; }
    100% { transform: translate(0px, 0px) scaleY(1); opacity: 1; }
}
@keyframes animacja_tytulu {
    0%   { opacity: 0.6; } 25% { opacity: 0.8; } 50% { opacity: 1; } 75% { opacity: 0.8; } 100% { opacity: 0.6; }
}

img
{
    user-select: none;
}

#header {
    transform: translate(0px, -50%); opacity: 0;
    width: 100%; height: 90vh; min-height: 300px;
    display: flex; align-items: center; justify-content: center;
    background-image: url("tlo.jpg"); background-size: cover;
    background-position: center; background-repeat: no-repeat;
    border-radius: 0px 0px 40px 40px;
    animation: animacja_tla 1s ease-in-out forwards;
    box-shadow: 5px 5px 10px 0px rgba(0,0,0,0.25);
    position: relative;
}
#tytul {
    font-size: clamp(32px, 8vw, 120px); font-family: "Mea Culpa", cursive;
    color: white; opacity: 80%; user-select: none; text-align: center; padding: 10px;
    animation: animacja_tytulu 8s ease-in-out infinite;
    cursor: pointer; /* Zmienia kursor by sugerować możliwość kliknięcia */
}
#przycisk {
    width: 30px; height: 30px; border-radius: 100%;
    background-color: white; opacity: 0.5; border: 1px solid black;
    position: absolute; bottom: 10px; cursor: pointer;
}

#main {
    background-color: rgb(216, 235, 221);
    display: flex; flex-wrap: wrap; justify-content: center;
    gap: 20px; padding: 50px 30px;
}
.blok {
    width: 180px; padding: 32px 20px 28px; background: white;
    border-radius: 16px; border: 2px solid #b5895a;
    display: flex; flex-direction: column; align-items: center;
    gap: 14px; text-align: center; cursor: pointer;
    transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.blok:hover { transform: translateY(-7px) scale(1.04); box-shadow: 0 12px 28px rgba(0,0,0,0.13); background: #fdf3e7; }
.blok.zielony  { border-color: #4a7c59; } .blok.zielony:hover  { background: #eaf4ed; }
.blok.czerwony { border-color: #c0474a; } .blok.czerwony:hover { background: #fdecea; }
.blok.niebieski{ border-color: #5a7fa8; } .blok.niebieski:hover{ background: #eaf1f9; }
.blok img { width: 40px; height: 40px; }
.blok h2 { font-family: "Oswald", sans-serif; font-size: 15px; margin: 0; color: #333; }
.blok p  { font-size: 12px; line-height: 1.6; color: #888; margin: 0; }

.sekcja-tresci { display: none; background-color: rgb(216, 235, 221); }
.wspolny-naglowek { text-align: center; font-family: 'Oswald', sans-serif; font-size: 35px; color: #333; margin-bottom: 40px; }

/* ===== KARUZELA ===== */
#sekcja-wladcow { padding: 40px 0; }
#okno { width: 100%; overflow: hidden; }
#track { display: flex; gap: 20px; padding: 0; transition: transform 0.4s ease; box-sizing: border-box; }
.karta { flex-shrink: 0; width: 260px; background: white; border-radius: 20px; overflow: hidden; border: 2px solid #b5895a; box-shadow: 0 2px 12px rgba(0,0,0,0.08); transform: scale(0.88); opacity: 0.5; transition: transform 0.4s ease, opacity 0.4s ease; }
.karta.aktywna { transform: scale(1); opacity: 1; }
.karta.sasiednia { transform: scale(0.94); opacity: 0.75; }
.karta-zdjecie { width: 100%; height: 340px; position: relative; overflow: hidden; }
.karta-zdjecie img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.karta-dynastia { position: absolute; top: 10px; right: 10px; background: rgba(181,137,90,0.9); color: white; font-family: 'Oswald', sans-serif; font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; padding: 4px 10px; border-radius: 100px; }
.karta-body { padding: 16px 18px 20px; display: flex; flex-direction: column; gap: 8px; }
.karta-imie { font-family: 'Gravitas One', serif; font-size: 18px; color: #222; margin: 0; }
.karta-lata { display: flex; gap: 10px; flex-wrap: wrap; }
.pill { font-family: 'Oswald', sans-serif; font-size: 11px; font-weight: 300; padding: 3px 10px; border-radius: 100px; }
.pill.zycie { border: 1px solid #aaa; color: #666; }
.pill.panowanie { border: 1px solid #b5895a; color: #8a5e2d; }
.karta-opis { font-size: 15px; line-height: 1.6; color: #777; margin: 0; border-top: 1px solid #f0f0f0; padding-top: 10px; }
#nav-wladcy { display: flex; justify-content: center; align-items: center; gap: 20px; margin-top: 24px; }
.nav-btn { width: 38px; height: 38px; border-radius: 50%; border: 1.5px solid #b5895a; background: white; color: #b5895a; font-size: 15px; cursor: pointer; }
.nav-btn:disabled { opacity: 0.25; cursor: default; }
#licznik { font-family: 'Oswald', sans-serif; font-size: 22px; font-weight: 500; color: #b5895a; }

/* ===== SEKCJA WYDARZEN ===== */
#sekcja-wydarzenia { padding: 60px 10%; }
.siatka-wydarzen { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 30px; max-width: 1200px; margin: 0 auto; }
.karta-wydarzenie { background: white; border-radius: 15px; overflow: hidden; box-shadow: 0 5px 15px rgba(0,0,0,0.1); border-bottom: 4px solid #4a7c59; transition: transform 0.3s ease; }
.karta-wydarzenie:hover { transform: translateY(-10px); }
.wydarzenie-foto { width: 100%; height: 200px; object-fit: cover; }
.wydarzenie-tresc { padding: 20px; }
.wydarzenie-rok { font-family: 'Oswald', sans-serif; color: #4a7c59; font-size: 20px; margin: 0; }
.wydarzenie-nazwa { font-family: 'Gravitas One', serif; font-size: 18px; margin: 10px 0; color: #222; }
.wydarzenie-opis { font-size: 14px; color: #555; line-height: 1.5; }

/* ===== SEKCJA BITEW ===== */
#sekcja-bitew { padding: 60px 5%; }
.bitwy-naglowek { margin-bottom: 10px; }
.bitwy-podnaglowek { text-align: center; font-family: 'Oswald', sans-serif; font-size: 13px; color: #888; letter-spacing: 0.12em; text-transform: uppercase; margin-bottom: 40px; }
.filtry-panel { background: white; border-radius: 16px; padding: 24px 28px; max-width: 900px; margin: 0 auto 40px; box-shadow: 0 4px 16px rgba(0,0,0,0.08); display: flex; flex-wrap: wrap; gap: 18px; align-items: flex-end; }
.filtr-grupa { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 160px; }
.filtr-etykieta { font-family: 'Oswald', sans-serif; font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: #aaa; }
.filtr-select { font-family: 'Oswald', sans-serif; font-size: 14px; color: #333; border: 1.5px solid #ddd; border-radius: 10px; padding: 10px 14px; background: #fafafa; cursor: pointer; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23aaa' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; transition: border-color 0.2s ease; }
.filtr-select:focus { outline: none; border-color: #c0474a; }
.filtr-btn { font-family: 'Oswald', sans-serif; font-size: 14px; letter-spacing: 0.06em; background: #c0474a; color: white; border: none; border-radius: 10px; padding: 10px 24px; cursor: pointer; transition: background 0.2s ease, transform 0.15s ease; align-self: flex-end; }
.filtr-btn:hover { background: #a33a3d; transform: translateY(-1px); }
.filtr-btn.reset { background: #eee; color: #555; }
.filtr-btn.reset:hover { background: #ddd; }
.tabela-wrapper { max-width: 1200px; margin: 0 auto; border-radius: 16px; overflow: hidden; box-shadow: 0 6px 24px rgba(0,0,0,0.1); }
.tabela-bitew { width: 100%; border-collapse: collapse; background: white; font-family: 'Oswald', sans-serif; }
.tabela-bitew thead { background: #2b1a1a; color: white; }
.tabela-bitew thead th { padding: 16px 18px; text-align: left; font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; font-weight: 400; }
.tabela-bitew tbody tr { border-bottom: 1px solid #f2f2f2; transition: background 0.2s ease; cursor: pointer; }
.tabela-bitew tbody tr:hover { background: #fef9f5; }
.tabela-bitew td { padding: 14px 18px; font-size: 14px; color: #333; vertical-align: middle; }
.td-zdjecie img { width: 64px; height: 52px; object-fit: cover; border-radius: 8px; border: 1.5px solid #eee; display: block; }
.bitwa-nazwa-td { font-weight: 600; font-size: 15px; color: #222; }
.bitwa-rok-td, .bitwa-przeciwnik-td { font-size: 13px; color: #888; }
.td-liczba { font-family: 'Oswald', sans-serif; font-size: 13px; color: #444; text-align: right; white-space: nowrap; }
.td-straty { color: #c0474a; }
.tabela-bitew thead th:nth-child(n+6) { text-align: right; }
@media (max-width: 900px) { .tabela-bitew th:nth-child(n+6), .tabela-bitew td:nth-child(n+6) { display: none; } }
@media (max-width: 600px) { .tabela-bitew th:nth-child(4), .tabela-bitew td:nth-child(4) { display: none; } }
.badge-wynik { display: inline-block; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; padding: 5px 14px; border-radius: 100px; font-weight: 600; }
.badge-w { background: #e8f5ec; color: #2e7d50; }
.badge-p { background: #fdecea; color: #b03030; }
.badge-r { background: #f0f0f0; color: #777; }
.brak-wynikow { text-align: center; padding: 40px; font-family: 'Oswald', sans-serif; color: #aaa; font-size: 16px; letter-spacing: 0.06em; }

/* ===== MODAL ===== */
.modal { display: none; position: fixed; z-index: 2000; left: 0; top: 0; width: 100%; height: 100%; background-color: rgba(0,0,0,0.9); justify-content: center; align-items: center; cursor: zoom-out; }
.modal-content { max-width: 90%; max-height: 85%; border: 3px solid white; border-radius: 5px; box-shadow: 0 0 20px rgba(0,0,0,0.5); animation: zoom 0.3s ease-out; }
@keyframes zoom { from {transform: scale(0.7); opacity: 0;} to {transform: scale(1); opacity: 1;} }
.close { position: absolute; top: 20px; right: 35px; color: #f1f1f1; font-size: 40px; font-weight: bold; cursor: pointer; }

/* ===== MAPY HISTORYCZNE ===== */
#sekcja-mapy {
    padding: 60px 5%;
}

.mapy-podnaglowek {
    text-align: center;
    font-family: 'Oswald', sans-serif;
    font-size: 13px;
    color: #888;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-bottom: 40px;
}

.mapy-kontener {
    max-width: 820px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 24px;
    align-items: center;
}

.mapa-ramka {
    position: relative;
    width: 100%;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 12px 48px rgba(0,0,0,0.28);
    background: #1a1208;
    aspect-ratio: 4 / 3;
}

.mapa-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.mapa-rok-overlay {
    position: absolute;
    top: 18px;
    left: 22px;
    font-family: 'Gravitas One', serif;
    font-size: clamp(28px, 5vw, 54px);
    color: white;
    text-shadow: 0 2px 16px rgba(0,0,0,0.9);
    z-index: 10;
    pointer-events: none;
}

.mapy-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    width: 100%;
}

.mapa-btn {
    flex-shrink: 0;
    font-family: 'Oswald', sans-serif;
    font-size: 15px;
    padding: 12px 28px;
    border-radius: 12px;
    border: 2px solid #b5895a;
    background: white;
    color: #b5895a;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
}

/* hover dziala tylko na aktywnych przyciskach */
.mapa-btn:hover:not(:disabled) {
    background: #fdf3e7;
    transform: translateY(-2px);
}

/* niekatywny przycisk */
.mapa-btn:disabled {
    opacity: 0.25;
    cursor: default;
}

.mapa-opis-tekst {
    font-family: 'Gravitas One', serif;
    font-size: 16px;
    color: #333;
    text-align: center;
    flex: 1;
}