/* ===== Reset & Variables ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #fff0f5;
  --pink: #e75480;
  --deep-pink: #c2185b;
  --light-pink: #fce4ec;
  --rose: #f06292;
  --text: #4a1040;
  --card-bg: #fffafc;
  --shadow: rgba(194, 24, 91, 0.15);
  --font-heading: 'Dancing Script', cursive;
  --font-body: 'Lato', sans-serif;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  background-image:
    radial-gradient(ellipse at 10% 20%, rgba(248, 187, 208, 0.3) 0%, transparent 50%),
    radial-gradient(ellipse at 90% 80%, rgba(252, 228, 236, 0.4) 0%, transparent 50%);
  font-family: var(--font-body);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ===== Fixed Decorations ===== */
.deco {
  position: fixed;
  z-index: 0;
  pointer-events: none;
  user-select: none;
  font-size: 2.8rem;
  opacity: 0.18;
  animation: gentle-sway 5s ease-in-out infinite alternate;
}

.deco-tl { top: 1.5rem; left: 1rem; animation-delay: 0s; }
.deco-tr { top: 1.5rem; right: 1rem; animation-delay: 1s; }
.deco-bl { bottom: 1.5rem; left: 1rem; animation-delay: 2s; }
.deco-br { bottom: 1.5rem; right: 1rem; animation-delay: 0.5s; }
.deco-ml { top: 50%; left: 0.5rem; transform: translateY(-50%); animation-delay: 1.5s; }
.deco-mr { top: 50%; right: 0.5rem; transform: translateY(-50%); animation-delay: 2.5s; }

@keyframes gentle-sway {
  from { transform: rotate(-8deg) scale(1); }
  to   { transform: rotate(8deg) scale(1.08); }
}

/* Cupids */
.cupid {
  position: fixed;
  z-index: 0;
  pointer-events: none;
  opacity: 0.22;
  animation: cupid-float 6s ease-in-out infinite alternate;
}

.cupid-top    { top: 0.5rem; left: 50%; transform: translateX(-50%); }
.cupid-bottom { bottom: 0.5rem; right: 6rem; animation-delay: 3s; }

@keyframes cupid-float {
  from { transform: translateY(0) rotate(-4deg); }
  to   { transform: translateY(-8px) rotate(4deg); }
}

.cupid-top    { animation: cupid-float 6s ease-in-out infinite alternate; }
.cupid-bottom { animation: cupid-float 6s ease-in-out infinite alternate; animation-delay: 3s; }

/* Lilies */
.lily {
  position: fixed;
  z-index: 0;
  pointer-events: none;
  opacity: 0.28;
  animation: lily-sway 7s ease-in-out infinite alternate;
}

.lily-left  { bottom: 5rem; left: 0; }
.lily-right { bottom: 5rem; right: 0; }

@keyframes lily-sway {
  from { transform: rotate(-5deg); }
  to   { transform: rotate(5deg); }
}

/* Roses */
.rose {
  position: fixed;
  z-index: 0;
  pointer-events: none;
  opacity: 0.28;
  animation: lily-sway 8s ease-in-out infinite alternate;
}

.rose-left  { top: 6rem; left: 0; animation-delay: 1s; }
.rose-right { top: 6rem; right: 0; animation-delay: 2s; }

/* ===== Floating Hearts ===== */
#hearts-container {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.floating-heart {
  position: absolute;
  bottom: -3rem;
  animation: rise-up linear forwards;
  pointer-events: none;
  will-change: transform, opacity;
}

@keyframes rise-up {
  0%   { opacity: 0.85; transform: translateY(0)     rotate(-10deg) scale(0.8); }
  40%  { opacity: 0.6;  transform: translateY(-40vh) rotate(10deg)  scale(1);   }
  100% { opacity: 0;    transform: translateY(-95vh) rotate(-5deg)  scale(0.6); }
}

/* ===== Falling Petals ===== */
#petals-container {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.petal {
  position: absolute;
  top: -1.5rem;
  width: 10px;
  height: 14px;
  border-radius: 50% 0 50% 0;
  opacity: 0;
  animation: petal-fall linear forwards;
  will-change: transform, opacity;
}

@keyframes petal-fall {
  0%   { opacity: 0.7; transform: translateY(0)     rotate(0deg)   translateX(0);   }
  30%  { opacity: 0.6; transform: translateY(30vh)  rotate(120deg) translateX(20px); }
  70%  { opacity: 0.4; transform: translateY(70vh)  rotate(260deg) translateX(-10px);}
  100% { opacity: 0;   transform: translateY(105vh) rotate(360deg) translateX(15px); }
}

/* ===== Screens ===== */
.screen {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 2rem 1.5rem;
  position: relative;
  z-index: 1;
  animation: screen-in 0.5s ease both;
}

.screen.active {
  display: flex;
}

