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

html, body {
  height: 100%;
}

body {
  background: url('assets/midsommar.webp') center center / cover no-repeat fixed;
  min-height: 100vh;
  font-family: 'Playfair Display', Georgia, serif;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 1rem;
  overflow-x: hidden;
  user-select: none;
}

.flowers {
  font-size: 1.6rem;
  letter-spacing: 0.4em;
  opacity: 0.85;
}

.app {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.75rem;
  width: 100%;
}

.title {
  color: #ffe566;
  font-size: clamp(1.6rem, 6vw, 2.2rem);
  text-align: center;
  letter-spacing: 0.06em;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

/* Wheel */
.wheel-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pointer {
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 13px solid transparent;
  border-right: 13px solid transparent;
  border-top: 26px solid #ffe566;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.6));
  z-index: 10;
}

#wheel {
  display: block;
  border-radius: 50%;
  box-shadow:
    0 0 0 4px #ffe566,
    0 0 40px rgba(0, 0, 0, 0.6),
    0 0 80px rgba(255, 229, 102, 0.15);
}

/* Spin button */
.spin-btn {
  background: #ffe566;
  color: #1b4332;
  border: none;
  padding: 0.9rem 3.5rem;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.4rem;
  font-weight: 700;
  border-radius: 50px;
  cursor: pointer;
  letter-spacing: 0.05em;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  -webkit-tap-highlight-color: transparent;
}

.spin-btn:hover:not(:disabled) {
  transform: scale(1.06);
  box-shadow: 0 6px 28px rgba(0, 0, 0, 0.45);
}

.spin-btn:active:not(:disabled) {
  transform: scale(0.96);
}

.spin-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 1rem;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: linear-gradient(160deg, rgba(255, 252, 220, 0.97) 0%, rgba(210, 240, 195, 0.97) 100%);
  border: 3px solid #5a9e3a;
  border-radius: 24px;
  padding: 2.5rem 2rem 2rem;
  text-align: center;
  width: 100%;
  max-width: 340px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.3);
  animation: popIn 0.38s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes popIn {
  from {
    opacity: 0;
    transform: scale(0.4);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.modal-emoji {
  font-size: 3.5rem;
  line-height: 1;
}

.modal-media {
  margin-bottom: 0.5rem;
}

.modal-img {
  width: 220px;
  height: 220px;
  object-fit: cover;
  border-radius: 16px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.modal-label {
  color: #2a6e1a;
  font-size: clamp(1.6rem, 7vw, 2.2rem);
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 700;
  margin-bottom: 1.75rem;
  text-shadow: none;
  line-height: 1.25;
}

.modal-desc {
  color: #3a6e25;
  font-size: 1rem;
  font-family: Georgia, serif;
  font-style: italic;
  margin-bottom: 1.5rem;
  line-height: 1.4;
}

.close-btn {
  background: #4a9e2a;
  color: #fff;
  border: none;
  padding: 0.75rem 2.25rem;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.1rem;
  font-weight: 700;
  border-radius: 50px;
  cursor: pointer;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.3);
  transition: transform 0.1s ease;
  -webkit-tap-highlight-color: transparent;
}

.close-btn:hover {
  transform: scale(1.05);
}

.close-btn:active {
  transform: scale(0.96);
}

/* Confetti canvas */
.confetti-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 150;
}
