*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  color-scheme: only light;
  --text-dark: #2b1f2f;
  --text-soft: #4b3d55;
  --pink: #ff97c8;
  --coral: #ffb3a7;
  --sunset-1: #ffb36b;
  --sunset-2: #ff7bb4;
  --sunset-3: #a66bff;
  --ocean-1: #7bd7ff;
  --ocean-2: #4bb7ff;
  --ocean-3: #2a7edb;
  --sand-1: #ffd8a6;
  --sand-2: #f6b777;
}

html,
body {
  height: 100%;
  width: 100%;
  overflow: hidden;
  font-family: "Fredoka", "Trebuchet MS", sans-serif;
  background: #fff;
  color: var(--text-dark);
}

button {
  border: none;
  background: none;
  font-family: inherit;
  color: inherit;
}

#app {
  height: 100%;
  width: 100%;
  position: relative;
}

.screen {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  text-align: center;
  contain: content;
}

.screen.is-active {
  display: flex;
  flex-direction: column;
}

/* Tap screen */
#screen-tap {
  overflow: hidden;
}

.tap-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, #ffe6f3 0%, #d7f2ff 50%, #fff7d9 100%);
}

.tap-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 1.6vh;
  align-items: center;
  justify-content: center;
  height: 100%;
  width: 100%;
}

.tap-text {
  font-size: 6.5vw;
  max-width: 70vw;
  color: var(--text-soft);
  animation: pulse 2.6s ease-in-out infinite;
  letter-spacing: 0.2vw;
}


.sound-toggle {
  display: flex;
  align-items: center;
  gap: 1.5vw;
  font-size: 3.6vw;
  font-family: inherit;
  color: #7a6b80;
  background: rgba(255, 255, 255, 0.6);
  border: none;
  border-radius: 999px;
  padding: 1vh 4vw;
  cursor: pointer;
  touch-action: manipulation;
  transition: background 0.25s ease, transform 0.15s ease;
}

.sound-toggle:active {
  transform: scale(0.95);
}

.sound-toggle.is-on {
  background: rgba(255, 210, 230, 0.7);
  color: #5a4a62;
}

.sound-icon {
  font-size: 4.5vw;
  line-height: 1;
}

.sound-label {
  line-height: 1;
}

.slide-control {
  margin-top: 4vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.2vh;
}

.slide-track {
  position: relative;
  width: min(78vw, 340px);
  height: 7vh;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.75);
  box-shadow: 0 2vh 4vh rgba(0, 0, 0, 0.08);
  overflow: hidden;
}

.slide-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0%;
  background: linear-gradient(90deg, #ffd0e8 0%, #ffc2a8 100%);
  transition: width 0.2s ease;
}

.slide-figures {
  width: min(86vw, 420px);
  height: 22vh;
  position: relative;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.slide-figures.hero {
  margin-bottom: 1vh;
}

.slide-person {
  position: absolute;
  bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8vh;
}

/* .slide-figures.hero .face-img removed — identical to base .face-img */
/* .slide-figures.hero .beach-stick removed — identical to base .beach-stick */

.slide-figures.hero .beach-stick .arm.outer,
.slide-figures.hero .beach-stick .arm.inner {
  width: 5vw;
}

.slide-figures.hero .beach-stick .arm.outer.left,
.slide-figures.hero .beach-stick .arm.inner.left {
  left: -2%;
}

.slide-figures.hero .beach-stick .arm.outer.right,
.slide-figures.hero .beach-stick .arm.inner.right {
  right: -2%;
}

.slide-handle {
  position: absolute;
  top: 50%;
  left: 0.6vh;
  transform: translateY(-50%);
  width: 6vh;
  height: 6vh;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 1vh 2vh rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  touch-action: none;
}

.slide-arrow {
  font-size: 5vw;
  color: #ff8fb1;
  line-height: 1;
}

.slide-hint {
  font-size: 3.4vw;
  color: #7a6b80;
  opacity: 0.8;
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.85;
  }
  50% {
    transform: scale(1.05);
    opacity: 1;
  }
}

/* Flower splash */
#screen-flowers {
  background: #fff;
  overflow: hidden;
}

