/* =========================================================
   TIRAGEAUSAURE — décor de saison (body[data-saison], voir festif.js).
   --festif-1..3 : couleurs des confettis ; --fond : nuit de la page participant.
========================================================= */
body[data-saison="noel"] { --fond: #0d1b2a; --festif-1: #e0484f; --festif-2: #3fae6a; --festif-3: #f2c14e; }
body[data-saison="halloween"] { --fond: #1a1024; --festif-1: #ff9a3c; --festif-2: #8e5bd6; --festif-3: #7bd389; }
body[data-saison="paques"] { --fond: #1b2430; --festif-1: #f7a8c8; --festif-2: #ffe08a; --festif-3: #9ad7a7; }
body[data-saison="ete"] { --fond: #0b2b3b; --festif-1: #ffd166; --festif-2: #ef6f6c; --festif-3: #4ecdc4; }
body[data-saison="fete"] { --fond: #1c1830; --festif-1: #ff6fb5; --festif-2: #6fd3ff; --festif-3: #ffd166; }

/* Page participant : toute la palette suit la saison (toujours sombre, comme une nuit de fête). */
body.festive {
  color-scheme: dark;
  --accent: var(--festif-3);
  --ink-950: var(--fond);
  --ink-900: color-mix(in srgb, var(--fond), #fff 6%);
  --ink-850: color-mix(in srgb, var(--fond), #fff 9%);
  --ink-800: color-mix(in srgb, var(--fond), #fff 13%);
  --ink-700: color-mix(in srgb, var(--fond), #fff 20%);
  --ink-600: color-mix(in srgb, var(--fond), #fff 32%);
  --ink-400: color-mix(in srgb, var(--fond), #fff 62%);
  --ink-300: color-mix(in srgb, var(--fond), #fff 80%);
  --ink-100: #f6f8fb;
  --accent-soft: color-mix(in srgb, var(--accent) 16%, transparent);
  background: radial-gradient(ellipse at 50% -10%, color-mix(in srgb, var(--fond), #fff 14%), var(--fond) 65%) fixed var(--fond);
}
body.festive .btn-principal { color: var(--fond); }
body.festive .btn-principal:hover { background: color-mix(in srgb, var(--accent), #fff 18%); }

/* ---------- Particules qui tombent ---------- */
.particules { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 0; }
.particule {
  position: absolute; top: -14px; left: var(--x);
  width: var(--taille); height: var(--taille); border-radius: 50%;
  background: #fff; opacity: 0.75;
  animation: tomber var(--duree) linear var(--delai) infinite;
}
body:not([data-saison="noel"]) .particule { border-radius: 2px; height: calc(var(--taille) * 0.5); background: var(--couleur); opacity: 0.85; }
@keyframes tomber { to { transform: translate(var(--derive), 105vh) rotate(600deg); } }
.page { position: relative; z-index: 1; }

/* Gerbe de confettis (révélation) */
.gerbe { position: fixed; left: var(--ox); top: var(--oy); pointer-events: none; z-index: 20; }
.eclat {
  position: absolute; width: 9px; height: 5px; border-radius: 2px; background: var(--couleur);
  animation: eclater 1.4s cubic-bezier(0.15, 0.7, 0.3, 1) forwards;
}
@keyframes eclater {
  60% { opacity: 1; }
  to { transform: translate(var(--dx), calc(var(--dy) + 140px)) rotate(720deg); opacity: 0; }
}

/* ---------- Dino et œuf ---------- */
.logo-dino { width: 44px !important; height: 44px !important; }
.deco { display: none; }
body[data-saison="noel"] .deco-noel,
body[data-saison="halloween"] .deco-halloween,
body[data-saison="paques"] .deco-paques,
body[data-saison="ete"] .deco-ete,
body[data-saison="fete"] .deco-fete { display: inline; }

.titre-tirage { text-align: center; margin: 4px 0 0; font-size: clamp(1.5rem, 6vw, 2.1rem); font-weight: 750; letter-spacing: -0.01em; }
.marque { text-align: center; margin: 0; color: var(--accent); font-weight: 650; font-size: 0.85rem; letter-spacing: 0.08em; text-transform: uppercase; }
.scene { display: flex; align-items: flex-end; justify-content: center; gap: 2px; margin: 12px 0 4px; }
.dino { width: min(50vw, 220px); height: auto; overflow: visible; transform-origin: 50% 100%; animation: respirer 3.2s ease-in-out infinite; }
@keyframes respirer { 50% { transform: scale(1.015, 1.035); } }
.dino.content { animation: sauter 0.45s ease-in-out 3; }
@keyframes sauter { 50% { transform: translateY(-16px) rotate(-3deg); } }

.oeuf { all: unset; cursor: pointer; width: min(27vw, 118px); transform-origin: 50% 92%; margin-bottom: 4px; }
.oeuf:disabled { cursor: default; }
.oeuf:focus-visible { outline: 3px solid var(--accent); outline-offset: 6px; border-radius: 40%; }
.oeuf svg { display: block; width: 100%; height: auto; overflow: visible; }
.oeuf:not(:disabled):hover { animation: dandiner 0.7s ease-in-out; }
@keyframes dandiner { 30% { transform: rotate(-6deg); } 70% { transform: rotate(6deg); } }
.oeuf.secoue { animation: secouer 0.16s ease-in-out infinite; }
@keyframes secouer { 25% { transform: rotate(-10deg) translateY(-2px); } 75% { transform: rotate(10deg) translateY(-2px); } }
.oeuf-haut { transform-box: fill-box; transform-origin: 20% 100%; transition: transform 0.7s cubic-bezier(0.2, 1.5, 0.4, 1), opacity 0.5s 0.4s; }
.oeuf.eclos .oeuf-haut { transform: translate(-30%, -70%) rotate(-35deg); opacity: 0; }
.oeuf-tache { fill: var(--festif-1); }
.oeuf-tache.b { fill: var(--festif-2); }

.bulle {
  position: relative; max-width: 420px; margin: 10px auto 0; padding: 10px 16px; text-align: center;
  background: var(--ink-900); border: 1px solid var(--ink-700); border-radius: 16px; color: var(--ink-300); min-height: 1.5em;
}
.bulle::before {
  content: ""; position: absolute; left: 34%; top: -8px; width: 14px; height: 14px; transform: rotate(45deg);
  background: var(--ink-900); border-left: 1px solid var(--ink-700); border-top: 1px solid var(--ink-700);
}
.bulle.roulette { font-weight: 700; color: var(--accent); font-size: 1.1rem; }

.revelation { text-align: center; margin: 18px 0 8px; animation: surgir 0.7s cubic-bezier(0.2, 1.6, 0.4, 1); }
@keyframes surgir { from { transform: scale(0.3) translateY(40px); opacity: 0; } }
.revelation-intro { margin: 0; color: var(--ink-300); }
.revelation-nom { margin: 2px 0 12px; font-size: clamp(2.2rem, 11vw, 3.4rem); font-weight: 800; color: var(--accent); line-height: 1.1; overflow-wrap: anywhere; }
.indices { text-align: left; }
.indices h3 { margin: 0 0 6px; font-size: 0.85rem; color: var(--ink-400); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; }
.puces { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; padding: 0; list-style: none; }
.puce { padding: 3px 11px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 0.88rem; font-weight: 550; }
.a-eviter { margin: 0; padding: 8px 12px; border-left: 3px solid var(--festif-1); background: var(--ink-850); border-radius: 0 10px 10px 0; color: var(--ink-300); white-space: pre-wrap; overflow-wrap: anywhere; }

.page.colonne-tirage { max-width: 560px; padding-top: 6vh; }
.regles {
  white-space: pre-wrap; overflow-wrap: anywhere; margin: 0;
  background: var(--ink-900); color: var(--ink-300); border: 2px dashed color-mix(in srgb, var(--accent) 55%, transparent);
}
.section-tirage { margin-top: 18px; }
.section-tirage h2 { margin: 0 0 4px; font-size: 1.05rem; }

@media (prefers-reduced-motion: reduce) {
  .particules, .gerbe { display: none; }
  .dino, .dino.content, .oeuf, .oeuf.secoue, .revelation { animation: none !important; }
  .oeuf-haut { transition: none; }
}

/* ---------- Page organisateur ---------- */
/* Ruban de saison sous l'en-tête ; neige teintée pour rester visible en thème clair. */
body[data-saison]:not(.festive) .entete {
  padding-bottom: 14px; border-bottom: 5px solid;
  border-image: repeating-linear-gradient(90deg, var(--festif-1) 0 22px, var(--festif-3) 22px 44px, var(--festif-2) 44px 66px) 1;
}
:root[data-theme="clair"] body[data-saison="noel"] .particule { background: #a9c4de; }
.tirage-entete { flex-wrap: wrap; }
.choix-tirage { width: auto; flex: 1; min-width: 0; }
.participant .aide { margin: 2px 0 0; }
.participant-cible { color: var(--accent); font-weight: 600; }
.etat-tirage { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.etat-tirage p { margin: 0; }
.etat-tirage .alerte-tirage { color: var(--rouge); font-weight: 600; white-space: pre-line; }
.resultats { display: flex; align-items: flex-start; gap: 16px; margin-top: 16px; }
.resultats ul { margin: 8px 0 0; padding-left: 18px; line-height: 1.7; }
/* Le petit dino veille sur les résultats : il respire et sautille de temps en temps. */
.resultats-dino { flex: none; width: 72px !important; height: auto !important; transform-origin: 50% 100%; animation: veiller 3s ease-in-out infinite; }
@keyframes veiller {
  0%, 60%, 100% { transform: none; }
  30% { transform: scale(1.03, 1.05); }
  75% { transform: translateY(-10px) rotate(-6deg); }
  85% { transform: translateY(0) rotate(3deg); }
}
@media (prefers-reduced-motion: reduce) { .resultats-dino { animation: none; } }
.exclus-liste { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 6px; }
.message-apercu { min-height: 160px; font-size: 0.85rem; }
.envoi-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.boutons-participants { display: flex; flex-wrap: wrap; gap: 8px; }

/* Animation du lancement du tirage */
.anim-tirage { text-align: center; background: transparent; border: none; box-shadow: none; overflow: visible; }
.anim-tirage::backdrop { background: color-mix(in srgb, var(--fond, #000) 82%, transparent); }
.anim-dino { width: min(50vw, 200px) !important; height: auto !important; transform-origin: 50% 100%; animation: grogner 0.18s ease-in-out infinite; }
@keyframes grogner { 25% { transform: rotate(-5deg) translateY(-3px); } 75% { transform: rotate(5deg) translateY(-3px); } }
.anim-tirage.fini .anim-dino { animation: sauter 0.45s ease-in-out 2; }
.anim-nom { margin: 12px 0 0; min-height: 1.3em; font-size: 1.8rem; font-weight: 800; color: var(--festif-3, #f2c14e); }
@media (prefers-reduced-motion: reduce) { .anim-dino, .anim-tirage.fini .anim-dino { animation: none; } }
