/**
 * QuizTreff Winter: Winternacht nach der Vorschau vom 03.11.2026, gebaut wie
 * das Halloween-Design (halloween.css). Aktiv über data-season="winter" auf
 * <html> (includes/season.php, templates/header.php).
 *
 * Die Marke bleibt: Pink und Violett sind weiter die Bedienfarben. Die Saison
 * bringt die gemalte Winternacht mit Schloss und Dorf in den Hero der
 * Startseite, den verschneiten Boden mit Laternen in den Fußbereich, dunkles
 * Glas für Navigation und Karten und warmes Kerzenlicht in Gold und Bernstein.
 * Farben und Licht folgen „Die verlorene Weihnacht“ (Nachtblau, Eisblau,
 * Gold, Bernstein). Die feste Ebene hinter der Seite (Nacht, Licht,
 * Schneedunst, Schneeeule) steht in season-layer.css, der Schneefall kommt aus
 * assets/js/snow.js.
 */

html[data-season="winter"] {
    color-scheme: dark;

    --wi-bg-0: #050a16;
    --wi-bg-1: #08122a;
    --wi-bg-2: #0d1b36;
    --wi-ice: #9fc6e8;
    --wi-moon: #d6e4ff;
    --wi-gold: #e8b65a;
    --wi-amber: #f2b544;
    --wi-fir: #1f5132;
    --wi-glass: rgba(9, 17, 36, 0.72);
    --wi-line: rgba(159, 198, 232, 0.16);
    --wi-line-warm: rgba(232, 182, 90, 0.26);

    /* Saison-Tokens, die andere Dateien lesen */
    --season-accent: var(--wi-gold);
    --season-glow: rgba(242, 181, 68, 0.26);
    --season-border: var(--wi-line-warm);

    overflow-x: clip;
}

html[data-season="winter"] body {
    background:
        radial-gradient(1100px 700px at 15% 40%, rgba(124, 58, 237, 0.08), transparent 70%),
        radial-gradient(900px 600px at 85% 60%, rgba(159, 198, 232, 0.06), transparent 70%),
        linear-gradient(180deg, var(--wi-bg-0) 0%, var(--wi-bg-1) 30%, var(--wi-bg-2) 70%, var(--wi-bg-1) 100%);
    background-attachment: fixed;
    min-height: 100vh;
}

/* Navigation: dunkles Glas und eine feine Lichtkante, links mondkalt,
   rechts kerzenwarm */
html[data-season="winter"] body > header {
    background: rgba(5, 10, 22, 0.74) !important;
    border-bottom-color: rgba(255, 255, 255, 0.06) !important;
    box-shadow: 0 1px 0 rgba(232, 182, 90, 0.12), 0 10px 30px rgba(0, 0, 0, 0.35);
}

html[data-season="winter"] body > header::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 1px;
    pointer-events: none;
    background: linear-gradient(90deg, transparent, rgba(214, 228, 255, 0.35) 25%, rgba(160, 107, 255, 0.3) 50%, rgba(232, 182, 90, 0.45) 75%, transparent);
}

