* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top, #ffecd2 0%, #fcb69f 40%, #b11226 100%);
  min-height: 100vh;
  display: flex;
  align-items: stretch;
  justify-content: center;
  color: #fff;
}

/* Loader */

#loader {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at top, #ffe9f0 0%, #c62828 60%, #4e0020 100%);
  z-index: 50;
}

.loader-content {
  text-align: center;
  padding: 2.5rem 3rem;
  border-radius: 1.5rem;
  background: rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(8px);
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.45);
}

.loader-title {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  letter-spacing: 1px;
}

.loader-text {
  font-size: 1rem;
  opacity: 0.9;
  margin-bottom: 1.5rem;
}

.loader-spinner {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 4px solid rgba(255, 255, 255, 0.4);
  border-top-color: #ffe066;
  animation: spin 1s linear infinite;
  margin: 0 auto;
}

/* Conținut principal */

.background {
  position: relative;
  width: 100%;
  max-width: 1200px;
  margin: 1.5rem;
  border-radius: 1.5rem;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

/* Zăpadă animată simplă */

.snow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(2px 2px at 20px 20px, rgba(255, 255, 255, 0.9) 50%, transparent 50%),
    radial-gradient(3px 3px at 200px 150px, rgba(255, 255, 255, 0.8) 50%, transparent 50%),
    radial-gradient(2px 2px at 400px 80px, rgba(255, 255, 255, 0.85) 50%, transparent 50%),
    radial-gradient(3px 3px at 600px 120px, rgba(255, 255, 255, 0.75) 50%, transparent 50%);
  background-repeat: repeat;
  background-size: 300px 300px;
  animation: snow-fall 18s linear infinite;
  opacity: 0.7;
}

.overlay {
  position: relative;
  padding: 2.5rem 2.5rem 3rem;
  background: radial-gradient(circle at top, #1b3b5f 0%, #0f1c3a 60%, #050814 100%);
}

/* Header */

.header {
  text-align: center;
  margin-bottom: 2rem;
}

.title {
  font-size: 2.3rem;
  margin-bottom: 0.5rem;
  text-shadow: 0 3px 8px rgba(0, 0, 0, 0.6);
}

.subtitle {
  font-size: 1rem;
  opacity: 0.9;
}

/* Grid de cadouri */

.grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.gift-card {
  position: relative;
  background: linear-gradient(135deg, #e53935, #b71c1c);
  border-radius: 1rem;
  padding: 0.75rem;
  cursor: pointer;
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.4);
  transform: translateY(0);
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.gift-card::before {
  content: "";
  position: absolute;
  inset: 12%;
  border-radius: 0.8rem;
  border: 3px solid rgba(255, 255, 255, 0.5);
  pointer-events: none;
}

.gift-ribbon-vertical,
.gift-ribbon-horizontal {
  position: absolute;
  background: linear-gradient(180deg, #ffe082, #ffca28);
  opacity: 0.9;
}

.gift-ribbon-vertical {
  width: 16%;
  left: 42%;
  top: 0;
  bottom: 0;
}

.gift-ribbon-horizontal {
  height: 16%;
  top: 42%;
  left: 0;
  right: 0;
}

.gift-bow {
  position: absolute;
  top: 6%;
  left: 50%;
  transform: translateX(-50%);
  width: 26px;
  height: 18px;
  border-radius: 999px;
  border: 3px solid #ffe082;
  box-shadow: 0 0 0 2px rgba(183, 28, 28, 0.7);
}

.gift-label {
  position: relative;
  margin-top: 2.4rem;
  background: rgba(255, 255, 255, 0.96);
  color: #b71c1c;
  font-weight: 600;
  text-align: center;
  padding: 0.35rem 0.4rem;
  border-radius: 0.5rem;
  font-size: 0.8rem;
  box-shadow: inset 0 0 0 1px rgba(183, 28, 28, 0.3);
}

.gift-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 26px rgba(0, 0, 0, 0.55);
  background: linear-gradient(135deg, #ff5252, #c62828);
}

.gift-card.opened {
  opacity: 0.8;
  background: linear-gradient(135deg, #8bc34a, #558b2f);
}

.gift-card.opened .gift-label {
  background: #f1ffe0;
  color: #33691e;
}

/* Animatie la deschidere */

.gift-card.just-opened {
  animation: gift-open 0.6s ease-out forwards;
}

/* Modal */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 40;
}

.modal {
  background: #0f1c3a;
  padding: 2rem 2.2rem 2.1rem;
  border-radius: 1.25rem;
  box-shadow: 0 22px 40px rgba(0, 0, 0, 0.6);
  max-width: 380px;
  width: 100%;
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.modal h2 {
  font-size: 1.4rem;
  margin-bottom: 0.3rem;
}

.modal-gift-label {
  font-size: 0.9rem;
  opacity: 0.8;
}

.modal-gift-name {
  font-size: 1.1rem;
  font-weight: 600;
  color: #ffe082;
  margin-bottom: 1rem;
}

.modal-label {
  display: block;
  font-size: 0.9rem;
  margin-bottom: 0.4rem;
}

.modal-input {
  width: 100%;
  padding: 0.5rem 0.7rem;
  border-radius: 0.6rem;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(5, 11, 32, 0.9);
  color: #fff;
  font-size: 0.95rem;
  margin-bottom: 0.9rem;
}

.modal-input:focus {
  outline: none;
  border-color: #ffe082;
  box-shadow: 0 0 0 1px rgba(255, 224, 130, 0.6);
}

.primary-btn {
  width: 100%;
  padding: 0.6rem;
  border: none;
  border-radius: 0.7rem;
  background: linear-gradient(135deg, #ffca28, #ff9800);
  color: #5d1900;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.45);
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.primary-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 24px rgba(0, 0, 0, 0.6);
  filter: brightness(1.05);
}

.close-btn {
  position: absolute;
  top: 0.55rem;
  right: 0.7rem;
  border: none;
  background: transparent;
  color: #fff;
  font-size: 1.4rem;
  cursor: pointer;
}

.feedback {
  margin-top: 0.6rem;
  font-size: 0.85rem;
  min-height: 1.2rem;
}

/* Toast */

.toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(5, 11, 32, 0.96);
  padding: 0.9rem 1.3rem;
  border-radius: 0.9rem;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.7);
  z-index: 45;
  max-width: 480px;
  width: calc(100% - 3rem);
  text-align: center;
  font-size: 0.95rem;
}

/* Helpers */

.hidden {
  display: none;
}

/* Animations */

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes snow-fall {
  0% {
    transform: translateY(-40px);
  }
  100% {
    transform: translateY(40px);
  }
}

@keyframes gift-open {
  0% {
    transform: scale(1) translateY(0);
  }
  40% {
    transform: scale(1.08) translateY(-6px) rotate(-2deg);
  }
  100% {
    transform: scale(1) translateY(-2px);
  }
}

/* Responsive */

@media (max-width: 900px) {
  .grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  .overlay {
    padding: 1.8rem 1.3rem 2.4rem;
  }

  .title {
    font-size: 1.6rem;
  }

  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
