/* =========================================
   0. LOKALE SCHRIFTARTEN (DSGVO Konform)
   ========================================= */
/* press-start-2p-regular - latin */
@font-face {
    font-display: swap; /* Zeigt Text sofort an (Fallback), bis Schrift geladen ist */
    font-family: 'Press Start 2P';
    font-style: normal;
    font-weight: 400;
    src: url('assets/fonts/press-start-2p-v16-latin-regular.woff2') format('woff2'),
    url('assets/fonts/press-start-2p-v16-latin-regular.woff') format('woff');
}



body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    background-color: #1a1a1a;
    color: white;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: 'Press Start 2P', cursive;
    font-size: 14px;
}

#game-container {
    position: relative;
    box-shadow: 0 0 50px rgba(0,0,0,0.8);
    border: 4px solid #444;
    background: #000;
    display: flex;
    overflow: hidden;
}

canvas {
    display: block;
    width: 100%;
    height: 100%;
    background-color: #f0f0f0;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

/* =========================================
   2. UI & SCORE
   ========================================= */
#ui-layer {
    position: absolute;
    top: 25px;
    right: 25px;
    color: #333;
    font-size: 24px;
    font-weight: bold;
    pointer-events: none;
    text-shadow: 2px 2px 0px rgba(255,255,255,0.8);
    z-index: 5;
}

/* =========================================
   3. OVERLAYS (Start, Game Over)
   ========================================= */
#startScreen, #gameOverScreen {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
    box-sizing: border-box;
    padding: 20px;
}

h1 {
    font-size: 32px;
    color: #ff4444;
    text-shadow: 4px 4px 0px #000;
    line-height: 1.4;
    margin: 10px 0 25px 0;
    text-align: center;
    text-transform: uppercase;
}

#inputSection {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin: 15px 0;
}

/* =========================================
   4. START SCREEN LAYOUT
   ========================================= */
#startScreen {
    flex-direction: row;
    gap: 40px;
}

.start-left {
    flex: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    max-width: 60%;
}

.start-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    max-width: 35%;
}

/* =========================================
   5. GAME OVER SCREEN
   ========================================= */
#gameOverScreen {
    flex-direction: column !important;
    gap: 15px;
}

#leaderboard {
    margin-top: 10px;
    font-size: 12px;
    width: 90%;
    max-width: 450px;
    background: rgba(0,0,0,0.5);
    padding: 15px;
    border: 2px solid #666;
    max-height: 200px;
    overflow-y: auto;
}

/* =========================================
   6. HALL OF FAME BOX
   ========================================= */
.hall-of-fame-box {
    background: rgba(0, 0, 0, 0.6);
    border: 4px solid #ffcc00;
    padding: 15px;
    width: 100%;
    max-height: 300px;
    overflow-y: auto;
    box-shadow: 0 0 15px rgba(255, 204, 0, 0.1);
}

.hall-of-fame-box h3 {
    color: #ffcc00;
    text-align: center;
    margin-top: 0;
    margin-bottom: 10px;
    border-bottom: 2px solid #555;
    padding-bottom: 8px;
    font-size: 14px;
}