.flowers-container {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.flower {
  position: absolute;
  top: -10vh;
  font-size: 6vw;
  animation: fall 2.6s linear forwards;
}

@keyframes fall {
  0% {
    transform: translateY(-10vh) rotate(0deg);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  100% {
    transform: translateY(120vh) rotate(360deg);
    opacity: 0.9;
  }
}

/* Beach scene */
#screen-beach {
  background: #fff;
  flex-direction: column;
  justify-content: flex-start;
}

.beach-scene {
  height: 65%;
  width: 100%;
  position: relative;
  display: flex;
  flex-direction: column;
}

.sky {
  flex: 3;
  position: relative;
  background: linear-gradient(
    180deg,
    var(--sunset-1) 0%,
    var(--sunset-2) 55%,
    var(--sunset-3) 100%
  );
  overflow: hidden;
}

.sky::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 6vh;
  background: linear-gradient(
    180deg,
    rgba(166, 107, 255, 0.2) 0%,
    rgba(123, 215, 255, 0.4) 100%
  );
  pointer-events: none;
}

.sky-glow {
  position: absolute;
  width: 80vw;
  height: 40vh;
  border-radius: 50%;
  left: 50%;
  bottom: -10vh;
  transform: translateX(-50%);
  background: radial-gradient(
    circle,
    rgba(255, 240, 210, 0.8) 0%,
    rgba(255, 240, 210, 0.2) 55%,
    rgba(255, 240, 210, 0) 70%
  );
}

.sun {
  position: absolute;
  width: 20vw;
  height: 20vw;
  border-radius: 50%;
  background: radial-gradient(circle, #fff4d2 0%, #ffd39f 65%, #ffbb7a 100%);
  left: 50%;
  bottom: 10vh;
  transform: translateX(-50%);
  opacity: 0.9;
}

.clouds {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.cloud {
  position: absolute;
  width: 24vw;
  height: 8vw;
  background: rgba(255, 255, 255, 0.75);
  border-radius: 999px;
  filter: blur(0.2vw);
  animation: drift-clouds 18s ease-in-out infinite;
  will-change: transform;
}

.cloud::before,
.cloud::after {
  content: "";
  position: absolute;
  background: rgba(255, 255, 255, 0.85);
  border-radius: 999px;
}

.cloud::before {
  width: 10vw;
  height: 6vw;
  left: 2vw;
  top: -3vw;
}

.cloud::after {
  width: 12vw;
  height: 7vw;
  right: 2vw;
  top: -2vw;
}

.cloud-1 {
  top: 10%;
  left: 5%;
  animation-duration: 22s;
}

.cloud-2 {
  top: 22%;
  left: 55%;
  width: 28vw;
  opacity: 0.6;
  animation-duration: 26s;
}

.cloud-3 {
  top: 35%;
  left: 25%;
  width: 20vw;
  opacity: 0.55;
  animation-duration: 20s;
}

@keyframes drift-clouds {
  0% {
    transform: translateX(0);
  }
  50% {
    transform: translateX(-6vw);
  }
  100% {
    transform: translateX(0);
  }
}

.ocean {
  flex: 3;
  position: relative;
  background: linear-gradient(
    180deg,
    var(--ocean-1) 0%,
    var(--ocean-2) 55%,
    var(--ocean-3) 100%
  );
  overflow: hidden;
}

.ocean::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 6vh;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.35) 0%,
    rgba(123, 215, 255, 0) 100%
  );
  pointer-events: none;
}

.ocean::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 6vh;
  background: linear-gradient(
    180deg,
    rgba(123, 215, 255, 0) 0%,
    rgba(255, 235, 210, 0.6) 100%
  );
  pointer-events: none;
}

.shoreline {
  position: absolute;
  left: -10%;
  right: -10%;
  bottom: 0;
  height: 10vh;
  background: radial-gradient(
      circle at 20% 30%,
      rgba(255, 255, 255, 0.8),
      rgba(255, 255, 255, 0) 60%
    ),
    radial-gradient(
      circle at 70% 40%,
      rgba(255, 255, 255, 0.8),
      rgba(255, 255, 255, 0) 60%
    );
  opacity: 0.7;
  animation: foam-shift 4s ease-in-out infinite;
  pointer-events: none;
  will-change: transform;
}

.wave-layer {
  position: absolute;
  inset: -10% 0 auto 0;
  height: 120%;
  opacity: 0.85;
  animation: drift 10s ease-in-out infinite;
  will-change: transform;
}

.wave-layer svg {
  width: 200%;
  height: 100%;
}

.wave-layer path {
  fill: rgba(255, 255, 255, 0.55);
}

.wave-layer-1 {
  animation-duration: 12s;
  top: 10%;
}

