/* Calendrier de l'Avent Alpanak : style commun, pensé d'abord pour le mobile (375 px). */
:root {
  --nuit: #0b1d3a;
  --ciel: #1f4f8a;
  --neige: #f4f8fc;
  --glace: #cfe3f5;
  --rouge: #c8102e;      /* rouge du drapeau valaisan */
  --rouge-fonce: #9b0c23;
  --texte: #f4f8fc;
  --doux: #a9c2df;
  --rayon: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  min-height: 100vh;
  background: linear-gradient(180deg, var(--nuit) 0%, var(--ciel) 70%, #3c6ea6 100%) fixed;
  background-color: var(--nuit);
  color: var(--texte);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.4;
  -webkit-text-size-adjust: 100%;
}
a { color: var(--glace); }
.page { max-width: 760px; margin: 0 auto; padding: 16px 16px 40px; position: relative; z-index: 1; }

/* En-tête */
.entete { text-align: center; padding: 8px 0 14px; }
.entete h1 { font-size: 1.55rem; margin: 6px 0 4px; letter-spacing: .01em; }
.entete .sous-titre { margin: 0; color: var(--doux); font-size: .95rem; }
.date-du-jour { display: inline-block; margin-top: 10px; padding: 4px 12px; border-radius: 999px;
  background: rgba(255,255,255,.12); font-size: .85rem; }
.date-du-jour.test { background: #8a5a00; }

/* Grille des 24 cases : 4 colonnes sur téléphone, 6 sur grand écran */
.grille { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px;
  grid-template-columns: repeat(4, 1fr); }
@media (min-width: 640px) { .grille { grid-template-columns: repeat(6, 1fr); gap: 12px; } }

.case { position: relative; aspect-ratio: 1 / 1.08; border-radius: var(--rayon); overflow: hidden; }
.case > a, .case > div { position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-decoration: none; color: inherit;
  padding: 6px; text-align: center; }
.case .num { font-size: 1.6rem; font-weight: 800; line-height: 1; }
.case .etiquette { font-size: .68rem; margin-top: 5px; line-height: 1.15; }
.case .record { font-size: .68rem; margin-top: 3px; opacity: .9; }

.case.avenir { background: rgba(255,255,255,.08); border: 1px dashed rgba(255,255,255,.25); color: var(--doux); }
.case.ferme { background: rgba(0,0,0,.25); color: #7f98b6; }
.case.ferme .num { text-decoration: line-through; text-decoration-thickness: 2px; }
.case.ouvert { background: var(--rouge); color: #fff; box-shadow: 0 0 0 3px #fff, 0 6px 18px rgba(0,0,0,.35); }
.case.ouvert.pret a { animation: battement 2.2s ease-in-out infinite; }
.case.ouvert.pret a:active { background: var(--rouge-fonce); }
.case.ouvert.preparation { background: #6b2a36; }
.case.rejouable { background: #2c6e49; }
.case:focus-within { outline: 3px solid #ffd54a; outline-offset: 2px; }
@keyframes battement { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } }

/* Boutons et blocs */
.actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 22px 0 8px; }
.bouton { display: inline-block; min-height: 44px; padding: 11px 18px; border: 0; border-radius: 999px;
  background: #fff; color: var(--nuit); font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; }
.bouton.secondaire { background: rgba(255,255,255,.14); color: #fff; }
.bloc { background: rgba(0,0,0,.2); border-radius: var(--rayon); padding: 14px 16px; margin-top: 18px; }
.bloc h2 { font-size: 1.05rem; margin: 0 0 6px; }
.bloc p { margin: 6px 0; font-size: .92rem; }
.pied { text-align: center; color: var(--doux); font-size: .78rem; margin-top: 26px; }
.message { text-align: center; min-height: 1.4em; font-size: .9rem; color: var(--glace); }

/* Page « jour fermé / à venir » */
.garde { max-width: 420px; margin: 18vh auto 0; padding: 16px; text-align: center; font-size: 1.1rem; }
.garde-num { font-size: 4rem; font-weight: 800; margin: 0; }

/* Neige légère (coupée si l'appareil demande moins d'animations) */
.neige { position: fixed; inset: 0; pointer-events: none; z-index: 0; }
@media (prefers-reduced-motion: reduce) {
  .neige { display: none; }
  .case.ouvert.pret a { animation: none; }
}

/* Choix de la langue (premier passage) */
.choix-langue { position: fixed; inset: 0; z-index: 10; background: rgba(11,29,58,.92);
  display: flex; align-items: center; justify-content: center; padding: 16px; }
.choix-langue-boite { width: 100%; max-width: 340px; display: flex; flex-direction: column; gap: 12px; text-align: center; }
.choix-langue-titre { font-size: .95rem; color: var(--glace); margin: 0 0 6px; }
.choix-langue .bouton { width: 100%; font-size: 1.1rem; }
.langues { text-align: center; margin-top: 18px; }
.langues select { min-height: 40px; padding: 6px 10px; border-radius: 10px; border: 0; font: inherit; }