@keyframes screen-in {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ===== Typography ===== */
h1 {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 6vw, 3.8rem);
  color: var(--deep-pink);
  text-align: center;
  line-height: 1.3;
  margin-bottom: 1rem;
  text-shadow: 1px 2px 4px rgba(194, 24, 91, 0.2);
}

h2 {
  font-family: var(--font-body);
  font-size: clamp(1.6rem, 4vw, 2.5rem);
  color: var(--pink);
  text-align: center;
  margin-bottom: 1.5rem;
}

p {
  font-size: 1.1rem;
  text-align: center;
  margin-bottom: 1.5rem;
  opacity: 0.75;
}

/* ===== Buttons ===== */
.btn-main {
  background: linear-gradient(135deg, var(--pink) 0%, var(--deep-pink) 100%);
  color: white;
  border: none;
  padding: 0.85rem 2.5rem;
  border-radius: 50px;
  font-family: var(--font-body);
  font-size: 1.5rem;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(194, 24, 91, 0.35);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  letter-spacing: 0.02em;
}

.btn-main:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 7px 24px rgba(194, 24, 91, 0.45);
}

.btn-main:active {
  transform: translateY(-1px);
}

.btn-secondary {
  background: transparent;
  color: var(--pink);
  border: 2px solid var(--pink);
  padding: 0.7rem 2rem;
  border-radius: 50px;
  font-family: var(--font-body);
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.18s, color 0.18s, left 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94), top 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.btn-secondary:hover {
  background: var(--light-pink);
}

.hidden { display: none !important; }

/* ===== Heart burst animation ===== */
.heart-burst {
  position: fixed;
  pointer-events: none;
  z-index: 500;
  font-size: 1.4rem;
  animation: heart-burst-anim 0.9s ease forwards;
}

@keyframes heart-burst-anim {
  0%   { opacity: 1;   transform: scale(0.5) translateY(0); }
  60%  { opacity: 0.8; transform: scale(1.3) translateY(-40px); }
  100% { opacity: 0;   transform: scale(0.8) translateY(-80px); }
}

/* ===== Intro Screen ===== */
#intro-screen p {
  font-size: 1.3rem;
  margin-bottom: 2.5rem;
  color: var(--text);
}

#dev-skip-nav {
  margin-top: 1rem;
  width: min(720px, 95%);
  padding: 0.85rem 0.8rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.5);
  border: 1px dashed rgba(231, 84, 128, 0.35);
}

#dev-skip-nav p {
  margin: 0 0 0.6rem;
  font-size: 0.85rem;
  opacity: 0.78;
}

#dev-skip-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  justify-content: center;
}

.dev-skip-btn {
  padding: 0.45rem 0.7rem;
  font-size: 0.82rem;
}

/* ===== Quiz Screen ===== */
#quiz-screen {
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  gap: 1.5rem;
}

#quiz-progress {
  width: 100%;
}

#progress-bar {
  width: 100%;
  height: 8px;
  background: var(--light-pink);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

#progress-fill {
  height: 100%;
  background: linear-gradient(to right, var(--rose), var(--deep-pink));
  border-radius: 10px;
  transition: width 0.45s ease;
  width: 0%;
}

#progress-text {
  font-size: 0.88rem;
  color: var(--pink);
  display: block;
  text-align: right;
  opacity: 0.7;
}

#question-container {
  background: var(--card-bg);
  border-radius: 20px;
  padding: 2.5rem 2rem;
  box-shadow: 0 8px 32px var(--shadow);
  width: 100%;
  border: 1px solid rgba(231, 84, 128, 0.12);
}

#question-text {
  font-family: var(--font-body);
  font-size: clamp(1.3rem, 3vw, 1.9rem);
  color: var(--deep-pink);
  text-align: center;
  margin-bottom: 1.8rem;
  line-height: 1.4;
}

#options-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.9rem;
}

.option-btn {
  background: var(--light-pink);
  border: 2px solid transparent;
  border-radius: 14px;
  padding: 1rem 0.8rem;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.18s, background 0.18s, transform 0.18s;
  text-align: center;
  line-height: 1.3;
}

.option-btn:hover:not(:disabled) {
  border-color: var(--pink);
  background: white;
  transform: translateY(-2px);
}

.option-btn.correct {
  background: #e8f5e9;
  border-color: #4caf50;
  color: #2e7d32;
  font-weight: bold;
}

.option-btn.wrong {
  background: #fce4e4;
  border-color: #e57373;
  color: #c62828;
  animation: shake 0.4s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%       { transform: translateX(-8px); }
  40%       { transform: translateX(8px); }
  60%       { transform: translateX(-6px); }
  80%       { transform: translateX(6px); }
}

/* ===== Gallery Screen ===== */
#gallery-screen,
#gallery2-screen {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  justify-content: flex-start;
  padding-top: 3rem;
  gap: 1rem;
}

#gallery-grid,
#gallery2-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  width: 100%;
}

.gallery-img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 14px;
  cursor: pointer;
  transition: transform 0.22s ease, box-shadow 0.22s ease;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1);
  display: block;
}

