/* === GLOBAL === */
html,
body {
  background-color: #1a1a1a; /* anthracite partout, tout le temps */
}

body {
  font-family: "Great Vibes", cursive, Arial, sans-serif;
  margin: 0;
  background: url('background.png') no-repeat center center fixed;
  background-size: cover;
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 40px;
  padding-bottom: 40px;
}


/* === HEADER WRAPPER (centers the title) === */
.header-wrap {
  display: flex;
  flex-direction: column;
  justify-content: center;      /* vertical centering */
  align-items: center;          /* horizontal centering */
  height: 22vh;
  max-width: 950px;             /* desktop width (5 x 150) */
  width: 100%;
  text-align: center;
  margin: 0 auto;
}

h1 {
  margin: 0;
  font-size: 8rem;
  text-shadow: 2px 2px 5px #000;
  width: 100%;
  overflow-wrap: break-word;
}

/* === CALENDAR === */
.calendar {
  position: relative;
  z-index: 10; /* above snowflakes */
  display: grid;
  grid-template-columns: repeat(5, 150px);
  grid-gap: 20px;
  margin-top: 10px;
}

.day {
  width: 150px;
  height: 150px;
  background: url('case-background.png') no-repeat center;
  background-size: cover;
  border: 2px solid rgba(0,0,0,0.6);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.6);
  text-align: center;
  line-height: 150px;
  font-size: 100px;
  font-weight: bold;
  color: #fff;
  position: relative;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45);
  text-shadow: 0 4px 8px rgba(0, 0, 0, 0.65);
}

.day img {
  display: none;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.day.opened img {
  display: block;
}

.day.empty {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  cursor: default;
}


/* === RESPONSIVE - TABLET === */
@media (max-width: 1020px) {
  h1 {
    font-size: 4rem;
  }

  .calendar {
    grid-template-columns: repeat(3, 150px);
    grid-gap: 15px;
  }

  .header-wrap {
    height: 18vh;
    max-width: 450px; /* 3 x 150 */
  }
}

/* === RESPONSIVE - MOBILE === */
@media (max-width: 670px) {
  h1 {
    font-size: 3.6rem;
    width: 100%;
    text-align: center;
    word-wrap: break-word;
  }
  
  .calendar {
    grid-template-columns: repeat(3, 75px);
    grid-gap: 5px;
  }
  
  .day {
    width: 75px;
    height: 75px;
    line-height: 75px;
    font-size: 50px;
  }
  
  .day img {
    width: 100%;
    height: 100%;
  }
  
  .header-wrap {
    height: 15vh;
    max-width: 100%;  /* full width on mobile */
    width: 100%;
  }
}


/* === OVERLAY === */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.8);
  visibility: hidden;
  opacity: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: 0.3s ease;
  z-index: 1000;
}

.overlay.show {
  visibility: visible;
  opacity: 1;
}

.overlay-container {
  position: relative;
  max-width: 90%;
  max-height: 90%;
}

.overlay img,
.overlay video {
  max-width: 90vw;
  max-height: 90vh;
  border: 5px solid #fff;
  border-radius: 10px;
  box-shadow: 0 0 15px rgba(255,255,255,0.7);
}

.close-btn {
  position: absolute;
  top: -15px;
  right: -15px;
  width: 40px;
  height: 40px;
  background: url('cancel.png') no-repeat center;
  background-size: cover;
  border: none;
  cursor: pointer;
}

.reset-btn {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: transparent;
  color: transparent;
  border: none;
  width: 50px;
  height: 50px;
  cursor: pointer;
  z-index: 1000;
}



/* === FALLING SNOW === */
.snowflake {
  position: fixed;
  top: -10px;
  left: 0;
  color: #ffffff;
  z-index: 0; /* snow behind the calendar but still visible */
  pointer-events: none;
  user-select: none;
  animation-name: snowfall;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}

@keyframes snowfall {
  0% {
    transform: translate3d(0, -10px, 0);
  }
  100% {
    transform: translate3d(0, 110vh, 0);
  }
}

/* Mobile-specific background */
@media (max-width: 670px) {
  body {
    /* Only override the background image and related properties */
    background-image: url('background-mobile.png');
    background-repeat: no-repeat;
    background-position: center center;
    background-size: cover;
    background-attachment: scroll; /* safer on mobile */
  }
}



/* === SPECIAL DAY 24 (gold highlight) === */
.special-24 {
  border: 1px solid rgba(255, 215, 0, 0.6);
  box-shadow: 0 4px 14px rgba(255, 215, 0, 0.6);
  color: rgba(255, 215, 0, 0.9);
  text-shadow: 0 4px 8px rgba(255, 215, 0, 0.1);
}
