:root{
  --bg1:#0b0b12;
  --bg2:#16162a;
  --stroke:#ffffff22;
  --text:#f6f6ff;
  --muted:#c7c7ea;
  --green:#3ddc97;
  --red1:#ff3b3b;
  --red2:#c91515;
  --shadow: 0 20px 80px #00000066;
  --radius: 20px;
  --stage-h: 140px;
}

*{ box-sizing:border-box; }
html,body{ height:100%; }

body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial;
  color:var(--text);
  background: radial-gradient(1200px 700px at 20% 10%, #2a1345 0%, transparent 60%),
              radial-gradient(900px 600px at 80% 40%, #112a3b 0%, transparent 55%),
              linear-gradient(180deg, var(--bg1), var(--bg2));

  /* ✅ IMPORTANT FIX: allow natural scroll, do NOT center vertically */
  min-height: 100dvh;
  padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
  display:flex;
  justify-content:flex-start; /* was center */
  align-items:flex-start;     /* was center */

  overflow-x:hidden;
  overflow-y:auto;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  touch-action: manipulation;
}

.app{
  width:min(760px, 100%);
  margin: 8% auto;          /* keep centered horizontally */
}

.card{
  width:100%;
  background: linear-gradient(180deg, #15163a66, #0e0f1ecc);
  border:1px solid var(--stroke);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow:hidden;
  backdrop-filter: blur(12px);
  position: relative;
}

.top{
  padding:18px 18px 10px;
  border-bottom:1px solid var(--stroke);
  text-align:center;
}
.brand{ margin:0; font-size: 26px; letter-spacing: .2px; }
.subtitle{ margin:6px 0 0; color:var(--muted); font-size: 14px; }

.video-box{ padding:16px 18px 6px; }
.video-inner{
  border:1px solid var(--stroke);
  border-radius: 16px;
  overflow:hidden;
  background: linear-gradient(135deg, #ffffff10, #ffffff05);
  min-height: 260px;
  position: relative;
}

.video-placeholder{
  padding:18px;
  width:100%;
  height: 260px;
  display:flex;
  flex-direction:column;
  justify-content:center;
  text-align:center;
}
.video-title{ margin:0; font-size:18px; font-weight:800; }
.video-hint{ margin:8px 0 0; color:var(--muted); font-size:14px; }

.question{ padding:10px 18px 0; text-align:center; }
.prompt{ margin:10px 0 0; font-size: 22px; font-weight: 900; }
.subprompt{ margin:8px 0 0; color: var(--muted); font-size: 14px; }

.actions{ padding:16px 18px 18px; }
.button-stage{
  position: relative;
  height: var(--stage-h);
  border:1px dashed #ffffff25;
  border-radius: 16px;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:14px;
  overflow:hidden;
  padding: 14px;
}

.btn{
  border:0;
  padding:14px 18px;
  border-radius: 14px;
  font-weight: 900;
  font-size: 16px;
  cursor:pointer;
  transition: transform .12s ease, filter .12s ease;
  user-select:none;
  max-width: 100%;
  -webkit-tap-highlight-color: transparent;
}
.btn:active{ transform: scale(0.98); }

.btn.small{
  padding:10px 14px;
  font-size: 14px;
  border-radius: 12px;
}
.btn.small.ghost{
  background: transparent;
  border: 1px solid var(--stroke);
  color: var(--text);
}

.btn.yes{
  background: linear-gradient(180deg, var(--green), #1aa772);
  color:#052014;
  box-shadow: 0 10px 30px #00ffbb22;
  transform-origin: center;
  white-space: nowrap;
  position: relative;
  z-index: 3;
}
.btn.no{
  background: linear-gradient(180deg, #8b5a2b, #5a3a1d);
  color:#140a03;
  box-shadow: 0 10px 30px #00000022;
  position: relative;
  white-space: normal;
  line-height: 1.1;
  text-align: center;
  max-width: min(320px, 42vw);
  z-index: 2;
}
.btn.no.angry{
  background: linear-gradient(180deg, var(--red1), var(--red2));
  color:#2b0014;
  box-shadow: 0 10px 30px #ff2b2b22;
}
.btn.no.runaway{ position:absolute; }

.tiny{ margin:10px 2px 0; color: var(--muted); font-size: 12px; text-align:center; }

.footer{
  border-top:1px solid var(--stroke);
  padding:14px 18px;
  background: #0b0c18aa;
  text-align:center;
}
.footer-text{ margin:0; font-size: 13px; color: var(--muted); }

.hidden{ display:none !important; }

/* -------------------------
   Selfie layout
-------------------------- */
.selfie-layout{
  width:100%;
  min-height: 260px;
  display:grid;
  grid-template-columns: 1fr 1.2fr 1fr;
  gap: 10px;
  align-items: center;
  padding: 14px;
}

.bouquet{
  height: 100%;
  border: 1px solid #ffffff18;
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff10, #ffffff06);
  display:flex;
  align-items:center;
  justify-content:center;
  padding: 10px;
  overflow:hidden;
}
.bouquet-img{
  width: 100%;
  height: 100%;
  object-fit: contain;
  max-height: 230px;
}

.selfie-center{
  display:flex;
  flex-direction:column;
  gap: 10px;
  align-items:center;
  justify-content:center;
}
.selfie-header{ text-align:center; }
.selfie-title{ margin: 0; font-weight: 1000; font-size: 16px; }
.selfie-subtitle{ margin: 6px 0 0; color: var(--muted); font-size: 12px; }

.selfie-frame{
  width: min(260px, 78vw);
  aspect-ratio: 1 / 1;
  border-radius: 18px;
  border: 1px solid #ffffff22;
  background: #0b0c18aa;
  overflow:hidden;
  position: relative;
  display:flex;
  align-items:center;
  justify-content:center;
  cursor: pointer;
  touch-action: manipulation;
}

.camera, .selfie{
  width:100%;
  height:100%;
  object-fit: cover;
}

.selfie-overlay{
  position:absolute;
  inset: 0;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  background: linear-gradient(180deg, #00000055, #00000022);
  text-align:center;
}
.overlay-big{ margin:0; font-size: 18px; font-weight: 1000; }
.overlay-small{ margin:6px 0 0; font-size: 12px; color: var(--muted); }

.selfie-actions{ display:flex; gap: 10px; }
.selfie-note{ margin:0; text-align:center; color: var(--muted); font-size: 12px; min-height: 18px; }

/* Confetti canvas */
.confetti{
  position: fixed;
  inset: 0;
  z-index: 999;
  pointer-events: none;
}

/* success tint */
.card.yes-mode .video-inner{ border-color:#00ffbb44; }
.card.yes-mode .prompt{ color:#b6ffe4; }

/* mobile stack */
@media (max-width: 560px){
  .selfie-layout{ grid-template-columns: 1fr; }
  .bouquet{ min-height: 120px; }
  .brand{ font-size: 22px; }
  .prompt{ font-size: 20px; }
  .button-stage{ height: 160px; gap: 12px; }
  .btn.no{ max-width: 56vw; }
}

/* -------------------------
   Rising madre flowers
-------------------------- */
.madre-corner{
  position: fixed;
  bottom: 0;
  width: min(260px, 40vw);
  height: auto;
  z-index: 998;
  pointer-events: none;
  transform: translateY(120%) scale(0.95);
  opacity: 0;
}
.madre-corner.left{ left: 0; }
.madre-corner.right{ right: 0; transform: translateY(120%) scale(0.95) scaleX(-1); }
.madre-corner.rise{ animation: madreRise 1.6s ease forwards; }
@keyframes madreRise{ to{ transform: translateY(0) scale(1); opacity: 1; } }

/* -------------------------
   Modal
-------------------------- */
.modal{
  position: fixed;
  inset: 0;
  background: #00000077;
  display:flex;
  align-items:center;
  justify-content:center;
  z-index: 1002;
  padding: 18px;
}
.modal-card{
  width: min(520px, 96vw);
  border: 1px solid var(--stroke);
  border-radius: 18px;
  background: linear-gradient(180deg, #16162acc, #0b0c18dd);
  box-shadow: var(--shadow);
  padding: 18px;
  text-align:center;
}
.modal-title{ margin: 0; font-size: 18px; font-weight: 1000; }
.modal-sub{ margin: 8px 0 14px; color: var(--muted); font-size: 13px; }

/* Save preview (NEW) */
.save-preview-wrap{
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 16px;
  overflow: hidden;
  background: rgba(0,0,0,0.25);
}
.save-preview{
  width: 100%;
  height: auto;
  display:block;
}
.save-actions{
  display:flex;
  gap: 10px;
  justify-content:center;
  flex-wrap: wrap;
  margin-top: 12px;
}

/* -------------------------
   Full screens
-------------------------- */
.full-screen{
  position: fixed;
  inset: 0;
  z-index: 1003;
  display:flex;
  align-items:center;
  justify-content:center;
  animation: fadeInUp .6s ease both;
}
@keyframes fadeInUp{
  from{ opacity:0; transform: translateY(10px); }
  to{ opacity:1; transform: translateY(0); }
}

#bouquetScreen{ background: linear-gradient(180deg, #7d0c18, #2b0014); }
.bouquet-screen-inner{
  width: min(920px, 96vw);
  display:flex;
  gap: 18px;
  align-items:center;
  justify-content:center;
  flex-wrap: wrap;
  padding: 18px;
}
.bouquet-screen-img{
  width: min(420px, 92vw);
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 20px 50px #00000066);
}

/* ✅ Reward screen: use CONTAIN for better clarity */
#rewardScreen{ background: #000; }
.reward-img{
  width: 100%;
  height: 100%;
  object-fit: cover; /* was contain */
}
