/* ===== RESPONSIVE TOP-POSITIONING ===== */
/* Löst das Problem: grüner Balken bei niedrigen Bildschirmen */

@media (min-width: 1024px) and (max-height: 600px) {

    .container {
		transform: translateX(-20px);
    }
    
    .scroll-container,
    .second-scroll-container,
    .third-scroll-container,
    .fourth-scroll-container,
    .sixth-scroll-container,
    .seventh-scroll-container {
        top: 35% !important;
    }
    
    .fifth-scroll-container {
		top: 70% !important;
	}
    
    .eighth-scroll-container { 
		top: 0% !important; 
    }
   
    .sixth-scroll-container,
    .seventh-scroll-container {
        left: 20% !important;
    }
}

/* ===== GLOBAL TOUCH EVENT OPTIMIERUNGEN ===== */
/* Verhindert eckige Kästen bei Touch-Events auf allen Elementen */

* {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    tap-highlight-color: transparent;
}

/* Zusätzliche Touch-Optimierungen für interaktive Elemente */
button, 
.butterfly, 
.memory-orb,
.seedling-element,
.mushroom,
[data-clickable="true"],
[onclick] {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    outline: none;
}

/* ===== LANGUAGE OVERLAY RESPONSIVE FIXES ===== */
/* Sanfte Anpassungen für kleine Bildschirmhöhen */

/* Mittlere Bildschirmhöhen (unter 700px) - leichte Komprimierung */
@media (min-width: 1024px) and (max-height: 700px) {
    #language-selection-overlay {
        padding-top: 20px;
        padding-bottom: 40px;
    }
    
    .start-seal {
        width: 100px;
        height: 100px;
        min-width: 100px;
        min-height: 100px;
        font-size: 50px;
        margin-top: -20px;
        margin-bottom: 30px;
    }
    
    .start-seal::after {
        width: 120px;
        height: 120px;
        min-width: 120px;
        min-height: 120px;
    }
    
    .start-title {
        font-size: 42px;
        margin-bottom: 12px;
    }
    
    .start-subtitle {
        font-size: 22px;
        margin-bottom: 25px;
    }
    
    .start-description {
        font-size: 17px;
        margin-bottom: 25px;
        line-height: 1.8;
    }
    
    .language-selection {
        gap: 25px;
    }
}

/* Kleine Bildschirmhöhen (unter 600px) - moderate Komprimierung */
@media (min-width: 1024px) and (max-height: 600px) {
    #language-selection-overlay {
        padding-top: 15px;
        padding-bottom: 30px;
        justify-content: center;
    }
    
    .start-seal {
        width: 90px;
        height: 90px;
        min-width: 90px;
        min-height: 90px;
        font-size: 45px;
        margin-top: -30px;
        margin-bottom: 25px;
    }
    
    .start-seal::after {
        width: 110px;
        height: 110px;
        min-width: 110px;
        min-height: 110px;
    }
    
    .start-title {
        font-size: 38px;
        margin-bottom: 10px;
    }
    
    .start-subtitle {
        font-size: 20px;
        margin-bottom: 20px;
    }
    
    .start-description {
        font-size: 16px;
        margin-bottom: 20px;
        line-height: 1.7;
    }
    
    .language-selection {
        gap: 20px;
    }
    
    .language-instruction {
        font-size: 18px;
    }
    
    .start-journey-button {
        padding: 12px 25px;
        font-size: 18px;
    }
}

/* Sehr kleine Bildschirmhöhen (unter 500px) - stärkere Komprimierung aber immer noch lesbar */
@media (min-width: 1024px) and (max-height: 500px) {
    #language-selection-overlay {
        padding-top: 10px;
        padding-bottom: 20px;
        overflow-y: auto;
    }
    
    .start-seal {
        width: 80px;
        height: 80px;
        min-width: 80px;
        min-height: 80px;
        font-size: 40px;
        margin-top: -40px;
        margin-bottom: 20px;
    }
    
    .start-seal::after {
        width: 100px;
        height: 100px;
        min-width: 100px;
        min-height: 100px;
    }
    
    .start-title {
        font-size: 32px;
        margin-bottom: 8px;
    }
    
    .start-subtitle {
        font-size: 18px;
        margin-bottom: 15px;
    }
    
    .start-description {
        font-size: 15px;
        margin-bottom: 15px;
        line-height: 1.6;
    }
    
    .language-selection {
        gap: 15px;
    }
    
    .language-instruction {
        font-size: 16px;
    }
    
    .language-button {
        padding: 15px 30px;
        font-size: 16px;
    }
    
    .start-journey-button {
        padding: 10px 20px;
        font-size: 16px;
    }
}

