/* ==========================================================================
   Weihnachten – nur auf Wunsch
   Greift nur, wenn assets/js/season.js die Klasse .christmas an <html> setzt.
   Läuft nicht von selbst, sondern wird in den Einstellungen gewählt.
   Eine klare Winternacht: tiefes Nachtblau, ein Hauch Polarlicht oben,
   warmes Kerzenlicht unten, leise fallender Schnee und eine Lichterkette
   unter der Kopfzeile. Akzente in Beerenrot und Eisblau, dazu Gold.
   ========================================================================== */

html.christmas {
  --bg: #070a10;
  --bg-2: #0c1119;
  --surface: rgba(20, 27, 38, 0.72);
  --surface-solid: #131a24;
  --surface-2: rgba(140, 165, 200, 0.12);
  --surface-3: rgba(140, 165, 200, 0.22);
  --line: rgba(220, 235, 255, 0.075);
  --line-strong: rgba(210, 230, 255, 0.16);
  --text: #eef3f8;
  --muted: rgba(225, 235, 245, 0.62);
  --muted-2: rgba(225, 235, 245, 0.36);

  /* Killer: Beerenrot. Survivor: Eisblau. */
  --killer: #e0414f;
  --killer-deep: #b52a38;
  --killer-rgb: 224, 65, 79;
  --killer-hover: #ea5d69;
  --survivor: #6fc3e8;
  --survivor-deep: #3f9fcc;
  --survivor-rgb: 111, 195, 232;
  --survivor-deep-rgb: 63, 159, 204;

  --gold: #f0c96a;
  --good: #5fcf8a;
  --bad: #ff5a6a;
  --purple: #b9a3e3;

  --shadow: 0 1px 0 rgba(220, 240, 255, 0.02) inset, 0 2px 10px rgba(0, 3, 8, 0.3), 0 24px 54px -32px rgba(0, 3, 8, 0.95);
  --shadow-lg: 0 6px 20px rgba(0, 3, 8, 0.42), 0 44px 84px -36px rgba(0, 3, 8, 1);
}

