:root {
  --bg: #0b0b14;
  --bg-2: #14142b;
  --ink: #f5f5ff;
  --muted: #a6a6c8;
  --pink: #ff2d78;
  --purple: #7c3aed;
  --cyan: #22d3ee;
  --lime: #a3e635;
  --amber: #f59e0b;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, Roboto, Helvetica, Arial, sans-serif;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

#app { position: relative; width: 100vw; height: 100vh; height: 100dvh; }

.screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4vh 5vw;
  background:
    radial-gradient(1200px 600px at 50% -10%, #1c1c3d 0%, transparent 60%),
    linear-gradient(160deg, var(--bg) 0%, var(--bg-2) 100%);
  overflow: hidden;
  animation: fade .35s ease;
}
.hidden { display: none !important; }

@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* Glows decorativos */
.glow { position: absolute; border-radius: 50%; filter: blur(90px); opacity: .55; pointer-events: none; }
.glow-a { width: 40vw; height: 40vw; background: var(--purple); top: -10vh; left: -8vw; }
.glow-b { width: 38vw; height: 38vw; background: var(--pink); bottom: -12vh; right: -8vw; }

/* Bienvenida */
.brand {
  font-weight: 900;
  letter-spacing: .35em;
  font-size: clamp(20px, 3.2vh, 34px);
  color: var(--ink);
  opacity: .9;
  margin-bottom: 2.5vh;
  text-shadow: 0 0 24px rgba(124, 58, 237, .8);
  z-index: 1;
}
.title {
  font-size: clamp(34px, 8.5vh, 78px);
  line-height: 1.02;
  font-weight: 900;
  letter-spacing: -.01em;
  z-index: 1;
}
.title .accent {
  background: linear-gradient(90deg, var(--pink), var(--amber), var(--lime));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.subtitle {
  margin-top: 2.5vh;
  font-size: clamp(16px, 2.8vh, 24px);
  color: var(--muted);
  max-width: 760px;
  z-index: 1;
}
.subtitle strong { color: var(--cyan); }
.hint { margin-top: 3vh; font-size: clamp(12px, 1.9vh, 16px); color: #6f6f93; max-width: 620px; z-index: 1; }

.btn-primary {
  margin-top: 4.5vh;
  border: none;
  cursor: pointer;
  font-size: clamp(20px, 3.4vh, 30px);
  font-weight: 800;
  color: #0b0b14;
  padding: clamp(16px, 2.6vh, 26px) clamp(34px, 6vw, 64px);
  border-radius: 999px;
  background: linear-gradient(90deg, var(--lime), var(--cyan));
  box-shadow: 0 10px 40px rgba(34, 211, 238, .45), inset 0 0 0 1px rgba(255,255,255,.3);
  transition: transform .12s ease, box-shadow .2s ease;
  z-index: 1;
}
.btn-primary:active { transform: scale(.96); box-shadow: 0 6px 22px rgba(34, 211, 238, .4); }

/* Rueda */
.wheel-wrap {
  position: relative;
  width: min(78vh, 92vw);
  height: min(78vh, 92vw);
  max-width: 720px;
  max-height: 720px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.wheel {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: #0b0b14;
  box-shadow:
    0 0 0 10px #1d1d3a,
    0 0 0 16px #2b2b55,
    0 24px 80px rgba(0,0,0,.6),
    0 0 80px rgba(124, 58, 237, .35);
  transform: rotate(0deg);
  will-change: transform;
}
.wheel svg { display: block; border-radius: 50%; }

/* Flecha / puntero arriba */
.pointer {
  position: absolute;
  top: -2.4%;
  left: 50%;
  transform: translateX(-50%);
  width: 0; height: 0;
  border-left: clamp(18px, 2.6vh, 26px) solid transparent;
  border-right: clamp(18px, 2.6vh, 26px) solid transparent;
  border-top: clamp(30px, 4.4vh, 44px) solid #ffffff;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,.55));
  z-index: 5;
}

/* Botón central (cubo de la rueda) */
.spin-center {
  position: absolute;
  width: clamp(108px, 17vh, 168px);
  height: clamp(108px, 17vh, 168px);
  border-radius: 50%;
  border: none;
  cursor: pointer;
  font-size: clamp(20px, 3.4vh, 30px);
  font-weight: 900;
  letter-spacing: .04em;
  color: #0b0b14;
  background: radial-gradient(circle at 35% 30%, #ffffff, #e6e6ff 60%, #c9c9f5);
  box-shadow: 0 0 0 6px #0b0b14, 0 0 0 10px #2b2b55, 0 10px 30px rgba(0,0,0,.5);
  transition: transform .12s ease, opacity .2s ease;
  z-index: 4;
}
.spin-center:active { transform: scale(.93); }
.spin-center.disabled, .spin-center:disabled { opacity: .55; pointer-events: none; }

.game-hint { margin-top: 3.5vh; font-size: clamp(14px, 2.3vh, 20px); color: var(--muted); }
.game-hint strong { color: var(--lime); }

.respin-tag {
  position: absolute;
  top: 4vh;
  font-size: clamp(15px, 2.4vh, 22px);
  font-weight: 800;
  color: var(--amber);
  background: rgba(245, 158, 11, .12);
  border: 1px solid rgba(245, 158, 11, .5);
  padding: 10px 22px;
  border-radius: 999px;
}

/* Resultado */
.result-card {
  position: relative;
  z-index: 1;
  background: rgba(20, 20, 43, .72);
  border: 1px solid rgba(255,255,255,.08);
  backdrop-filter: blur(8px);
  border-radius: 32px;
  padding: clamp(28px, 5vh, 56px) clamp(28px, 6vw, 72px);
  max-width: 860px;
  box-shadow: 0 30px 90px rgba(0,0,0,.55);
  animation: pop .5s cubic-bezier(.2,1.3,.35,1);
}
@keyframes pop { from { transform: scale(.7); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.result-emoji { font-size: clamp(60px, 13vh, 120px); line-height: 1; animation: bob 1.6s ease-in-out infinite; }
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

.result-kicker {
  margin-top: 1.5vh;
  font-size: clamp(16px, 2.6vh, 24px);
  font-weight: 800;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--muted);
}
.result-prize {
  margin-top: 1vh;
  font-size: clamp(40px, 9vh, 92px);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -.01em;
  background: linear-gradient(90deg, var(--cyan), var(--lime));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.result-msg {
  margin-top: 2.5vh;
  font-size: clamp(17px, 3vh, 26px);
  color: var(--ink);
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
}

/* Cupón de descuento (el ganador le saca una foto) */
.coupon {
  margin-top: 2.6vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.1vh;
}
.coupon-label {
  font-size: clamp(12px, 1.9vh, 16px);
  font-weight: 800;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--muted);
}
.coupon-code {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: clamp(30px, 6.4vh, 60px);
  font-weight: 900;
  letter-spacing: .06em;
  color: var(--ink);
  background: rgba(163, 230, 53, .12);
  border: 2px dashed var(--lime);
  border-radius: 16px;
  padding: clamp(12px, 2.2vh, 22px) clamp(20px, 5vw, 48px);
  box-shadow: 0 0 44px rgba(163, 230, 53, .25);
  user-select: all;
  -webkit-user-select: all;
  word-break: break-all;
}
.coupon-hint {
  font-size: clamp(13px, 2.1vh, 18px);
  font-weight: 700;
  color: var(--amber);
}

/* En tablets muy bajas, achicamos un poco los textos verticales */
@media (max-height: 560px) {
  .title { font-size: clamp(28px, 9vh, 54px); }
}
