/* =========================================================================
 * avent.css — Calendrier de l'Avent et rendez-vous (côté enfant et côté parent)
 * Animations coupées par .calm / .no-fx (réglage « Réduire les animations ») et prefers-reduced-motion.
 * Largeur téléphone → tablette : aucun défilement horizontal.
 * ========================================================================= */

/* ---------------- Calendrier de l'Avent ---------------- */
.advent-card.has-new { background: linear-gradient(135deg, #e6fff0, #ffe9ec); animation: adv-card-pulse 2.6s infinite; }
@keyframes adv-card-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(214, 40, 57, .0); } 50% { box-shadow: 0 0 0 6px rgba(214, 40, 57, .18); } }

.adv-wrap { max-width: 880px; margin: 0 auto; padding: 0 16px 24px; }
.adv-count { text-align: center; font-size: clamp(1.4rem, 5vw, 2.2rem); font-weight: 700; color: #b5171f; margin: 8px 0 2px; }
.adv-info { text-align: center; font-size: 1.15rem; color: #3a3560; margin: 0 0 14px; }
.adv-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
@media (min-width: 640px) { .adv-grid { grid-template-columns: repeat(6, 1fr); gap: 14px; } }

.adv-case {
  position: relative; aspect-ratio: 1; border: 0; border-radius: 16px; cursor: pointer; padding: 0;
  display: grid; place-items: center; overflow: hidden; color: #fff; font-family: inherit;
  background: linear-gradient(145deg, #c1121f, #8d0f1a); box-shadow: 0 4px 10px rgba(80, 0, 10, .25);
  transition: transform .2s, box-shadow .2s;
}
.adv-case:nth-child(3n+2) { background: linear-gradient(145deg, #2a9d5c, #1b6f40); }
.adv-case:nth-child(3n) { background: linear-gradient(145deg, #1d4e89, #14365f); }
.adv-num { position: absolute; top: 5px; left: 9px; font-size: clamp(1.1rem, 4vw, 1.6rem); z-index: 2; text-shadow: 0 1px 2px rgba(0, 0, 0, .35); }
.adv-gift { font-size: clamp(1.6rem, 6vw, 2.4rem); }
.adv-lock { font-size: clamp(1.1rem, 4vw, 1.5rem); opacity: .85; margin-top: 18px; }
.adv-miss { font-size: 2rem; opacity: .5; }
.adv-item { width: 82%; height: 82%; margin-top: 8px; }
.adv-case.ouverte { background: linear-gradient(145deg, #fff6d6, #ffe8a8); color: #5b3a00; }
.adv-case.ouverte .adv-num { color: #8a5a00; text-shadow: none; }
.adv-case.verrouillee { filter: saturate(.7) brightness(.92); }
.adv-case.manquee { background: #c9c6d6; color: #6c6788; box-shadow: none; cursor: default; }
.adv-case.aujourdhui { animation: adv-glow 2s ease-in-out infinite; outline: 3px solid #ffd34d; outline-offset: 1px; }
@keyframes adv-glow { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 211, 77, .0), 0 4px 10px rgba(80, 0, 10, .25); } 50% { box-shadow: 0 0 18px 6px rgba(255, 211, 77, .65), 0 4px 10px rgba(80, 0, 10, .25); } }

/* Survol / approche : la case vibre légèrement, avec un halo doux */
.adv-case:not(.ouverte):not(.manquee):hover, .adv-case:not(.ouverte):not(.manquee):focus-visible {
  animation: adv-shake .55s ease-in-out; box-shadow: 0 0 22px 7px rgba(255, 236, 160, .75); outline: none;
}
@keyframes adv-shake { 0%, 100% { transform: rotate(0); } 20% { transform: rotate(-2.2deg) scale(1.03); } 40% { transform: rotate(2.2deg) scale(1.03); } 60% { transform: rotate(-1.4deg) scale(1.03); } 80% { transform: rotate(1.4deg) scale(1.03); } }
.adv-case.lift { animation: adv-lift .9s ease-out forwards; z-index: 5; }
@keyframes adv-lift { 0% { transform: none; } 55% { transform: translateY(-14px) scale(1.12) rotate(-3deg); } 100% { transform: translateY(-6px) scale(1.06); } }
.adv-note { text-align: center; color: #5b5680; font-size: .98rem; margin-top: 18px; line-height: 1.5; }

/* ---------------- Ouverture : lumière, accessoire en grand, flocons, félicitations ---------------- */
.adv-stage { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; background: rgba(18, 12, 44, .78); overflow: hidden; animation: adv-fade .35s ease-out; }
.adv-rays { position: absolute; width: 150vmax; height: 150vmax; left: 50%; top: 50%; margin: -75vmax 0 0 -75vmax; opacity: .55; pointer-events: none;
  background: repeating-conic-gradient(from 0deg, rgba(255, 236, 160, .85) 0 7deg, rgba(255, 236, 160, 0) 7deg 22deg); border-radius: 50%;
  animation: adv-rays-in 1.1s ease-out both, adv-spin 24s linear infinite; mask-image: radial-gradient(circle, #000 4%, transparent 55%); -webkit-mask-image: radial-gradient(circle, #000 4%, transparent 55%); }
@keyframes adv-rays-in { from { transform: scale(.05); opacity: 0; } to { transform: scale(1); opacity: .55; } }
@keyframes adv-spin { to { rotate: 360deg; } }
.adv-reveal { position: relative; z-index: 2; width: min(62vw, 340px); aspect-ratio: 1; display: grid; place-items: center; border-radius: 50%;
  background: radial-gradient(circle, #9d8fe6 0%, #5f4fc0 62%, rgba(95, 79, 192, 0) 72%); animation: adv-pop 1.6s cubic-bezier(.2, .8, .2, 1) both; }
.adv-reveal.rare { background: radial-gradient(circle, #8fd6ff 0%, #2f86d0 62%, rgba(47, 134, 208, 0) 72%); }
.adv-reveal .adv-item { width: 78%; height: 78%; margin: 0; filter: drop-shadow(0 4px 8px rgba(0, 0, 0, .3)); }
@keyframes adv-pop { 0% { transform: scale(.1) rotateY(-360deg); opacity: 0; } 55% { transform: scale(1.12) rotateY(15deg); opacity: 1; } 100% { transform: scale(1) rotateY(0); opacity: 1; } }
.adv-flakes span { position: absolute; top: -8vh; animation: adv-fall linear infinite; pointer-events: none; }
@keyframes adv-fall { to { transform: translateY(112vh) rotate(260deg); } }
@keyframes adv-fade { from { opacity: 0; } to { opacity: 1; } }
.adv-win { position: absolute; z-index: 4; left: 50%; bottom: 8vh; transform: translateX(-50%); width: min(92vw, 520px); background: #fff; border-radius: 22px; padding: 18px 20px 20px; text-align: center; box-shadow: 0 12px 40px rgba(0, 0, 0, .4); animation: adv-win-in .5s ease-out both; }
.adv-win[hidden] { display: none; }
.adv-win h2 { margin: 0 0 6px; font-size: clamp(1.4rem, 5vw, 1.9rem); color: #b5171f; }
.adv-rar { margin: 0 0 12px; color: #5b5680; font-weight: 700; }
.adv-rar.rare { color: #1d6fb8; }
.adv-win .btn { display: block; width: 100%; margin: 8px 0 0; }
@keyframes adv-win-in { from { transform: translate(-50%, 40px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }
.adv-stage.done .adv-reveal { transform: translateY(-14vh) scale(.82); transition: transform .5s; animation: none; }

/* Animations réduites : plus de mouvement, seulement un fondu */
.adv-stage.calm .adv-rays, .adv-stage.calm .adv-reveal, .adv-wrap.calm .adv-case, body.no-fx .adv-case, body.no-fx .advent-card { animation: none !important; }
.adv-stage.calm .adv-rays { opacity: .25; }
.adv-stage.calm .adv-win { animation: adv-fade .3s both; transform: translateX(-50%); }
.adv-stage.calm.done .adv-reveal { transform: none; }
@media (prefers-reduced-motion: reduce) {
  .adv-rays, .adv-reveal, .adv-case, .advent-card, .adv-flakes span, .adv-win { animation: none !important; }
  .adv-win { transform: translateX(-50%); }
  .adv-stage.done .adv-reveal { transform: none; }
}

/* ---------------- Rendez-vous : bloc séparé des devoirs, tout en gris côté enfant ---------------- */
.rdv-block { margin: 18px 0; padding: 14px 16px; border-radius: 18px; background: #eceef2; color: #3d4350; }
.rdv-block h2 { margin: 0 0 10px; font-size: 1.25rem; color: #3d4350; }
.rdv-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.rdv-item { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; background: #d9dce3; color: #3d4350; border: 0; border-radius: 14px; padding: 10px 14px; font: inherit; cursor: pointer; }
.rdv-item:hover, .rdv-item:focus-visible { background: #cfd3dc; outline: 2px solid #8a91a1; }
.rdv-item .rdv-when { min-width: 92px; font-weight: 700; }
.rdv-item .rdv-what { flex: 1; }
.rdv-item small { display: block; color: #5d6473; }
.rdv-item.annule .rdv-what b { text-decoration: line-through; }
.rdv-tag { flex: none; font-size: .85rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: #8a91a1; color: #fff; }
.rdv-empty { color: #5d6473; margin: 0; }
.rdv-par .rdv-item { cursor: default; }
.rdv-par .rdv-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.rdv-par .rdv-actions .btn { padding: 4px 10px; }
.rdv-par form .grid3 { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.rdv-par .rdv-item { background: #f1f2f6; }
