/**
 * Calendrier de l'avent — styles de base (le thème peut surcharger).
 */

.cal-avent {
  max-width: 1160px;
  margin: 0 auto;
  font-family: inherit;
}
.cal-avent .cal-avent-player {
  margin: 0 0 16px;
  font-weight: 600;
}

.cal-avent-register {
  background: #faf7f2;
  border: 1px solid #e8e2d7;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 24px;
}
.cal-avent-register-title {
  margin: 0 0 8px;
  font-size: 1.25em;
}
.cal-avent-register-intro {
  margin: 0 0 16px;
}
.cal-avent-field {
  margin: 0 0 12px;
}
.cal-avent-field label {
  display: block;
  margin-bottom: 4px;
  font-size: 0.95em;
}
.cal-avent-field input[type="email"],
.cal-avent-field input[type="text"] {
  width: 100%;
  max-width: 420px;
  padding: 8px 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
}
.cal-avent-consent {
  font-size: 0.9em;
  display: flex;
  gap: 8px;
  align-items: flex-start;
}
.cal-avent-hp {
  position: absolute !important;
  left: -9999px !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.cal-avent-submit {
  background: #cb5040;
  color: #fff;
  border: 0;
  border-radius: 6px;
  padding: 10px 22px;
  font-size: 1em;
  cursor: pointer;
}
.cal-avent-submit:disabled {
  opacity: 0.6;
  cursor: default;
}
.cal-avent-note {
  font-size: 0.9em;
  color: #777;
}

/* --- Consentement RGPD + popup --- */
.cal-av-consent-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.cal-av-consent {
  align-items: center;
}
.cal-av-rgpd-open {
  border: 1px solid #c8c2b6;
  background: #fff;
  color: #333;
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 0.85em;
  cursor: pointer;
}
.cal-av-rgpd-open:hover {
  background: #f2efe9;
}

.cal-av-popup {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.cal-av-popup[hidden] {
  display: none;
}
.cal-av-popup-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
}
.cal-av-popup.cal-av-thanks.has-bg .cal-av-popup-backdrop {
  background-color: #0b0b10;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  box-shadow: inset 0 0 0 9999px rgba(0, 0, 0, 0.55);
}
.cal-av-popup-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 440px;
  max-height: 80vh;
  overflow: auto;
  background: #fff;
  color: #1d2327;
  border-radius: 12px;
  padding: 26px 24px 24px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
}
.cal-av-popup-title {
  margin: 0 0 10px;
  font-size: 1.1em;
}
.cal-av-popup-body {
  font-size: 0.95em;
  line-height: 1.65;
}
.cal-av-popup-close {
  position: absolute;
  top: 4px;
  right: 8px;
  border: 0;
  background: transparent;
  color: #666;
  font-size: 1.5em;
  line-height: 1;
  padding: 4px 8px;
  cursor: pointer;
}

/* --- Calendrier : grille 5 x 5, cases rondes --- */
.cal-avent-layout {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 40px;
}
.cal-avent-side {
  flex: 0 0 auto;
  text-align: center;
}
.cal-avent-side-logo {
  display: block;
  width: min(200px, 38vw);
  height: auto;
  margin: 0 auto 14px;
}
.cal-avent-side-text {
  margin: 0 auto;
  max-width: 14ch;
  font-size: 1.2em;
  font-weight: 700;
  line-height: 1.3;
}

.cal-avent-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  width: 100%;
  max-width: 1056px;
  margin: 0 auto;
}
.cal-avent-door {
  position: relative;
  box-sizing: border-box;
  aspect-ratio: 1 / 1;
  width: 100%;
  max-width: min(130px, 20vw);
  justify-self: center;
  border-radius: 50%;
  overflow: hidden;
}
.cal-avent-door-front {
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1em;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 2px;
  background: #cb5040;
  color: #fff;
  text-align: center;
  transition:
    transform 0.15s ease,
    filter 0.15s ease;
}
.cal-avent-door.is-openable .cal-avent-door-front:hover {
  transform: scale(1.04);
  filter: brightness(1.08);
}
.cal-avent-door.is-openable .cal-avent-door-front:focus-visible {
  outline: 3px solid #fff;
  outline-offset: -6px;
}
.cal-avent-door-day {
  font-size: 2em;
  font-weight: 800;
  line-height: 1;
  color: inherit;
}
.cal-avent-door-front:disabled {
  cursor: default;
  opacity: 1;
  -webkit-text-fill-color: #fff;
}
.cal-avent-door.is-past {
  opacity: 0.5;
}
.cal-avent-door.is-past .cal-avent-door-front,
.cal-avent-door.is-future .cal-avent-door-front {
  cursor: default;
}
.cal-avent-door.is-won {
  border: 3px solid #cb5040;
}
.cal-avent-lock {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4em;
  pointer-events: none;
}
.cal-avent-door-inner {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  text-align: center;
  padding: 8px;
  background: #f4f1ea;
  color: #333;
}
.cal-avent-door.is-won .cal-avent-door-inner {
  background: #d8cebc;
  color: #cb5040;
}
.cal-avent-badge {
  display: inline-block;
  background: #cb5040;
  color: #fff;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 0.7em;
  font-weight: 700;
}
.cal-avent-prize-img {
  width: 100%;
  display: flex;
  justify-content: center;
}
.cal-avent-prize-img img {
  max-width: 100%;
  max-height: 88px;
  object-fit: contain;
  border-radius: 4px;
}
.cal-avent-prize {
  margin: 0;
  font-size: 0.85em;
  font-weight: 600;
  line-height: 1.2;
}
.cal-avent-code {
  margin: 0;
  font-size: 0.75em;
  font-family: monospace;
  word-break: break-all;
}
.cal-avent-lost {
  font-size: 0.75em;
  color: #888;
  font-style: italic;
}
.cal-avent-door.is-busy .cal-avent-door-front {
  opacity: 0.5;
}

