:root {
  --shell-bg: linear-gradient(135deg, #fff7fb 0%, #ffe3ec 50%, #f8d7ec 100%);
  --card-pink: #f7a8c1;
  --card-plum: #c26ba0;
  --text-main: #5e3451;
  --accent-gold: #f9c46b;
  --success-mint: #a6f0d1;
  --locked-grey: rgba(94, 52, 81, 0.3);
  --shadow-soft: 0 15px 35px rgba(94, 52, 81, 0.15);
  font-family: 'Quicksand', 'Segoe UI', Tahoma, sans-serif;
  color: var(--text-main);
  background: #ffeef7;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  background: radial-gradient(circle at top, #fffdfa, #ffe4f3 50%, #ffd6eb 100%);
  display: flex;
  justify-content: center;
  padding: 2rem;
  position: relative;
}

.snow-layer::before,
.snow-layer::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  background-image: radial-gradient(2px 2px at 20px 20px, rgba(255, 255, 255, 0.8), transparent),
    radial-gradient(2px 2px at 80px 0px, rgba(255, 255, 255, 0.8), transparent);
  background-size: 100px 100px;
  animation: snowfall 12s linear infinite;
}

.snow-layer::after {
  animation-duration: 18s;
  opacity: 0.6;
  filter: blur(1px);
}

@keyframes snowfall {
  from {
    transform: translateY(-100px);
  }
  to {
    transform: translateY(100px);
  }
}

.calendar-shell {
  width: min(1100px, 100%);
  background: var(--shell-bg);
  border-radius: 30px;
  padding: 2.5rem;
  box-shadow: var(--shadow-soft);
  position: relative;
  overflow: hidden;
}

.calendar-shell::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" width="120" height="120" viewBox="0 0 120 120"%3E%3Ctext x="10" y="90" font-size="80" opacity="0.08"%3E❤%3C/text%3E%3C/svg%3E');
  opacity: 0.8;
  pointer-events: none;
}

.calendar-hero {
  text-align: center;
  margin-bottom: 2rem;
  position: relative;
  z-index: 1;
}

.hero-overline {
  font-size: 0.95rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--card-plum);
  margin-bottom: 0.75rem;
}

.calendar-hero h1 {
  font-family: 'Quicksand', 'Segoe UI', Tahoma, sans-serif;
  font-weight: 600;
  letter-spacing: 0.05em;
  font-size: clamp(2.4rem, 5vw, 3.4rem);
  margin-bottom: 0.75rem;
}

.hero-body {
  font-size: 1.05rem;
  max-width: 480px;
  margin: 0 auto;
}

.calendar-status {
  background: rgba(255, 255, 255, 0.8);
  border-radius: 99px;
  padding: 0.85rem 1.25rem;
  text-align: center;
  font-size: 0.95rem;
  color: var(--card-plum);
  margin-bottom: 1.5rem;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1rem;
  position: relative;
  z-index: 1;
}

.calendar-card {
  position: relative;
  border: none;
  border-radius: 16px;
  padding: 1.25rem 0.75rem;
  background: linear-gradient(145deg, #ffe1f0, #ffc7df);
  box-shadow: 0 10px 25px rgba(194, 107, 160, 0.25);
  color: var(--card-plum);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
}

.calendar-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 30px rgba(194, 107, 160, 0.35);
}

.calendar-card:focus-visible {
  outline: 3px solid var(--accent-gold);
  outline-offset: 4px;
}

.card-day-count {
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--card-plum);
  letter-spacing: 0.03em;
}

.card-date {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: rgba(90, 32, 78, 0.8);
}