.hof-entry {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px dotted #444;
    font-size: 11px;
    font-family: sans-serif;
    color: #ddd;
    line-height: 1.4;
}
.hof-rank { color: #ffcc00; font-weight: bold; margin-right: 8px; }
.hof-score { color: white; font-weight: bold; }

/* =========================================
   7. BUTTONS & INPUTS
   ========================================= */
button {
    font-family: 'Press Start 2P', cursive;
    background: #ffcc00;
    border: 4px solid #fff;
    padding: 18px 30px;
    font-size: 18px;
    cursor: pointer;
    color: #000;
    box-shadow: 0 6px 0 #997a00;
    text-transform: uppercase;
    margin: 12px;
}
button:active { transform: translateY(4px); box-shadow: 0 1px 0 #997a00; }
button:disabled { background: #555; color: #888; box-shadow: none; }

input {
    font-family: 'Press Start 2P', cursive;
    padding: 12px;
    font-size: 16px;
    border: 3px solid white;
    background: #222;
    color: white;
    text-align: center;
    margin-bottom: 15px;
    width: 250px;
    outline: none;
}

/* =========================================
   8. INFO BOXEN
   ========================================= */
.info-box {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid #555;
    padding: 12px;
    margin: 8px 0;
    width: 100%;
    max-width: 320px;
    text-align: left;
    box-sizing: border-box;
}
.info-box p {
    font-family: sans-serif;
    font-size: 14px;
    color: #ccc;
    line-height: 1.4;
    margin: 0;
}
.info-title {
    color: #ffcc00;
    font-size: 12px;
    margin-bottom: 6px;
    text-align: center;
    text-decoration: underline;
}

/* =========================================
   9. RECHTLICHES
   ========================================= */
.legal-bar {
    margin-top: 20px;
    display: flex;
    gap: 15px;
}
.legal-btn {
    font-size: 10px;
    padding: 8px 12px;
    margin: 0;
    background: transparent;
    border: 1px solid #666;
    color: #888;
    box-shadow: none;
}
.legal-btn:hover { background: #333; color: white; border-color: white; }

.modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.95);
    z-index: 999;
    align-items: center;
    justify-content: center;
}
.modal-content {
    background: #222;
    border: 4px solid #fff;
    padding: 30px;
    width: 80%;
    max-width: 600px;
    max-height: 80%;
    overflow-y: auto;
    color: #ccc;
    font-family: sans-serif;
    text-align: left;
    position: relative;
    font-size: 16px;
    line-height: 1.6;
}
.modal-content h2 { color: #ffcc00; font-family: 'Press Start 2P'; margin-top: 0; font-size: 20px; }
.close-modal {
    position: absolute;
    top: 10px; right: 10px;
    background: #ff4444; border: 2px solid white;
    width: 35px; height: 35px;
    font-size: 16px;
    line-height: 30px;
    margin: 0; padding: 0;
    box-shadow: none;
}

/* =========================================
   10. PC / DESKTOP SPEZIAL
   ========================================= */
@media (min-width: 1024px) {
    h1 { font-size: 48px; margin-bottom: 40px; }
    button { font-size: 22px; padding: 20px 40px; }
    input { width: 350px; font-size: 20px; padding: 15px; }
    .info-box { max-width: 500px; }
    .info-box p { font-size: 16px; }
    .info-title { font-size: 14px; }
    .hall-of-fame-box { max-height: 400px; }
    .hof-entry { font-size: 14px; padding: 8px 0; }
    .hall-of-fame-box h3 { font-size: 18px; margin-bottom: 15px; }
}

/* =========================================
   11. MOBILE LANDSCAPE FIX (Kritisch!)
   ========================================= */
@media (max-height: 500px) {
    #startScreen {
        flex-direction: row;
        align-items: center;
        justify-content: center;
        gap: 20px;
        padding: 10px;
        overflow-y: auto;
    }
    .start-left {
        width: 45%; max-width: none;
        align-items: center; text-align: center; margin: 0;
    }
    .start-right {
        width: 45%; max-width: none; height: auto; margin: 0;
    }
    h1 { font-size: 18px; margin: 0 0 10px 0; line-height: 1.2; }
    .info-box { display: none; }
    .legal-bar { margin-top: 5px; }
    button { padding: 8px 12px; font-size: 10px; margin: 5px; }
    .hall-of-fame-box { max-height: 180px; }
    .hall-of-fame-box h3 { font-size: 10px; margin-bottom: 5px; }
    .hof-entry { padding: 2px 0; font-size: 8px; }
    #gameOverScreen { justify-content: center; align-items: center; padding-top: 0; }
    #inputSection { margin: 5px 0; }
    input { padding: 5px; font-size: 12px; width: 150px; margin-bottom: 5px; }
    #leaderboard { max-height: 100px; padding: 5px; margin-top: 5px; }
}

/* =========================================
   12. ROTATE OVERLAY
   ========================================= */
#rotate-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: #222;
    z-index: 9999;
    color: white;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}
.icon { font-size: 60px; margin-bottom: 20px; }

/* HIER IST DIE ÄNDERUNG: Gilt jetzt IMMER bei Hochformat */
@media screen and (orientation: portrait) {
    #rotate-overlay { display: flex; }
    #game-container { display: none !important; }
}

/* ... bestehende Styles ... */

#mute-btn {
    position: fixed;
    top: 10px;
    left: 10px;
    z-index: 100; /* Über allem */
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid #555;
    color: white;
    font-size: 20px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    padding: 0;
    margin: 0; /* Override default button margin */
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 10px rgba(0,0,0,0.5);
}

#mute-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: white;
}