/* Beyblade X Wiki - Weihnachtsdesign
   Gilt nur, wenn i18n.js <html data-saison="weihnachten"> setzt: jedes Jahr vom 1. bis 27. Dezember
   (Datum im Browser), ab dem 28.12. ist automatisch wieder das normale Design da.
   Testen außerhalb der Zeit: sessionStorage.setItem('bxwiki.saison', 'weihnachten') und neu laden ('aus' = abschalten).
   Ändert nur Farben und Schmuck, keine Abstände (kein Springen der Seite). Typ-Farben (Ausdauer blau usw.) bleiben. */

/* ---------- Farben: Rot statt Blau, warmer Hintergrund ---------- */
:root[data-saison="weihnachten"]:not([data-theme="dark"]) {
  --bg: #f5efe7;
  --surface-2: #fbf7f1;
  --border: #e6dccd;
  --border-strong: #d4c5b0;
  --faint: #5f6678;  /* Kontrast 5:1 auf dem wärmeren Hintergrund */
  --accent: #c8102e;
  --accent-soft: rgba(200, 16, 46, .10);
  --snow: rgba(255, 255, 255, .95);
  --on-accent: #ffffff;
}
:root[data-saison="weihnachten"][data-theme="dark"] {
  --bg: #07110d;
  --surface: #0f1c16;
  --surface-2: #152620;
  --border: #1f3a2e;
  --border-strong: #2d5243;
  --faint: #8a95ac;
  --accent: #ff6b6b;
  --accent-soft: rgba(255, 107, 107, .15);
  --snow: rgba(255, 255, 255, .6);
  --on-accent: #07110d;
}
@media (prefers-color-scheme: dark) {
  :root[data-saison="weihnachten"]:not([data-theme="light"]) {
    --bg: #07110d;
    --surface: #0f1c16;
    --surface-2: #152620;
    --border: #1f3a2e;
    --border-strong: #2d5243;
    --faint: #8a95ac;
    --accent: #ff6b6b;
    --accent-soft: rgba(255, 107, 107, .15);
    --snow: rgba(255, 255, 255, .6);
    --on-accent: #07110d;
  }
}

/* Gewählte Knöpfe (Filter, Hasbro/Japan-Namen, Decks/Baukasten) rot statt schwarz/weiß */
[data-saison="weihnachten"] .seg button[aria-pressed="true"],
[data-saison="weihnachten"] .dk-seg [aria-current="page"] { background: var(--accent); color: var(--on-accent); }
[data-saison="weihnachten"] .chip[aria-pressed="true"],
[data-saison="weihnachten"] .ftoggle[aria-expanded="true"] { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }

/* ---------- Logo: Blau wird Rot, das rote X wird Grün ---------- */
[data-saison="weihnachten"] .brand .logo img { filter: hue-rotate(150deg) saturate(1.15); }

/* ---------- Lichterkette unter dem Kopf ---------- */
[data-saison="weihnachten"] .top::before,
[data-saison="weihnachten"] .top::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -7px; height: 12px;
  pointer-events: none; background-repeat: repeat-x; background-size: 128px 12px;
}
[data-saison="weihnachten"] .top::before {
  background-image:
    radial-gradient(circle at 16px 6px, #ff3b4e 0 2.6px, rgba(255, 59, 78, .35) 3.2px, transparent 6px),
    radial-gradient(circle at 80px 6px, #2fd47a 0 2.6px, rgba(47, 212, 122, .35) 3.2px, transparent 6px);
  animation: xm-blink 2.6s ease-in-out infinite;
}
[data-saison="weihnachten"] .top::after {
  background-image:
    radial-gradient(circle at 48px 6px, #ffc93c 0 2.6px, rgba(255, 201, 60, .35) 3.2px, transparent 6px),
    radial-gradient(circle at 112px 6px, #ffffff 0 2.4px, rgba(255, 255, 255, .4) 3px, transparent 6px);
  animation: xm-blink 2.6s ease-in-out -1.3s infinite;
}
@keyframes xm-blink { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
/* Weiße Lämpchen auf hellem Grund: mit Rand, sonst unsichtbar */
:root[data-saison="weihnachten"]:not([data-theme="dark"]) .top::after {
  background-image:
    radial-gradient(circle at 48px 6px, #f0a800 0 2.6px, rgba(255, 201, 60, .4) 3.2px, transparent 6px),
    radial-gradient(circle at 112px 6px, #fff 0 2px, #c9b99f 2.4px, rgba(201, 185, 159, .3) 3px, transparent 5px);
}
@media (prefers-color-scheme: dark) {
  :root[data-saison="weihnachten"]:not([data-theme="light"]) .top::after {
    background-image:
      radial-gradient(circle at 48px 6px, #ffc93c 0 2.6px, rgba(255, 201, 60, .35) 3.2px, transparent 6px),
      radial-gradient(circle at 112px 6px, #ffffff 0 2.4px, rgba(255, 255, 255, .4) 3px, transparent 6px);
  }
}

/* ---------- Schnee im Hintergrund (hinter Karten und Texten, nur in den Lücken sichtbar) ---------- */
[data-saison="weihnachten"] body::before,
[data-saison="weihnachten"] body::after {
  content: ""; position: fixed; left: -40px; right: 0; z-index: -1; pointer-events: none;
  will-change: transform;
}
[data-saison="weihnachten"] body::before {
  top: -260px; height: calc(100% + 260px);
  background-size: 260px 260px;
  background-image:
    radial-gradient(circle at 30px 40px, var(--snow) 0 1.6px, transparent 2.4px),
    radial-gradient(circle at 150px 20px, var(--snow) 0 1.2px, transparent 2px),
    radial-gradient(circle at 210px 120px, var(--snow) 0 1.8px, transparent 2.6px),
    radial-gradient(circle at 90px 170px, var(--snow) 0 1.3px, transparent 2.1px),
    radial-gradient(circle at 180px 230px, var(--snow) 0 1.5px, transparent 2.3px),
    radial-gradient(circle at 20px 220px, var(--snow) 0 1.1px, transparent 1.9px);
  animation: xm-snow-a 26s linear infinite;
}
[data-saison="weihnachten"] body::after {
  top: -420px; height: calc(100% + 420px);
  background-size: 420px 420px;
  background-image:
    radial-gradient(circle at 70px 60px, var(--snow) 0 2.4px, transparent 3.4px),
    radial-gradient(circle at 300px 150px, var(--snow) 0 2.8px, transparent 3.8px),
    radial-gradient(circle at 180px 310px, var(--snow) 0 2.2px, transparent 3.2px),
    radial-gradient(circle at 380px 380px, var(--snow) 0 2.6px, transparent 3.6px);
  animation: xm-snow-b 34s linear infinite;
  opacity: .8;
}
@keyframes xm-snow-a { from { transform: translate3d(0, 0, 0); } to { transform: translate3d(0, 260px, 0); } }
@keyframes xm-snow-b { from { transform: translate3d(0, 0, 0); } to { transform: translate3d(40px, 420px, 0); } }

/* Wer weniger Bewegung eingestellt hat: Schnee und Lichter stehen still */
@media (prefers-reduced-motion: reduce) {
  [data-saison="weihnachten"] body::before,
  [data-saison="weihnachten"] body::after,
  [data-saison="weihnachten"] .top::before,
  [data-saison="weihnachten"] .top::after { animation: none; }
}
@media print {
  [data-saison="weihnachten"] body::before,
  [data-saison="weihnachten"] body::after,
  [data-saison="weihnachten"] .top::before,
  [data-saison="weihnachten"] .top::after { display: none; }
}
