/* Calendrier de l'Avent (v0.28.0). Chargée seulement par les pages du jeu. */
.avent-page {
  --avent-fond: #f5f8fc;
  --avent-carte: #ffffff;
  --avent-trait: #d9e2ef;
  --avent-texte: #111827;
  --avent-doux: #64748b;
  --avent-or: #b88a1b;
  --avent-ouverte: #10b981;
}

html[data-theme="dark"] .avent-page {
  --avent-fond: #07111f;
  --avent-carte: #0d1b2e;
  --avent-trait: #1e2a3a;
  --avent-texte: #e2e8f0;
  --avent-doux: #94a3b8;
  --avent-or: #e8c75f;
}

.avent-main {
  max-width: 1080px;
  margin: 0 auto;
  padding: 32px 20px 64px;
  color: var(--avent-texte);
}

.avent-hero {
  text-align: center;
  padding: 24px 0 8px;
}

.avent-eyebrow {
  margin: 0 0 8px;
  color: var(--avent-or);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 13px;
}

.avent-hero h1 {
  margin: 0 0 12px;
  font-size: clamp(30px, 5vw, 46px);
}

.avent-lead {
  max-width: 720px;
  margin: 0 auto;
  color: var(--avent-doux);
  font-size: 18px;
}

.avent-annonce {
  margin: 16px auto 0;
  font-weight: 600;
}

.avent-carte {
  margin: 24px auto;
  padding: 24px;
  border: 1px solid var(--avent-trait);
  border-radius: 14px;
  background: var(--avent-carte);
}

.avent-carte h2 {
  margin-top: 0;
}

.avent-champ {
  display: grid;
  gap: 6px;
  margin-bottom: 14px;
  font-weight: 600;
}

.avent-champ input {
  padding: 10px 12px;
  border: 1px solid var(--avent-trait);
  border-radius: 8px;
  font: inherit;
}

.avent-piege {
  position: absolute;
  left: -10000px;
}

.avent-message {
  margin: 14px 0 0;
  font-weight: 600;
}

.avent-message.is-erreur,
.avent-resultat.is-erreur {
  color: #ef4444;
}

.avent-note {
  color: var(--avent-doux);
}

.avent-deja {
  margin-top: 18px;
}

.avent-deja summary {
  cursor: pointer;
  font-weight: 600;
}

.avent-chances {
  margin: 4px 0;
  font-size: 26px;
  font-weight: 800;
}

.avent-numero,
.avent-detail {
  margin: 0;
  color: var(--avent-doux);
}

.avent-actions {
  margin: 16px 0;
}

.avent-parrainage {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--avent-trait);
}

.avent-lien-parrainage {
  display: flex;
  gap: 8px;
}

.avent-lien-parrainage input,
.avent-champ input {
  background: var(--avent-fond);
  color: var(--avent-texte);
}

.avent-lien-parrainage input {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--avent-trait);
  border-radius: 8px;
  font: inherit;
}

