/* ============================================================
   what do you think Jenna — kiosk stylesheet
   Portrait touchscreen (~1080x1920), Chrome desktop, no scroll.
   ============================================================ */

:root {
  --bg-primary: #2B1B4A;
  --bg-secondary: #4A2E7A;
  --accent: #FFD166;
  --text-on-dark: #FDF6FF;
  --safe-margin: clamp(16px, 4vw, 36px);
  --flash-strength: 0.35;
  --tilt: 0deg;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overscroll-behavior: none;
}

body {
  font-family: 'Baloo 2', system-ui, -apple-system, sans-serif;
  background: #120a24;
  color: var(--text-on-dark);
  overflow: hidden;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  touch-action: manipulation;
}

img { -webkit-user-drag: none; user-drag: none; }

/* ---------- Stage ---------- */

.stage {
  position: relative;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

.stage.is-shaking { animation: stage-shake 500ms ease-in-out; }
.stage.is-wobbling { animation: stage-wobble 600ms ease-in-out; }

@keyframes stage-shake {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  20%      { transform: translate(-10px, 5px) rotate(-1deg); }
  40%      { transform: translate(8px, -6px) rotate(1deg); }
  60%      { transform: translate(-6px, 4px) rotate(-0.6deg); }
  80%      { transform: translate(5px, -3px) rotate(0.6deg); }
}

@keyframes stage-wobble {
  0%, 100% { transform: rotate(0deg); }
  25%      { transform: rotate(-1.4deg); }
  50%      { transform: rotate(1deg); }
  75%      { transform: rotate(-0.7deg); }
}

/* ---------- Background layers (crossfaded gradients) ---------- */

.bg-layer {
  position: absolute;
  inset: 0;
  z-index: 0;
  transition: opacity 700ms ease;
  background: linear-gradient(165deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
}

.bg-layer.is-active { opacity: 1; }
.bg-layer.is-inactive { opacity: 0; }

/* animated idle gradient shimmer on whichever layer is active */
.bg-layer.is-active::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 15%, rgba(255,255,255,0.10), transparent 55%);
  animation: sheen-drift 9s ease-in-out infinite;
}

@keyframes sheen-drift {
  0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.7; }
  50%      { transform: translate(3%, 4%) scale(1.1); opacity: 1; }
}

/* ---------- Idle ambient blobs ---------- */

.idle-blobs {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  mix-blend-mode: soft-light;
}

.blob {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,0.6), rgba(255,255,255,0) 70%);
  filter: blur(4px);
  opacity: 0.55;
  animation: blob-float 16s ease-in-out infinite;
}

.blob--1 { width: 42vw; height: 42vw; top: -12vw; left: -14vw; animation-duration: 17s; }
.blob--2 { width: 34vw; height: 34vw; bottom: -10vw; right: -10vw; animation-duration: 21s; animation-delay: -6s; }
.blob--3 { width: 24vw; height: 24vw; top: 42%; left: 62%; animation-duration: 13s; animation-delay: -9s; }

@keyframes blob-float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50%      { transform: translate(4%, -6%) scale(1.12); }
}

/* ---------- Flash ---------- */

.flash {
  position: absolute;
  inset: 0;
  z-index: 5;
  background: #fff;
  opacity: 0;
  pointer-events: none;
}

.flash.is-flashing { animation: flash-pop 480ms ease-out; }

@keyframes flash-pop {
  0%   { opacity: 0; }
  10%  { opacity: var(--flash-strength); }
  100% { opacity: 0; }
}

/* ---------- Particles ---------- */

.particle-layer {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  overflow: hidden;
}

.particle {
  position: absolute;
  top: 0;
  left: 0;
  will-change: transform, opacity;
  line-height: 1;
}

/* ---------- Layout ---------- */

.layout {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--safe-margin);
  gap: clamp(6px, 1.6vh, 18px);
}

.button-zone {
  flex: 0 0 auto;
  width: 100%;
  display: flex;
  justify-content: center;
  padding-top: clamp(6px, 2.5vh, 26px);
}

.result-zone {
  flex: 1 1 auto;
  width: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(8px, 1.6vh, 18px);
}