html.christmas body { background: var(--bg); }
html.christmas ::selection { background: rgba(224, 65, 79, 0.4); color: #fff; }

/* -------------------------------------------------------------- Kulisse -- */

/* Polarlicht oben, Kerzenschein unten, ein Schneefeld am Boden. */
html.christmas .glow {
  overflow: hidden;
  background:
    radial-gradient(60% 14% at 50% 104%, rgba(225, 238, 255, 0.07), transparent 70%),
    radial-gradient(1100px 460px at 30% 116%, rgba(240, 160, 80, 0.13), transparent 66%),
    radial-gradient(700px 320px at 78% 110%, rgba(224, 65, 79, 0.1), transparent 64%),
    radial-gradient(1000px 380px at 70% -14%, rgba(95, 207, 138, 0.11), transparent 62%),
    radial-gradient(800px 360px at 10% -10%, rgba(111, 195, 232, 0.1), transparent 60%),
    linear-gradient(180deg, var(--bg-2), var(--bg) 55%, #0a0e16);
}

/*
  Schnee in zwei Tiefen, gebaut wie das Herbstlaub: ein senkrecht gekachelter
  Streifen, der um genau eine Kachelhöhe nach unten wandert – endlos und ohne
  Sprung, reine Verschiebung.
*/
html.christmas .glow::before,
html.christmas .glow::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  pointer-events: none;
  background-repeat: repeat;
  will-change: transform;
}

/* Hinten: viele kleine, blasse Flocken, langsam. */
html.christmas .glow::before {
  top: -600px;
  bottom: 0;
  opacity: 0.45;
  background-size: 420px 600px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='420' height='600' fill='%23e6f2ff'%3E%3Ccircle cx='30' cy='40' r='1.2'/%3E%3Ccircle cx='140' cy='110' r='1'/%3E%3Ccircle cx='260' cy='60' r='1.4'/%3E%3Ccircle cx='380' cy='150' r='1'/%3E%3Ccircle cx='80' cy='230' r='1.3'/%3E%3Ccircle cx='200' cy='300' r='1'/%3E%3Ccircle cx='330' cy='270' r='1.2'/%3E%3Ccircle cx='20' cy='380' r='1'/%3E%3Ccircle cx='150' cy='440' r='1.4'/%3E%3Ccircle cx='290' cy='410' r='1'/%3E%3Ccircle cx='400' cy='480' r='1.2'/%3E%3Ccircle cx='100' cy='540' r='1'/%3E%3Ccircle cx='240' cy='570' r='1.3'/%3E%3C/svg%3E");
  filter: blur(0.4px);
  animation: xm-fall-far 90s linear infinite;
}

/* Vorne: wenige größere, weiche Flocken, etwas schneller. */
html.christmas .glow::after {
  top: -900px;
  bottom: 0;
  opacity: 0.5;
  background-size: 640px 900px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='640' height='900' fill='%23f2f8ff'%3E%3Ccircle cx='90' cy='120' r='2.4'/%3E%3Ccircle cx='470' cy='70' r='2'/%3E%3Ccircle cx='300' cy='330' r='2.8'/%3E%3Ccircle cx='600' cy='420' r='2.2'/%3E%3Ccircle cx='60' cy='560' r='2.6'/%3E%3Ccircle cx='410' cy='690' r='2.2'/%3E%3Ccircle cx='220' cy='820' r='2.4'/%3E%3C/svg%3E");
  filter: blur(0.7px);
  animation: xm-fall-near 60s linear infinite;
}

/* Feines Korn über allem – nimmt den Verläufen das Glatte. */
html.christmas body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.05;
  mix-blend-mode: overlay;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

@keyframes xm-fall-near {
  0% { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(-22px, 450px, 0); }
  100% { transform: translate3d(0, 900px, 0); }
}

@keyframes xm-fall-far {
  0% { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(14px, 300px, 0); }
  100% { transform: translate3d(0, 600px, 0); }
}

@media (prefers-reduced-motion: reduce) {
  html.christmas .glow::before,
  html.christmas .glow::after,
  html.christmas .topbar::after { animation: none; }
}

@media (max-width: 640px) {
  html.christmas .glow::after { opacity: 0.35; }
  html.christmas .glow::before { opacity: 0.3; }
}

/* --------------------------------------------------------------- Topbar -- */

html.christmas .topbar {
  background: rgba(8, 11, 17, 0.7);
  border-bottom-color: transparent;
}

/* Eine Lichterkette unter der Kopfzeile: rot, gold, grün im Wechsel. */
html.christmas .topbar::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -3px;
  height: 5px;
  pointer-events: none;
  background:
    radial-gradient(circle at 12px 2.5px, rgba(255, 92, 104, 0.95) 0 1.6px, rgba(255, 92, 104, 0.28) 2.4px, transparent 4px) 0 0 / 72px 5px repeat-x,
    radial-gradient(circle at 36px 2.5px, rgba(255, 214, 120, 0.95) 0 1.6px, rgba(255, 214, 120, 0.28) 2.4px, transparent 4px) 0 0 / 72px 5px repeat-x,
    radial-gradient(circle at 60px 2.5px, rgba(110, 220, 150, 0.95) 0 1.6px, rgba(110, 220, 150, 0.28) 2.4px, transparent 4px) 0 0 / 72px 5px repeat-x;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  animation: xm-twinkle 3.2s ease-in-out infinite alternate;
}

@keyframes xm-twinkle {
  from { opacity: 0.65; }
  to { opacity: 1; }
}

/* Eine Schneeflocke hinter dem Namen – gezeichnet, kein Emoji. */
html.christmas .topbar__brand > span:last-child { white-space: nowrap; }
html.christmas .topbar__brand > span:last-child::after {
  content: "";
  display: inline-block;
  width: 0.95em;
  height: 0.95em;
  margin-left: 0.4em;
  vertical-align: -0.1em;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-12 -12 24 24'%3E%3Cg fill='none' stroke='%23cfe8ff' stroke-width='1.6' stroke-linecap='round'%3E%3Cg id='a'%3E%3Cpath d='M0-10V10M0-6.5L-2.6-9M0-6.5L2.6-9M0 6.5L-2.6 9M0 6.5L2.6 9'/%3E%3C/g%3E%3Cuse href='%23a' transform='rotate(60)'/%3E%3Cuse href='%23a' transform='rotate(120)'/%3E%3C/g%3E%3C/svg%3E") no-repeat center / contain;
}

html.christmas .topbar__glyph { color: var(--killer); }

html.christmas .topbar__nav {
  background: rgba(140, 165, 200, 0.09);
  box-shadow: inset 0 0 0 1px var(--line);
}

html.christmas .topbar__nav a.is-active,
html.christmas .tab.is-active {
  color: var(--text);
  background: rgba(140, 165, 200, 0.24);
  box-shadow: inset 0 0 0 1px rgba(210, 230, 255, 0.1), 0 1px 2px rgba(0, 0, 0, 0.4);
}

/* ------------------------------------------------------------ Typografie -- */

html.christmas .hero__eyebrow,
html.christmas .page-head__eyebrow { color: var(--gold); }

