body {
  position: relative;
  background-color: var(--bs-body-bg);
  color: var(--bs-body-color);
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  overflow: hidden;
}

.cover-container {
  max-width: 42em;
  position: relative;
  z-index: 1;
}

.background.valentines {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background-image: url("./assets/img/background-alliance.png");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  pointer-events: none;
  z-index: 0;
  opacity: 0.55;
}

.hearts {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hearts li {
  position: absolute;
  list-style: none;
  font-size: 100px;
  color: rgba(255, 255, 255, 0.7);
  bottom: -100px;
  animation: floatHeart 25s infinite linear;
  opacity: 0.85;
}

.hearts li:nth-child(1) { left: 8%; font-size: 20px; animation-duration: 20s; animation-delay: 2s; }
.hearts li:nth-child(2) { left: 18%; font-size: 36px; animation-duration: 28s; animation-delay: 6s; }
.hearts li:nth-child(3) { left: 28%; font-size: 32px; animation-duration: 22s; animation-delay: 4s; }
.hearts li:nth-child(4) { left: 38%; font-size: 48px; animation-duration: 30s; animation-delay: 1s; }
.hearts li:nth-child(5) { left: 48%; font-size: 26px; animation-duration: 26s; animation-delay: 8s; }
.hearts li:nth-child(6) { left: 58%; font-size: 44px; animation-duration: 34s; animation-delay: 3s; }
.hearts li:nth-child(7) { left: 68%; font-size: 34px; animation-duration: 24s; animation-delay: 5s; }
.hearts li:nth-child(8) { left: 78%; font-size: 22px; animation-duration: 36s; animation-delay: 7s; }
.hearts li:nth-child(9) { left: 88%; font-size: 16px; animation-duration: 40s; animation-delay: 9s; }
.hearts li:nth-child(10) { left: 94%; font-size: 55px; animation-duration: 38s; animation-delay: 11s; }

@keyframes floatHeart {
  0% { transform: translateY(0) scale(1) rotate(0deg); opacity: 0; }
  10% { opacity: 1; }
  100% { transform: translateY(-1200px) scale(1.4) rotate(360deg); opacity: 0; }
}

.cover-container main {
  flex: 1;
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: center;
}

.scene {
  display: none;
  width: 100%;
  /* height: 100%; */
  animation: sceneIn 0.6s ease;
  align-items: center;
  justify-content: center;
}

.scene.active {
  display: flex;
}

@keyframes sceneIn {
  from { opacity: 0; transform: translateY(20px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.scene-card {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  padding: 2rem;
  border-radius: 28px;
  max-width: 540px;
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.12),
    0 3px 12px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.65);
  margin: 0 auto;
}

.scene-emoji {
  font-size: 3.5rem;
  line-height: 1;
  animation: pulse 2s ease infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

.catch-hud {
  display: flex;
  justify-content: center;
  gap: 2rem;
}

.catch-hud-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 90px;
  padding: 0.5rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.7);
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.08);
}

.catch-hud-label {
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  opacity: 0.65;
}

.catch-hud-value {
  font-size: 1.5rem;
  font-weight: 700;
}

.catch-field {
  position: relative;
  width: 100%;
  height: 200px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.6);
  border: 2px dashed rgba(255, 77, 109, 0.35);
  overflow: hidden;
  box-shadow: inset 0 10px 25px rgba(0, 0, 0, 0.05);
}

.falling-item {
  position: absolute;
  top: -80px;
  left: 50%;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  font-size: 2.1rem;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
  cursor: pointer;
  transition: transform 0.18s ease, opacity 0.18s ease;
  animation: fallDown 6s linear forwards;
}

.falling-letter {
  border: 2px solid rgba(255, 77, 109, 0.45);
}

.falling-item:hover {
  transform: translateX(-50%) scale(1.05);
}

.falling-item.caught {
  background: linear-gradient(135deg, rgba(255, 77, 109, 0.92), rgba(255, 149, 180, 0.92));
  color: #fff;
  opacity: 0.9;
  transform: translateX(-50%) scale(0.7);
}

.falling-item.decoy-caught {
  opacity: 0.4;
  transform: translateX(-50%) scale(0.75);
  background: rgba(255, 255, 255, 0.6);
}

@keyframes fallDown {
  0% { top: -80px; opacity: 0; }
  8% { opacity: 1; }
  100% { top: calc(100% + 80px); opacity: 0; }
}

.fail-card {
  border: 2px solid rgba(255, 77, 109, 0.35);
}

.poem-text {
  line-height: 1.6;
  font-style: italic;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 16px;
  padding: 1.25rem;
  box-shadow: inset 0 0 0 1px rgba(255, 77, 109, 0.15);
}

