:root {
    --font-pixel: 'Press Start 2P', cursive;
    --primary-color: #FAFAFA;
    --secondary-color: #1a1a1a;
    --accent-color: #4CAF50; /* Green accent */
}

body {
    background-color: var(--secondary-color);
    color: var(--primary-color);
    font-family: var(--font-pixel);
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
    overflow: hidden;
}

#wrapper {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

#game-container {
    width: 100%;
    max-width: 1000px;
    position: relative;
    background: #000;
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.4);
    border: 3px solid var(--primary-color);
    overflow: hidden;
}

#game-canvas {
    width: 100%;
    height: 100%;
    display: none;
    image-rendering: pixelated; /* Sharp pixels */
}

/* --- Bildschirme (Start, HoF, Game Over) --- */
.screen {
    position: absolute; top: 0; left: 0;
    width: 100%; height: 100%;
    display: none; flex-direction: column;
    justify-content: center; align-items: center;
    text-align: center; padding: 20px;
    box-sizing: border-box; background: rgba(10, 10, 10, 0.85);
    backdrop-filter: blur(5px); z-index: 10;
}
.screen.active { display: flex; }

.title {
    font-size: clamp(2rem, 10vw, 4rem);
    color: var(--accent-color);
    text-shadow: 4px 4px 0px #000;
    margin-bottom: 40px;
}

.btn {
    font-family: var(--font-pixel);
    font-size: clamp(1rem, 5vw, 1.5rem);
    background-color: var(--primary-color);
    color: var(--secondary-color);
    border: 3px solid var(--secondary-color);
    padding: 15px 30px; margin: 10px;
    cursor: pointer; transition: all 0.2s ease;
    box-shadow: 4px 4px 0px var(--secondary-color);
}
.btn:hover {
    background-color: var(--accent-color);
    color: var(--primary-color);
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0px var(--secondary-color);
}

#start-screen .character-preview {
    width: 100px; height: 118px;
    background-image: url('assets/majoo_sprites.png');
    background-size: 600% 100%; /* 6 frames */
    background-position: 0 0;
    margin-bottom: 30px;
    image-rendering: pixelated;
    animation: idle-preview 1s steps(4) infinite;
}

@keyframes idle-preview {
    from { background-position: 0 0; }
    to { background-position: -400px 0; } /* 4 * 100px preview width */
}

#hof-list-container {
    width: 80%; max-height: 50%; overflow-y: auto;
    background: rgba(0,0,0,0.5); border: 2px solid var(--primary-color);
    padding: 20px;
}
#hof-list {
    list-style: none; padding: 0; font-size: clamp(0.9rem, 4vw, 1.2rem);
    text-align: left;
}
#hof-list li { display: flex; justify-content: space-between; padding: 5px; }
#hof-list li:nth-child(odd) { background-color: rgba(255, 255, 255, 0.1); }
#hof-list li .name { text-transform: uppercase; }
#hof-list li .score { color: var(--accent-color); }

#game-over-screen p { font-size: 1.5rem; margin: 10px 0; }
#final-score { font-size: 3rem; color: var(--accent-color); margin-bottom: 20px; }
#initials-input {
    font-family: var(--font-pixel); text-transform: uppercase;
    background: #333; border: 2px solid var(--primary-color);
    color: var(--primary-color); padding: 10px;
    font-size: 1.5rem; width: 150px; text-align: center; margin: 10px 0;
}

#powerup-display {
    position: absolute;
    top: 20px;
    left: 20px;
    font-size: 3rem;
    text-shadow: 2px 2px 0 #000;
}

.hidden { display: none !important; }

/* --- MOBILE STEUERUNG --- */
#mobile-controls {
    display: none; /* Standardmäßig versteckt */
    width: 100%;
    flex-direction: row;
    justify-content: space-around;
    padding: 10px;
    box-sizing: border-box;
}

#mobile-controls button {
    font-family: var(--font-pixel);
    font-size: 1.5rem;
    padding: 20px;
    width: 45%;
    background-color: #333;
    color: white;
    border: 2px solid white;
    border-radius: 10px;
    -webkit-tap-highlight-color: transparent; /* Verhindert blauen Klick-Effekt */
}

/* --- QUERFORMAT (Landscape) --- */
@media (orientation: landscape) {
    #game-container {
        aspect-ratio: 16 / 9;
    }
}

/* --- HOCHFORMAT (Portrait) --- */
@media (orientation: portrait) {
    #wrapper {
        flex-direction: column;
        height: 100svh; /* Stellt sicher, dass die ganze Höhe genutzt wird */
    }
    #game-container {
        width: 100%;
        height: 70%; /* Spiel nimmt 70% der Höhe ein */
        max-width: none;
        border-left: none;
        border-right: none;
        flex-shrink: 0;
    }
    #mobile-controls {
        display: flex;
        height: 30%; /* Steuerung nimmt 30% der Höhe ein */
        align-items: center;
    }
}