:root {
  --primary-pink: #ff2a85;
  --secondary-pink: #ff75c3;
  --gold: #ffd700;
  --cyan: #00f0ff;
  --dark-bg: #090712;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
}

html, body {
  width: 100%;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background-color: var(--dark-bg);
  font-family: 'Montserrat', sans-serif;
  color: #ffffff;
  touch-action: manipulation;
}

/* Background animated canvas */
#bgCanvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}

/* Flash overlay for drop impact */
#flashOverlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #ffffff;
  opacity: 0;
  z-index: 80;
  pointer-events: none;
}

/* Intro Start Screen */
.screen-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 100;
  background: radial-gradient(circle at center, rgba(35, 12, 50, 0.95) 0%, rgba(9, 7, 18, 0.98) 100%);
  backdrop-filter: blur(12px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s ease;
}

.screen-overlay.hidden {
  opacity: 0;
  pointer-events: none;
  transform: scale(1.08);
}

.intro-card {
  text-align: center;
  padding: 2.8rem 2.2rem;
  max-width: 440px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 30px;
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.7), 0 0 50px rgba(255, 42, 133, 0.25);
  animation: floatCard 4s ease-in-out infinite;
}

@keyframes floatCard {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.heart-pulse {
  font-size: 3.8rem;
  margin-bottom: 1.2rem;
  display: inline-block;
  animation: heartbeat 1.3s ease-in-out infinite;
}

@keyframes heartbeat {
  0% { transform: scale(1); }
  14% { transform: scale(1.22); }
  28% { transform: scale(1); }
  42% { transform: scale(1.3); }
  70% { transform: scale(1); }
}

.intro-title {
  font-size: 2rem;
  font-weight: 900;
  margin-bottom: 0.6rem;
  background: linear-gradient(135deg, #fff 0%, var(--secondary-pink) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.intro-subtitle {
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.75);
  margin-bottom: 2.2rem;
  line-height: 1.5;
}

.glow-button {
  background: linear-gradient(135deg, #ff2a85 0%, #ff7300 100%);
  border: none;
  color: white;
  padding: 1.15rem 2.4rem;
  font-size: 1.1rem;
  font-weight: 800;
  border-radius: 50px;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(255, 42, 133, 0.55);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.glow-button:hover {
  transform: scale(1.05);
  box-shadow: 0 15px 45px rgba(255, 42, 133, 0.75);
}

.glow-button:active {
  transform: scale(0.97);
}

/* Stage Area */
.stage {
  position: relative;
  width: 100%;
  height: 100%;
  z-index: 10;
  display: flex;
  justify-content: center;
  align-items: center;
  perspective: 1000px;
}

/* Warmup Lyrics Styling (39s - 51s) */
.warmup-container {
  position: absolute;
  width: 90%;
  max-width: 650px;
  text-align: center;
  z-index: 15;
  pointer-events: none;
}

.warmup-line {
  font-size: clamp(1.4rem, 4.5vw, 2.5rem);
  font-weight: 800;
  line-height: 1.4;
  opacity: 0;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  text-shadow: 0 0 25px rgba(255, 42, 133, 0.5);
  letter-spacing: 1px;
}

.highlight-warmup {
  color: #fff;
  font-size: clamp(1.6rem, 5vw, 2.9rem);
  text-shadow: 
    0 0 20px rgba(0, 240, 255, 0.7),
    0 0 40px rgba(255, 42, 133, 0.5);
}

/* Lyrics Words */
.lyric-word {
  position: absolute;
  font-weight: 900;
  text-transform: uppercase;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  will-change: transform, opacity, filter;
}

/* Style for СВЕТА */
.style-sveta {
  font-size: clamp(3.8rem, 14vw, 8.5rem);
  color: #fff;
  text-shadow: 
    -4px -4px 0 var(--cyan),
    4px 4px 0 var(--primary-pink),
    0 0 35px rgba(0, 240, 255, 0.7);
  letter-spacing: 5px;
}

/* Style for ЛЕНА */
.style-lena {
  font-size: clamp(4rem, 15vw, 9rem);
  color: #ffe600;
  text-shadow: 
    0 0 25px #ffe600,
    0 0 60px #ff7700;
  letter-spacing: 6px;
  font-style: italic;
}

/* Style for ВИКА */
.style-vika {
  font-size: clamp(4.2rem, 16vw, 9.5rem);
  color: #ff3366;
  text-shadow: 
    0 0 30px rgba(255, 51, 102, 0.85),
    0 0 70px rgba(255, 51, 102, 0.5);
  letter-spacing: 6px;
}

/* Style for А... */
.style-a {
  font-size: clamp(3.2rem, 11vw, 6.5rem);
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.95);
  text-shadow: 0 0 25px rgba(255, 255, 255, 0.6);
}

/* The Climax: ВЕРОНИКА */
.veronika-container {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 25;
  opacity: 0;
  pointer-events: none;
}

.style-veronika {
  font-size: clamp(3.8rem, 13vw, 9.5rem);
  font-weight: 900;
  letter-spacing: 7px;
  background: linear-gradient(135deg, #ffffff 0%, #ffe066 30%, #ff2a85 70%, #ff75c3 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 40px rgba(255, 42, 133, 0.9)) drop-shadow(0 0 80px rgba(255, 224, 102, 0.6));
  display: flex;
  gap: 2px;
}

.style-veronika span {
  display: inline-block;
  will-change: transform;
}

.veronika-subtitle {
  margin-top: 12px;
  font-size: clamp(1rem, 3.5vw, 1.6rem);
  font-weight: 800;
  color: #fff;
  letter-spacing: 2px;
  text-transform: uppercase;
  background: rgba(255, 42, 133, 0.4);
  padding: 10px 28px;
  border-radius: 50px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  white-space: nowrap;
}

/* Photo Stage for the "Чика чика" Drop */
.photo-stage {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 20;
}

/* Polaroid Photo Card styling */
.photo-card {
  position: absolute;
  width: clamp(200px, 44vw, 320px);
  background: #ffffff;
  padding: 12px 12px 30px 12px;
  border-radius: 14px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7), 0 0 35px rgba(255, 42, 133, 0.45);
  opacity: 0;
  transform-origin: center center;
  will-change: transform, opacity;
  border: 2px solid rgba(255, 255, 255, 0.9);
  pointer-events: auto;
  cursor: pointer;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease;
}

.photo-card:hover {
  transform: scale(1.08) rotate(0deg) !important;
  z-index: 70 !important;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.85), 0 0 50px rgba(255, 42, 133, 0.7);
}

.photo-card-img-wrapper {
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 8px;
  background: #111;
  position: relative;
}

.photo-card-img-wrapper.is-portrait {
  aspect-ratio: 4 / 5;
}

.photo-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.photo-card-caption {
  margin-top: 12px;
  font-family: 'Playfair Display', serif;
  font-size: clamp(0.9rem, 2.6vw, 1.15rem);
  color: #1a1a1a;
  text-align: center;
  font-weight: 700;
  font-style: italic;
}

.photo-badge {
  position: absolute;
  top: -12px;
  right: -12px;
  background: var(--primary-pink);
  color: #fff;
  font-size: 1.3rem;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
  border: 2px solid #fff;
}

/* Grand Finale Love Card */
.finale-card {
  position: absolute;
  z-index: 75;
  background: rgba(18, 10, 28, 0.92);
  border: 2px solid rgba(255, 42, 133, 0.5);
  border-radius: 32px;
  padding: 2.5rem 2rem;
  max-width: 440px;
  text-align: center;
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.85), 0 0 60px rgba(255, 42, 133, 0.4);
  backdrop-filter: blur(16px);
  pointer-events: auto;
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.finale-card.visible {
  opacity: 1;
  transform: scale(1);
}

.finale-crown {
  font-size: 3.5rem;
  margin-bottom: 0.8rem;
  animation: floatCard 3s ease-in-out infinite;
}

.finale-title {
  font-size: clamp(1.8rem, 5vw, 2.4rem);
  font-weight: 900;
  margin-bottom: 0.8rem;
  background: linear-gradient(135deg, #fff 0%, var(--gold) 50%, var(--primary-pink) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.finale-text {
  font-size: 1.05rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 2rem;
}

.kiss-button {
  width: 100%;
}

/* Screen shake */
.shake-screen {
  animation: shake 0.4s cubic-bezier(.36,.07,.19,.97) both;
}

@keyframes shake {
  10%, 90% { transform: translate3d(-3px, 2px, 0) rotate(-0.5deg); }
  20%, 80% { transform: translate3d(5px, -3px, 0) rotate(1deg); }
  30%, 50%, 70% { transform: translate3d(-6px, 4px, 0) rotate(-1.5deg); }
  40%, 60% { transform: translate3d(6px, -4px, 0) rotate(1.5deg); }
}

.shake-heavy {
  animation: shakeHeavy 0.5s cubic-bezier(.36,.07,.19,.97) both;
}

@keyframes shakeHeavy {
  10%, 90% { transform: translate3d(-8px, 6px, 0) rotate(-2deg) scale(1.04); }
  20%, 80% { transform: translate3d(10px, -7px, 0) rotate(2deg) scale(1.05); }
  30%, 50%, 70% { transform: translate3d(-12px, 8px, 0) rotate(-3deg) scale(1.06); }
  40%, 60% { transform: translate3d(12px, -8px, 0) rotate(3deg) scale(1.04); }
}

/* Debug panel */
.debug-panel {
  position: fixed;
  bottom: 20px;
  left: 20px;
  background: rgba(0, 0, 0, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 12px;
  padding: 14px 18px;
  z-index: 200;
  font-family: monospace;
  font-size: 13px;
  color: #00f0ff;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 340px;
}

.debug-panel.hidden {
  display: none !important;
}

.debug-panel button {
  background: #222;
  color: #fff;
  border: 1px solid #555;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
}

.debug-panel button:hover {
  background: #444;
}

.debug-hint {
  font-size: 11px;
  color: #aaa;
  line-height: 1.3;
}
