/* ✅ MOBILE SAFETY */
* {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

/* ========== MODERN (default / data-look=modern) ========== */
body {
  margin: 0;
  background: radial-gradient(circle,#1a001f,#000);
  font-family: 'Poppins', sans-serif;
  color: white;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  overflow: hidden;
}

#app {
  width: 100%;
  display: flex;
  justify-content: center;
}

.card {
  width: 90vw;
  max-width: 380px;
  background: rgba(255,255,255,0.08);
  border-radius: 26px;
  padding: 24px;
  text-align: center;
  box-shadow: 0 20px 50px rgba(255,80,150,0.35);
  animation: pop 0.4s ease;
}

.screen { display: none; }
.active { display: block; }

@keyframes pop {
  from { opacity: 0; transform: scale(0.9) translateY(20px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

button {
  padding: 12px 24px;
  border-radius: 30px;
  border: none;
  background: linear-gradient(135deg,#ff4d8d,#ff85b2);
  color: white;
  font-size: 15px;
  margin: 8px;
  cursor: pointer;
  touch-action: manipulation;
}

button.soft {
  background: rgba(255,255,255,0.2);
}

.top-bar {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
}

/* ✅ RESPONSIVE GAME AREA */
#gameArea {
  position: relative;
  height: 55vh;
  min-height: 320px;
  max-height: 520px;
  overflow: hidden;
  touch-action: none;
}

/* ✅ BIGGER HEARTS FOR MOBILE */
.heart {
  position: absolute;
  font-size: 64px;
  animation: fall linear;
  user-select: none;
  z-index: 2;
}

@keyframes fall {
  from { top: -80px; }
  to { top: 100%; }
}

.ticket {
  background: white;
  color: black;
  padding: 12px;
  border-radius: 16px;
  margin: 10px 0;
}

.confetti {
  position: fixed;
  font-size: 22px;
  animation: blast 1.5s forwards;
}

@keyframes blast {
  from { transform: scale(0); opacity: 1; }
  to { transform: translateY(-200px) scale(1.5); opacity: 0; }
}

input {
  width: 80%;
  padding: 12px;
  border-radius: 20px;
  border: none;
  outline: none;
  font-size: 16px;
  margin: 14px auto;
  text-align: center;
}

h3 {
  margin-top: 22px;
  margin-bottom: 10px;
  color: #ff9fc9;
  font-weight: 600;
}

#rewardScreen button {
  display: block;
  width: 100%;
  max-width: 300px;
  margin: 8px auto;
}

*{box-sizing:border-box}body{min-height:100svh;height:100svh}.card{max-height:calc(100svh - 24px);overflow-y:auto;width:calc(100vw - 28px)}#gameArea{height:48svh;min-height:180px;max-height:440px}.ticket{overflow-wrap:anywhere}

html{overflow-x:hidden}body{max-width:100vw}h1,h2,h3,p,.choice,.pill,.say,.ticket{overflow-wrap:anywhere}

/* Modern keepsake photo (VI copy preserved) */
body[data-look="modern"] .vintage-keepsake{
  width:min(100%,250px);margin:18px auto;padding:0;background:transparent;border:none;box-shadow:none;transform:none;
}
body[data-look="modern"] .vintage-keepsake img{
  display:block;width:100%;height:140px;object-fit:cover;border-radius:16px;filter:none;
}
body[data-look="modern"] .vintage-keepsake figcaption{
  font-size:12px;color:#ff9fc9;padding-top:8px;font-style:normal;line-height:1.5;
}

/* ========== VINTAGE (data-look=vintage / .mec-vintage) ========== */
body.mec-vintage,
body[data-look="vintage"]{
  padding:18px 0;min-height:0;align-items:center;
  color:#4b3427;
}

body.mec-vintage #app,
body[data-look="vintage"] #app{
  padding:18px 0;min-height:0;align-items:center;
}

body.mec-vintage .card,
body[data-look="vintage"] .card{
  max-width:440px;
  padding:26px 24px;
  background:
    radial-gradient(ellipse at 28% 12%,#fff9ebcc,transparent 55%),
    linear-gradient(165deg,#f8efdf,#efe2c8);
  color:#4b3427;
  border:1px solid #a98e66;
  border-radius:0;
  outline:1px solid #bda982;
  outline-offset:-7px;
  box-shadow:0 16px 40px #3b2d2226, inset 0 0 48px #c4a35a0c;
  animation:none;
}

body.mec-vintage h1,
body[data-look="vintage"] h1{
  font-size:clamp(1.55rem,6vw,2rem);line-height:1.3;color:#4b3427;
}
body.mec-vintage h2,
body.mec-vintage h3,
body[data-look="vintage"] h2,
body[data-look="vintage"] h3{color:#7d3839}

body.mec-vintage .vintage-keepsake,
body[data-look="vintage"] .vintage-keepsake{
  width:min(100%,250px);margin:18px auto;background:#fffaf0;padding:8px 8px 12px;
  box-shadow:0 4px 12px #49342625;transform:rotate(-2deg);border:1px solid #d4c6ae;
  position:relative;
}
body.mec-vintage .vintage-keepsake::before,
body.mec-vintage .vintage-keepsake::after,
body[data-look="vintage"] .vintage-keepsake::before,
body[data-look="vintage"] .vintage-keepsake::after{
  content:"";position:absolute;width:36px;height:36px;pointer-events:none;z-index:2;
  background:url("/assets/vintage/svg/corner.svg") no-repeat center/contain;opacity:.75;
}
body.mec-vintage .vintage-keepsake::before,
body[data-look="vintage"] .vintage-keepsake::before{top:2px;left:2px}
body.mec-vintage .vintage-keepsake::after,
body[data-look="vintage"] .vintage-keepsake::after{top:2px;right:2px;transform:scaleX(-1)}

body.mec-vintage .vintage-keepsake img,
body[data-look="vintage"] .vintage-keepsake img{
  display:block;width:100%;height:125px;object-fit:cover;border-radius:0;filter:sepia(.18) saturate(.8);
}
body.mec-vintage figcaption,
body[data-look="vintage"] figcaption{
  font-size:11px;color:#765c46;padding-top:9px;font-style:italic;line-height:1.5;
}

body.mec-vintage button,
body[data-look="vintage"] button{
  margin:8px 3px;min-height:44px;background:#7d3839;color:#fff8e4;
  border-radius:2px;box-shadow:3px 3px 0 #6b443023;
}
body.mec-vintage button.soft,
body[data-look="vintage"] button.soft{
  background:#e5d6ba!important;color:#573f2e!important;border:1px solid #ad9272;
}

body.mec-vintage #gameArea,
body[data-look="vintage"] #gameArea{
  background:
    radial-gradient(ellipse at 20% 30%,#fff8e866,transparent 45%),
    radial-gradient(ellipse at 80% 70%,#c4a35a22,transparent 40%),
    #e8dcc3;
  border-top:1px solid #b69a72;
  border-bottom:1px solid #b69a72;
  margin:10px 0;
  isolation:isolate;
}

/* Petal / floral backdrop — pointer-events none so hitboxes stay intact */
body.mec-vintage #gameArea::before,
body[data-look="vintage"] #gameArea::before{
  content:"";
  position:absolute;inset:0;z-index:0;pointer-events:none;
  background:
    url("/assets/vintage/svg/petal.svg") 12% 18% / 18px 24px no-repeat,
    url("/assets/vintage/svg/petal.svg") 78% 28% / 14px 20px no-repeat,
    url("/assets/vintage/svg/petal.svg") 22% 62% / 20px 26px no-repeat,
    url("/assets/vintage/svg/petal.svg") 88% 72% / 16px 22px no-repeat,
    url("/assets/vintage/svg/leaf.svg") 8% 88% / 22px 28px no-repeat,
    url("/assets/vintage/svg/leaf.svg") 92% 12% / 18px 24px no-repeat,
    url("/assets/vintage/svg/sparkle.svg") 48% 12% / 12px 12px no-repeat,
    url("/assets/vintage/svg/sparkle.svg") 58% 84% / 10px 10px no-repeat;
  opacity:.55;
  animation:hg-petal-drift 14s ease-in-out infinite alternate;
}
body.mec-vintage #gameArea::after,
body[data-look="vintage"] #gameArea::after{
  content:"";
  position:absolute;inset:0;z-index:0;pointer-events:none;
  background:
    radial-gradient(circle at 30% 40%,#c4a35a33 0 2px,transparent 3px),
    radial-gradient(circle at 70% 55%,#7d383933 0 1.5px,transparent 3px),
    radial-gradient(circle at 50% 20%,#fff8e899 0 1px,transparent 2px);
  background-size:120px 120px,160px 160px,90px 90px;
  animation:hg-sparkle-shift 8s linear infinite;
  opacity:.7;
}

@keyframes hg-petal-drift{
  0%{transform:translateY(0) rotate(0deg);opacity:.5}
  100%{transform:translateY(6px) rotate(2deg);opacity:.65}
}
@keyframes hg-sparkle-shift{
  0%{background-position:0 0,40px 20px,10px 30px;opacity:.45}
  50%{opacity:.8}
  100%{background-position:40px 30px,-20px 60px,50px -10px;opacity:.55}
}

body.mec-vintage #gameScreen .top-bar,
body[data-look="vintage"] #gameScreen .top-bar{font-size:15px;gap:8px;color:#4b3427}

body.mec-vintage #rewardScreen button,
body[data-look="vintage"] #rewardScreen button{max-width:100%;font-size:14px;text-align:left;padding:12px}

body.mec-vintage .ticket,
body[data-look="vintage"] .ticket{
  background:#fffaf0;border:1px dashed #a78b65;border-radius:0;color:#4b3427;
}

body.mec-vintage input,
body[data-look="vintage"] input{
  width:100%;border:1px solid #b69a72;background:#fffaf0;color:#4b3427;border-radius:2px;
}

@media(max-height:640px){
  body.mec-vintage .vintage-keepsake img,
  body[data-look="vintage"] .vintage-keepsake img{height:100px}
  body.mec-vintage .card,
  body[data-look="vintage"] .card{padding:22px 18px}
}

@media(prefers-reduced-motion:reduce){
  body.mec-vintage #gameArea::before,
  body.mec-vintage #gameArea::after,
  body[data-look="vintage"] #gameArea::before,
  body[data-look="vintage"] #gameArea::after{animation:none!important}
  .card,.heart,.confetti{animation-duration:0.01ms!important;animation-iteration-count:1!important}
}