.wave-layer-2 {
  animation-duration: 9s;
  top: 30%;
  opacity: 0.7;
}

.wave-layer-3 {
  animation-duration: 14s;
  top: 50%;
  opacity: 0.5;
}

@keyframes drift {
  0% {
    transform: translateX(0);
  }
  50% {
    transform: translateX(-20%);
  }
  100% {
    transform: translateX(0);
  }
}

@keyframes foam-shift {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-1.5vh);
  }
}

.ocean.is-calm .wave-layer {
  opacity: 0;
  animation-play-state: paused;
}

.tsunami-layer {
  position: absolute;
  inset: auto 0 -120% 0;
  height: 140%;
  opacity: 0;
  transform: translateY(20%);
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.tsunami-layer svg {
  width: 120%;
  height: 100%;
}

.tsunami-layer path {
  fill: rgba(36, 120, 208, 0.95);
}

.ocean.is-tsunami .tsunami-layer {
  animation: tsunami-rise 2s ease forwards;
  opacity: 1;
}

@keyframes tsunami-rise {
  0% {
    transform: translateY(40%);
  }
  100% {
    transform: translateY(-30%);
  }
}

.sand {
  flex: 4;
  background: linear-gradient(180deg, var(--sand-1) 0%, var(--sand-2) 100%);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  position: relative;
}

.sand::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    circle at 20% 30%,
    rgba(255, 255, 255, 0.2),
    transparent 60%
  );
  opacity: 0.6;
}

.sand::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -1px;
  height: 6vh;
  background: linear-gradient(
    180deg,
    rgba(255, 235, 210, 0.7) 0%,
    rgba(255, 216, 166, 0) 100%
  );
  pointer-events: none;
}

.couple {
  width: 44vw;
  max-width: 240px;
  padding-bottom: 5vh;
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 0;
}

.beach-person {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6vh;
  position: relative;
}

.beach-person.left {
  animation: jump-left 4s linear infinite;
}

.beach-person.right {
  animation: jump-right 4s linear infinite;
}

@keyframes jump-left {
  0%,
  24%,
  50%,
  74%,
  100% {
    transform: translateY(0);
  }
  25%,
  49% {
    transform: translateY(-2.4vh);
  }
}

@keyframes jump-right {
  0%,
  49%,
  74%,
  100% {
    transform: translateY(0);
  }
  50%,
  73% {
    transform: translateY(-2.4vh);
  }
}

.face-img {
  width: 30vw;
  max-width: 220px;
  height: auto;
  border-radius: 70%;
  box-shadow: 0 1.2vh 2.4vh rgba(0, 0, 0, 0.08);
}

.beach-stick {
  position: relative;
  width: 14vw;
  height: 12vw;
  min-width: 40px;
  min-height: 34px;
}

.beach-stick .torso {
  position: absolute;
  width: 0.9vw;
  min-width: 3px;
  height: 6vw;
  min-height: 18px;
  background: #5a4a62;
  left: 50%;
  top: 0.5vw;
  transform: translateX(-50%);
  border-radius: 999px;
}

.beach-stick .leg {
  position: absolute;
  width: 0.9vw;
  min-width: 3px;
  height: 4vw;
  min-height: 12px;
  background: #5a4a62;
  top: 5vw;
  border-radius: 999px;
}

.beach-stick .leg.left {
  left: 30%;
  transform: rotate(35deg);
}

.beach-stick .leg.right {
  right: 30%;
  transform: rotate(-35deg);
}

.beach-stick .arm {
  position: absolute;
  height: 0.9vw;
  min-height: 3px;
  background: #5a4a62;
  top: 2.8vw;
  border-radius: 999px;
}

/* Outer arms (short, pointing away from partner) */
.beach-stick .arm.outer {
  width: 4vw;
  min-width: 12px;
}

.beach-stick .arm.outer.left {
  left: 5%;
  transform: rotate(-15deg);
}

.beach-stick .arm.outer.right {
  right: 5%;
  transform: rotate(15deg);
}

/* Inner arms (long, reaching toward partner to hold hands) */
.beach-stick .arm.inner {
  width: 13vw;
  min-width: 38px;
}

.beach-stick .arm.inner.left {
  left: -60%;
  transform: rotate(-5deg);
}

.beach-stick .arm.inner.right {
  right: -60%;
  transform: rotate(5deg);
}

