:root {
    --bg-color: #f2f0ef;
    --card-bg: #ffffff;
    --text-color: #000000;
    --border-color: #000000;
    /* Hier wird dein Wolken-Icon als beweglicher Hintergrund geladen */
    --clouds-img: url('icons/bewoelkt.png'); 
}

/* --- HINTERGRUND-STEUERUNG FÜR ALLE BROWSER (Firefox/Safari Fix) --- */
html {
    background-color: var(--bg-color);
    transition: background-color 0.3s;
}

/* Wechselt die Hintergrundfarbe auf dem HTML-Element, wenn der Body im Nachtmodus ist */
html:has(body.night-mode) {
    background-color: #0a0e17;
}

/* Nachtmodus-Variablen für Boxen, Schriften und die Navigationsleiste */
body.night-mode {
    --bg-color: #0a0e17;     /* Damit die Navigationsleiste nachts ebenfalls dunkelblau wird */
    --card-bg: #111622;      
    --text-color: #ffffff;   
    --border-color: #ffffff; 
}

html, body {
    overflow-x: hidden;
    width: 100%;
}

body {
    /* WICHTIG: Body muss transparent sein, damit z-index: -1 auf allen Browsern klappt! */
    background-color: transparent; 
    
    color: var(--text-color);
    font-family: 'Press Start 2P', sans-serif; 
    margin: 0;
    padding: 0;
    transition: color 0.3s; 
}

/* HIER SIND DEINE DEZENTEN WOLKEN */
body::before {
    content: " ";
    display: block;
    position: absolute;
    top: 110px; 
    left: 0;
    width: 100%;
    height: 64px; 
    background-image: var(--clouds-img);
    background-repeat: repeat-x;
    opacity: 0.12; 
    z-index: -1; /* Liegt jetzt sicher vor dem HTML-Hintergrund, aber hinter dem Inhalt */
    pointer-events: none; 
    image-rendering: pixelated;
    animation: scrollClouds 180s linear infinite; 
}

/* Die Bewegung für deine Wolken */
@keyframes scrollClouds {
    from { background-position-x: 0; }
    to { background-position-x: 1000px; }
}

/* RETRO SCREEN-EFFEKT (CRT-Raster) */
body::after {
    content: " ";
    display: block;
    position: fixed;
    top: 0; left: 0; bottom: 0; right: 0;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.05) 50%), 
                linear-gradient(90deg, rgba(255, 0, 0, 0.02), rgba(0, 255, 0, 0.01), rgba(0, 0, 255, 0.02));
    background-size: 100% 4px, 6px 100%; 
    z-index: 9999; 
    pointer-events: none; 
}

/* --- NAVIGATIONSLEISTE --- */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    box-sizing: border-box;
    background-color: var(--bg-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
    border-bottom: 4px solid var(--border-color);
    z-index: 1000;
}

.logo {
    font-size: 1.7rem; 
    text-align: left;
    margin: 0;
}

.nav-links {
    list-style: none; 
    display: flex;
    gap: 30px;
    margin: 0;
    padding: 0;
}

.nav-links a {
    color: var(--text-color);
    text-decoration: none;
    font-size: 1rem; 
    transition: color 0.3s;
    padding-bottom: 4px;
}

.nav-links a:hover,
.nav-links a.current {
    border-bottom: 4px solid var(--border-color);
}

/* --- HAUPTINHALT --- */
main {
    display: flex;
    flex-direction: column;
    gap: 30px;
    width: 90%;
    max-width: 600px;
    margin: 140px auto 100px auto; /* 100px Abstand nach unten, damit Platz über dem Gras ist */
    box-sizing: border-box;
}

.weather-box {
    display: flex;
    align-items: center;
    background-color: var(--card-bg);
    border: 4px solid var(--border-color);
    padding: 30px;
    gap: 35px;
}