.gallery-img:hover {
  transform: scale(1.04);
  box-shadow: 0 8px 28px rgba(231, 84, 128, 0.32);
}

#gallery-continue,
#gallery2-continue {
  margin-top: 1.5rem;
  margin-bottom: 2rem;
}

/* ===== Lightbox ===== */
#lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

#lightbox-bg {
  position: absolute;
  inset: 0;
  background: rgba(10, 0, 15, 0.88);
  cursor: pointer;
}

#lightbox-img {
  position: relative;
  z-index: 1;
  max-width: 92vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 14px;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.6);
}

#lightbox-prev,
#lightbox-next,
#lightbox-close {
  position: absolute;
  z-index: 2;
  background: rgba(255, 255, 255, 0.18);
  border: none;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  line-height: 1;
}

#lightbox-prev,
#lightbox-next {
  top: 50%;
  transform: translateY(-50%);
  font-size: 2rem;
  width: 52px;
  height: 52px;
  border-radius: 50%;
}

#lightbox-prev {
  left: max(12px, 1.2rem);
}

#lightbox-next {
  right: max(12px, 1.2rem);
}

#lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1.2rem;
  font-size: 1.6rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
}

#lightbox-prev:hover,
#lightbox-next:hover,
#lightbox-close:hover {
  background: rgba(255, 255, 255, 0.32);
}

/* ===== Puzzle Screen ===== */
#puzzle-screen {
  gap: 1rem;
  padding: 2rem 1rem;
}

#puzzle-hint {
  font-size: 0.95rem;
  color: var(--pink);
  margin-bottom: 0.5rem;
  opacity: 0.75;
}

#puzzle-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  background: rgba(231, 84, 128, 0.25);
  border: 3px solid var(--pink);
  border-radius: 14px;
  padding: 4px;
  user-select: none;
  touch-action: none;
}

.puzzle-slot {
  width: clamp(70px, calc((min(90vw, 480px) - 40px) / 4), 110px);
  height: clamp(70px, calc((min(90vw, 480px) - 40px) / 4), 110px);
  background: var(--light-pink);
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  transition: outline 0.1s;
}

.puzzle-slot.drag-over {
  outline: 3px solid var(--deep-pink);
  outline-offset: -3px;
}

.puzzle-slot.solved {
  outline: 2px solid #4caf50;
  outline-offset: -2px;
}

.puzzle-piece {
  width: 100%;
  height: 100%;
  background-repeat: no-repeat;
  cursor: grab;
  transition: opacity 0.15s;
  border-radius: 8px;
}

.puzzle-piece:active {
  cursor: grabbing;
}

.puzzle-piece.dragging {
  opacity: 0.45;
}

/* ===== Video Screen ===== */
#video-screen,
#video2-screen {
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
  gap: 1rem;
  padding: 2rem 1rem;
}

#video-player-wrap,
#video2-player-wrap {
  width: 100%;
  max-width: 860px;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.2);
  background: #000;
}

#youtube-player,
#youtube-player-2 {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
}

#video-hint,
#video2-hint {
  color: var(--pink);
  font-size: 0.95rem;
  opacity: 0.8;
}

#video-continue,
#video2-continue {
  margin-top: 0.75rem;
}

/* ===== Final Screen ===== */
#final-screen {
  text-align: center;
}

#final-content {
  max-width: 700px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
}

#final-message {
  font-family: var(--font-heading);
  font-size: clamp(1.6rem, 4vw, 2.8rem);
  color: var(--deep-pink);
  line-height: 1.5;
  padding: 2rem;
  background: var(--card-bg);
  border-radius: 20px;
  box-shadow: 0 8px 32px var(--shadow);
  border: 1px solid rgba(231, 84, 128, 0.12);
}

#final-buttons {
  display: flex;
  gap: 1.5rem;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  position: relative;
  min-height: 60px;
}

/* ===== Celebration Overlay ===== */
#celebration-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255, 240, 245, 0.97);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
  animation: screen-in 0.5s ease both;
}

#celebration-overlay h1 {
  font-size: clamp(2.5rem, 8vw, 5rem);
  animation: pop-in 0.5s ease both;
  margin-bottom: 1rem;
}

#celebration-overlay p {
  font-family: var(--font-body);
  font-size: clamp(1.2rem, 3vw, 2rem);
  color: var(--deep-pink);
  opacity: 1;
  max-width: 600px;
  line-height: 1.5;
}

@keyframes pop-in {
  0%   { transform: scale(0) rotate(-10deg); opacity: 0; }
  70%  { transform: scale(1.15) rotate(3deg); }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

/* ===== Responsive ===== */
@media (max-width: 500px) {
  #options-container {
    grid-template-columns: 1fr;
  }

  #question-container {
    padding: 1.5rem 1.2rem;
  }

  #gallery-grid,
  #gallery2-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }

  .deco-ml, .deco-mr { display: none; }
  .cupid-bottom { display: none; }
}
