:root {
  --color-dark: #0f111a;
  --color-pink-soft: #ffb7b2;
  --color-pink-deep: #e28495;
  --color-text: #f8fafc;
  --color-text-mut: #cbd5e1;
  --mouse-x: 0;
  --mouse-y: 0;
  --gyro-x: 0;
  --gyro-y: 0;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body,
html {
  width: 100%;
  height: 100%;
  overflow: hidden;
  /* No scroll, single page app feel */
  font-family: "Outfit", sans-serif;
  background-color: var(--color-dark);
  color: var(--color-text);
  touch-action: none;
}

h1,
h2,
.font-serif {
  font-family: "Playfair Display", serif;
}

.italic {
  font-style: italic;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 17, 26, 0.95);
  backdrop-filter: blur(10px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-box {
  background: linear-gradient(to bottom, #2b1f32, #1b1625);
  border: 1px solid rgba(255, 183, 178, 0.2);
  padding: 40px 30px;
  border-radius: 24px;
  text-align: center;
  max-width: 400px;
  width: 90%;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.modal-box h2 {
  color: var(--color-pink-soft);
  margin-bottom: 15px;
  font-size: 2rem;
}

.modal-box p {
  color: var(--color-text-mut);
  margin-bottom: 30px;
  font-size: 1rem;
  line-height: 1.5;
}

.btn-primary,
.btn-next,
.btn-magic {
  background: linear-gradient(45deg, var(--color-pink-deep), #ff6b81);
  color: #fff;
  border: none;
  padding: 14px 28px;
  border-radius: 30px;
  font-family: "Outfit", sans-serif;
  font-weight: 500;
  font-size: 1.1rem;
  cursor: pointer;
  box-shadow: 0 10px 20px rgba(226, 132, 149, 0.3);
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.btn-primary:active,
.btn-next:active,
.btn-magic:active {
  transform: scale(0.95);
}

.btn-primary:hover,
.btn-next:hover,
.btn-magic:hover {
  box-shadow: 0 15px 25px rgba(226, 132, 149, 0.5);
  transform: translateY(-2px);
}

/* MUSIC */
.music-toggle {
  position: fixed;
  top: 25px;
  right: 25px;
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(5px);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  cursor: pointer;
  z-index: 1000;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.music-toggle .bar {
  width: 3px;
  height: 12px;
  background: var(--color-pink-soft);
  border-radius: 2px;
  transition: height 0.2s ease;
}

.music-toggle.playing .bar {
  animation: playBar 1s ease-in-out infinite alternate;
}

.music-toggle.playing .bar:nth-child(2) {
  animation-delay: 0.3s;
}

.music-toggle.playing .bar:nth-child(3) {
  animation-delay: 0.6s;
}

@keyframes playBar {
  0% {
    height: 6px;
  }

  100% {
    height: 18px;
  }
}

/* PAGINATION */
.pagination {
  position: fixed;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 15px;
  z-index: 1000;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transition: all 0.3s ease;
  cursor: pointer;
}

.dot.active {
  height: 24px;
  border-radius: 4px;
  background: var(--color-pink-soft);
  box-shadow: 0 0 10px var(--color-pink-soft);
}

/* SCENES CONTROLLER */
#scenes-container {
  position: relative;
  width: 100%;
  height: 100%;
}

.scene {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 1s cubic-bezier(0.4, 0, 0.2, 1),
    transform 1s cubic-bezier(0.4, 0, 0.2, 1);
  transform: scale(1.05);
  /* Slight zoom out transition */
  display: flex;
  align-items: center;
  justify-content: center;
}

.scene.active {
  opacity: 1;
  visibility: visible;
  transform: scale(1);
}

.scene.prev {
  transform: translateY(-30px) scale(0.95);
}

.scene.next {
  transform: translateY(30px) scale(1.05);
}

/* PARALLAX LAYERS */
.parallax-layer {
  position: absolute;
  top: -5%;
  left: -5%;
  width: 110%;
  /* Wider to avoid edge clipping on gyro */
  height: 110%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Parallax calculations applied via JS custom properties */
.bg-layer {
  z-index: 1;
  transform: translate(
    calc(var(--mouse-x) * -10px + var(--gyro-x) * -15px),
    calc(var(--mouse-y) * -10px + var(--gyro-y) * -15px)
  );
}

.mid-layer {
  z-index: 2;
  transform: translate(
    calc(var(--mouse-x) * 15px + var(--gyro-x) * 20px),
    calc(var(--mouse-y) * 15px + var(--gyro-y) * 20px)
  );
}

.front-layer {
  z-index: 3;
  transform: translate(
    calc(var(--mouse-x) * 30px + var(--gyro-x) * -10px),
    calc(var(--mouse-y) * 30px + var(--gyro-y) * -10px)
  );
}

/* Backgrounds - TWILIGHT & PINK / ROMANTIC THEME */
.scene-bg-1 {
  background: radial-gradient(circle at top right, #392b42 0%, #15101a 100%);
}

.scene-bg-2 {
  background: radial-gradient(circle at bottom left, #292437 0%, #0d0f18 100%);
}

.scene-bg-3 {
  background: linear-gradient(to bottom, #1d2133 0%, #0b0c10 100%);
}

.scene-bg-4 {
  background: radial-gradient(ellipse at center, #1b1625 0%, #000 100%);
}

.scene-bg-5 {
  background: linear-gradient(135deg, #4d1c31 0%, #160c18 100%);
}

/* Rain effect for scene 3 */
.rain-overlay {
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='40'%3E%3Crect width='1' height='20' fill='%23ffffff' fill-opacity='0.1'/%3E%3C/svg%3E");
  background-size: 10px 100px;
  animation: rainDrop 0.6s linear infinite;
  opacity: 0.5;
}

@keyframes rainDrop {
  0% {
    background-position: 0 0;
  }

  100% {
    background-position: 20px 200px;
  }
}

/* Content Area */
.content {
  max-width: 600px;
  padding: 40px;
  z-index: 10;
  position: relative;
}

.glass-card {
  background: rgba(20, 22, 35, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 183, 178, 0.15);
  border-radius: 24px;
  padding: 40px;
  box-shadow:
    0 20px 40px rgba(0, 0, 0, 0.6),
    0 0 40px rgba(248, 113, 113, 0.1) inset;
}

.content h1 {
  font-size: 3.5rem;
  line-height: 1.1;
  color: var(--color-pink-soft);
  margin-bottom: 20px;
  text-shadow: 0 5px 15px rgba(255, 183, 178, 0.3);
}

.content p.cool-text {
  font-size: 1.2rem;
  color: var(--color-text-mut);
  margin-bottom: 20px;
  font-weight: 300;
  line-height: 1.6;
}

.badge {
  display: inline-block;
  padding: 6px 14px;
  background: rgba(255, 183, 178, 0.15);
  color: var(--color-pink-soft);
  border-radius: 20px;
  font-size: 0.85rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 15px;
  backdrop-filter: blur(5px);
}

.badge-dark {
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.text-pink {
  color: var(--color-pink-soft);
}

.text-center {
  text-align: center;
}

.mx-auto {
  margin-left: auto;
  margin-right: auto;
}

.opacity-70 {
  opacity: 0.7;
}

.big-title {
  font-size: 4rem !important;
  margin-bottom: 20px !important;
}

/* Emoji Stickers */
.decal-layer {
  pointer-events: none;
}

.emoji-sticker {
  position: absolute;
  font-size: 100px;
  line-height: 1;
  text-align: center;
  filter: drop-shadow(0 15px 25px rgba(0, 0, 0, 0.4));
  user-select: none;
  font-family:
    "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", "Android Emoji",
    sans-serif;
}

.modal-icon.emoji-sticker {
  position: relative;
  font-size: 80px;
  margin-bottom: 20px;
  display: inline-block;
  animation: float 3s ease-in-out infinite;
  filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.3));
}

.center-sticker.emoji-sticker {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 150px;
  opacity: 0.8;
  z-index: -1;
}

/* Positioning Stickers */
.s-tl {
  top: 15%;
  left: 15%;
}

.s-br {
  bottom: 20%;
  right: 10%;
  width: 80px;
}

.s-tr {
  top: 20%;
  right: 15%;
}

.s-bl {
  bottom: 15%;
  left: 15%;
}

.s-tc {
  top: 10%;
  left: 50%;
  transform: translateX(-50%);
}

/* Animations */
.float-1 {
  animation: float 4s ease-in-out infinite;
}

.float-2 {
  animation: float 5s ease-in-out infinite alternate-reverse;
}

@keyframes float {
  0% {
    transform: translateY(0) rotate(0);
  }

  50% {
    transform: translateY(-20px) rotate(5deg);
  }

  100% {
    transform: translateY(0) rotate(-2deg);
  }
}

.heartbeat {
  animation: heart 2s ease-in-out infinite;
}

@keyframes heart {
  0%,
  100% {
    transform: translate(-50%, -50%) scale(1);
  }

  15% {
    transform: translate(-50%, -50%) scale(1.15);
  }

  30% {
    transform: translate(-50%, -50%) scale(1);
  }

  45% {
    transform: translate(-50%, -50%) scale(1.15);
  }
}

/* Confetti */
#canvas-confetti {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 5000;
}

/* RELATIONSHIP TIMER */
.signature {
  color: var(--color-pink-soft);
  font-size: 1.1rem;
  margin-top: 5px;
  margin-bottom: 25px;
  text-shadow: 0 2px 5px rgba(255, 183, 178, 0.3);
  opacity: 0.8;
}

.timer-box {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 183, 178, 0.15);
  border-radius: 16px;
  padding: 15px;
  margin: 15px auto;
  max-width: 380px;
  backdrop-filter: blur(8px);
}

.timer-title {
  font-size: 0.75rem;
  color: var(--color-text-mut);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.timer-numbers {
  display: flex;
  justify-content: space-around;
  align-items: center;
}

.time-unit {
  display: flex;
  flex-direction: column;
}

.time-unit span {
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
  font-family: "Outfit", sans-serif;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.4);
}

.time-unit small {
  font-size: 0.65rem;
  color: var(--color-pink-deep);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Responsive adjustments */
@media screen and (max-width: 768px) {
  .content {
    padding: 30px 20px;
    padding-left: 50px;
    /* Space for pagination */
  }

  .content h1 {
    font-size: 2.5rem;
  }

  .content p.cool-text {
    font-size: 1rem;
  }

  .big-title {
    font-size: 3rem !important;
  }

  .pagination {
    left: 10px;
  }

  .emoji-sticker {
    font-size: 60px !important;
  }

  .center-sticker.emoji-sticker {
    font-size: 100px !important;
  }

  .timer-box {
    max-width: 100%;
  }
}
