/* 1. Grund-Setup: Grauer Hintergrund außerhalb des Containers */
html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    width: 100%;
    overflow: hidden;
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: #4a4a4a; 
    display: flex;
    justify-content: center;
    align-items: center;
}

/* 2. Der Haupt-Container mit 10px Rand */
.container {
    display: flex;
    flex-direction: column;
    width: 95vw;
    height: 95vh;
    background-color: #000;
    border: 10px solid #222; 
    box-shadow: 0 20px 50px rgba(0,0,0,0.6);
    box-sizing: border-box;
}

/* 3. Header-Bereich */
.header-content {
    padding: 12px 25px;
    background-color: #1a1a1a;
    color: #eee;
    border-bottom: 2px solid #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.header-left h1 {
    margin: 0;
    font-size: 1.1rem;
    color: #00ffcc;
    letter-spacing: 1px;
}

.header-left p {
    margin: 4px 0 0 0;
    font-size: 0.85rem;
    color: #888;
}

/* 4. Steuerelemente */
.header-controls {
    display: flex;
    gap: 15px;
    align-items: center;
}

.header-controls label {
    font-size: 0.85rem;
    color: #bbb;
}

.header-controls input {
    width: 50px;
    background: #222;
    border: 1px solid #444;
    color: #00ffcc;
    padding: 4px;
    border-radius: 3px;
    text-align: center;
    font-weight: bold;
}

.header-controls button {
    padding: 6px 14px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: bold;
}

.btn-restart { background-color: #00ffcc; color: #000; }
.btn-exit { background-color: #ff4444; color: #fff; }

/* 5. Wrapper für die 20px Margin zum Canvas */
#wrapper {
    flex-grow: 1;
    padding: 20px; 
    box-sizing: border-box;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #050505;
    overflow: hidden;
}

/* 6. Das Canvas */
#canvas {
    display: block;
    background-image: url('/assets/img/background.jpg'); 
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-color: transparent; 
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.8);
}

/* 7. Mini-Impressum Styling (Optimierte Lesbarkeit) */
.mini-impressum {
    padding: 8px 25px;
    background-color: #111;
    color: #aaa; /* Helleres Grau für bessere Lesbarkeit */
    font-size: 0.75rem;
    border-top: 1px solid #222;
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-shrink: 0;
}

.mini-impressum a {
    color: #ccc; /* Links noch etwas deutlicher */
    text-decoration: none;
    transition: color 0.2s;
}

.mini-impressum a:hover {
    color: #fff; /* Reinweiß beim Hover für maximale Klarheit */
}

.mini-impressum .separator {
    color: #444; /* Trenner bleibt dezent */
}

/* 8. IDs für die Anzeige */
#steps, #duration {
    color: #00ffcc;
    font-weight: bold;
    font-family: 'Courier New', monospace;
}

.impressum-box {
    background-color: #1a1a1a;
    border: 2px solid #00ffcc;
    padding: 30px;
    border-radius: 8px;
    text-align: center;
    color: #eee;
    max-width: 400px;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.9), 0 0 20px rgba(0, 255, 204, 0.3);
    cursor: default; /* Zeiger innerhalb der Box normal lassen */
}

.overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(3px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    cursor: pointer; /* Zeigt dem Nutzer, dass er hier klicken kann */
}

.impressum-box h3 {
    margin-top: 0;
    color: #00ffcc;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.impressum-box p {
    line-height: 1.6;
    margin: 10px 0;
}

.impressum-box a {
    color: #00ffcc;
    text-decoration: none;
}

/* Schließen-Button in der Box */
.btn-close {
    margin-top: 20px;
    background-color: #333;
    color: #eee;
    border: none;
    padding: 8px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.2s;
}

.btn-close:hover {
    background-color: #444;
}

/* Spezifische Styles für die Info-Box */
.info-box {
    background-color: #1a1a1a;
    border: 2px solid #00ffcc;
    padding: 30px;
    border-radius: 8px;
    color: #eee;
    max-width: 500px; /* Etwas breiter als das Impressum */
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.9), 0 0 20px rgba(0, 255, 204, 0.3);
    text-align: left; /* Text linksbündig für bessere Lesbarkeit */
}

.info-box h3 {
    text-align: center;
    color: #00ffcc;
    margin-top: 0;
}

.info-links h4 {
    margin-bottom: 10px;
    color: #00ffcc;
    font-size: 0.9rem;
}

.info-links ul {
    list-style: none;
    padding: 0;
}

.info-links li {
    margin-bottom: 8px;
}

.info-links a {
    color: #fff;
    text-decoration: underline;
    transition: color 0.2s;
}

.info-links a:hover {
    color: #00ffcc;
}

.ai-story p {
    font-style: italic;
    color: #ddd;
}

/* Grundstruktur des Headers (Flexbox) */
header {
    display: flex;
    flex-wrap: wrap; /* Erlaubt Umbruch auf Handys */
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    background: #111;
    border-bottom: 1px solid #222;
}

/* Optimierung für Smartphones (max 600px Breite) */
@media (max-width: 600px) {
    header {
        flex-direction: column; /* Stapelt Titel und Steuerung untereinander */
        align-items: flex-start;
        gap: 15px;
    }

    .header-left h1 {
        font-size: 1.2rem; /* Titel etwas kleiner */
    }

    .header-controls {
        display: grid; /* Nutzt ein Raster für die Eingabefelder */
        grid-template-columns: 1fr 1fr; /* Zwei Spalten nebeneinander */
        gap: 10px;
        width: 100%;
    }

    /* Damit die Buttons die volle Breite nutzen */
    .btn-restart, .btn-exit {
        grid-column: span 1; 
        width: 100%;
        padding: 10px;
    }

    /* Labels und Inputs sauber ausrichten */
    .header-controls label {
        font-size: 0.8rem;
        align-self: center;
    }

    .header-controls input {
        width: 100% !important;
        box-sizing: border-box;
    }

    /* Das Overlay braucht Padding, damit die Box nicht am Rand klebt */
    .overlay {
        padding: 20px;
        box-sizing: border-box;
        align-items: center; /* Zentriert die Box vertikal */
    }

    /* Die Boxen selbst */
    .impressum-box, .info-box {
        width: 100%;
        max-height: 85vh; /* Verhindert, dass die Box höher als der Screen wird */
        overflow-y: auto; /* Erlaubt Scrollen innerhalb der Box, falls Text zu lang ist */
        padding: 20px;
        margin: 0;
        font-size: 0.9rem;
        box-sizing: border-box;
        border-width: 1px; /* Etwas feinerer Rand auf kleinen Screens */
    }

    /* Damit Links und Texte nicht umbrechen/quetschen */
    .info-box h3, .impressum-box h3 {
        font-size: 1.1rem;
        margin-bottom: 15px;
    }

    .ai-story {
        padding: 10px;
        font-size: 0.8rem;
    }
}