@import url('https://fonts.googleapis.com/css2?family=Hanalei+Fill&display=swap');


/* --- 1. HARD RESET & BASIS --- */
html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100vh;
}

/* Scrollen ist am Anfang deaktiviert (wird durch JS nach Popup-Klick aktiviert) */
body {
    overflow: hidden; 
}

/* --- 2. FARBSCHEMATA (DYNAMISCH) --- */
.color-scheme-dark {
    background-color: black !important;
    transition: background-color 0.5s ease;
}
.color-scheme-dark #km-display {
    color: white !important;
}

.color-scheme-light {
    background-color: white !important;
    transition: background-color 0.5s ease;
}
.color-scheme-light #km-display {
    color: #3e5aff !important;
}

/* --- 3. POPUP STYLES --- */
#popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    font-family: Verdana, Geneva, Tahoma, sans-serif;
}

#popup-box {
    background-color: white;
    text-align: center;
    color: #4A5EFF;
    padding: 40px;
    max-width: 800px;
    width: 90%;
    border: 8px solid #4A5EFF;
    border-radius: 40px;
    box-shadow: 0 0 0 8px white;
}

#popup-box h1 {
    font-family: "Hanalei Fill", sans-serif;
    margin-top: 0;
    font-size: 2.5rem;
    text-transform: uppercase;
}

#popup-button {
    background-color: #4A5EFF;
    color: white;
    font-family: "Hanalei Fill", sans-serif;
    font-size: 1.8rem;
    border: none;
    padding: 15px 40px;
    border-radius: 20px;
    cursor: pointer;
    margin-top: 20px;
}

/* --- 4. SPIELWELT & LAYOUT --- */
.scroll-track {
    width: 30000000px; 
    height: 100vh;
    position: relative;
}

#gif /* Beispiel für sehr große Bildschirme */{
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    /* Diese Variable kannst du nun bequem anpassen */
    top: var(--char-pos, 27%); 
    width: 250px; 
    z-index: 9;
    pointer-events: none;
    will-change: transform;
}

/* Beispiel für kleine Bildschirme */
@media (max-width: 768px) {
    :root {
        --char-pos: 55%; /* Daumen tiefer setzen, falls der Boden dort ist */
    }
    #gif {
        width: 150px;
    }
}

/* Beispiel für sehr große Bildschirme */
@media (min-width: 1800px) {
    :root {
        --char-pos: 41%; 
    }
}
#logo {
    position: fixed;
    top: 40px;
    left: 100px;
    transform: translateX(-50%);
    width: 150px;
    z-index: 30;
}

#km-display {
    position: fixed;
    top: 40px;
    right: 40px;
    font-size: 24px;
    font-family: "Hanalei Fill", sans-serif;
    z-index: 30;
}

/* --- 5. HINTERGRUND & BODEN --- */
#ground, #kontur {
    position: fixed;
    bottom: -50px;
    left: 0;
    width: 100vw;
    height: 255px;
    background-repeat: repeat-x;
    background-size: auto 255px;
}

#ground {
    z-index: 11; /* Vor der Kontur, hinter Charakter/Blumen */
    background-image: url('../media/Vordergrund/Background.png');
}

#kontur {
    z-index: 1; /* Ganz hinten */
    background-image: url('../media/Vordergrund/kontur.png');
}

/* --- 6. FLIEGENDE OBJEKTE (DYNAMISCH) --- */

/* Blumen */
.flying-flower {
    position: fixed;
    bottom: 130px;
    height: 300px; 
    width: auto; 
    z-index: 15; /* Vor dem Charakter (9) */
    pointer-events: none;
    display: none;
    will-change: left;
}

/* Schmetterlinge (Ehemals .flying-creature) */
.flying-creature {
    position: fixed;
    height: 200px; /* Im oberen Drittel eher klein */
    width: auto;
    z-index: 4; /* Ganz vorne */
    pointer-events: none;
    display: none;
    will-change: left, top;
}

/* Schaukeln */
.swing-object {
    position: fixed;
    height: 180px; /* Schaukel etwas größer */
    width: auto;
    z-index: 14; /* Zwischen Boden (11) und Blumen (15) */
    pointer-events: none;
    display: none;
    will-change: left, top;
}

/* Abschnitt Animation */
.special-animation-element {
    position: fixed;
    bottom: 150px; 
    width: 1100px;
    height: auto;
    z-index: 10;
    display: none; 
    pointer-events: none;
    will-change: left;
}

/* QUER-OBJEKT --- */
.cross-object {
    position: fixed;
    height: 180px; /* Größe nach Bedarf anpassen */
    width: auto;
    z-index: 13;    /* Zwischen Schaukel (12) und Blumen (15) */
    display: none;
    pointer-events: none;
    will-change: left, top;
}

/* Disco-Objekte */
.disco-object {
    position: fixed;
    height: 185px; /* Größe anpassen */
    width: auto;
    z-index: 12;    /* Hinter Blumen, vor Boden */
    display: none;
    pointer-events: none;
    will-change: left, top;
}

/* Noodle-Objekte */
.noodle-object {
    position: fixed;
    height: 210px; 
    width: auto;
    z-index: 20;
    display: none;
    pointer-events: none;
    will-change: left, top; /* top hinzugefügt */
}

/* Water-Objekte */
.water-object {
    position: fixed;
    height: 180px; 
    width: auto;
    z-index: 21;
    display: none;
    pointer-events: none;
    will-change: left, top; /* top hinzugefügt */
}

#gif, #abschnitt-animation, .flying-creature, .swing-object, .cross-object, .disco-object, .noodle-object, .water-object, .flower-img {
    will-change: transform;
    backface-visibility: hidden;
    perspective: 1000px;
}

.stats-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 250px !important;
    font-family: "Hanalei Fill", sans-serif;
    color: white;
    text-align: center;
    
    /* --- ÄNDERUNG: Höhere Positionierung --- */
    /* Erhöhe diesen Wert, um das Element weiter nach oben zu schieben */
    top: 40px !important; 
}

.skull-img {
    width: 150px;
    height: auto;
    margin-bottom: 20px;
}

.stats-text {
    font-size: 1.8rem;
    line-height: 0.8; 
    text-transform: uppercase;
    color: #ffffff;
    margin: 5px 0;
    /* Neu: Erstmal unsichtbar und weicher Übergang */
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

/* Hilfsklasse, die wir per JS hinzufügen */
.stats-active .stats-text {
    opacity: 1;
}

#end-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 2000; /* Höher als alles andere */
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    font-family: Verdana, Geneva, Tahoma, sans-serif;
}

#end-popup-button {
    background-color: #4A5EFF;
    color: white;
    font-family: "Hanalei Fill", sans-serif;
    font-size: 1.8rem;
    border: none;
    padding: 15px 40px;
    border-radius: 20px;
    cursor: pointer;
    margin-top: 20px;
}