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

html {
    background-color: #0a192f;
}

body {
    background-image: url('Backgrounds/Background.jpg');

    /* Stejná sada jako u indexu */
    background-repeat: no-repeat;
    background-position: center center;
    background-size: cover;
    background-attachment: fixed;

    min-height: 100vh;
    margin: 0;

    color: var(--neon-blue);
    font-family: var(--font-main);
    display: flex;
    flex-direction: column;
}

/* HEADER */
header {
    height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    position: relative;
    margin-bottom: 40px;
    padding: 0 20px;
}

header h1 {
    font-size: 48px;
    text-transform: uppercase;
    letter-spacing: 4px;
    margin-bottom: 15px;

    /* Neonová záře */
    color: var(--neon-blue);
    text-shadow:
        0 0 10px rgba(0, 217, 255, 0.8),
        0 0 20px rgba(0, 217, 255, 0.4);
}

.subtitle {
    font-family: var(--font-story);
    font-size: 18px;
    font-style: italic;
    /* Kurzíva pro citát */
    line-height: 1.5;

    color: var(--text-light);

    /* Omezení šířky - aby to byl hezký blok textu uprostřed */
    max-width: 600px;
}

.tech-line {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 2px;
    width: 100%;
    background-color: var(--neon-blue);
    box-shadow: 0 0 10px var(--neon-blue), 0 0 20px var(--neon-blue);
}

/* MAIN */
main {
    flex: 1;
    /* Roztáhne se, aby patička byla dole */
    display: flex;
    justify-content: center;
    /* Všechno na střed */
    padding-bottom: 50px;
}

.container {
    width: 90%;
    max-width: 800px;
    /* Tohle zajistí zarovnání "roh na roh" */
    display: flex;
    flex-direction: column;
    gap: 20px;
    /* Mezera mezi Avatarem a Formulářem */
}

/* Topper -> avatar + řeč */
.topper {
    display: flex;
    align-items: center;
    /* Svisle na střed */
    gap: 20px;
    /* Mezera mezi obrázkem a textem */
}

/* Obrázek */
.avatar-wrapper img {
    width: 140px;
    /* Velikost avatara */
    height: auto;
    border: 2px solid var(--neon-blue);
    border-radius: 10px;
    box-shadow: 0 0 15px rgba(0, 217, 255, 0.5);
    background: #000;
}

/* Bublina s textem */
.speech-bubble {
    position: relative;
    background: rgba(0, 20, 40, 0.8);
    /* Poloprůhledná tmavá */
    border: 1px solid var(--neon-blue);
    padding: 20px;
    border-radius: 10px;
    flex: 1;
    /* Zabere zbytek místa vedle obrázku */
    box-shadow: 0 0 10px rgba(0, 217, 255, 0.1);
}

/* Ten "zobáček" bubliny */
.speech-bubble::before {
    content: '';
    position: absolute;
    left: -10px;
    /* Posun doleva mimo bublinu */
    top: 50%;
    transform: translateY(-50%);

    /* Vytvoření trojúhelníku pomocí borderů */
    border-width: 10px 10px 10px 0;
    border-style: solid;
    border-color: transparent var(--neon-blue) transparent transparent;
}

.speech-bubble h2 {
    font-size: 22px;
    margin-bottom: 5px;
    color: var(--neon-blue);
}

.speech-bubble p {
    font-size: 16px;
    color: var(--text-light);
    line-height: 1.4;
    font-family: var(--font-story);
}

/* FORMULÁŘ */
.quiz-frame {
    background: rgba(0, 10, 20, 0.8);
    border: 1px solid var(--dark-teal);
    padding: 30px;
    border-radius: 10px;
}

.question-block {
    margin-bottom: 20px;
}

.question-block h3 {
    margin-bottom: 15px;
    font-size: 18px;
    color: var(--neon-blue);
}

/* Stylování možností */
.options {
    display: flex;
    flex-direction: column;
    gap: 10px;

    color: var(--text-light);
}