/* Ein kurzer Strich unter der großen Überschrift, im Abendlicht. */
html.christmas .hero__title::after,
html.christmas .page-head h1::after {
  content: "";
  display: block;
  width: 2.2rem;
  height: 3px;
  margin-top: 0.55rem;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--killer), var(--gold));
}
html.christmas .page-head { align-items: flex-start; }
html.christmas .page-head__meta { padding-top: 0.6rem; }

/* -------------------------------------------------------------- Flächen -- */

html.christmas .panel,
html.christmas .kpi,
html.christmas .auth-card,
html.christmas .challenge-card,
html.christmas .board__col {
  background:
    linear-gradient(180deg, rgba(200, 225, 255, 0.025), transparent 140px),
    var(--surface);
  border-color: var(--line);
}

html.christmas .panel::before {
  background: linear-gradient(90deg, transparent, rgba(210, 230, 255, 0.16) 25%, rgba(210, 230, 255, 0.16) 75%, transparent);
}

html.christmas .kpi { --kpi-tint: rgba(210, 230, 255, 0.05); }
html.christmas .kpi--killer { --kpi-tint: rgba(224, 65, 79, 0.15); }
html.christmas .kpi--survivor { --kpi-tint: rgba(111, 195, 232, 0.13); }
html.christmas .kpi--bp { --kpi-tint: rgba(240, 201, 106, 0.13); }
html.christmas .kpi:hover { border-color: rgba(210, 230, 255, 0.18); }

html.christmas .kpi--survivor .kpi__icon { color: var(--survivor); background: rgba(111, 195, 232, 0.16); }

html.christmas .summit,
html.christmas .gstatus { border-color: rgba(210, 230, 255, 0.1); }

html.christmas .perk-card:hover,
html.christmas .streak-card:hover,
html.christmas .pcard:hover,
html.christmas .tcard:hover,
html.christmas .build-slot:hover { border-color: rgba(224, 65, 79, 0.3); }