.weather-icon {
    width: 144px;
    height: 144px;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

.weather-data {
    display: flex;
    flex-direction: column;
}

.temperature {
    font-size: 3.5rem;
    font-weight: bold;
    margin-bottom: 15px;
}

.condition-text {
    font-size: 1.1rem;
    font-weight: bold;
    margin-bottom: 15px;
    line-height: 1.4;
}

.details {
    font-size: 0.95rem;
    line-height: 1.8;
}

/* --- VORHERSAGE --- */
.info-box {
    background-color: var(--card-bg);
    border: 4px solid var(--border-color);
    padding: 30px;
}

.info-box h2 {
    font-size: 1.4rem;
    margin-top: 0;
    margin-bottom: 25px;
}

.forecast-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.forecast-item {
    display: flex;
    align-items: center;
    background-color: var(--card-bg);
    border: 3px solid var(--border-color); 
    padding: 15px;
    gap: 20px;
}

.forecast-icon {
    width: 64px; 
    height: 64px;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

.forecast-text {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.forecast-text .day {
    font-weight: bold;
    font-size: 1rem;
}

.forecast-text .condition {
    font-size: 0.8rem;
}

/* --- FOOTER & GRAS --- */
.footer {
    position: relative; 
    width: 100%;
    border-top: 4px solid var(--border-color);
    text-align: center;
    padding: 20px 0;
    font-size: 0.8rem;
    background-color: var(--bg-color);
    box-sizing: border-box;
}

.footer p {
    margin: 10px 0;
    line-height: 1.5;
}

.footer a {
    color: var(--text-color);
    text-decoration: underline;
}

.footer a:hover {
    text-decoration: none;
}

#grass-container {
    width: 100%;
    height: 192px; 
    display: flex;
    align-items: flex-end; /* Drückt das Gras auf die Linie */
    overflow: hidden;
    pointer-events: none; 
}

.grass-tile {
    width: 192px;  
    height: 192px; 
    display: block; 
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    flex-shrink: 0; 
}

/* Gras im Nachtmodus abdunkeln */
body.night-mode #grass-container {
    filter: brightness(0.25) contrast(1.2); 
}

/* --- INFO.HTML SPEZIFISCHES DESIGN --- */
.info-body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    box-sizing: border-box;
    padding: 40px 20px;
}

.info-card {
    background-color: var(--card-bg);
    border: 6px solid var(--border-color);
    box-shadow: 12px 12px 0px var(--border-color);
    max-width: 650px;
    width: 100%;
    padding: 40px;
    margin: 140px auto 60px auto; 
    display: block;
}

.back-button {
    display: inline-block;
    text-decoration: none;
    margin-bottom: 30px;
    transition: transform 0.1s ease;
}

.back-button:hover {
    transform: translateX(-6px);
}

.back-button img {
    width: 48px;
    height: auto;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

/* Schützt den Zurück-Pfeil und die Email vor dem Unsichtbarwerden im Nachtmodus */
body.night-mode .back-button img,
body.night-mode .email-icon {
    filter: invert(1);
}

.info-title {
    font-size: 1.6rem;
    margin-top: 0;
    margin-bottom: 30px;
    line-height: 1.4;
}

.info-content p {
    font-size: 0.85rem;
    line-height: 1.8;
    margin-bottom: 25px;
}

.content-link {
    color: var(--text-color);
    text-decoration: none;
    border-bottom: 3px solid var(--border-color);
    padding-bottom: 2px;
}

.content-link:hover {
    border-bottom: 5px solid var(--border-color);
}

.station-image {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    border: 4px solid var(--border-color);
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    margin: 30px 0;
}

.info-content h3 {
    font-size: 1.1rem;
    margin-top: 40px;
    margin-bottom: 20px;
}

.email-link {
    display: inline-flex;
    align-items: center;
    gap: 15px;
    text-decoration: none;
    color: var(--text-color);
    transition: transform 0.1s ease;
}

.email-link:hover {
    transform: translateX(6px);
}

.email-link:hover .email-text {
    border-bottom: 4px solid var(--border-color);
}

.email-icon {
    width: 32px;
    height: auto;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

.email-text {
    font-size: 0.85rem;
    padding-bottom: 3px;
    border-bottom: 2px solid transparent;
    transition: border-color 0.1s ease;
}

.wäsche {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.wäsche-title {
    font-size: 1.3rem;
    margin: 0;
}

.wäsche-content {
    font-size: 0.9rem;
    line-height: 1.5;
}

/* --- HANDY DESIGN (Reaktionsfähigkeit) --- */
@media (max-width: 1050px) {
    .navbar {
        flex-direction: column;
        gap: 20px;
        padding: 20px;
    }
    
    main {
        margin-top: 220px;
        width: 90%;
    }

    .weather-box {
        flex-direction: column;
        text-align: center;
    }
    
    .nav-links {
        gap: 15px;
        flex-wrap: wrap;
        justify-content: center;
    }
}