.card-label {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.card-lock {
  font-size: 1.25rem;
  opacity: 0;
  transition: opacity 0.2s ease;
}


.calendar-card.day-25 {
  background: linear-gradient(135deg, #fff4d0, #ffd46b 45%, #ffbd3c 70%, #ffe9a0);
  color: #7a4a00;
  box-shadow: 0 26px 48px rgba(255, 190, 60, 0.45);
}

.calendar-card.day-25::before {
  content: '★';
  position: absolute;
  top: 0.4rem;
  right: 0.6rem;
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.95);
  text-shadow: 0 0 10px rgba(255, 227, 160, 0.9);
}

.calendar-card.day-25.locked {
  background: linear-gradient(135deg, rgba(255, 244, 208, 0.85), rgba(255, 212, 107, 0.85));
  color: rgba(122, 74, 0, 0.8);
  box-shadow: inset 0 0 0 2px rgba(255, 212, 107, 0.4);
}
.calendar-card.day-25.locked .card-lock {
  color: rgba(122, 74, 0, 0.6);
}

.calendar-card.day-25.today {
  animation: shimmer 3s linear infinite;
}

@keyframes shimmer {
  0% {
    filter: drop-shadow(0 0 8px rgba(255, 230, 160, 0.5));
  }
  50% {
    filter: drop-shadow(0 0 18px rgba(255, 210, 120, 0.9));
  }
  100% {
    filter: drop-shadow(0 0 8px rgba(255, 230, 160, 0.5));
  }
}

.calendar-card.locked .card-lock {
  opacity: 1;
}

.calendar-card.locked {
  background: rgba(255, 255, 255, 0.6);
  color: var(--locked-grey);
  box-shadow: inset 0 0 0 2px rgba(94, 52, 81, 0.08);
  cursor: not-allowed;
}

.calendar-card.wiggle {
  animation: wiggle 0.6s ease;
}

@keyframes wiggle {
  0%,
  100% {
    transform: rotate(0deg);
  }
  25% {
    transform: rotate(-3deg);
  }
  75% {
    transform: rotate(3deg);
  }
}

.calendar-card.locked:focus-visible {
  outline-color: var(--locked-grey);
}

.calendar-card.today {
  background: linear-gradient(145deg, #ffdbe6, #f7a8c1);
  color: #7a2254;
  box-shadow: 0 20px 35px rgba(247, 168, 193, 0.4);
}

.calendar-card.today::after {
  content: 'today';
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  background: var(--accent-gold);
  color: #7a2254;
  padding: 0.15rem 0.5rem;
  border-radius: 99px;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(94, 52, 81, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  z-index: 10;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: #fffafc;
  border-radius: 24px;
  padding: 2.5rem;
  width: min(480px, 90vw);
  box-shadow: 0 20px 50px rgba(94, 52, 81, 0.3);
  position: relative;
  text-align: center;
}

.modal-content.modal-finale {
  background: linear-gradient(140deg, #fff8e4, #ffe3b2 55%, #ffd27d 100%);
  border: 3px solid rgba(255, 210, 125, 0.9);
  box-shadow: 0 30px 60px rgba(255, 190, 60, 0.4);
  overflow: hidden;
}

.modal-content.modal-finale::after,
.modal-content.modal-finale::before {
  content: '';
  position: absolute;
  inset: -40%;
  background-image:
    radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.55) 0, rgba(255, 255, 255, 0.55) 4px, transparent 5px),
    radial-gradient(circle at 70% 40%, rgba(255, 105, 180, 0.7) 0, rgba(255, 105, 180, 0.7) 6px, transparent 7px),
    radial-gradient(circle at 40% 70%, rgba(255, 220, 120, 0.7) 0, rgba(255, 220, 120, 0.7) 4px, transparent 5px),
    radial-gradient(circle at 80% 80%, rgba(120, 200, 255, 0.7) 0, rgba(120, 200, 255, 0.7) 6px, transparent 7px),
    radial-gradient(circle at 30% 50%, rgba(255, 170, 120, 0.7) 0, rgba(255, 170, 120, 0.7) 5px, transparent 6px);
  opacity: 0.6;
  pointer-events: none;
  animation: confetti-float 12s linear infinite;
}

.modal-content.modal-finale::before {
  animation-delay: -4s;
  opacity: 0.5;
}

.modal-content.modal-finale .modal-overline {
  color: #b86c00;
  letter-spacing: 0.5em;
}

.modal-content.modal-finale h2 {
  color: #7a4a00;
}

.modal-content.modal-finale .modal-body {
  color: #6a3600;
}

@keyframes confetti-float {
  0% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(10%) rotate(180deg);
  }
  100% {
    transform: translateY(0) rotate(360deg);
  }
}

.modal-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  border: none;
  background: transparent;
  font-size: 1.75rem;
  color: var(--card-plum);
  cursor: pointer;
}

.modal-overline {
  text-transform: uppercase;
  letter-spacing: 0.4em;
  font-size: 0.75rem;
  color: var(--card-plum);
  margin-bottom: 0.75rem;
}

.modal h2 {
  font-family: 'Quicksand', 'Segoe UI', Tahoma, sans-serif;
  font-weight: 600;
  font-size: 2rem;
  letter-spacing: 0.04em;
  margin-bottom: 1rem;
}

.modal-body {
  font-size: 1.05rem;
  line-height: 1.6;
}

.modal-link {
  display: inline-flex;
  margin-top: 1.25rem;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  border-radius: 999px;
  background: var(--card-plum);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  box-shadow: 0 8px 20px rgba(194, 107, 160, 0.35);
}

.modal-link:hover {
  filter: brightness(1.05);
}

.modal-link.hidden {
  display: none;
}

@media (max-width: 768px) {
  body {
    padding: 1rem;
  }

  .calendar-shell {
    padding: 1.75rem;
  }

  .calendar-grid {
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  }
}
