:root {
  --ink: #fff6dc;
  --ink-soft: #e9d6ad;
  --gold: #f7c948;
  --gold-deep: #b47716;
  --orange: #ff6a00;
  --green: #2f5d3a;
  --wood: #2a140a;
  --night: #0d0604;
  --font-body: 'Montserrat', system-ui, sans-serif;
  --font-slab: 'Alfa Slab One', Georgia, serif;
  --font-script: 'Yellowtail', cursive;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--night);
  color: var(--ink);
  font-family: var(--font-body);
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; cursor: pointer; }
[hidden] { display: none !important; }

/* ---------- Escenario 16:9 escalado ---------- */
.viewport { position: fixed; inset: 0; overflow: hidden; background: #070302; }
.stage {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 1600px;
  height: 900px;
  transform-origin: 50% 50%;
  overflow: hidden;
  background:
    radial-gradient(ellipse 60% 70% at 70% 50%, #4a2410 0%, transparent 70%),
    radial-gradient(ellipse 80% 90% at 50% 50%, #241008 0%, var(--night) 100%);
  user-select: none;
}

/* Luces cálidas de bar desenfocadas */
.bg { position: absolute; inset: 0; pointer-events: none; }
.bg span {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 190, 80, .5), transparent 65%);
  animation: bokeh 9s ease-in-out infinite alternate;
}
.bg span:nth-child(1) { width: 260px; height: 260px; left: 2%; top: 64%; }
.bg span:nth-child(2) { width: 180px; height: 180px; left: 36%; top: 6%; animation-delay: -3s; background: radial-gradient(circle, rgba(255, 106, 0, .35), transparent 65%); }
.bg span:nth-child(3) { width: 320px; height: 320px; left: 84%; top: 62%; animation-delay: -5s; }
.bg span:nth-child(4) { width: 140px; height: 140px; left: 92%; top: 4%; animation-delay: -1s; }
.bg span:nth-child(5) { width: 220px; height: 220px; left: 26%; top: 78%; animation-delay: -7s; background: radial-gradient(circle, rgba(120, 200, 120, .18), transparent 65%); }
.bg span:nth-child(6) { width: 200px; height: 200px; left: 50%; top: 40%; animation-delay: -4s; opacity: .5; }
@keyframes bokeh { from { transform: translate(0, 0) scale(1); opacity: .55; } to { transform: translate(20px, -24px) scale(1.12); opacity: 1; } }

/* ---------- Columna izquierda ---------- */
.side {
  position: absolute;
  left: 60px;
  top: 40px;
  bottom: 60px;
  width: 560px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  z-index: 2;
}
.side__logo { width: 400px; height: auto; filter: drop-shadow(0 6px 14px rgba(0, 0, 0, .6)); }
.title { margin-top: 18px; line-height: .9; }
.title__script {
  display: block;
  font-family: var(--font-script);
  font-weight: 400;
  font-size: 84px;
  color: var(--gold);
  text-shadow: 0 3px 0 #6b3d05, 0 0 24px rgba(247, 201, 72, .45);
  transform: rotate(-4deg);
}
.title__slab {
  display: block;
  margin-top: 2px;
  font-family: var(--font-slab);
  font-size: 104px;
  letter-spacing: 2px;
  background: linear-gradient(180deg, #fff6c2 0%, #f7c948 45%, #c8871a 70%, #ffe08a 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 5px 0 #4a2706) drop-shadow(0 10px 20px rgba(0, 0, 0, .6));
}
.side__lead { margin-top: 16px; font-size: 26px; font-weight: 700; color: var(--ink-soft); }

.jackpot {
  margin-top: 24px;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 14px 30px 14px 20px;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(47, 93, 58, .95), rgba(18, 44, 26, .95));
  border: 3px solid var(--gold);
  box-shadow: 0 0 0 4px rgba(0, 0, 0, .35), 0 0 40px rgba(247, 201, 72, .35), inset 0 0 30px rgba(0, 0, 0, .35);
  text-align: left;
  animation: jackpotGlow 2.2s ease-in-out infinite;
}
.jackpot img { width: 40px; height: auto; filter: drop-shadow(0 0 10px rgba(255, 220, 90, .8)); }
.jackpot small { display: block; font-size: 16px; font-weight: 800; letter-spacing: 3px; text-transform: uppercase; color: var(--gold); }
.jackpot strong { display: block; font-size: 24px; line-height: 1.15; font-weight: 800; }
@keyframes jackpotGlow { 50% { box-shadow: 0 0 0 4px rgba(0, 0, 0, .35), 0 0 70px rgba(247, 201, 72, .7), inset 0 0 30px rgba(0, 0, 0, .35); } }

.btn-spin {
  position: relative;
  margin-top: auto;
  width: 520px;
  height: 120px;
  border: 0;
  border-radius: 70px;
  background: linear-gradient(180deg, #ffb054 0%, var(--orange) 45%, #c94a00 100%);
  box-shadow: 0 10px 0 #7a2c00, 0 18px 30px rgba(0, 0, 0, .55), inset 0 3px 0 rgba(255, 255, 255, .45), 0 0 0 5px var(--gold);
  font-family: var(--font-slab);
  font-size: 36px;
  letter-spacing: .5px;
  color: #fff;
  text-shadow: 0 3px 0 rgba(0, 0, 0, .35);
  animation: pulse 1.6s ease-in-out infinite;
  transition: transform .1s, box-shadow .1s, filter .2s;
  overflow: hidden;
}
.btn-spin::after {
  content: '';
  position: absolute;
  top: 0;
  left: -60%;
  width: 40%;
  height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .55), transparent);
  transform: skewX(-20deg);
  animation: shine 2.6s ease-in-out infinite;
}
.btn-spin:active { transform: translateY(8px); box-shadow: 0 2px 0 #7a2c00, 0 6px 14px rgba(0, 0, 0, .55), inset 0 3px 0 rgba(255, 255, 255, .45), 0 0 0 5px var(--gold); }
.btn-spin:disabled { filter: grayscale(.7) brightness(.7); animation: none; cursor: default; }
.btn-spin:disabled::after { display: none; }
@keyframes pulse { 50% { transform: scale(1.045); } }
@keyframes shine { 0%, 55% { left: -60%; } 100% { left: 130%; } }
.side__note { margin-top: 18px; font-size: 18px; font-weight: 600; color: var(--ink-soft); opacity: .85; }

/* ---------- Ruleta ---------- */
.wheel {
  position: absolute;
  left: 690px;
  top: 10px;
  width: 860px;
  height: 860px;
  z-index: 1;
}
.wheel__layer, .wheel__svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.wheel__label { font-family: var(--font-body); font-weight: 900; letter-spacing: 1px; }
.wheel__label--jackpot { filter: drop-shadow(0 0 6px rgba(255, 210, 80, .9)); }

.bulb { fill: #5a3a10; stroke: #2a1504; stroke-width: 3; transition: fill .08s; }
.bulb.is-on { fill: #fff3b0; filter: drop-shadow(0 0 8px #ffd34d) drop-shadow(0 0 16px #ffb300); }

.win-wedge { fill: rgba(255, 230, 120, .0); stroke: none; opacity: 0; }
.win-wedge.is-on { opacity: 1; animation: winWedge .5s ease-in-out infinite alternate; }
.win-wedge[data-kind='win'] { fill: rgba(255, 230, 120, .35); stroke: #fff3b0; stroke-width: 6; }
.win-wedge[data-kind='jackpot'] { fill: rgba(255, 230, 120, .5); stroke: #fff; stroke-width: 8; }
.win-wedge[data-kind='lose'] { fill: rgba(255, 255, 255, .12); stroke: rgba(255, 255, 255, .5); stroke-width: 4; animation: none; }
@keyframes winWedge { from { opacity: .45; } to { opacity: 1; } }

.bottle {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 200px;
  height: auto;
  transform: translate(-50%, -50%);
  will-change: transform;
  pointer-events: none;
}
.bottle.is-knock { animation: knock .12s ease-out; }
@keyframes knock { 50% { margin-left: 2px; margin-top: -2px; } }

.stage.is-tense .wheel { animation: tense .25s linear infinite; }
@keyframes tense { 50% { filter: brightness(1.18) saturate(1.2); } }

.confetti { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 6; }

.legal {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 14px;
  text-align: center;
  font-size: 15px;
  font-weight: 600;
  color: rgba(255, 246, 220, .55);
  z-index: 2;
}

/* ---------- Resultado ---------- */
.result {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 50% 45%, rgba(20, 9, 4, .55), rgba(5, 2, 1, .88));
  opacity: 0;
  transition: opacity .3s;
}
.result.is-open { opacity: 1; }
.result__card {
  position: relative;
  width: 760px;
  padding: 112px 56px 36px;
  border-radius: 34px;
  text-align: center;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .08), transparent 40%),
    linear-gradient(160deg, #4a2410, #1d0c05);
  border: 4px solid var(--gold);
  box-shadow: 0 0 0 8px rgba(0, 0, 0, .4), 0 30px 80px rgba(0, 0, 0, .7), 0 0 80px rgba(247, 201, 72, .3);
  transform: scale(.85) translateY(30px);
  transition: transform .45s cubic-bezier(.2, 1.6, .4, 1);
}
.result.is-open .result__card { transform: none; }
.result__burst {
  position: absolute;
  left: 50%;
  top: -96px;
  width: 200px;
  height: 200px;
  transform: translateX(-50%);
  display: grid;
  place-items: center;
}
.result__burst::before {
  content: '';
  position: absolute;
  inset: -50px;
  background: url(../assets/prizes/botella.svg) center / contain no-repeat;
  animation: spinSlow 10s linear infinite;
}
.result__burst img { position: relative; width: 180px; height: 180px; filter: drop-shadow(0 10px 20px rgba(0, 0, 0, .5)); }
.result__burst img.is-bottle { width: auto; height: 250px; margin-top: -30px; }
.result__burst--lose::before { opacity: .25; filter: grayscale(1); }
.result__burst--jackpot::before { inset: -120px; }
@keyframes spinSlow { to { transform: rotate(360deg); } }
.result__kicker { font-size: 28px; font-weight: 800; color: var(--ink-soft); }
.result__title {
  margin-top: 4px;
  font-family: var(--font-slab);
  font-size: 76px;
  line-height: 1;
  background: linear-gradient(180deg, #fff6c2 0%, #f7c948 45%, #c8871a 75%, #ffe08a 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 4px 0 #4a2706);
}
.result__title--sm { font-size: 60px; }
.result__prize { margin-top: 10px; font-size: 42px; font-weight: 900; line-height: 1.1; }
.result__text { margin-top: 16px; font-size: 28px; line-height: 1.35; font-weight: 600; }
.result__text b { color: var(--gold); }
.result__small { margin-top: 12px; font-size: 22px; line-height: 1.4; color: var(--ink-soft); }
.result__small b { color: var(--ink); }
.result__sms { margin-top: 18px; font-size: 24px; font-weight: 700; color: #bff0c8; }
.result__code {
  margin: 16px auto 0;
  padding: 10px 20px;
  width: 480px;
  border-radius: 16px;
  background: #fff6dc;
  color: #2a140a;
  border: 3px dashed var(--orange);
}
.result__code small { display: block; font-size: 16px; font-weight: 700; text-transform: uppercase; letter-spacing: 2px; }
.result__code strong { display: block; margin: 2px 0; font-family: var(--font-slab); font-size: 48px; letter-spacing: 3px; white-space: nowrap; }
.btn-ok {
  margin-top: 22px;
  min-width: 300px;
  height: 78px;
  padding: 0 40px;
  border: 0;
  border-radius: 50px;
  background: linear-gradient(180deg, #fff3b5, var(--gold) 50%, var(--gold-deep));
  box-shadow: 0 7px 0 #6b3d05, 0 12px 24px rgba(0, 0, 0, .5);
  font-family: var(--font-slab);
  font-size: 34px;
  color: #3a1a08;
}
.btn-ok:active { transform: translateY(5px); box-shadow: 0 2px 0 #6b3d05; }

/* ---------- Formulario (capa normal, responsive) ---------- */
.sheet {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(12px, env(safe-area-inset-top)) 16px 12px;
  background: rgba(5, 2, 1, .78);
  overflow-y: auto;
  opacity: 0;
  transition: opacity .2s;
}
.sheet.is-open { opacity: 1; }
.sheet__card {
  position: relative;
  width: 100%;
  max-width: 560px;
  margin: auto;
  padding: 22px 22px 20px;
  border-radius: 22px;
  background: linear-gradient(160deg, #4a2410, #1d0c05);
  border: 3px solid var(--gold);
  box-shadow: 0 20px 60px rgba(0, 0, 0, .7);
}
.sheet__card h2 { font-family: var(--font-slab); font-weight: 400; font-size: 28px; color: var(--gold); padding-right: 40px; }
.sheet__lead { margin-top: 4px; font-size: 14px; color: var(--ink-soft); }
.sheet__close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .1);
  font-size: 28px;
  line-height: 1;
}
.field { display: block; margin-top: 12px; }
.field span { display: block; font-size: 13px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; color: var(--ink-soft); }
.field input {
  display: block;
  width: 100%;
  margin-top: 4px;
  height: 48px;
  padding: 0 14px;
  border: 2px solid rgba(247, 201, 72, .45);
  border-radius: 12px;
  background: #fff6dc;
  color: #2a140a;
  font: 700 17px var(--font-body);
}
.field input:focus { outline: none; border-color: var(--orange); box-shadow: 0 0 0 3px rgba(255, 106, 0, .35); }
.check { display: flex; gap: 10px; align-items: flex-start; margin-top: 14px; font-size: 12.5px; line-height: 1.4; color: var(--ink-soft); }
.check input { flex: none; width: 22px; height: 22px; margin-top: 1px; accent-color: var(--orange); }
.trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-error { min-height: 20px; margin-top: 10px; font-size: 14px; font-weight: 700; color: #ffb199; }
.btn-spin--form { width: 100%; height: 64px; margin-top: 6px; font-size: 28px; border-radius: 40px; box-shadow: 0 6px 0 #7a2c00, 0 0 0 3px var(--gold); animation: none; }

/* Celulares horizontales: formulario en dos columnas para que quepa sobre el teclado */
@media (orientation: landscape) and (max-height: 520px) {
  .sheet { align-items: flex-start; }
  .sheet__card { max-width: 760px; padding: 14px 18px; display: grid; grid-template-columns: 1fr 1fr 1fr; column-gap: 12px; }
  .sheet__card h2, .sheet__lead, .check, .form-error, .btn-spin--form { grid-column: 1 / -1; }
  .sheet__card h2 { font-size: 22px; }
  .field { margin-top: 8px; }
  .field input { height: 42px; }
  .check { margin-top: 10px; }
  .form-error { min-height: 0; margin-top: 6px; }
  .btn-spin--form { height: 52px; font-size: 24px; }
}

/* ---------- Aviso de girar el celular ---------- */
.rotate {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 24px;
  text-align: center;
  background: rgba(10, 4, 2, .94);
  font-size: 20px;
  font-weight: 800;
}
.rotate__phone {
  width: 56px;
  height: 96px;
  border: 5px solid var(--gold);
  border-radius: 12px;
  animation: rotatePhone 1.8s ease-in-out infinite;
}
@keyframes rotatePhone { 0%, 30% { transform: rotate(0); } 60%, 100% { transform: rotate(90deg); } }
.rotate button { padding: 10px 22px; border: 2px solid rgba(255, 255, 255, .3); border-radius: 30px; background: none; font-size: 15px; font-weight: 700; }

@media (prefers-reduced-motion: reduce) {
  .bg span, .btn-spin, .btn-spin::after, .jackpot, .result__burst::before { animation: none; }
}

/* ---------- TV ---------- */
.qr {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 26px;
  padding: 18px 30px 18px 18px;
  border-radius: 26px;
  background: linear-gradient(180deg, #ffb054, var(--orange) 50%, #c94a00);
  box-shadow: 0 0 0 5px var(--gold), 0 18px 40px rgba(0, 0, 0, .6);
  text-align: left;
  animation: pulse 2s ease-in-out infinite;
}
.qr img { width: 210px; height: 210px; padding: 8px; border-radius: 14px; background: #fff; }
.qr strong { display: block; font-family: var(--font-slab); font-weight: 400; font-size: 46px; line-height: 1; text-shadow: 0 3px 0 rgba(0, 0, 0, .3); }
.qr span { display: block; margin-top: 10px; font-size: 20px; font-weight: 700; line-height: 1.3; }

.banner {
  position: absolute;
  left: 50%;
  top: 26px;
  z-index: 4;
  padding: 16px 40px;
  border-radius: 50px;
  background: rgba(13, 6, 4, .88);
  border: 3px solid var(--gold);
  box-shadow: 0 0 40px rgba(247, 201, 72, .4);
  font-size: 34px;
  font-weight: 700;
  white-space: nowrap;
  transform: translate(-50%, -140%);
  transition: transform .4s cubic-bezier(.2, 1.4, .4, 1);
}
.banner.is-open { transform: translate(-50%, 0); }
.banner b { color: var(--gold); }

.tv-start {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: rgba(5, 2, 1, .82);
}
.tv-start button {
  padding: 22px 48px;
  border: 0;
  border-radius: 50px;
  background: var(--orange);
  box-shadow: 0 0 0 4px var(--gold);
  font-size: 30px;
  font-weight: 900;
}
.tv-start p { font-size: 18px; color: var(--ink-soft); }
