/* =========================================================
   Gemini Craft Info – styles.css
   Wersja responsywna: dopasowuje się do telefonów, tabletów i komputerów.
   ========================================================= */

:root {
    --tlo: #0f172a;
    --tlo-2: #1e293b;
    --karta: #ffffff;
    --obramowanie: #334155;
    --akcent: #22c55e;
    --akcent-ciemny: #15803d;
    --tekst: #0f172a;

    /* Wymiary craftingu – skalują się z szerokością ekranu.
       Na komputerze: pole 64px, ikona 48px, odstęp 25px, strzałka 35px. */
    --slot: clamp(40px, 12vw, 64px);
    --slot-img: calc(var(--slot) * 0.75);
    --ilosc: calc(var(--slot) * 0.3125);
    --gap: clamp(8px, 2.5vw, 25px);
    --strzalka: clamp(22px, 6vw, 35px);
}

* {
    box-sizing: border-box;
}

/* Własny kursor Gemini Craft na całej stronie (także na linkach i przyciskach).
   Pola do wpisywania tekstu zostawiają zwykły kursor tekstowy.
   Druga linia daje ostrzejszy kursor na ekranach o dużej gęstości pikseli. */
html,
*:not(input):not(textarea) {
    cursor: url("../img/kursor.png") 1 1, auto !important;
    cursor: image-set(url("../img/kursor.png") 1x, url("../img/kursor@2x.png") 2x) 1 1, auto !important;
}

img {
    max-width: 100%;
    height: auto;
}