/* TEXT OPTIONS */
.text-option {
    padding: 10px;
    width: 100%;
    max-width: 300px;

    background: rgba(0, 10, 20, 0.5);
    /* Trochu tmavší pozadí pro čitelnost */
    border: 2px solid var(--dark-teal);
    border-radius: 5px;

    color: var(--neon-blue);
    font-family: var(--font-main);
    font-size: 18px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;

    outline: none;
    transition: 0.3s;
}

.text-option:focus,
.text-option:not(:placeholder-shown) {
    border-color: var(--neon-blue);
    /* Rámeček se rozsvítí */
    box-shadow: 0 0 15px rgba(0, 217, 255, 0.4);
    /* Přidáme záři */
    background: rgba(0, 20, 40, 0.8);
}

.text-place {
    padding: 10px;
}

/* RADIO BUTTONS */
/* Vytvoření vlastního kroužku */
input[type="radio"] {
    /* Vypnutí defaultního nastavení tlačítek prohlížeče */
    -webkit-appearance: none;
    appearance: none;
    /* Přebarvení prohlížečového/systémového kroužku u radio typů */
    background-color: transparent;
    /* Průhledný střed */
    margin: 0;
    width: 18px;
    height: 18px;
    border: 2px solid var(--dark-teal);
    /* Tmavě modrý okraj */
    border-radius: 50%;

    /* Flexbox pro zarovnání tečky uvnitř */
    display: grid;
    place-content: center;

    cursor: pointer;
    transition: 0.2s;
}

/* Vytvoření tečky uvnitř */
input[type="radio"]::before {
    content: "";
    width: 10px;
    height: 10px;
    border-radius: 50%;
    transform: scale(0);
    /* Zmenšená na nulu (není vidět) */
    transition: 0.2s transform ease-in-out;
    background-color: var(--neon-blue);
    /* Barva tečky */
    box-shadow: 0 0 5px var(--neon-blue);
    /* Záře tečky */
}

/* Stav ZAŠKRTNUTO (CHECKED) */
input[type="radio"]:checked {
    border-color: var(--neon-blue);
    /* Rámeček se rozsvítí */
    box-shadow: 0 0 10px rgba(0, 217, 255, 0.4);
    /* Záře celého kroužku */
}

/* Když je zaškrtnuto, tak se tečka uvnitř zvětší */
input[type="radio"]:checked::before {
    transform: scale(1);
}

.option {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 12px;

    border: 1px solid transparent;
    transition: all 0.2s ease-in-out;
    border-radius: 8px;
}

.option:hover {
    background: rgba(0, 217, 255, 0.1);
    border-color: var(--dark-teal);
}

.option:has(input:checked) {
    background: rgba(0, 217, 255, 0.2);
    /* Výraznější pozadí */
    border-color: var(--neon-blue);
    /* Svítící rámeček */
    box-shadow: 0 0 10px rgba(0, 217, 255, 0.1);
    /* Jemná záře */
}

.option:has(input:checked) span {
    color: #fff;
    /* Text zbělá pro lepší kontrast */
}

/* Oddělovací čára */
.separator {
    border: 0;
    height: 1px;
    background: rgba(0, 217, 255, 0.3);
    margin: 20px 0;
}

/* Button */
.button-wrapper {
    margin-top: 30px;
    display: flex;
    justify-content: center;
}

button {
    padding: 15px 40px;
    /* Větší padding */
    width: 100%;
    /* Roztáhneme ho na mobilu */
    max-width: 300px;
    /* Ale na PC nebude větší než 300px */

    background: transparent;
    border: 2px solid var(--neon-blue);
    /* Tlustší rámeček */
    border-radius: 5px;
    color: var(--neon-blue);
    font-family: var(--font-main);
    font-size: 18px;
    cursor: pointer;
    font-weight: bold;
    text-transform: uppercase;
    transition: 0.3s;
    letter-spacing: 2px;
}

button:hover {
    background: var(--neon-blue);
    color: #000;
    box-shadow: 0 0 20px var(--neon-blue);
}

