/* =====================================
   Grundlayout
===================================== */

body {

    margin: 0;
    padding: 0;

    background: #ffffff;

    font-family: Arial, Helvetica, sans-serif;

    text-align: center;

    overflow-x: hidden;

    color: #222;
}

.container {

    max-width: 900px;

    margin: 0 auto;

    padding: 20px;
}

h1 {

    margin-top: 10px;
    margin-bottom: 30px;

    font-size: 2.5rem;
}

/* =====================================
   Lernstufen
===================================== */

.settings {

    margin-bottom: 15px;
}

.settings label {

    font-weight: bold;

    margin-right: 10px;
}

.settings select {

    padding: 8px 12px;

    border: 1px solid #ccc;

    border-radius: 8px;

    font-size: 1rem;
}

/* =====================================
   Eigene Buchstaben
===================================== */

#customLettersContainer {

    margin-bottom: 20px;
}

#customLettersContainer label {

    display: block;

    margin-bottom: 10px;

    font-weight: bold;
}

#customLetters {

    width: 300px;

    max-width: 90%;

    padding: 10px;

    border: 1px solid #ccc;

    border-radius: 8px;

    text-align: center;

    font-size: 1.1rem;
}

/* =====================================
   Wortanzeige
===================================== */

#word {

    min-height: 180px;

    display: flex;

    align-items: center;

    justify-content: center;

    font-size: clamp(5rem, 18vw, 12rem);

    font-weight: bold;

    color: #111;
}

/* =====================================
   Statusanzeigen
===================================== */

#counter {

    margin-top: 20px;

    font-size: 1.5rem;
}

#bestTimeDisplay {

    margin-top: 10px;

    font-size: 1.1rem;

    color: #555;
}

/* =====================================
   Buttons
===================================== */

.buttons {

    margin-top: 30px;
}

button {

    padding: 15px 25px;

    margin: 8px;

    border: none;

    border-radius: 12px;

    cursor: pointer;

    font-size: 1.1rem;

    transition: all 0.2s ease;
}

button:hover {

    transform: scale(1.05);
}

button:active {

    transform: scale(0.98);
}

#backBtn {

    background: #2196f3;

    color: white;
}

#nextBtn {

    background: #4caf50;

    color: white;
}

#restartBtn {

    background: #4caf50;

    color: white;

    margin-top: 20px;
}

/* =====================================
   Rakete
===================================== */

.rocket-area {

    position: relative;

    width: 100%;

    height: 80px;

    overflow: hidden;
}

#rocket-container {

    position: absolute;

    left: 0;

    top: 10px;

    display: flex;

    align-items: center;

    transition: left 0.6s ease;
}

#rocket {

    font-size: 42px;
}

#flame {

    margin-right: -5px;

    font-size: 22px;

    animation: flame 0.2s infinite alternate;
}

@keyframes flame {

    from {

        transform: scale(0.8);
    }

    to {

        transform: scale(1.2);
    }
}

/* =====================================
   Feuerwerk
===================================== */

#fireworksCanvas {

    position: fixed;

    inset: 0;

    width: 100%;

    height: 100%;

    pointer-events: none;

    z-index: 900;
}

/* =====================================
   Ergebnis Overlay
===================================== */

#resultOverlay {

    position: fixed;

    inset: 0;

    background: rgba(0, 0, 0, 0.75);

    justify-content: center;

    align-items: center;

    z-index: 999;
}

#resultOverlay.hidden {

    display: none;
}

#resultOverlay:not(.hidden) {

    display: flex;
}

.resultCard {

    background: white;

    border-radius: 20px;

    padding: 30px;

    width: 90%;

    max-width: 550px;

    box-shadow: 0 0 25px rgba(0, 0, 0, 0.3);
}

.resultCard h2 {

    margin-top: 0;
}

#timeResult {

    margin: 20px 0;

    font-size: 2rem;

    font-weight: bold;
}

#comparisonResult {

    font-size: 1.2rem;

    line-height: 1.6;
}

/* =====================================
   Mobile-Optimierung
===================================== */

@media (max-width: 700px) {

    h1 {

        font-size: 1.8rem;
    }

    #word {

        font-size: clamp(4rem, 22vw, 7rem);

        min-height: 140px;
    }

    #counter {

        font-size: 1.2rem;
    }

    #bestTimeDisplay {

        font-size: 1rem;
    }

    button {

        display: block;

        width: 90%;

        max-width: 350px;

        margin: 8px auto;
    }

    #rocket {

        font-size: 34px;
    }

    #flame {

        font-size: 18px;
    }
}