/* ===== END SCREEN OVERLAY RESPONSIVE FIXES ===== */
/* Analoge Anpassungen zum Language Overlay */

/* Mittlere Bildschirmhöhen (unter 700px) - leichte Komprimierung */
@media (min-width: 1024px) and (max-height: 700px) {
    #end-screen-overlay {
        padding-top: 20px;
        padding-bottom: 40px;
    }
    
    .end-seal {
        width: 80px;
        height: 80px;
        margin-bottom: 30px;
    }
    
    .end-seal::before {
        font-size: 35px;
    }
    
    .inner-glow {
        width: 100px;
        height: 100px;
    }
    
    .end-title {
        font-size: 36px;
        margin-bottom: 12px;
    }
    
    .end-subtitle {
        font-size: 20px;
        margin-bottom: 18px;
    }
    
    .end-description {
        font-size: 16px;
        margin-bottom: 40px;
    }
    
    .restart-instruction {
        font-size: 18px;
        margin-bottom: 8px;
    }
    
    .main-restart-button {
        padding: 15px 30px;
        font-size: 18px;
    }
    
	.language-button {
        padding: 15px 30px;
        font-size: 16px;
        min-width: 120px;
    }
    
    .language-flag {
        font-size: 20px;
        margin-bottom: 3px;
    }
}

/* Kleine Bildschirmhöhen (unter 600px) - moderate Komprimierung */
@media (min-width: 1024px) and (max-height: 600px) {
    #end-screen-overlay {
        padding-top: 15px;
        padding-bottom: 30px;
        justify-content: center;
    }
    
    .end-screen-content {
        padding: 30px;
    }
    
    .end-seal {
        width: 70px;
        height: 70px;
        margin-bottom: 25px;
    }
    
    .end-seal::before {
        font-size: 30px;
    }
    
    .inner-glow {
        width: 90px;
        height: 90px;
    }
    
    .end-title {
        font-size: 32px;
        margin-bottom: 10px;
    }
    
    .end-subtitle {
        font-size: 18px;
        margin-bottom: 15px;
    }
    
    .end-description {
        font-size: 15px;
        margin-bottom: 35px;
    }
    
    .restart-instruction {
        font-size: 16px;
        margin-bottom: 8px;
    }
    
    .main-restart-button {
        padding: 12px 25px;
        font-size: 16px;
    }
    
	.language-button {
        padding: 12px 25px;
        font-size: 15px;
        min-width: 110px;
    }
    
    .language-flag {
        font-size: 18px;
        margin-bottom: 2px;
    }
    
    .language-buttons {
        gap: 20px;
    }
}

/* Sehr kleine Bildschirmhöhen (unter 500px) - stärkere Komprimierung */
@media (min-width: 1024px) and (max-height: 500px) {
    #end-screen-overlay {
        padding-top: 10px;
        padding-bottom: 20px;
        overflow-y: auto;
    }
    
    .end-screen-content {
        padding: 20px;
    }
    
    .end-seal {
        width: 60px;
        height: 60px;
        margin-bottom: 20px;
    }
    
    .end-seal::before {
        font-size: 25px;
    }
    
    .inner-glow {
        width: 80px;
        height: 80px;
    }
    
    .end-title {
        font-size: 28px;
        margin-bottom: 8px;
    }
    
    .end-subtitle {
        font-size: 16px;
        margin-bottom: 12px;
    }
    
    .end-description {
        font-size: 14px;
        margin-bottom: 25px;
    }
    
    .restart-instruction {
        font-size: 14px;
        margin-bottom: 5px;
    }
    
    .main-restart-button {
        padding: 10px 20px;
        font-size: 14px;
    }
    
    .exit-hint {
        font-size: 12px;
        bottom: 15px;
    }
    
	.language-button {
        padding: 10px 20px;
        font-size: 14px;
        min-width: 100px;
    }
    
    .language-flag {
        font-size: 16px;
        margin-bottom: 2px;
    }
    
    .language-buttons {
        gap: 15px;
    }
}

/* ===== SECHSTE SCHRIFTROLLE - RESPONSIVE ANPASSUNG ===== */
/* Länger und schmaler auf kleinen Screens, damit Blume nicht überdeckt wird */

@media (max-height: 700px) {   
    .sixth-scroll {
        width: 580px !important; /* Schmalere Schriftrolle */
    }
}

/* ===== MUSHROOM RESPONSIVE POSITIONING ===== */
/* Für schmale Desktop-Bildschirme (knapp über 1024px) */
@media (min-width: 1024px) and (max-width: 1200px) {
    .mushroom-container {
        left: 5% !important;
    }
}