.text-zone {
  flex: 0 0 auto;
  width: 100%;
  min-height: clamp(64px, 13vh, 150px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding-bottom: clamp(10px, 2.5vh, 30px);
}

/* ---------- Main button (signature element) ---------- */

.main-btn {
  position: relative;
  border: none;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  font-family: inherit;
  font-weight: 800;
  color: #3A0F2B;
  background: linear-gradient(150deg, #ffa4d3 0%, #ff5da2 55%, #ff3f8f 100%);
  border-radius: clamp(28px, 6vw, 54px);
  padding: clamp(22px, 4.4vh, 40px) clamp(28px, 7vw, 56px);
  width: 100%;
  max-width: min(94vw, 760px);
  box-shadow:
    0 10px 0 #c23f7e,
    0 20px 34px rgba(0, 0, 0, 0.35),
    inset 0 2px 0 rgba(255, 255, 255, 0.5);
  animation: btn-breathe 3.8s ease-in-out infinite;
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.main-btn__label {
  position: relative;
  z-index: 1;
  display: block;
  font-size: clamp(1.9rem, 7.6vw, 3.4rem);
  line-height: 1.08;
  text-shadow: 0 2px 0 rgba(255, 255, 255, 0.4);
}

.main-btn__glow {
  position: absolute;
  inset: -20%;
  z-index: 0;
  border-radius: inherit;
  background: radial-gradient(circle, rgba(255, 214, 102, 0.55), transparent 70%);
  filter: blur(20px);
  animation: glow-pulse 3.8s ease-in-out infinite;
}

@keyframes btn-breathe {
  0%, 100% { transform: translateY(0) scale(1); }
  50%      { transform: translateY(-1.5%) scale(1.015); }
}

@keyframes glow-pulse {
  0%, 100% { opacity: 0.5; transform: scale(1); }
  50%      { opacity: 0.9; transform: scale(1.1); }
}

.main-btn.is-pressed {
  transform: scale(0.92) translateY(5px);
  box-shadow:
    0 4px 0 #c23f7e,
    0 8px 16px rgba(0, 0, 0, 0.3),
    inset 0 2px 0 rgba(255, 255, 255, 0.5);
  animation: none;
}

.main-btn.is-rolling { animation: btn-breathe 3.8s ease-in-out infinite, btn-jiggle 0.4s ease-in-out; }

@keyframes btn-jiggle {
  0%, 100% { transform: rotate(0deg); }
  25%      { transform: rotate(-1.2deg) scale(0.99); }
  75%      { transform: rotate(1.2deg) scale(0.99); }
}

.main-btn--compact .main-btn__label {
  font-size: clamp(1.4rem, 5.2vw, 2.15rem);
}

.main-btn--compact {
  padding: clamp(14px, 2.6vh, 24px) clamp(22px, 5.5vw, 38px);
}

/* ---------- Slot marquee ---------- */

.marquee {
  background: rgba(10, 6, 20, 0.55);
  border: 3px solid rgba(255, 255, 255, 0.25);
  border-radius: 18px;
  padding: clamp(10px, 1.7vh, 18px) clamp(20px, 4.5vw, 34px);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  min-width: 62%;
  text-align: center;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 200ms ease, transform 200ms ease;
}

.marquee.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.marquee__text {
  font-family: 'Courier New', Courier, monospace;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: clamp(1.3rem, 5.6vw, 2.4rem);
  color: #fff;
}

/* ---------- Result image ---------- */

.image-frame {
  position: relative;
  width: 100%;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.image-tilt {
  transform: rotate(var(--tilt, 0deg));
  transition: transform 500ms ease;
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  max-height: 100%;
}

.result-image {
  display: block;
  max-width: min(78vw, 640px);
  max-height: 58dvh;
  max-height: 58vh;
  width: auto;
  height: auto;
  object-fit: contain;
  opacity: 0;
  transform: translateY(50px) scale(0.65);
  filter: drop-shadow(0 22px 32px rgba(0, 0, 0, 0.38));
  pointer-events: none;
}

.result-image.is-visible {
  animation: image-pop 720ms cubic-bezier(0.2, 1.4, 0.4, 1) forwards;
}

@keyframes image-pop {
  0%   { opacity: 0; transform: translateY(70px) scale(0.55); }
  55%  { opacity: 1; transform: translateY(-12px) scale(1.1); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* ---------- Result text ---------- */

.result-text {
  margin: 0;
  font-weight: 800;
  text-align: center;
  line-height: 1;
  font-size: clamp(2.6rem, 13vw, 6.2rem);
  color: var(--text-on-dark);
  text-shadow: 0 4px 0 rgba(0, 0, 0, 0.22), 0 14px 26px rgba(0, 0, 0, 0.28);
  opacity: 0;
  transform: translateY(24px) scale(0.85);
}

.result-text.is-visible {
  animation: text-pop 560ms cubic-bezier(0.2, 1.5, 0.4, 1) forwards;
}

@keyframes text-pop {
  0%   { opacity: 0; transform: translateY(26px) scale(0.8); }
  60%  { opacity: 1; transform: translateY(-6px) scale(1.08); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  .main-btn,
  .main-btn__glow,
  .bg-layer.is-active::after,
  .blob {
    animation: none !important;
  }

  .result-image.is-visible,
  .result-text.is-visible,
  .stage.is-shaking,
  .stage.is-wobbling,
  .flash.is-flashing,
  .main-btn.is-rolling {
    animation-duration: 0.001ms !important;
  }

  .marquee,
  .image-tilt,
  .bg-layer,
  .main-btn {
    transition-duration: 0.001ms !important;
  }
}

/* ---------- Small-screen safety ---------- */

@media (max-height: 560px) {
  .main-btn__label { font-size: clamp(1.3rem, 6vw, 2rem); }
  .result-text { font-size: clamp(2rem, 10vw, 3.6rem); }
}
