/* Thèmes saisonniers : se choisissent dans l'admin (Réglages → Apparence). Sans thème, le site garde son design normal (site.css).
   Chaque thème remplace les variables de couleur, puis ajoute ses décorations (CSS + quelques éléments créés par app.js dans #fx). */

#fx { position: fixed; inset: 0; z-index: 25; pointer-events: none; overflow: hidden; }
html[data-theme] main, html[data-theme] .footer { position: relative; z-index: 1; }
html[data-theme] .logo { position: relative; }

/* ───── neige (Noël et Hiver) ───── */
.fx-snow { position: absolute; top: 0; left: var(--x); width: var(--s); height: var(--s); border-radius: 50%; background: #fff; opacity: .85; box-shadow: 0 0 6px rgba(255,255,255,.7); animation: fx-fall var(--d) linear var(--l) infinite; }
@keyframes fx-fall { from { transform: translate3d(0, -6vh, 0); } to { transform: translate3d(var(--dx), 108vh, 0); } }

/* ───── Halloween ───── */
html[data-theme="halloween"] {
  --bg: #120a1c; --surface: #1d1229; --surface-2: #271a37; --line: #3d2b54; --text: #f7effd; --muted: #b6a5cc;
  --accent: #ff7a00; --accent-2: #ffa23d; --accent-ink: #1c0c00; --ok: #8be24b; --warn: #ff8f87; --foot-bg: #09040f; --foot-ink: #b6a5cc; --glow: #ff7a00;
  color-scheme: dark;
}
html[data-theme="halloween"] .logo { text-shadow: 0 0 14px rgba(255,122,0,.65); padding-left: 36px; }
html[data-theme="halloween"] .logo::before { content: ""; position: absolute; left: 0; top: 50%; width: 30px; height: 27px; margin-top: -14px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 36'%3E%3Cellipse cx='20' cy='21' rx='16' ry='13' fill='%23ff7a00'/%3E%3Cellipse cx='11' cy='21' rx='8' ry='12' fill='%23ff9a2e' opacity='.7'/%3E%3Cellipse cx='29' cy='21' rx='8' ry='12' fill='%23ff9a2e' opacity='.7'/%3E%3Crect x='18' y='4' width='4' height='7' rx='1.5' fill='%2368b82a'/%3E%3Cpath d='M12 18l4 4h-5zM28 18l-4 4h5zM13 28q7 5 14 0l-2-3-2 2-3-2-3 2-2-2z' fill='%23120a1c'/%3E%3C/svg%3E") center / contain no-repeat; animation: hw-flicker 3.2s ease-in-out infinite; }
@keyframes hw-flicker { 0%, 100% { filter: drop-shadow(0 0 4px rgba(255,122,0,.5)); } 45% { filter: drop-shadow(0 0 10px rgba(255,170,60,.9)); } 55% { filter: drop-shadow(0 0 3px rgba(255,122,0,.4)); } }
html[data-theme="halloween"] .hero h1 { text-shadow: 0 0 34px rgba(255,122,0,.4); }
html[data-theme="halloween"] .topbar { background: rgba(18,10,28,.92); border-bottom-color: #4a2f6b; }
html[data-theme="halloween"] .band { background: linear-gradient(120deg, #ff7a00, #d94a00); }
html[data-theme="halloween"] body::after { content: ""; position: fixed; left: 0; right: 0; bottom: 0; height: 140px; z-index: 24; pointer-events: none; background: linear-gradient(to top, rgba(139,61,255,.2), transparent); }
.fx-bat { position: absolute; top: var(--y); left: 0; width: calc(54px * var(--z)); height: calc(27px * var(--z)); animation: fx-fly var(--d) linear var(--l) infinite; filter: drop-shadow(0 0 8px rgba(190,120,255,.85)); opacity: .9; }
.fx-bat::before { content: ""; position: absolute; inset: 0; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 32'%3E%3Cpath fill='%238a5cf0' d='M32 8c-2 0-3 2-4 4-3-3-8-6-14-4 3 2 4 5 4 8-3-1-6-1-9 1 4 1 6 3 7 6 2-3 5-4 8-3 1 2 3 4 8 4s7-2 8-4c3-1 6 0 8 3 1-3 3-5 7-6-3-2-6-2-9-1 0-3 1-6 4-8-6-2-11 1-14 4-1-2-2-4-4-4z'/%3E%3C/svg%3E") center / contain no-repeat; animation: fx-flap .45s ease-in-out infinite alternate; }
@keyframes fx-fly { from { transform: translate3d(-12vw, 0, 0); } 50% { transform: translate3d(50vw, 6vh, 0); } to { transform: translate3d(112vw, -3vh, 0); } }
@keyframes fx-flap { from { transform: scaleY(1); } to { transform: scaleY(.55); } }

/* ───── Noël ───── */
html[data-theme="noel"] {
  --bg: #0e2a1f; --surface: #153a2b; --surface-2: #1b4634; --line: #2f6a4f; --text: #fff6ea; --muted: #bdd6c8;
  --accent: #e5383b; --accent-2: #ff5a5d; --accent-ink: #ffffff; --ok: #6be28d; --warn: #ffb3ae; --foot-bg: #081a13; --foot-ink: #bdd6c8; --gold: #f2c14e;
  color-scheme: dark;
}
html[data-theme="noel"] .topbar { background: rgba(14,42,31,.94); border-bottom-color: #2f6a4f; }
html[data-theme="noel"] .logo::before { content: ""; position: absolute; left: -9px; top: -13px; width: 28px; height: 21px; transform: rotate(-17deg); background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 30'%3E%3Cpath d='M4 26C6 10 16 2 30 4c-5 3-6 9-5 13l11 0c1 3 1 6 0 9z' fill='%23e5383b'/%3E%3Crect x='2' y='22' width='36' height='7' rx='3.5' fill='%23fff'/%3E%3Ccircle cx='31' cy='4' r='4' fill='%23fff'/%3E%3C/svg%3E") center / contain no-repeat; }
html[data-theme="noel"] .topbar::after { content: ""; position: absolute; left: 0; right: 0; bottom: -15px; height: 15px; pointer-events: none; z-index: 2;
  background: radial-gradient(circle at 10px 7px, #ff4d4d 0 4px, transparent 5px), radial-gradient(circle at 30px 7px, #ffd34d 0 4px, transparent 5px), radial-gradient(circle at 50px 7px, #4dff88 0 4px, transparent 5px), radial-gradient(circle at 70px 7px, #4dc3ff 0 4px, transparent 5px);
  background-size: 80px 15px; background-repeat: repeat-x; filter: drop-shadow(0 0 5px rgba(255,255,255,.35)); animation: no-blink 1.6s ease-in-out infinite alternate; }
@keyframes no-blink { from { opacity: 1; } to { opacity: .45; } }
html[data-theme="noel"] .hero h1 { text-shadow: 0 .05em 0 rgba(229,56,59,.55); }
html[data-theme="noel"] .sec-head h2::before { content: ""; display: inline-block; width: .55em; height: .55em; margin-right: .35em; border-radius: 50%; background: var(--gold); box-shadow: 0 0 12px var(--gold); }
html[data-theme="noel"] .band { background: linear-gradient(120deg, #e5383b, #a4161a); }
html[data-theme="noel"] .band .btn { color: #a4161a; }

/* ───── Hiver ───── */
html[data-theme="hiver"] {
  --bg: #e8f1f9; --surface: #ffffff; --surface-2: #f1f7fc; --line: #c3d7e8; --text: #0c2236; --muted: #4a6580;
  --accent: #1a7fd9; --accent-2: #1366b3; --accent-ink: #ffffff; --ok: #0a8a57; --warn: #b3261e; --foot-bg: #0c2236; --foot-ink: #bfd3e6;
  color-scheme: light;
}
html[data-theme="hiver"] .topbar { background: rgba(232,241,249,.92); backdrop-filter: blur(10px); border-bottom: 0; box-shadow: 0 1px 0 #c3d7e8, 0 3px 0 rgba(255,255,255,.9); }
html[data-theme="hiver"] body { background: linear-gradient(180deg, #dbe9f6 0, var(--bg) 480px) var(--bg); }
html[data-theme="hiver"] .hero h1 { text-shadow: 0 2px 0 #fff, 0 6px 22px rgba(26,127,217,.18); }
html[data-theme="hiver"] .card .im, html[data-theme="hiver"] .wall a { box-shadow: 0 0 0 1px #c3d7e8; }
html[data-theme="hiver"] .logo::after { content: "*"; color: var(--accent); margin-left: 3px; font-weight: 800; }
html[data-theme="hiver"] .band { background: linear-gradient(120deg, #1a7fd9, #0f5aa6); }

/* congères en bas de page (Noël et Hiver) */
html[data-theme="noel"] .footer, html[data-theme="hiver"] .footer { margin-top: 44px; }
html[data-theme="noel"] .footer::before, html[data-theme="hiver"] .footer::before { content: ""; position: absolute; left: 0; right: 0; top: -39px; height: 40px; pointer-events: none; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 40' preserveAspectRatio='none'%3E%3Cpath fill='%23ffffff' d='M0 40V22C80 6 160 8 240 22s160 12 240-2 160-14 240 0 160 14 240 0 160-8 240 2v18z'/%3E%3C/svg%3E") center bottom / 100% 100% no-repeat; }

/* ───── Été ───── */
html[data-theme="ete"] {
  --bg: #e4f6fb; --surface: #ffffff; --surface-2: #f0fbfe; --line: #b9e0e9; --text: #05303b; --muted: #3d6a77;
  --accent: #ff5a36; --accent-2: #e2441f; --accent-ink: #ffffff; --ok: #0a8a57; --warn: #b3261e; --foot-bg: #05485a; --foot-ink: #cdeaf0; --sun: #ffd34d;
  color-scheme: light;
}
html[data-theme="ete"] .topbar { background: rgba(228,246,251,.92); backdrop-filter: blur(10px); }
html[data-theme="ete"] .hero h1 { text-shadow: 0 .06em 0 rgba(255,211,77,.95); }
html[data-theme="ete"] .logo::after { content: ""; display: inline-block; width: .42em; height: .42em; margin-left: .22em; border-radius: 50%; background: var(--sun); box-shadow: 0 0 0 3px rgba(255,211,77,.35), 0 0 14px rgba(255,211,77,.9); vertical-align: .12em; }
html[data-theme="ete"] body::before { content: ""; position: fixed; top: 40px; right: -90px; width: 420px; height: 420px; border-radius: 50%; z-index: 24; pointer-events: none; mix-blend-mode: screen; opacity: .7; background: radial-gradient(circle, #fff7b8 0 18%, #ffd34d 36%, rgba(255,211,77,.35) 56%, rgba(255,211,77,0) 72%); animation: et-sun 6s ease-in-out infinite alternate; }
@keyframes et-sun { from { transform: scale(1); } to { transform: scale(1.08); } }
html[data-theme="ete"] .band { background: linear-gradient(120deg, #ff5a36, #ff8a3d); }
html[data-theme="ete"] .footer { margin-top: 44px; }
html[data-theme="ete"] .footer::before { content: ""; position: absolute; left: 0; right: 0; top: -39px; height: 40px; pointer-events: none; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 40' preserveAspectRatio='none'%3E%3Cpath fill='%2305485a' d='M0 40V18C100 2 200 2 300 18s200 16 300 0 200-16 300 0 200 16 300 0v22z'/%3E%3C/svg%3E") center bottom / 100% 100% no-repeat; }
@media (prefers-reduced-motion: no-preference) { html[data-theme="ete"] .footer::before { animation: et-wave 7s ease-in-out infinite alternate; } @keyframes et-wave { from { background-position: 0 bottom; } to { background-position: 60px bottom; } } }

/* ───── réglages de lisibilité communs ───── */
html[data-theme] .badge { box-shadow: 0 1px 0 rgba(0,0,0,.15); }

/* « réduire les animations » : décors posés, sans mouvement */
@media (prefers-reduced-motion: reduce) { .fx-snow { top: var(--t, 10vh); } .fx-bat { left: var(--bx, 20vw); } }
/* flocons visibles sur fond clair */
html[data-theme="hiver"] .fx-snow { box-shadow: 0 0 0 1px rgba(26,127,217,.4), 0 0 9px rgba(90,160,235,.7); opacity: .95; }
html[data-theme="noel"] .hero h1 { text-shadow: 0 .05em 0 rgba(229,56,59,.38); }