html.christmas .streak-card--killer { --accent-rgb: 224, 65, 79; }
html.christmas .streak-card__value,
html.christmas .streak-badge { color: #f4cf74; }

/* ---------------------------------------------------------- Formulare -- */

html.christmas input[type="text"],
html.christmas input[type="email"],
html.christmas input[type="password"],
html.christmas input[type="datetime-local"],
html.christmas input[type="date"],
html.christmas input[type="number"],
html.christmas input[type="search"],
html.christmas select,
html.christmas textarea {
  background-color: rgba(140, 165, 200, 0.08);
  border-color: var(--line);
}

html.christmas input:hover,
html.christmas select:hover,
html.christmas textarea:hover { border-color: var(--line-strong); }

html.christmas input:focus,
html.christmas select:focus,
html.christmas textarea:focus {
  border-color: rgba(240, 201, 106, 0.65);
  box-shadow: 0 0 0 4px rgba(240, 201, 106, 0.14);
}

html.christmas .perk-pick__select { background-color: transparent; border-color: transparent; }
html.christmas .perk-pick__select:focus { box-shadow: none; border-color: rgba(240, 201, 106, 0.35); }
html.christmas .bp-display input { border-color: transparent; }
html.christmas .bp-display input:focus { border-color: rgba(240, 201, 106, 0.65); box-shadow: 0 0 0 4px rgba(240, 201, 106, 0.16); }

html.christmas option { background: #141b25; }
html.christmas input[type="datetime-local"],
html.christmas input[type="date"] { color-scheme: dark; }

html.christmas .form-group__title::before { background: var(--killer); box-shadow: none; }
html.christmas #entry-panel[data-role="survivor"] .form-group__title::before { background: var(--survivor); }

html.christmas .segmented {
  background: rgba(140, 165, 200, 0.09);
  box-shadow: inset 0 0 0 1px var(--line);
}

html.christmas .segmented__opt input:checked + span {
  color: #fff;
  background: var(--killer);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 4px 14px -8px rgba(224, 65, 79, 0.9);
}

html.christmas .segmented--sm .segmented__opt input:checked + span {
  color: var(--text);
  background: var(--surface-3);
  box-shadow: inset 0 0 0 1px var(--line-strong);
}

html.christmas .segmented__opt--good input:checked + span { color: #1a2006; background: var(--good); }
html.christmas .segmented__opt--bad input:checked + span { color: #fff; background: var(--bad); }
html.christmas .segmented__opt input:focus-visible + span { box-shadow: 0 0 0 3px rgba(240, 201, 106, 0.45); }

html.christmas .bp-field {
  background: linear-gradient(160deg, rgba(240, 201, 106, 0.07), rgba(224, 65, 79, 0.02));
  border-color: rgba(240, 201, 106, 0.16);
}
html.christmas .bp-slider {
  background: linear-gradient(90deg, var(--gold) var(--bp-fill, 0%), rgba(240, 201, 106, 0.16) var(--bp-fill, 0%));
}

html.christmas .check input { accent-color: var(--killer); }

/* --------------------------------------------------------------- Buttons -- */

html.christmas .btn--primary {
  color: #fff;
  background: var(--killer);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 6px 18px -10px rgba(224, 65, 79, 0.9);
}
html.christmas .btn--primary:hover { background: var(--killer-hover); }

html.christmas .btn--ghost {
  background: rgba(140, 165, 200, 0.1);
  box-shadow: inset 0 0 0 1px var(--line);
}
html.christmas .btn--ghost:hover {
  background: rgba(140, 165, 200, 0.18);
  box-shadow: inset 0 0 0 1px var(--line-strong);
}

html.christmas .btn:focus-visible,
html.christmas .icon-btn:focus-visible,
html.christmas .th-sort:focus-visible { box-shadow: 0 0 0 3px rgba(240, 201, 106, 0.45); }

html.christmas .icon-btn:hover { color: var(--survivor); background: rgba(111, 195, 232, 0.14); }
html.christmas .icon-btn--danger:hover { color: var(--bad); background: rgba(226, 96, 78, 0.14); }
html.christmas .icon-btn--owner:hover { color: var(--gold); background: rgba(240, 201, 106, 0.14); }

html.christmas .chip { background: rgba(240, 201, 106, 0.11); box-shadow: inset 0 0 0 1px rgba(240, 201, 106, 0.14); }
html.christmas .chip:hover { background: rgba(240, 201, 106, 0.2); }
html.christmas .chip--reset { background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); }

/* --------------------------------------------------------------- Tabellen -- */

html.christmas .table th { color: var(--muted-2); border-bottom-color: var(--line-strong); }
html.christmas .table td { border-bottom-color: rgba(220, 235, 255, 0.05); }
html.christmas .table tbody tr:hover { background: rgba(140, 165, 200, 0.06); }
html.christmas .th-sort.is-sorted::after { color: var(--gold); }

/* Kill-Stufen von Schnee über Gold nach Beerenrot. */
html.christmas .pill--k4 { color: #fff; background: var(--killer); }
html.christmas .bar__fill--k1 { background: #c9d6e6; }
html.christmas .bar__fill--k2 { background: #f0c96a; }
html.christmas .bar__fill--k3 { background: #ea7a5a; }
html.christmas .bar__track { background: rgba(140, 165, 200, 0.1); }

html.christmas .gstep__fill { background: var(--survivor); }
html.christmas .gstep.is-done .gstep__fill { background: var(--good); }

/* ------------------------------------------------------ Schwebende Teile -- */

html.christmas .fab {
  color: #fff;
  background: var(--killer);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 10px 28px -10px rgba(224, 65, 79, 0.9), var(--shadow);
}
html.christmas .fab:hover { background: var(--killer-hover); }
html.christmas .fab__badge { border-color: var(--bg); }

html.christmas .toast {
  background: rgba(20, 27, 38, 0.86);
  border-color: rgba(210, 230, 255, 0.14);
}

html.christmas .drawer__scrim { background: rgba(2, 4, 10, 0.6); }
html.christmas .drawer__panel {
  background: rgba(16, 22, 31, 0.92);
  border-left-color: rgba(210, 230, 255, 0.1);
}

/* --------------------------------------------------------- Rollbalken -- */

html.christmas * { scrollbar-color: rgba(240, 201, 106, 0.3) transparent; }
html.christmas ::-webkit-scrollbar-thumb { background: rgba(240, 201, 106, 0.26); background-clip: content-box; }
html.christmas ::-webkit-scrollbar-thumb:hover { background: rgba(240, 201, 106, 0.44); background-clip: content-box; }

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  html.christmas .panel, html.christmas .kpi, html.christmas .auth-card { background: var(--surface-solid); }
  html.christmas .topbar { background: rgba(8, 11, 17, 0.97); }
  html.christmas .drawer__panel { background: #131a24; }
  html.christmas .toast { background: #1a2230; }
}

@media (prefers-reduced-transparency: reduce) {
  html.christmas .panel, html.christmas .kpi, html.christmas .auth-card { background: var(--surface-solid); }
  html.christmas .topbar { background: #080b11; }
  html.christmas .drawer__panel { background: #131a24; }
  html.christmas .toast { background: #1a2230; }
}