.question-area {
  width: 100%;
  height: 35%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 2vh;
  padding: 0 6vw 6vh;
}

.typing-text {
  font-size: 5.4vw;
  color: var(--text-dark);
  min-height: 6vw;
}

.cursor {
  display: inline-block;
  margin-left: 0.4vw;
  animation: blink 0.9s steps(2, start) infinite;
}

@keyframes blink {
  0%,
  100% {
    opacity: 0;
  }
  50% {
    opacity: 1;
  }
}

.choice-buttons {
  display: flex;
  gap: 4vw;
}

.choice-btn {
  font-size: 4.4vw;
  padding: 2vh 6vw;
  border-radius: 999px;
  background: #fff;
  color: var(--text-dark);
  box-shadow: 0 1vh 2vh rgba(0, 0, 0, 0.1);
  transition: transform 0.2s ease;
}

.choice-btn:active {
  transform: scale(0.97);
}

.choice-btn.yes {
  background: #ffd5ea;
}

.choice-btn.no {
  background: #f4f0f6;
}

.choice-btn[disabled] {
  opacity: 0.6;
}

/* Yes screen */
#screen-yes {
  background: linear-gradient(160deg, #ffe6f3 0%, #f4f0ff 50%, #ffe7c8 100%);
  overflow: hidden;
}

.yes-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 3vh;
  align-items: center;
  padding: 0 8vw;
}

.yes-message {
  font-size: 5.5vw;
  color: var(--text-soft);
}

.love-line {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2vw;
  font-size: 4.5vw;
}

.stick-figure {
  position: relative;
  width: 10vw;
  height: 18vw;
  min-width: 30px;
  min-height: 54px;
}

.stick-figure .head {
  position: absolute;
  width: 4.6vw;
  height: 4.6vw;
  min-width: 14px;
  min-height: 14px;
  border-radius: 50%;
  border: 0.6vw solid #5a4a62;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  background: #fff;
}

.stick-figure .body {
  position: absolute;
  width: 0.8vw;
  min-width: 2px;
  height: 7vw;
  min-height: 22px;
  background: #5a4a62;
  left: 50%;
  top: 4.6vw;
  transform: translateX(-50%);
  border-radius: 999px;
}

.stick-figure .leg {
  position: absolute;
  width: 0.8vw;
  min-width: 2px;
  height: 6vw;
  min-height: 20px;
  background: #5a4a62;
  top: 10.5vw;
  border-radius: 999px;
}

.stick-figure .leg.left {
  left: 35%;
  transform: rotate(12deg);
}

.stick-figure .leg.right {
  right: 35%;
  transform: rotate(-12deg);
}

.stick-figure .arm.base {
  position: absolute;
  width: 7vw;
  min-width: 18px;
  height: 0.8vw;
  min-height: 2px;
  background: #5a4a62;
  top: 7vw;
  left: 50%;
  transform: translateX(-50%);
  border-radius: 999px;
}

.stretch-arm {
  position: relative;
  width: 90vw;
  height: 18vw;
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stretch-arm .stick-figure {
  position: relative;
  z-index: 2;
}

.stick-figure .arm.extend {
  position: absolute;
  height: 0.8vw;
  min-height: 2px;
  background: #5a4a62;
  top: 7vw;
  border-radius: 999px;
  transform: scaleX(0);
  animation: arm-extend 3.6s ease-out forwards;
}

.stick-figure .arm.extend.left {
  right: 50%;
  width: 60vw;
  transform-origin: right center;
}

.stick-figure .arm.extend.right {
  left: 50%;
  width: 60vw;
  transform-origin: left center;
}

@keyframes arm-extend {
  0% {
    transform: scaleX(0);
  }
  100% {
    transform: scaleX(1);
  }
}

.confetti-container {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.confetti {
  position: absolute;
  top: -10vh;
  font-size: 6vw;
  animation: fall 4.5s linear infinite;
  will-change: transform, opacity;
  backface-visibility: hidden;
}

/* Rotate hint */
#rotate-hint {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.95);
  z-index: 99;
  text-align: center;
  padding: 6vw;
}

.rotate-box {
  font-size: 5vw;
  color: var(--text-soft);
  padding: 4vh 6vw;
  border-radius: 3vw;
  background: #fff0f7;
  box-shadow: 0 2vh 4vh rgba(0, 0, 0, 0.08);
}

@media (orientation: landscape) {
  #rotate-hint {
    display: flex;
  }
}