.cal-avent-message {
  min-height: 1.4em;
  margin-top: 16px;
  text-align: center;
  font-weight: 600;
}
.cal-avent-empty {
  text-align: center;
  color: #888;
}

/* --- Grattage --- */
.cal-scratch-lock {
  overflow: hidden;
}
.cal-scratch {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.72);
}
.cal-scratch.has-bg {
  background-color: #0b0b10;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.cal-scratch.has-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}
.cal-scratch.has-bg .cal-scratch-modal {
  position: relative;
  z-index: 1;
}
.cal-scratch-modal {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
.cal-scratch-card {
  background: transparent;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
}
.cal-scratch-slot {
  position: relative;
  box-sizing: border-box;
  width: min(340px, 86vw);
  height: min(280px, 58vh);
  background: #d8cebc;
  border: 3px solid #cb5040;
  border-radius: 10px;
  overflow: hidden;
}
.cal-scratch-underground {
  position: absolute;
  inset: 0;
}
.cal-scratch-prize {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  padding: 16px;
}
.cal-scratch-prize.is-won {
  background: #d8cebc;
}
.cal-scratch-prize.is-lost {
  background: #d8cebc;
  color: #666;
}
.cal-scratch-label {
  font-size: 1.4em;
  font-weight: 800;
  line-height: 1.1;
}
.cal-scratch-prize.is-won .cal-scratch-label {
  color: #cb5040;
}
.cal-scratch-img {
  max-width: 100%;
  max-height: 120px;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25);
}
.cal-scratch-prize-title {
  margin: 0;
  font-size: 1em;
  font-weight: 600;
}
.cal-scratch-code {
  margin: 0;
  font-size: 0.9em;
  font-family: monospace;
  font-weight: 700;
}
.cal-scratch-lost-text {
  margin: 0;
  font-size: 0.95em;
}
.cal-scratch-foil {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: grab;
  transition: opacity 0.5s ease;
}
.cal-scratch-foil.is-revealed {
  opacity: 0;
}
.cal-scratch-hint {
  position: absolute;
  bottom: 10px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 0.8em;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.cal-scratch-hint.is-gone {
  opacity: 0;
}
.cal-scratch-actions {
  display: flex;
  gap: 10px;
}
.cal-scratch-actions button {
  border: 0;
  border-radius: 6px;
  padding: 9px 20px;
  font-size: 0.95em;
  font-weight: 600;
  cursor: pointer;
}
.cal-scratch-reveal {
  background: #e5e5e5;
  color: #333;
}
.cal-scratch-continue {
  background: #cb5040;
  color: #fff;
}

/* --- Roue --- */
.cal-wheel-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.cal-wheel-stage {
  position: relative;
  width: min(300px, 74vw);
  aspect-ratio: 1;
}
.cal-wheel {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  overflow: hidden;
  border: 6px solid #fff;
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.4);
}
.cal-wheel-seg {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 11%;
  font-size: 0.78em;
  font-weight: 800;
  letter-spacing: 0.02em;
  transform-origin: 50% 50%;
}
.cal-wheel-seg.is-win {
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}
.cal-wheel-seg.is-lose {
  color: #7a6f5d;
}
.cal-wheel-pointer {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 11px solid transparent;
  border-right: 11px solid transparent;
  border-top: 24px solid #cb5040;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.45));
  z-index: 2;
}
.cal-wheel-hub {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 20%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  z-index: 1;
}
.cal-wheel-result {
  width: 100%;
}
.cal-wheel-result .cal-scratch-prize {
  position: static;
  border-radius: 10px;
}

/* --- Grattage multi-choix --- */
.cal-scratch-multi .cal-scratch-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.cal-multi-intro {
  margin: 0;
  font-weight: 700;
  text-align: center;
}
.cal-multi-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}
.cal-multi-slot {
  position: relative;
  box-sizing: border-box;
  width: min(150px, 27vw);
  height: min(165px, 36vh);
  background: #d8cebc;
  border: 3px solid #cb5040;
  border-radius: 10px;
  overflow: hidden;
  transition:
    opacity 0.4s ease,
    transform 0.4s ease,
    box-shadow 0.3s ease;
}
.cal-multi-slot.is-picked {
  box-shadow: 0 0 0 4px #cb5040;
}
.cal-multi-slot.is-discarded {
  opacity: 0.25;
  transform: scale(0.94);
  pointer-events: none;
}

/* --- Grille : empilement sous 940px --- */
@media (max-width: 940px) {
  .cal-avent-layout {
    flex-direction: column;
    gap: 22px;
  }
  .cal-avent-side-logo {
    width: min(150px, 34vw);
  }
  .cal-avent-side-text {
    max-width: none;
  }
  .cal-avent-grid {
    gap: 10px;
  }
}