body {
    margin: 0;
    padding: 24px 16px 60px;
    font-family: 'Segoe UI', Arial, sans-serif;
    color: var(--tekst);
    min-height: 100vh;
    background: linear-gradient(-45deg, #0f172a, #1e3a8a, #166534, #0f766e, #0f172a);
    background-size: 400% 400%;
    background-attachment: fixed;
    animation: animowany-gradient 18s ease infinite;
}

@keyframes animowany-gradient {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* Użytkownicy, którzy wyłączyli animacje w systemie */
@media (prefers-reduced-motion: reduce) {
    body {
        animation: none;
    }
}

/* Logo */
.logo {
    max-width: 900px;
    margin: 0 auto 20px;
    text-align: center;
    background: url('../img/tlo-logo.jpg') center/cover, #1e293b;
    background-size: cover;
    background-position: center;
    border: 4px solid #000;
    border-radius: 12px;
    box-shadow: 0 8px 0 #000, 0 16px 30px #0008;
    overflow: hidden;
}

.logo img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

/* Nagłówek */
.header {
    font-family: Impact, 'Arial Black', sans-serif;
    background: linear-gradient(180deg, #334155, #1e293b);
    color: #fff;
    padding: 14px clamp(16px, 5vw, 40px);
    text-align: center;
    border: 3px solid #000;
    border-radius: 10px;
    margin: 28px auto;
    display: table;
    max-width: 100%;
    letter-spacing: 3px;
    text-transform: uppercase;
    box-shadow: 0 5px 0 #000;
}

.header h1 {
    margin: 0;
    font-size: 2rem;
    text-shadow: 3px 3px 0 #000;
    overflow-wrap: anywhere;
}

/* Układ (opcjonalny: menu + treść obok siebie) */
.uklad {
    display: flex;
    align-items: flex-start;
    gap: 20px;
}

.zawartosc {
    flex: 1;
    min-height: 600px;
    background: var(--karta);
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 20px;
}

/* Menu */
.menu {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
}

/* Wszystkie zakładki */
details {
    background: var(--karta);
    border: 2px solid var(--obramowanie);
    border-radius: 10px;
    padding: 10px 14px;
    margin: 10px 0;
    box-shadow: 0 3px 0 #0006;
    transition: box-shadow 0.2s;
}

details[open] {
    box-shadow: 0 5px 0 #0008;
}

.menu>details {
    padding: 14px;
    background: #f8fafc;
}

/* Tekst zakładek */
summary {
    cursor: pointer;
    font-weight: 700;
    font-size: 1.05rem;
    padding: 6px 10px;
    border-radius: 8px;
    list-style: none;
    margin-bottom: 6px;
    /* Zielony pasek, który przy najechaniu „wjeżdża” od lewej */
    background-image: linear-gradient(90deg, #22c55e40, #22c55e10 70%, transparent);
    background-size: 0% 100%;
    background-repeat: no-repeat;
    transition:
        background-size 0.35s ease,
        color 0.2s,
        padding-left 0.25s ease,
        box-shadow 0.25s ease,
        letter-spacing 0.25s ease;
}

summary::-webkit-details-marker {
    display: none;
}

summary::before {
    content: "▶";
    display: inline-block;
    margin-right: 10px;
    font-size: 0.8em;
    color: var(--akcent-ciemny);
    transition: transform 0.25s ease, color 0.2s;
}

details[open]>summary::before {
    transform: rotate(90deg);
}

/* Efekt najechania tylko tam, gdzie jest myszka (nie „przykleja się" po dotknięciu) */
@media (hover: hover) {
    summary:hover {
        background-size: 100% 100%;
        color: var(--akcent-ciemny);
        padding-left: 18px;
        letter-spacing: 0.6px;
        box-shadow: inset 4px 0 0 var(--akcent);
    }

    /* Strzałka podskakuje w stronę tekstu */
    summary:hover::before {
        color: var(--akcent);
        transform: translateX(3px) scale(1.15);
    }

    details[open]>summary:hover::before {
        transform: rotate(90deg) scale(1.15);
    }

    summary:active {
        box-shadow: inset 6px 0 0 var(--akcent-ciemny);
    }
}

@media (prefers-reduced-motion: reduce) {

    summary,
    summary::before {
        transition: none;
    }
}

/* Widoczny fokus dla klawiatury */
summary:focus-visible,
.pobierz:focus-visible,
a:focus-visible {
    outline: 3px solid var(--akcent);
    outline-offset: 2px;
}

p,
li {
    line-height: 1.6;
}

a {
    color: #2563eb;
    overflow-wrap: anywhere;
}

/* Zawartość zakładki */
.tresc {
    padding: 8px 12px;
}

/* Launcher */
.launcher .tresc {
    text-align: center;
}

.pobierz {
    display: inline-block;
    max-width: 100%;
    margin-top: 10px;
    padding: 14px clamp(18px, 6vw, 34px);
    background: linear-gradient(180deg, #4ade80, var(--akcent));
    color: #052e16;
    font-family: Impact, 'Arial Black', sans-serif;
    font-size: clamp(1rem, 4.5vw, 1.15rem);
    line-height: 1.3;
    letter-spacing: 1.5px;
    text-align: center;
    text-decoration: none;
    text-transform: uppercase;
    border: 3px solid #14532d;
    border-radius: 10px;
    box-shadow: 0 6px 0 #14532d;
    transition: transform 0.1s, box-shadow 0.1s, filter 0.2s;
}

@media (hover: hover) {
    .pobierz:hover {
        filter: brightness(1.08);
        transform: translateY(-2px);
        box-shadow: 0 8px 0 #14532d;
    }
}

.pobierz:active {
    transform: translateY(5px);
    box-shadow: 0 1px 0 #14532d;
}

.licznik {
    display: inline-block;
    max-width: 100%;
    margin-top: 18px;
    padding: 8px 18px;
    background: var(--tlo-2);
    color: #e2e8f0;
    border: 2px solid #000;
    border-radius: 999px;
    font-size: 0.95rem;
}

.licznik span {
    color: #4ade80;
    font-family: Impact, 'Arial Black', sans-serif;
    font-size: 1.15rem;
    letter-spacing: 1px;
    margin-left: 6px;
}

/* Crafting */
.receptury {
    display: flex;
    flex-direction: column;
    gap: 14px;
    align-items: center;
    max-width: 100%;
}

.recipe {
    display: flex;
    align-items: center;
    gap: var(--gap);
    padding: clamp(8px, 2.5vw, 15px);
    width: fit-content;
    max-width: 100%;
    background: #e2e8f0;
    border: 2px solid var(--obramowanie);
    border-radius: 10px;
}

.craft-grid {
    display: grid;
    grid-template-columns: repeat(3, var(--slot));
    grid-template-rows: repeat(3, var(--slot));
    flex-shrink: 0;
}

.slot,
.result {
    width: var(--slot);
    height: var(--slot);
    flex-shrink: 0;
    background: #8b8b8b;
    border: 2px solid #373737;
    box-shadow: inset 2px 2px 0 #5a5a5a, inset -2px -2px 0 #b5b5b5;
    display: flex;
    align-items: center;
    justify-content: center;
}

.result {
    position: relative;
}

.slot img,
.result img {
    width: var(--slot-img);
    height: var(--slot-img);
    image-rendering: pixelated;
}

.arrow {
    flex-shrink: 0;
    font-size: var(--strzalka);
    line-height: 1;
    color: var(--obramowanie);
}

/* Liczba sztuk w polu wyniku receptury (np. ×6) */
.receptury .result .ilosc {
    position: absolute;
    right: calc(var(--slot) * 0.0625);
    bottom: calc(var(--slot) * 0.03125);
    font-family: Arial, sans-serif;
    font-weight: bold;
    font-size: var(--ilosc);
    line-height: 1;
    color: #fff;
    text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
    pointer-events: none;
}

/* ================= Aktualizacje ================= */
.wersje {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 8px;
    padding-left: 22px;
}

/* Oś czasu po lewej */
.wersje::before {
    content: "";
    position: absolute;
    left: 6px;
    top: 10px;
    bottom: 10px;
    width: 4px;
    border-radius: 2px;
    background: linear-gradient(180deg, #a855f7, var(--akcent), var(--obramowanie));
}

/* Karta wersji (nadpisuje ogólny wygląd <details>) */
.wersja {
    position: relative;
    margin: 0;
    padding: 0;
    background: #fff;
    border: 3px solid #000;
    border-radius: 12px;
    box-shadow: 0 5px 0 #000;
    overflow: visible;
}

.wersja[open] {
    box-shadow: 0 6px 0 #000;
}

/* Kropka na osi czasu */
.wersja::before {
    content: "";
    position: absolute;
    left: -24px;
    top: 26px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--akcent);
    border: 3px solid #000;
    z-index: 1;
}

.wersja-wkrotce::before {
    background: #a855f7;
}

/* Nagłówek wersji ze zrzutem gry w tle */
.wersja-baner {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    min-height: 96px;
    margin: 0;
    padding: 16px 18px;
    border-radius: 9px;
    overflow: hidden;
    isolation: isolate;
    background: linear-gradient(135deg, #1e293b, #0f172a);
    color: #fff;
    cursor: pointer;
}

.wersja[open]>.wersja-baner {
    border-radius: 9px 9px 0 0;
}

.wersja-zrzut {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -2;
    transition: transform 0.4s ease;
}

/* Przyciemnienie zrzutu, żeby napisy były czytelne */
.wersja-baner::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(90deg, #000d 0%, #0009 55%, #0003 100%);
}

.wersja-baner:hover .wersja-zrzut {
    transform: scale(1.05);
}

/* Strzałka rozwijania (zastępuje ogólny ▶ z summary) */
.wersja-baner::before {
    content: "▶";
    margin: 0;
    font-size: 0.9rem;
    color: #4ade80;
    transition: transform 0.2s;
}

.wersja[open]>.wersja-baner::before {
    transform: rotate(90deg);
}

summary.wersja-baner:hover {
    background: linear-gradient(135deg, #1e293b, #0f172a);
    color: #fff;
    text-transform: none;
    letter-spacing: normal;
    padding-left: 18px;
    box-shadow: inset 5px 0 0 var(--akcent);
}

.wersja-wkrotce .wersja-baner::before {
    display: none;
}

.wersja-wkrotce .wersja-baner {
    cursor: default;
    background: repeating-linear-gradient(-45deg, #3b0764, #3b0764 14px, #4c1d95 14px, #4c1d95 28px);
    border-radius: 9px 9px 0 0;
}

.wersja-nr {
    font-family: Impact, 'Arial Black', sans-serif;
    font-size: 2.1rem;
    letter-spacing: 2px;
    line-height: 1;
    text-shadow: 3px 3px 0 #000;
}

.znaczek {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    padding: 4px 10px;
    border: 2px solid #000;
    border-radius: 999px;
    background: var(--akcent);
    color: #052e16;
    box-shadow: 0 2px 0 #000;
}

.znaczek-wkrotce {
    background: #c084fc;
    color: #2e1065;
    animation: pulsuj 1.6s ease-in-out infinite;
}

.znaczek-pierwsza {
    background: #fde047;
    color: #422006;
}

@keyframes pulsuj {
    50% {
        transform: scale(1.08);
    }
}

.wersja-data {
    margin-left: auto;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 8px;
    background: #0008;
    border: 1px solid #fff4;
}

/* Zaszyfrowana data oA1.3 (animuje ją index.js) */
.wersja-data-hack {
    border-color: #c084fc88;
    box-shadow: 0 0 10px #a855f766;
}

.wersja-data-hack .hacked-text {
    display: inline-block;
    width: 10ch;
    overflow: hidden;
    white-space: nowrap;
    text-align: center;
    vertical-align: bottom;
}

/* Treść wersji */
.wersja-tresc {
    padding: 16px 18px 20px;
}

.wersja-opis {
    margin: 0 0 12px;
    font-size: 1.05rem;
}

.liczniki {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 6px;
    padding: 0;
    list-style: none;
}

.liczniki li {
    padding: 4px 12px;
    border-radius: 999px;
    background: var(--tlo-2);
    color: #e2e8f0;
    font-size: 0.9rem;
}

.liczniki b {
    color: #4ade80;
    font-family: Impact, 'Arial Black', sans-serif;
    font-weight: normal;
    font-size: 1.05rem;
    letter-spacing: 1px;
}

.sekcja {
    margin: 18px 0 8px;
    font-family: Impact, 'Arial Black', sans-serif;
    font-weight: normal;
    font-size: 1.15rem;
    letter-spacing: 1px;
    color: var(--tlo-2);
}

.sekcja small {
    font-family: 'Segoe UI', Arial, sans-serif;
    font-size: 0.85rem;
    letter-spacing: 0;
    color: #64748b;
}

/* Kafelki bloków / przedmiotów */
.kafelki {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.kafelki li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px 6px 6px;
    background: #e2e8f0;
    border: 2px solid var(--obramowanie);
    border-radius: 8px;
    font-weight: 600;
    line-height: 1.2;
    min-width: 0;
    overflow-wrap: anywhere;
    transition: transform 0.15s, background 0.15s;
}

.kafelki li:hover {
    transform: translateY(-2px);
    background: #f1f5f9;
}

.kafelki small {
    display: block;
    font-weight: 400;
    font-size: 0.78rem;
    color: #475569;
}

/* Ikona w kafelku – wygląd jak slot w ekwipunku */
.kafelki img,
.kafelki .kolor {
    flex: 0 0 auto;
    width: 36px;
    height: 36px;
    padding: 2px;
    background: #8b8b8b;
    border: 2px solid #373737;
    box-shadow: inset 2px 2px 0 #5a5a5a, inset -2px -2px 0 #b5b5b5;
    image-rendering: pixelated;
}

/* Kolorowy kwadrat dla bloków bez obrazka */
.kafelki .kolor {
    background:
        linear-gradient(var(--kolor), var(--kolor)) content-box,
        #8b8b8b;
}

.kafelki .ikona-mala,
.kafelki .kolor-maly {
    padding: 8px;
}

.kafelki .kolor-trawa {
    background:
        linear-gradient(#5fa53a 0 35%, var(--kolor) 35%) content-box,
        #8b8b8b;
}

.kafelki .kolor-powietrze {
    background:
        repeating-conic-gradient(#cbd5e1 0 25%, #f8fafc 0 50%) content-box 0 0 / 10px 10px,
        #8b8b8b;
}

/* Zwykłe listy zmian */
.lista-zmian {
    margin: 0;
    padding: 0;
    list-style: none;
}

.lista-zmian li {
    position: relative;
    padding: 6px 10px 6px 34px;
    margin-bottom: 6px;
    background: #f1f5f9;
    border-radius: 8px;
}

.lista-zmian li::before {
    content: "+";
    position: absolute;
    left: 10px;
    top: 5px;
    font-weight: 900;
    color: var(--akcent-ciemny);
}

.lista-poprawki li::before {
    content: "✔";
    color: #2563eb;
}

.lista-plan li::before {
    content: "★";
    color: #9333ea;
}

/* Zrzuty chunków */
.chunki {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.chunki figure {
    margin: 0;
}

.chunki img {
    display: block;
    width: 100%;
    height: auto;
    border: 3px solid #000;
    border-radius: 8px;
}

.chunki figcaption {
    margin-top: 6px;
    text-align: center;
    font-weight: 600;
}

@media (max-width: 600px) {
    .wersje {
        padding-left: 16px;
    }

    .wersje::before {
        left: 3px;
    }

    .wersja::before {
        left: -19px;
        width: 10px;
        height: 10px;
    }

    .wersja-nr {
        font-size: 1.6rem;
    }

    .wersja-data {
        margin-left: 0;
    }

    .wersja-tresc {
        padding: 12px;
    }

    .kafelki {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    }

    .kafelki li {
        gap: 8px;
        font-size: 0.92rem;
    }

    .kafelki img,
    .kafelki .kolor {
        width: 30px;
        height: 30px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .znaczek-wkrotce {
        animation: none;
    }

    .wersja-zrzut,
    .kafelki li {
        transition: none;
    }
}

.instrukcja {
    font-family: 'Courier New', Courier, monospace;
    background: #1e293b;
    color: #f8fafc;
    padding: 12px 16px;
    border-radius: 8px;
    border: 2px solid var(--obramowanie);
    box-shadow: inset 2px 2px 0 #0006, inset -2px -2px 0 #0006;
    margin-top: 10px;
    overflow-wrap: anywhere;
}

/* =========================================================
   RESPONSYWNOŚĆ – telefony (do 600px szerokości)
   ========================================================= */
@media (max-width: 600px) {
    body {
        padding: 16px 10px 40px;
    }

    .header {
        margin: 20px auto;
        letter-spacing: 2px;
    }

    .header h1 {
        font-size: clamp(1.1rem, 5.5vw, 1.6rem);
    }

    .menu>details {
        padding: 8px;
    }

    details {
        padding: 8px 10px;
        margin: 8px 0;
    }

    /* Większe pole dotyku, łatwiej trafić palcem */
    summary {
        min-height: 44px;
        padding: 10px 4px;
        font-size: 1rem;
    }

    .tresc {
        padding: 6px;
    }

    .instrukcja {
        padding: 10px 12px;
        font-size: 0.9rem;
    }
}

/* Obrazki w zakładkach (z wersji na serwerze) */
.tresc img {
    height: auto;
    border-radius: 8px;
    border: 3px solid #000;
    display: block;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
    transition: transform 0.25s ease, box-shadow 0.25s ease, filter 0.25s ease;
}

.tresc img:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.35);
    filter: brightness(1.06) saturate(1.1);
}

/* Ikony w craftingu zostają bez ramek i efektów */
.receptury .tresc img,
.slot img,
.result img {
    border: 0;
    border-radius: 0;
    box-shadow: none;
    transform: none;
    filter: none;
}

.lead {
    font-weight: bold;
    font-size: 1.1rem;
    margin-bottom: 6px;
}

.opis {
    font-style: italic;
    font-family: 'Impact', Courier, monospace;
    color: #e4e400;
    margin-top: 4px;
}

/* Pasek nawigacji (na wszystkich ekranach) – animowany */
#navbar {
    max-width: 900px;
    margin: 0 auto 16px;
    padding: 10px 16px;
    background-color: rgba(50, 162, 132, 0.9);
    /* Płynący gradient w odcieniach koloru paska */
    background-image: linear-gradient(90deg,
            rgba(50, 162, 132, 0.95),
            rgba(34, 197, 94, 0.95),
            rgba(15, 118, 110, 0.95),
            rgba(50, 162, 132, 0.95));
    background-size: 300% 100%;
    border: 3px solid #000;
    box-shadow: 0 4px 0 #000;
    position: sticky;
    top: 0;
    /* bez tego sticky nie działa */
    z-index: 10;
    overflow: hidden;
    animation:
        navbar-wjazd 0.6s ease-out both,
        navbar-gradient 8s linear infinite;
}

/* Błysk przesuwający się po pasku */
#navbar::after {
    content: "";
    position: absolute;
    top: 0;
    left: -40%;
    width: 30%;
    height: 100%;
    background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.35), transparent);
    transform: skewX(-20deg);
    animation: navbar-blysk 4s ease-in-out infinite;
    pointer-events: none;
}

@keyframes navbar-wjazd {
    from {
        transform: translateY(-30px);
        opacity: 0;
    }

    to {
        transform: none;
        opacity: 1;
    }
}

@keyframes navbar-gradient {
    from {
        background-position: 0% 50%;
    }

    to {
        background-position: 300% 50%;
    }
}

@keyframes navbar-blysk {
    0% {
        left: -40%;
    }

    60%,
    100% {
        left: 120%;
    }
}

#navbar .nav-link {
    position: relative;
    display: inline-block;
    color: #fff;
    font-family: Impact, 'Arial Black', sans-serif;
    font-weight: 700;
    text-decoration: none;
    text-shadow: 1px 1px 0 #000;
    transition: transform 0.2s;
    letter-spacing: 1.3px;
    font-size: 1.6rem;
    margin: 0 12px;
}

#navbar .nav-link:hover {
    text-shadow: 0px 0px 10px #a804efa8;
    text-transform: uppercase;
}

/* Podkreślenie, które „rośnie" po najechaniu */
#navbar .nav-link::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -3px;
    width: 100%;
    height: 3px;
    background: #fff;
    box-shadow: 1px 1px 0 #000;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.25s ease;
}

@media (hover: hover) {
    #navbar .nav-link:hover {
        transform: translateY(-2px);
    }

    #navbar .nav-link:hover::after {
        transform: scaleX(1);
    }
}

/* Wyłączone animacje w systemie – pasek bez ruchu */
@media (prefers-reduced-motion: reduce) {

    #navbar,
    #navbar::after {
        animation: none;
    }

    #navbar::after {
        display: none;
    }
}