/* « Le chat de Noël » (décembre 2026, lib/noel.js) : chargé sur l'accueil pendant la période seulement.
   Un petit chat à bonnet dort entre deux mots de la bande orange ; au clic, la fenêtre de la révélation.
   prefers-reduced-motion : site.css coupe déjà toute animation, tout reste posé et lisible. */

/* ——— Le chat endormi : même orange que la bande (un rien plus sombre), yeux fermés, bonnet rouge ——— */
.noel-spot { display: inline-block; position: relative; width: 1.3em; height: 1.2em; vertical-align: -0.22em; margin-inline: 0.12em 0.05em; }
.noel-cat { display: block; width: 100%; height: 100%; margin: 0; padding: 0; border: 0; background: none; color: inherit; cursor: pointer; position: relative; }
.noel-cat:focus-visible { outline: 3px solid var(--cacao); outline-offset: 5px; border-radius: 6px; }
.cat-mini { width: 100%; height: 100%; overflow: visible; transition: transform 0.25s var(--spring); }
.cat-mini .cat-head { fill: #fb8400; transition: fill 0.3s; }
.noel-cat.awake .cat-head, .noel-cat:hover .cat-head { fill: var(--orange-deep); }
.noel-cat.asleep .cat-eye { transform: scaleY(0.08); }
.noel-cat:hover .cat-mini, .noel-cat:focus-visible .cat-mini { transform: translateY(-0.08em) scale(1.08); }
.noel-cat.jump .cat-mini { animation: noelJump 0.5s var(--spring); }
@keyframes noelJump { 35% { transform: translateY(-0.7em) scale(1.14) rotate(-6deg); } 70% { transform: translateY(0.04em) scale(0.96); } }
/* Petits « z » qui montent de temps en temps : le mouvement attire l'œil, c'est l'indice silencieux. */
.noel-zz { position: absolute; inset-inline-end: -0.3em; top: -0.1em; font: 800 0.42em/1 var(--font); color: var(--cacao); pointer-events: none; }
.noel-zz i { position: absolute; inset-inline-start: 0; top: 0; font-style: normal; opacity: 0; animation: noelZ 7s ease-out infinite; }
.noel-zz i + i { animation-delay: 0.7s; font-size: 0.8em; }
@keyframes noelZ { 0%, 100% { opacity: 0; transform: none; } 4% { opacity: 0.9; } 16% { opacity: 0; transform: translate(0.9em, -1.6em); } }
html[dir="rtl"] .noel-zz i { animation-name: noelZRtl; }
@keyframes noelZRtl { 0%, 100% { opacity: 0; transform: none; } 4% { opacity: 0.9; } 16% { opacity: 0; transform: translate(-0.9em, -1.6em); } }
.noel-cat.awake .noel-zz, .noel-cat:hover .noel-zz { display: none; }
/* Le pompon se balance quand le chat est réveillé (toutes les têtes à bonnet). */
.cat-hat-pom, .cat-hat-tail { transform-box: view-box; transform-origin: 236px 44px; }
.noel-cat.awake .cat-hat-pom, .noel-cat.awake .cat-hat-tail, .cat-noel .cat-hat-pom, .cat-noel .cat-hat-tail { animation: noelSway 1.6s ease-in-out infinite; }
@keyframes noelSway { 50% { transform: rotate(5deg); } }

/* ——— Pastille d'appel, en bas à gauche (la bulle d'aide est à droite) ——— */
.noel-teaser { position: fixed; z-index: 60; inset-inline-start: 1rem; bottom: 1rem; display: flex; align-items: flex-end; gap: 0.8rem; width: min(380px, calc(100vw - 2rem - 84px)); padding: 0.85rem; padding-inline-end: 2.4rem; background: var(--night); color: var(--fur); border-radius: 18px; box-shadow: 0 12px 40px rgb(36 20 11 / 35%); animation: noelIn 0.7s var(--spring) both; }
.noel-teaser[hidden] { display: none; }
/* En arabe, le début de ligne est à droite, où se trouve déjà la bulle d'aide : la pastille reste à gauche. */
html[dir="rtl"] .noel-teaser { inset-inline-start: auto; inset-inline-end: 1rem; }
@keyframes noelIn { from { opacity: 0; transform: translateY(20px); } }
.noel-teaser-cat { flex: none; width: 56px; margin-bottom: -0.85rem; overflow: hidden; }
.cat-teaser { display: block; margin-bottom: -26%; overflow: visible; }
.noel-teaser-text { min-width: 0; }
.noel-teaser-text p { margin: 0 0 0.25rem; font-weight: 600; font-size: 0.95rem; line-height: 1.35; text-wrap: pretty; }
.noel-teaser-text a { color: var(--orange); font-size: 0.8rem; font-weight: 600; text-decoration: none; }
.noel-teaser-text a:hover { color: var(--fur); text-decoration: underline; }
.noel-teaser-x { position: absolute; top: 0.45rem; inset-inline-end: 0.45rem; width: 30px; height: 30px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%; background: none; color: rgb(255 231 199 / 65%); cursor: pointer; }
.noel-teaser-x:hover { background: rgb(255 231 199 / 12%); color: var(--fur); }
.noel-teaser-x .ico { width: 1rem; height: 1rem; }

/* ——— La révélation : scène de nuit sous la neige à gauche, carte poil clair à droite ——— */
.noel-dialog { border: 0; padding: 0; margin: auto; width: min(980px, calc(100vw - 2rem)); max-height: calc(100vh - 2rem); border-radius: 24px; overflow: hidden; background: var(--fur); color: var(--cacao); box-shadow: 0 30px 80px rgb(36 20 11 / 45%); }
.noel-dialog::backdrop { background: rgb(36 20 11 / 72%); backdrop-filter: blur(6px); }
.noel-dialog[open] { display: grid; grid-template-columns: 0.85fr 1.15fr; animation: noelPop 0.55s var(--spring) both; }
@keyframes noelPop { from { opacity: 0; transform: translateY(24px) scale(0.96); } }
.noel-scene { position: relative; min-height: 420px; background: radial-gradient(120% 80% at 50% 100%, #3a2112 0%, var(--night) 60%); overflow: hidden; }
.noel-snow { position: absolute; inset: 0; pointer-events: none; opacity: 0.9; background-image: radial-gradient(circle, rgb(255 254 252 / 95%) 1.8px, transparent 2.6px), radial-gradient(circle, rgb(255 254 252 / 70%) 1.3px, transparent 2.1px), radial-gradient(circle, rgb(255 254 252 / 45%) 1px, transparent 1.7px); background-size: 170px 170px, 110px 110px, 70px 70px; background-position: 20px 10px, 60px 40px, 0 0; animation: noelSnow 16s linear infinite; }
@keyframes noelSnow { to { background-position: 20px 180px, 60px 150px, 0 70px; } }
.noel-cat-big { position: absolute; bottom: -3px; inset-inline: 0; margin-inline: auto; width: 70%; max-width: 340px; }
.cat-noel { display: block; animation: catRise 1.15s var(--spring) 0.25s both; }
.cat-noel .cat-eye { animation: eyesOpen 0.3s ease-out 1.2s backwards; }
.noel-confetti { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.noel-confetti i { position: absolute; top: -16px; inset-inline-start: var(--x); width: 10px; height: 14px; border-radius: 2px; background: var(--c); opacity: 0; transform: scale(var(--s)); animation: noelConfetti var(--d) ease-in var(--w) both; }
@keyframes noelConfetti { 0% { opacity: 1; transform: translateY(0) rotate(0) scale(var(--s)); } 100% { opacity: 0; transform: translateY(560px) rotate(var(--r)) scale(var(--s)); } }
.noel-card { position: relative; min-height: 0; overflow: auto; display: flex; flex-direction: column; padding: clamp(1.6rem, 4vw, 3rem); padding-inline-end: clamp(2.6rem, 5vw, 3.6rem); }
.noel-kicker { margin: 0 0 0.6rem; color: var(--orange-deep); font-weight: 700; font-size: 0.95rem; }
.noel-card h2 { margin: 0 0 0.4em; font-size: clamp(1.9rem, 3.4vw, 2.8rem); }
.noel-found { margin: 0 0 0.35em; font-weight: 700; font-size: 1.15rem; }
.noel-secret { margin: 0 0 1.1rem; font-size: 1.05rem; line-height: 1.55; text-wrap: pretty; }
.noel-answer { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "label label" "value copy"; align-items: center; gap: 0.2rem 0.8rem; margin-bottom: 1rem; padding: 0.9rem 1.1rem; background: var(--paper); border: 2px dashed var(--orange); border-radius: 16px; }
.noel-answer-label { grid-area: label; font-size: 0.85rem; font-weight: 600; color: var(--muted); }
.noel-answer-value { grid-area: value; font-size: clamp(1.4rem, 2.6vw, 1.9rem); font-weight: 800; font-stretch: 88%; letter-spacing: -0.02em; line-height: 1.1; }
.noel-copy { grid-area: copy; display: inline-flex; align-items: center; gap: 0.4em; padding: 0.5em 0.95em; border: 0; border-radius: 999px; background: var(--cacao); color: var(--fur); font: 700 0.9rem/1.2 var(--font); cursor: pointer; transition: background 0.2s, color 0.2s; }
.noel-copy:hover { background: var(--night); color: var(--orange); }
.noel-copy.done { background: var(--orange); color: var(--cacao); }
.noel-copy .ico { width: 1em; height: 1em; }
.noel-rules { margin: 0 0 1.2rem; font-size: 0.92rem; line-height: 1.5; color: var(--muted); }
.noel-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: auto; }
.noel-x { position: absolute; top: 0.7rem; inset-inline-end: 0.7rem; z-index: 2; width: 40px; height: 40px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%; background: rgb(80 45 22 / 10%); color: var(--cacao); cursor: pointer; }
.noel-x:hover { background: var(--cacao); color: var(--fur); }
@media (max-width: 760px) {
  .noel-dialog { width: calc(100vw - 1rem); max-height: calc(100vh - 1rem); border-radius: 20px; }
  .noel-dialog[open] { grid-template-columns: 1fr; grid-template-rows: 190px minmax(0, 1fr); }
  .noel-scene { min-height: 0; }
  .noel-cat-big { width: 42%; max-width: 190px; }
  .noel-card { padding: 1.3rem; }
  .noel-actions .btn { width: 100%; white-space: normal; text-align: center; }
}
/* Téléphone : au-dessus de la rangée de la bulle d'aide (et de son message d'accueil), sur toute la largeur. */
@media (max-width: 600px) {
  .noel-teaser { width: calc(100vw - 2rem); bottom: calc(1rem + 84px); }
}