/* Karten: dunkles Glas mit kühlem Saum, beim Überfahren warm */
html[data-season="winter"] main .rounded-2xl[class*="border"],
html[data-season="winter"] main .rounded-xl[class*="border"] {
    border-color: var(--wi-line);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

html[data-season="winter"] main .rounded-2xl[class*="border"]:hover,
html[data-season="winter"] main .rounded-xl[class*="border"]:hover {
    border-color: rgba(232, 182, 90, 0.38);
}

/* Hauptschaltflächen: Markenverlauf bleibt, dazu warmes Glühen */
html[data-season="winter"] .qt-btn-primary,
html[data-season="winter"] .qt-cta-primary,
html[data-season="winter"] [class*="from-qtPink"][class*="to-qtPurple"] {
    box-shadow: 0 8px 26px rgba(255, 79, 216, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

html[data-season="winter"] .qt-btn-primary:hover,
html[data-season="winter"] .qt-cta-primary:hover,
html[data-season="winter"] [class*="from-qtPink"][class*="to-qtPurple"]:hover {
    box-shadow: 0 10px 34px rgba(255, 79, 216, 0.36), 0 0 0 1px rgba(232, 182, 90, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

html[data-season="winter"] :focus-visible {
    outline: 2px solid var(--wi-gold);
    outline-offset: 2px;
}

html[data-season="winter"] main h1 {
    text-shadow: 0 0 28px rgba(214, 228, 255, 0.16);
}

html[data-season="winter"] ::selection {
    background: rgba(232, 182, 90, 0.35);
    color: #fff;
}

/* ---------- Startseite: die gemalte Winternacht im Hero ---------- */

/* Szene und Lesbarkeitsverlauf liegen zusammen im ::before. Unten blendet die
   Maske weich aus, darunter liegt die feste Hintergrundszene. */
html[data-season="winter"] .landing-hero::before {
    background:
        linear-gradient(90deg, rgba(5, 10, 22, 0.88) 0%, rgba(5, 10, 22, 0.66) 32%, rgba(5, 10, 22, 0.15) 62%, rgba(5, 10, 22, 0.05) 100%),
        linear-gradient(180deg, rgba(5, 10, 22, 0.35) 0%, transparent 25%),
        url("../../assets/seasons/winter/v2/night-960.webp") 70% 20% / cover no-repeat,
        #08122a;
    -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 55%, transparent 100%);
            mask-image: linear-gradient(180deg, #000 0%, #000 55%, transparent 100%);
    animation: qt-wi-breathe 30s ease-in-out infinite alternate;
}

@media (min-width: 1200px) {
    html[data-season="winter"] .landing-hero::before {
        background:
            linear-gradient(90deg, rgba(5, 10, 22, 0.88) 0%, rgba(5, 10, 22, 0.66) 32%, rgba(5, 10, 22, 0.15) 62%, rgba(5, 10, 22, 0.05) 100%),
            linear-gradient(180deg, rgba(5, 10, 22, 0.35) 0%, transparent 25%),
            url("../../assets/seasons/winter/v2/night-1920.webp") 70% 20% / cover no-repeat,
            #08122a;
    }
}

/* Schmale Bildschirme: Text steht mittig über der Szene, also von oben
   nach unten abdunkeln statt von links */
@media (max-width: 1023px) {
    html[data-season="winter"] .landing-hero::before {
        background:
            linear-gradient(180deg, rgba(5, 10, 22, 0.5) 0%, rgba(5, 10, 22, 0.72) 45%, rgba(5, 10, 22, 0.6) 80%, transparent 100%),
            url("../../assets/seasons/winter/v2/night-960.webp") 78% 40% / cover no-repeat,
            #08122a;
        animation: none;
    }
}

@keyframes qt-wi-breathe {
    from { background-position: 0 0, 0 0, 70% 20%, 0 0; }
    to { background-position: 0 0, 0 0, 70% 16%, 0 0; }
}

/* Ein Winterlicht schwebt über dem Dorf, nur auf breiten Bildschirmen */
@media (min-width: 1024px) {
    html[data-season="winter"] .landing-hero::after {
        content: "";
        position: absolute;
        z-index: 0;
        right: 9%;
        top: 58%;
        width: 54px;
        height: 54px;
        pointer-events: none;
        background: url("../../assets/seasons/winter/v2/light-orb.webp") center / contain no-repeat;
        opacity: 0.55;
        filter: drop-shadow(0 0 22px rgba(242, 181, 68, 0.55));
        animation: qt-wi-orb 18s ease-in-out infinite;
    }
}

@keyframes qt-wi-orb {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(-12px, -14px); }
}

/* ---------- Fußbereich: der verschneite Boden mit Laternen ---------- */
html[data-season="winter"] #qt-footer {
    position: relative;
    isolation: isolate;
    padding-top: 220px;
    padding-bottom: 28px;
    background: transparent;
    border-top-color: transparent;
}

html[data-season="winter"] #qt-footer::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        linear-gradient(180deg, transparent 0%, rgba(8, 18, 42, 0.25) 26%, rgba(5, 10, 22, 0.05) 52%, rgba(5, 10, 22, 0.45) 82%, rgba(5, 10, 22, 0.8) 100%),
        url("../../assets/seasons/winter/v2/ground-960.webp") 50% 85% / cover no-repeat;
    -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 30%);
            mask-image: linear-gradient(180deg, transparent 0%, #000 30%);
}

@media (min-width: 1200px) {
    html[data-season="winter"] #qt-footer::before {
        background:
            linear-gradient(180deg, transparent 0%, rgba(8, 18, 42, 0.25) 26%, rgba(5, 10, 22, 0.05) 52%, rgba(5, 10, 22, 0.45) 82%, rgba(5, 10, 22, 0.8) 100%),
            url("../../assets/seasons/winter/v2/ground-1920.webp") 50% 85% / cover no-repeat;
    }
}

/* Der Inhalt des Fußbereichs steht auf dunklem Glas über dem Schnee */
html[data-season="winter"] #qt-footer > div {
    background: rgba(5, 10, 22, 0.64);
    border: 1px solid var(--wi-line);
    border-radius: 18px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

@media (max-width: 640px) {
    html[data-season="winter"] #qt-footer { padding-top: 160px; }
    html[data-season="winter"] #qt-footer > div { margin-left: 12px; margin-right: 12px; }
}

/* ---------- Schneefall (assets/js/snow.js) ---------- */
/* snow.js erkennt den Winter an data-theme="winter" und legt .qt-snow an.
   Weiche, leicht unscharfe Flocken hinter allen Inhalten. */
html[data-theme="winter"] .qt-snow {
    position: fixed !important;
    inset: 0;
    z-index: -1 !important;
    overflow: hidden;
    pointer-events: none !important;
    user-select: none !important;
}

html[data-theme="winter"] .qt-snowflake {
    position: absolute;
    top: -12px;
    width: var(--size, 6px);
    height: var(--size, 6px);
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.95) 0%, rgba(230, 240, 255, 0.55) 45%, rgba(230, 240, 255, 0) 72%);
    opacity: var(--opacity, 0.6);
    pointer-events: none !important;
    will-change: transform;
}

@media (prefers-reduced-motion: reduce) {
    html[data-season="winter"] .landing-hero::before,
    html[data-season="winter"] .landing-hero::after {
        animation: none !important;
    }

    html[data-theme="winter"] .qt-snow { display: none !important; }
}

@media print {
    html[data-theme="winter"] .qt-snow { display: none !important; }
}