/* Footer */
footer {
    padding: 20px;
    font-size: 12px;
    color: var(--text-muted);
    text-align: center;
    border-top: 1px solid rgba(0, 217, 255, 0.1);
}

.author-link {
    color: inherit;
    text-decoration: none;
    transition: 0.3s;
    font-weight: bold;
}

.author-link:hover {
    color: var(--neon-blue);
    text-shadow: 0 0 8px rgba(0, 217, 255, 0.6);
    /* Přidání záře */
    cursor: pointer;
}

/* OVERLAY  */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    /* Ztmavení pozadí */
    backdrop-filter: blur(5px);
    /* Rozmazání obsahu pod ním */

    /* Vycentrování overlaye */
    display: flex;
    justify-content: center;
    align-items: center;

    /* Skrytí overlaye */
    visibility: hidden;
    opacity: 0;
    transition: 0.3s;
    z-index: 1000;
    /* Aby byl úplně nahoře */
}

/* Tuhle třídu přidá JavaScript */
.overlay.active {
    visibility: visible;
    opacity: 1;
}

/* Vzhled obdélníku */
.overlay-box {
    background-color: rgba(10, 15, 30, 0.95);
    border: 2px solid var(--neon-blue);
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0, 217, 255, 0.5);
    color: white;

    max-width: 600px;
    width: 90%;

    white-space: pre-line;
    line-height: 1.6;

    padding: 30px;
    text-align: center;
}

/* Styly pro ÚSPĚCH (přidá JS) */
.overlay-box.win {
    border-color: var(--neon-green);
    /* Neonová tyrkysová */
    box-shadow: 0 0 20px rgba(0, 255, 204, 0.3);
}

.overlay-box.win h2 {
    color: var(--neon-green);
    text-shadow: 0 0 10px rgba(0, 255, 204, 0.5);
}

.overlay-box.win .close-btn:hover {
    background-color: rgba(0, 255, 204, 0.1);
    box-shadow: 0 0 15px var(--neon-green);
    border-color: var(--neon-green);
    color: var(--neon-green);
}

/* Styly pro NEÚSPĚCH (přidá JS) */
.overlay-box.lose {
    border-color: var(--neon-red);
    /* Neonová červená */
    box-shadow: 0 0 20px rgba(255, 51, 51, 0.3);
}

.overlay-box.lose h2 {
    color: var(--neon-red);
    text-shadow: 0 0 10px rgba(255, 51, 51, 0.5);
}

.overlay-box.lose .close-btn:hover {
    background-color: rgba(255, 51, 51, 0.1);
    box-shadow: 0 0 15px var(--neon-red);
    border-color: var(--neon-red);
    color: var(--neon-red);
}

/* Tlačítka */
.overlay-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    /* Mezera mezi tlačítky */
    margin-top: 20px;
}

.btn {
    padding: 10px 25px;
    background: transparent;
    border: 1px solid;
    font-family: inherit;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-decoration: none;
    transition: 0.3s;
    display: inline-block;
    /* paddingy u odkazu */
}

/* Tlačítko ZAVŘÍT */
.close-btn {
    color: inherit;
    border-color: currentColor;
    opacity: 0.7;
    background: transparent;
}

.close-btn:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 15px currentColor;
}

/* Tlačítko K BRÁNĚ */
.home-btn {
    border: 2px solid var(--neon-blue);
    /* Tlustší rámeček */
    border-radius: 5px;
    color: var(--neon-blue);
}

.home-btn:hover {
    color: #000;
    background: var(--neon-blue);
    box-shadow: 0 0 20px var(--neon-blue);
}

/* Responsive Exceptions */
@media (max-width: 600px) {
    header h1 {
        font-size: 32px;
        letter-spacing: 2px;
    }

    .subtitle {
        font-size: 14px;
    }

    .topper {
        flex-direction: column;
        /* Na mobilu avatar nad textem */
        text-align: center;
    }

    .speech-bubble::before {
        /* Změna šipky, aby ukazovala nahoru k avatarovi */
        left: 50%;
        top: -15px;
        transform: translateX(-50%) rotate(90deg);
    }
}