.video-takeover {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.video-takeover.active {
  opacity: 1;
  visibility: visible;
}

.video-takeover-player {
  width: 100%;
  height: 100%;
  object-fit: contain;
  cursor: pointer;
}

.video-takeover-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.45);
  cursor: pointer;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.video-takeover-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.video-takeover-play-btn {
  width: 80px;
  height: 80px;
  background: rgba(255, 77, 109, 0.9);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: #fff;
  box-shadow: 0 6px 24px rgba(255, 77, 109, 0.55);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.video-takeover-overlay:hover .video-takeover-play-btn {
  transform: scale(1.12);
  box-shadow: 0 8px 32px rgba(255, 77, 109, 0.7);
}

.video-takeover-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 1.3rem;
  cursor: pointer;
  backdrop-filter: blur(6px);
  transition: opacity 0.3s ease, background 0.2s ease, transform 0.2s ease;
  opacity: 0;
  z-index: 10;
}

.video-takeover-close.visible {
  opacity: 1;
}

.video-takeover-close:hover {
  background: rgba(255, 77, 109, 0.7);
  transform: scale(1.1);
}

.video-takeover-controls {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  padding: 1rem 1.5rem;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.75));
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 10;
}

.video-takeover-controls.visible {
  opacity: 1;
}

.video-takeover-controls .btn {
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 600;
  backdrop-filter: blur(6px);
}

@media (max-width: 480px) {
  .scene-card {
    padding: 1.75rem 1.4rem;
    border-radius: 24px;
  }

  .catch-field {
    height: 220px;
  }

  .falling-item {
    width: 64px;
    height: 64px;
    font-size: 1.8rem;
  }

  .catch-hud {
    gap: 1.25rem;
  }

  .video-takeover-play-btn {
    width: 64px;
    height: 64px;
    font-size: 1.6rem;
  }

  .video-takeover-close {
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    font-size: 1.1rem;
  }

  .video-takeover-controls {
    padding: 0.75rem 1rem;
    gap: 0.35rem;
  }

  .video-takeover-controls .btn {
    font-size: 0.75rem;
    padding: 0.3rem 0.6rem;
  }
}
/*
 * Globals
 */

.btn-light,
.btn-light:hover,
.btn-light:focus {
  color: #333;
  text-shadow: none;
}

body {
  position: relative;
  background-color: var(--bs-body-bg);
  color: var(--bs-body-color);
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  overflow-x: hidden;
}

html[data-bs-theme="light"] body {
  text-shadow: none;
  box-shadow: none;
}

html[data-bs-theme="dark"] body {
  text-shadow: 0 .05rem .1rem rgba(0, 0, 0, .5);
  box-shadow: inset 0 0 5rem rgba(0, 0, 0, .5);
}

.bd-mode-toggle,
.cover-container {
  position: relative;
  z-index: 1;
}

/* Background */
.background.valentines {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background-image: url("./assets/img/background-alliance.png");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  pointer-events: none;
  z-index: 0;
  opacity: 0.55;
}

