/* --- Style CSS (Wygląd) --- */
        
:root {
    --kolor-glowny: #007bff;
    --kolor-sukces: #28a745;
    --kolor-blad: #dc3545;
    --kolor-pomoc: #fd7e14; /* Bardziej pomarańczowy */
    --kolor-tla: #f4f7f6;
    --kolor-bialy: #ffffff;
    --kolor-tekst: #333;
    --cień: 0 4px 15px rgba(0, 0, 0, 0.08);
}

body {
    font-family: Arial, sans-serif;
    background-color: var(--kolor-tla);
    display: flex;
    flex-direction: column; /* Zmienione dla przycisku powrotu */
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px 0;
    color: var(--kolor-tekst);
}

.game-container {
    width: 90%;
    max-width: 600px;
    background-color: var(--kolor-bialy);
    border-radius: 20px;
    padding: 30px;
    box-shadow: var(--cień);
    text-align: center;
}

h1 {
    color: #0056b3;
    margin-top: 0;
}

/* === Panel Gracza (Dashboard) === */
.player-dashboard {
    background-color: #f9f9f9;
    border-radius: 15px;
    padding: 20px;
    margin: 20px 0;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
}

/* Punkty i Seria */
.score-row {
    display: flex;
    justify-content: space-around;
    margin-bottom: 20px;
    font-size: 24px;
    font-weight: bold;
}
#score-display {
    color: var(--kolor-glowny);
}
#streak-display {
    color: var(--kolor-sukces);
}

/* === Pasek Postępu === */
.progress-bar-container {
    width: 100%;
    background-color: #e9ecef;
    border-radius: 10px;
    height: 20px;
    overflow: hidden;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
}
#progress-bar {
    height: 100%;
    width: 0%;
    background-color: var(--kolor-sukces);
    border-radius: 10px;
    transition: width 0.5s ease-in-out;
}

/* === Statystyki (Błędy, Pomocnik) === */
.stats-row {
    display: flex;
    justify-content: space-around;
    margin-top: 15px; /* Odstęp od paska postępu */
    font-size: 18px;
    font-weight: bold;
}
#mistakes-display {
    color: var(--kolor-blad);
}
#cheats-display {
    color: var(--kolor-pomoc);
}


/* Pytanie */
#question-display {
    font-size: 22px; 
    font-weight: 500;
    margin: 25px 0;
    min-height: 50px;
    line-height: 1.4;
}

/* Miejsce na odpowiedzi */
#answer-area {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-bottom: 25px;
}

#answer-area input {
    width: 100px; 
    padding: 10px;
    font-size: 20px; 
    text-align: center;
    border: 2px solid #ddd;
    border-radius: 10px;
    transition: border-color 0.3s;
}
#answer-area input:focus {
    border-color: var(--kolor-glowny);
    outline: none;
}

#answer-area span {
    font-size: 20px;
    font-weight: bold;
    color: #555;
}

/* Przyciski */
.buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 25px;
}

button {
    padding: 12px 25px;
    font-size: 16px;
    font-weight: bold;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

/* Główny przycisk "Sprawdź" */
#submit-btn {
    background-color: var(--kolor-sukces);
    color: white;
    flex-grow: 1; 
    max-width: 300px;
}
#submit-btn:hover {
    background-color: #218838;
}

/* Przycisk "Dalej" */
#next-btn {
    background-color: var(--kolor-glowny);
    color: white;
    flex-grow: 1; 
    max-width: 300px;
    display: none; /* Ukryty na starcie */
}
#next-btn:hover {
    background-color: #0056b3;
}


/* Informacja zwrotna (Dobrze/Źle) */
#feedback {
    margin-top: 20px;
    font-size: 16px;
    font-weight: bold;
    min-height: 60px;
    line-height: 1.5;
}
.correct {
    color: var(--kolor-sukces);
}
.incorrect {
    color: var(--kolor-blad);
}

/* === Przycisk i Panel Pomocnika === */
#toggle-cheat-sheet-btn {
    background-color: var(--kolor-pomoc);
    color: var(--kolor-tekst);
    margin-top: 20px;
}
#toggle-cheat-sheet-btn:hover {
    background-color: #e0a800;
}

#cheat-sheet {
    background-color: #fffacd;
    border: 1px dashed #e0a800;
    border-radius: 10px;
    padding: 15px;
    text-align: left;
    margin-top: 15px;
    font-size: 14px;
    line-height: 1.6;
    
    transition: all 0.4s ease;
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    padding-top: 0;
    padding-bottom: 0;
}
#cheat-sheet.visible {
    max-height: 300px; 
    opacity: 1;
    padding-top: 15px;
    padding-bottom: 15px;
}

#cheat-sheet h3 {
    margin: 0 0 10px 0;
    text-align: center;
    color: #555;
}
#cheat-sheet p {
    margin: 2px 0;
}


/* Ekran wygranej */
#win-screen {
    display: none;
    text-align: center;
}
#win-screen h2 {
    font-size: 36px;
    color: var(--kolor-sukces);
}
#win-screen p {
    font-size: 20px;
}
#cheatsheet-stats, #mistakes-stats {
    font-size: 16px;
    color: #555;
}
#restart-btn {
    background-color: var(--kolor-glowny);
    color: white;
    margin-top: 20px;
}
#restart-btn:hover {
    background-color: #0056b3;
}

/* Tooltip z zasadami */
.tooltip {
    position: relative;
    display: inline-block;
    cursor: help;
    font-weight: bold;
    color: var(--kolor-glowny);
    margin-left: 5px;
    font-size: 20px;
}
.tooltip .tooltiptext {
    visibility: hidden;
    width: 220px;
    background-color: #555;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 10px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -110px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 14px;
    font-weight: normal;
}
.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}

/* NOWY Styl dla przycisku powrotu do strony głównej */
.btn-homepage {
    display: block; /* Sprawia, że link jest blokiem */
    width: fit-content; /* Szerokość dopasowana do tekstu */
    margin: 30px auto 20px auto; /* Centruje przycisk i daje odstęp */
    padding: 12px 25px;
    background-color: #6c757d; /* Neutralny szary kolor */
    color: #ffffff;
    text-decoration: none; /* Usuwa podkreślenie linku */
    font-weight: bold;
    border-radius: 10px;
    transition: background-color 0.3s ease;
}

.btn-homepage:hover {
    background-color: #5a6268; /* Ciemniejszy szary po najechaniu */
}