﻿:root {
  --w: 1920;
  --h: 1080;
  --accent: #f2fbff;
  --text-shadow: rgba(0, 0, 0, 0.55);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  background: radial-gradient(circle at 20% 20%, #4f7a94, #243748 70%);
  overflow: hidden;
}

#app,
.scene {
  width: 100%;
  height: 100%;
}

.scene {
  display: none;
  align-items: center;
  justify-content: center;
}

.scene.active {
  display: flex;
}

#viewport16x9 {
  position: relative;
  width: min(100vw, calc(100vh * 16 / 9));
  aspect-ratio: 16 / 9;
  max-height: 100vh;
  overflow: hidden;
  border-radius: 14px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
  user-select: none;
  touch-action: none;
}

#bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#hintText {
  position: absolute;
  left: 50%;
  bottom: 10%;
  transform: translateX(-50%);
  margin: 0;
  color: var(--accent);
  font-size: clamp(18px, 2vw, 38px);
  font-weight: 700;
  text-shadow: 0 2px 8px var(--text-shadow);
  letter-spacing: 0.04em;
  transition: opacity 0.2s ease;
  z-index: 7;
}

#cloudRain {
  position: absolute;
  left: 0;
  top: 0;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%);
  transition: opacity 0.15s linear;
  z-index: 8;
}

#cloud {
  width: clamp(110px, 12vw, 250px);
  display: block;
}

#rain {
  width: clamp(80px, 8vw, 180px);
  position: absolute;
  left: 50%;
  top: 75%;
  transform: translateX(-50%);
  image-rendering: auto;
}

#flowersLayer,
#showerLayer {
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: none;
}

.flower {
  position: absolute;
  max-width: min(12vw, 180px);
  width: var(--flower-size, 140px);
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.25));
}

.pulse {
  animation: pulse 2.2s ease-in-out infinite;
}

.shower-flower {
  position: absolute;
  width: clamp(36px, 4vw, 95px);
  opacity: 0;
  transform: scale(0.5) rotate(0deg);
  animation: bloom 800ms ease forwards;
}

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

@keyframes bloom {
  0% {
    opacity: 0;
    transform: scale(0.5) rotate(-12deg);
  }
  100% {
    opacity: 1;
    transform: scale(1) rotate(0deg);
  }
}

#finalScene {
  background: linear-gradient(160deg, #0e2536, #385a6f);
  color: #f3fbff;
}

#finalContent {
  width: min(90vw, 1000px);
  padding: clamp(20px, 4vw, 70px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(0, 0, 0, 0.22);
  border-radius: 16px;
  backdrop-filter: blur(3px);
}

#typedText {
  margin: 0;
  font-size: clamp(24px, 3vw, 52px);
  line-height: 1.3;
  letter-spacing: 0.02em;
}
