/* ---- Reset-ish + full-screen mobile canvas ---- */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  /* stop pull-to-refresh and rubber-band scroll while chasing the No button */
  overscroll-behavior: none;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Noto Kufi Arabic", "Noto Sans Arabic", Roboto, sans-serif;
  color: #571b3c;
  background: #ffb3d1;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;   /* no long-press "copy/save" menu */
  touch-action: manipulation;
}

/* soft animated gradient — slow drift so the background feels alive */
body::before {
  content: "";
  position: fixed;
  inset: -25%;
  z-index: -1;
  background:
    radial-gradient(60% 50% at 20% 25%, #ffd9ea 0%, transparent 70%),
    radial-gradient(55% 55% at 82% 20%, #ffc4dd 0%, transparent 70%),
    radial-gradient(70% 60% at 50% 90%, #ff86b3 0%, transparent 75%),
    linear-gradient(160deg, #ffd6e8 0%, #ffb3d1 45%, #ff8fb8 100%);
  animation: drift 16s ease-in-out infinite alternate;
}
@keyframes drift {
  from { transform: translate3d(-2%, -1%, 0) scale(1); }
  to   { transform: translate3d(2%, 1.5%, 0) scale(1.06); }
}

.screen {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 20px;
  /* respect the phone's safe areas (notch / home indicator) */
  padding-top: max(20px, env(safe-area-inset-top));
  padding-bottom: max(20px, env(safe-area-inset-bottom));
}

.hidden { display: none; }

/* ---- frosted glass card holds the content ---- */
.card {
  width: min(92vw, 420px);
  padding: clamp(28px, 7vw, 40px) clamp(20px, 6vw, 36px);
  border-radius: 32px;
  background: rgba(255, 255, 255, 0.42);
  backdrop-filter: blur(18px) saturate(1.3);
  -webkit-backdrop-filter: blur(18px) saturate(1.3);
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow:
    0 24px 60px rgba(180, 30, 90, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

/* staggered entrance: everything floats up softly on load.
   (buttons are excluded — their own animations, like the Yes glow,
   would override `enter` and leave them stuck at opacity 0) */
.card > :not(.btn) {
  opacity: 0;
  animation: enter 0.65s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.card > *:nth-child(1) { animation-delay: 0.05s; }
.card > *:nth-child(2) { animation-delay: 0.15s; }
.card > *:nth-child(3) { animation-delay: 0.25s; }
.card > *:nth-child(4) { animation-delay: 0.35s; }
.card > *:nth-child(5) { animation-delay: 0.45s; }
@keyframes enter {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

.face {
  font-size: clamp(64px, 20vw, 104px);
  line-height: 1;
  margin-bottom: 8px;
  animation: enter 0.65s cubic-bezier(0.22, 1, 0.36, 1) forwards,
             breathe 3.2s ease-in-out 0.7s infinite;
}
@keyframes breathe {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.06); }
}
.bounce {
  animation: enter 0.65s cubic-bezier(0.22, 1, 0.36, 1) forwards,
             bounce 1.1s ease-in-out 0.7s infinite;
}
@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-14px); }
}

h1 {
  font-size: clamp(26px, 7.5vw, 38px);
  margin: 0 0 6px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.subtitle {
  font-size: clamp(17px, 4.8vw, 21px);
  line-height: 1.6;
  margin: 0 0 30px;
  opacity: 0.8;
  min-height: 1.6em;
}

/* the hint swaps text as she chases — reserve 2 lines so nothing jumps */
.hint {
  margin: 26px 0 0;
  font-size: clamp(14px, 4vw, 16px);
  line-height: 1.5;
  min-height: 3em;
  opacity: 0.65;
  transition: opacity 0.2s ease;
}

/* ---- Buttons ---- */
.buttons {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  min-height: 60px;   /* keep the card height stable once لأ floats away */
}

.btn {
  border: none;
  border-radius: 999px;
  min-height: 56px;               /* comfy thumb target */
  padding: 14px 34px;
  font-size: clamp(18px, 5vw, 21px);
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  color: white;
  transition: transform 0.15s ease, filter 0.2s ease;
}
.btn:active { filter: brightness(0.92); }

.btn-yes {
  background: linear-gradient(135deg, #ff5c8a, #ff2d6f);
  transform-origin: center;
  /* pulsing glow to draw the eye — uses box-shadow so it never fights the
     inline transform:scale() we set from JS */
  animation: glow 1.3s ease-in-out infinite;
}
@keyframes glow {
  0%, 100% {
    box-shadow: 0 6px 18px rgba(214, 0, 74, 0.55),
                0 0 12px 3px rgba(255, 60, 130, 0.45);
  }
  50% {
    box-shadow: 0 12px 34px rgba(214, 0, 74, 0.95),
                0 0 46px 16px rgba(255, 60, 130, 0.9);
  }
}

.btn-no {
  background: linear-gradient(135deg, #a7adc2, #848ba3);
  box-shadow: 0 6px 16px rgba(60, 60, 90, 0.25);
  /* the No button is moved from JS via transform — glide smoothly to each
     new spot instead of teleporting */
  transition: transform 0.9s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
  white-space: nowrap;
}

/* once it floats free of the card, the entrance animation must not
   own its transform anymore (JS drives it) */
body > .btn-no { animation: none; opacity: 1; }

/* confetti canvas sits full-screen on the win page */
#confetti {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.win-content { position: relative; z-index: 2; }

/* floating background hearts */
#hearts-bg { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 0; }
.float-heart {
  position: absolute;
  bottom: -40px;
  font-size: 24px;
  opacity: 0.6;
  animation: rise linear forwards;
}
@keyframes rise {
  to { transform: translateY(-110vh) rotate(360deg); opacity: 0; }
}

main.screen, section.screen { z-index: 1; }

/* Respect users who ask the OS to reduce motion */
@media (prefers-reduced-motion: reduce) {
  body::before, .bounce, .btn-yes, .face { animation: none; }
  .card > * { animation-duration: 0.01s; }
  .float-heart { animation-duration: 10s !important; }
}

/* short/landscape phones: tighten vertical rhythm so it all fits */
@media (max-height: 600px) {
  .face { font-size: 56px; margin-bottom: 4px; }
  .subtitle { margin-bottom: 18px; }
  .hint { margin-top: 14px; min-height: 2.4em; }
  .card { padding: 20px 24px; }
}