html[data-bs-theme="dark"] .background.valentines {
  background: linear-gradient(135deg, #702963, #b91372);
  opacity: 0.75;
}

.hearts {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hearts li {
  position: absolute;
  list-style: none;
  font-size: 100px;
  color: rgba(255, 255, 255, 0.7);
  bottom: -100px;
  animation: floatHeart 25s infinite linear;
  opacity: 0.85;
}

.hearts li:nth-child(1) { left: 8%; font-size: 20px; animation-duration: 20s; animation-delay: 2s; }
.hearts li:nth-child(2) { left: 18%; font-size: 36px; animation-duration: 28s; animation-delay: 6s; }
.hearts li:nth-child(3) { left: 28%; font-size: 32px; animation-duration: 22s; animation-delay: 4s; }
.hearts li:nth-child(4) { left: 38%; font-size: 48px; animation-duration: 30s; animation-delay: 1s; }
.hearts li:nth-child(5) { left: 48%; font-size: 26px; animation-duration: 26s; animation-delay: 8s; }
.hearts li:nth-child(6) { left: 58%; font-size: 44px; animation-duration: 34s; animation-delay: 3s; }
.hearts li:nth-child(7) { left: 68%; font-size: 34px; animation-duration: 24s; animation-delay: 5s; }
.hearts li:nth-child(8) { left: 78%; font-size: 22px; animation-duration: 36s; animation-delay: 7s; }
.hearts li:nth-child(9) { left: 88%; font-size: 16px; animation-duration: 40s; animation-delay: 9s; }
.hearts li:nth-child(10) { left: 94%; font-size: 55px; animation-duration: 38s; animation-delay: 11s; }

@keyframes floatHeart {
  0% { transform: translateY(0) scale(1) rotate(0deg); opacity: 0; }
  10% { opacity: 1; }
  100% { transform: translateY(-1200px) scale(1.4) rotate(360deg); opacity: 0; }
}

.cover-container {
  max-width: 42em;
}

/* Scene system */
.scene {
  display: none;
  animation: sceneIn 0.6s ease;
}

.scene.active {
  display: block;
}

@keyframes sceneIn {
  from { opacity: 0; transform: translateY(20px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.scene-card {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  padding: 2rem;
  border-radius: 24px;
  max-width: 500px;
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.12),
    0 2px 8px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.6);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

html[data-bs-theme="dark"] .scene-card {
  background: rgba(30, 20, 40, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.scene-emoji {
  font-size: 3.5rem;
  line-height: 1;
  animation: pulse 2s ease infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

.gender-btn {
  border-radius: 16px;
  transition: all 0.3s ease;
  min-width: 120px;
}

.gender-btn:hover,
.gender-btn:focus-visible {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.scene-button-field {
  position: relative;
  min-height: 220px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  overflow: hidden;
}

.scene-button-field .btn {
  min-width: 140px;
  border-radius: 18px;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.scene-button-field .btn:hover,
.scene-button-field .btn:focus-visible {
  transform: translateY(-4px) scale(1.05);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18);
}

.scene-button-field > .btn:not(.no-button) {
  position: relative;
  z-index: 2;
}

.no-button {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease, left 0.25s ease, top 0.25s ease;
  transform: scale(0.95);
  z-index: 1;
}

.no-button.visible {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1);
}

.no-button.vanishing {
  opacity: 0;
  transform: scale(0.75);
}

/* Decorative effects kept from main experience */
#heartExplosion {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1000;
  overflow: hidden;
}

.explode-heart {
  position: absolute;
  bottom: -30px;
  animation: heartExplode linear forwards;
}

@keyframes heartExplode {
  0% { transform: translateY(0) scale(0); opacity: 0; }
  10% { opacity: 1; transform: translateY(0) scale(1); }
  100% { transform: translateY(-110vh) scale(1.3) rotate(360deg); opacity: 0; }
}

#confettiCanvas {
  position: fixed;
  inset: 0;
  z-index: 1001;
  pointer-events: none;
  display: none;
}

/* Video takeover */
.video-takeover {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.video-takeover.active {
  opacity: 1;
  visibility: visible;
}

.video-takeover-player {
  width: 100%;
  height: 100%;
  object-fit: contain;
  cursor: pointer;
}

.video-takeover-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.45);
  cursor: pointer;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.video-takeover-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.video-takeover-play-btn {
  width: 80px;
  height: 80px;
  background: rgba(255, 77, 109, 0.9);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: #fff;
  box-shadow: 0 4px 30px rgba(255, 77, 109, 0.5);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.video-takeover-overlay:hover .video-takeover-play-btn {
  transform: scale(1.12);
  box-shadow: 0 6px 36px rgba(255, 77, 109, 0.7);
}

.video-takeover-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 1.3rem;
  cursor: pointer;
  backdrop-filter: blur(6px);
  transition: opacity 0.3s ease, background 0.2s ease, transform 0.2s ease;
  opacity: 0;
  z-index: 10;
}

.video-takeover-close.visible {
  opacity: 1;
}

.video-takeover-close:hover {
  background: rgba(255, 77, 109, 0.7);
  transform: scale(1.1);
}

.video-takeover-controls {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  padding: 1rem 1.5rem;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 10;
}

.video-takeover-controls.visible {
  opacity: 1;
}

.video-takeover-controls .btn {
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 600;
  backdrop-filter: blur(6px);
}

/* Responsive tweaks */
@media (max-width: 480px) {
  .scene-card {
    padding: 1.4rem 1rem;
    margin: 0 0.5rem;
    max-width: 100%;
  }

  .scene-button-field {
    min-height: 200px;
    gap: 1rem;
  }

  .scene-button-field .btn {
    min-width: 120px;
  }

  .video-takeover-play-btn {
    width: 60px;
    height: 60px;
    font-size: 1.5rem;
  }

  .video-takeover-close {
    top: 10px;
    right: 10px;
    width: 36px;
    height: 36px;
    font-size: 1.1rem;
  }

  .video-takeover-controls {
    padding: 0.75rem 1rem;
    gap: 0.35rem;
  }

  .video-takeover-controls .btn {
    font-size: 0.75rem;
    padding: 0.3rem 0.6rem;
  }
}