.avent-partage {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.avent-x,
.avent-telecharger {
  margin-top: 16px;
}

.avent-mobile {
  color: var(--avent-or);
  font-weight: 600;
}

.avent-lien-discret {
  padding: 0;
  border: 0;
  background: none;
  color: var(--avent-doux);
  font: inherit;
  font-size: 14px;
  text-decoration: underline;
  cursor: pointer;
}

.avent-calendrier {
  margin: 32px 0;
}

.avent-grille {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 18px 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Les portes (06/11/2026), d'après le P du logo de Portalis : les couleurs du logo clair, puis
   celles du logo sombre. Fermée : en gris, au cadenas. Du jour : un halo doré. Ouverte par le
   joueur : le battant s'efface, on voit le logo, barres et marches. */
.avent-defs {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.avent-masque {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.avent-case > a,
.avent-case.is-fermee {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 2px 0 4px;
  border-radius: 12px;
  color: var(--avent-doux);
  text-align: center;
  text-decoration: none;
}

.avent-case > a:focus-visible {
  outline: 3px solid var(--avent-or);
  outline-offset: 4px;
}

.avent-porte {
  display: block;
  width: 100%;
  max-width: 150px;
  height: auto;
  overflow: visible;
}

.avent-porte-p { fill: url(#avent-p-clair); }
.avent-porte-dedans { fill: #ffffff; }
.avent-porte-barres rect { fill: url(#avent-barres-clair); }
.avent-porte-marches path { fill: url(#avent-marches-clair); }
.avent-porte-panneau { fill: url(#avent-battant-clair); }
.avent-porte-moulure { fill: none; stroke: rgba(255, 255, 255, 0.18); stroke-width: 5; }
.avent-porte-poignee { fill: #e8c75f; }
.avent-porte-cadenas { fill: #e2e8f0; }
.avent-porte-anse { stroke: #e2e8f0; }

.avent-porte-numero {
  fill: #ffffff;
  font-family: "DM Sans", "Segoe UI", Arial, sans-serif;
  font-weight: 800;
  letter-spacing: -4px;
  text-anchor: middle;
  dominant-baseline: central;
}

html[data-theme="dark"] .avent-page .avent-porte { filter: drop-shadow(0 0 10px rgba(47, 107, 255, 0.35)); }
html[data-theme="dark"] .avent-page .avent-porte-p { fill: url(#avent-p-sombre); }
html[data-theme="dark"] .avent-page .avent-porte-dedans { fill: #02101c; }
html[data-theme="dark"] .avent-page .avent-porte-barres rect { fill: url(#avent-barres-sombre); }
html[data-theme="dark"] .avent-page .avent-porte-marches path { fill: url(#avent-marches-sombre); }
html[data-theme="dark"] .avent-page .avent-porte-panneau { fill: url(#avent-battant-sombre); }
html[data-theme="dark"] .avent-page .avent-porte-cadenas { fill: #94a3b8; }
html[data-theme="dark"] .avent-page .avent-porte-anse { stroke: #94a3b8; }

.avent-case.is-fermee .avent-porte-p { fill: #94a3b8; }
.avent-case.is-fermee .avent-porte-panneau { fill: #64748b; }
.avent-case.is-fermee .avent-porte-marches path { fill: #cbd5e1; }
.avent-case.is-fermee .avent-porte-numero { fill: rgba(255, 255, 255, 0.78); }
html[data-theme="dark"] .avent-page .avent-case.is-fermee .avent-porte { filter: none; }
html[data-theme="dark"] .avent-page .avent-case.is-fermee .avent-porte-p { fill: #475569; }
html[data-theme="dark"] .avent-page .avent-case.is-fermee .avent-porte-panneau { fill: #1e293b; }
html[data-theme="dark"] .avent-page .avent-case.is-fermee .avent-porte-marches path { fill: #334155; }

.avent-case.is-du-jour .avent-porte,
html[data-theme="dark"] .avent-page .avent-case.is-du-jour .avent-porte {
  filter: drop-shadow(0 0 9px rgba(232, 199, 95, 0.95));
}

.avent-case.is-du-jour .avent-case-etat {
  color: var(--avent-or);
  font-weight: 700;
}

.avent-case.is-faite .avent-porte-battant {
  display: none;
}

.avent-case.is-faite .avent-case-etat {
  color: var(--avent-ouverte);
  font-weight: 700;
}

.avent-case-etat {
  font-size: 13px;
}

.avent-tableau {
  width: 100%;
  border-collapse: collapse;
}

.avent-tableau th,
.avent-tableau td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--avent-trait);
  text-align: left;
}

.avent-retour {
  margin: 0 0 8px;
}

.avent-resultat {
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(16, 185, 129, 0.12);
  font-weight: 600;
}

.avent-texte {
  font-size: 17px;
  line-height: 1.6;
}

.avent-case-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

/* Le règlement : des articles qui respirent, lisibles d'un bout à l'autre. */
.avent-reglement h2 {
  margin: 28px 0 8px;
  font-size: 19px;
}

.avent-reglement p,
.avent-reglement li {
  line-height: 1.6;
}

.avent-reglement ol,
.avent-reglement ul {
  padding-left: 22px;
}

.avent-reglement li + li {
  margin-top: 6px;
}

@media (max-width: 720px) {
  .avent-grille {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .avent-lien-parrainage {
    flex-direction: column;
  }
}
