:root{
  /* Bubble Splash palette */
  --bg: #f7ffff;
  --ink: #1F4E5F;
  --muted: #2c6672;
  --white: #ffffff;

  --bubble-main: #3DB7B0;   /* teal */
  --bubble-soft: #8FE3DC;   /* aqua */
  --bubble-coral: #FF6F61;  /* coral */
  --bubble-cream: #FFF3C4;  /* cream */
  --deep: #0b3140;

  --radius: 26px;
  --shadow: 0 22px 70px rgba(31,78,95,.18);
  --fast: .25s ease;
  --slow: .65s cubic-bezier(.22,.61,.36,1);
  --spin-time: 5200ms;
}

*,
*::before,
*::after{
  box-sizing:border-box;
  margin:0;
  padding:0;
}

html, body{
  width:100%;
  max-width:100%;
  overflow-x:hidden;
}

body{
  font-family: system-ui,-apple-system,BlinkMacSystemFont,"SF Pro Text",sans-serif;
  color: var(--ink);
  min-height: 100vh;
  overflow-x:hidden;

  /* fondo “espuma” */
  background:
    radial-gradient(120px 120px at 14% 18%, rgba(255,255,255,.75), transparent 60%),
    radial-gradient(180px 180px at 82% 12%, rgba(255,255,255,.55), transparent 60%),
    radial-gradient(220px 220px at 84% 80%, rgba(255,255,255,.45), transparent 60%),
    radial-gradient(1200px 700px at -10% -20%, rgba(143,227,220,.55), transparent 60%),
    radial-gradient(900px 700px at 120% 120%, rgba(255,111,97,.22), transparent 60%),
    var(--bg);
}

/* burbujitas flotantes de fondo */
body::before,
body::after{
  content:"";
  position:fixed;
  inset:-30vh -30vw;
  pointer-events:none;
  z-index:0;
  opacity:.55;
  filter: blur(.2px);
  background:
    radial-gradient(circle at 10% 20%, rgba(255,255,255,.9) 0 10px, transparent 11px),
    radial-gradient(circle at 30% 70%, rgba(255,255,255,.75) 0 14px, transparent 15px),
    radial-gradient(circle at 60% 30%, rgba(255,255,255,.65) 0 9px, transparent 10px),
    radial-gradient(circle at 80% 60%, rgba(255,255,255,.6) 0 16px, transparent 17px),
    radial-gradient(circle at 45% 45%, rgba(255,255,255,.55) 0 12px, transparent 13px);
  animation: floatBubbles 10s linear infinite;
}
body::after{
  opacity:.35;
  animation-duration: 14s;
  transform: scale(1.08);
}
@keyframes floatBubbles{
  from{ transform: translate3d(0,0,0); }
  to{ transform: translate3d(120px, -120px, 0); }
}

/* CONTENEDOR */
.page{
  position:relative;
  z-index:1;
  width:100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 16px;
}

.panel{
  background: rgba(255,255,255,.92);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  backdrop-filter: blur(18px);
  border: 1px solid rgba(31,78,95,.08);
}

/* HEADER */
.brand{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:14px;
}

.brand-left{
  display:flex;
  align-items:center;
  gap:10px;
}

.chip{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:6px 10px;
  border-radius:999px;
  background: linear-gradient(180deg, rgba(255,255,255,.9), rgba(255,255,255,.55));
  border: 1px solid rgba(31,78,95,.10);
  box-shadow: 0 10px 25px rgba(31,78,95,.10);
}

.chip-img{
  height:32px;
  width:auto;
  display:block;
  border-radius:10px;
  filter: drop-shadow(0 2px 0 rgba(0,0,0,0.10));
}

/* GRID */
.grid{
  display:flex;
  flex-direction:column;
  gap:20px;
}

@media (min-width:900px){
  .grid{
    display:grid;
    grid-template-columns:1.1fr .9fr;
    align-items:center;
    gap:34px;
  }
}

/* RULETA */
.wheel-area{
  position:relative;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:14px 4px 10px;
}

/* aura glossy */
.aura{
  position:absolute;
  top:-18px;
  width:min(320px,82vw);
  height:min(320px,82vw);
  border-radius:50%;
  background:
    radial-gradient(closest-side, rgba(255,255,255,.75), rgba(61,183,176,.45), transparent 72%);
  filter: blur(10px);
  z-index:0;
  animation: auraPulse 3.6s ease-in-out infinite;
}
@keyframes auraPulse{
  0%,100%{transform:scale(1);opacity:.95}
  50%{transform:scale(1.06);opacity:1}
}

/* Pointer más “bubble” */
.pointer{
  position:absolute;
  top:0px;
  left:50%;
  transform:translateX(-50%);
  z-index:8;
  width:42px;
  height:42px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 30%, rgba(255,255,255,.95), rgba(255,255,255,.45) 35%, rgba(255,111,97,.95) 70%),
    radial-gradient(circle at 70% 80%, rgba(0,0,0,.08), transparent 55%);
  box-shadow: 0 18px 35px rgba(15,23,42,.22);
}
.pointer::after{
  content:"";
  position:absolute;
  left:50%;
  top:30px;
  transform:translateX(-50%);
  width:0;height:0;
  border-left:10px solid transparent;
  border-right:10px solid transparent;
  border-top:18px solid var(--deep);
  filter: drop-shadow(0 4px 8px rgba(15,23,42,.25));
}

/* RUEDA */
.wheel{
  --size: min(320px,82vw);
  width: var(--size);
  height: var(--size);
  border-radius:50%;
  position:relative;
  z-index:2;

  /* ring y brillo */
  box-shadow:
    inset 0 0 0 10px rgba(255,255,255,.95),
    inset 0 0 0 18px rgba(255,255,255,.35),
    0 24px 70px rgba(15,23,42,.22);

  transition: transform var(--spin-time) var(--slow);
  will-change: transform;

  background:
    conic-gradient(
      from -90deg,
      rgba(143,227,220,.95) 0 72deg,
      rgba(61,183,176,.98) 72deg 144deg,
      rgba(255,243,196,.92) 144deg 216deg,
      rgba(61,183,176,.98) 216deg 288deg,
      rgba(255,111,97,.88) 288deg 360deg
    );
}

/* brillo diagonal encima de la rueda */
.wheel::before{
  content:"";
  position:absolute;
  inset: 10px;
  border-radius:50%;
  background: linear-gradient(135deg, rgba(255,255,255,.65), transparent 45%);
  mix-blend-mode: screen;
  opacity:.9;
  pointer-events:none;
}

/* líneas separadoras (delicadas) */
.wheel::after{
  content:"";
  position:absolute;
  inset:0;
  border-radius:50%;
  background:
    repeating-conic-gradient(
      from -90deg,
      rgba(255,255,255,.75) 0 1.2deg,
      transparent 1.2deg calc(72deg)
    );
  opacity:.35;
  pointer-events:none;
}

/* Tablet / Desktop */
@media (min-width:768px){
  .wheel{ --size: 380px; }
  .aura{ width:380px; height:380px; top:-26px; }
}
@media (min-width:1080px){
  .wheel{ --size: 460px; }
  .aura{ width:460px; height:460px; top:-32px; }
}

/* CENTRO */
.center{
  position:absolute;
  inset:50% auto auto 50%;
  transform:translate(-50%,-50%);
  width:40%;
  aspect-ratio:1;
  border-radius:50%;
  display:grid;
  place-items:center;

  background:
    radial-gradient(circle at 25% 25%, rgba(255,255,255,1), rgba(255,255,255,.65) 45%, rgba(143,227,220,.35) 85%);
  box-shadow:
    0 18px 40px rgba(15,23,42,.18),
    inset 0 0 0 10px rgba(255,255,255,.75);
}

.center-ring{
  position:absolute;
  inset:10px;
  border-radius:50%;
  background:
    conic-gradient(from 0deg, rgba(255,111,97,.55), rgba(61,183,176,.55), rgba(255,243,196,.55), rgba(255,111,97,.55));
  filter: blur(12px);
  opacity:.55;
  animation: ring 6s linear infinite;
}
@keyframes ring{to{transform: rotate(360deg)}}

.spin-btn{
  position:relative;
  z-index:1;
  width:86%;
  aspect-ratio:1;
  border-radius:50%;
  border:none;
  color:#fff;
  font-weight:900;
  cursor:pointer;

  background:
    radial-gradient(circle at 30% 25%, rgba(255,255,255,.35), transparent 40%),
    linear-gradient(135deg, var(--bubble-coral), #ff9a8c);
  box-shadow: 0 16px 34px rgba(255,111,97,.45);
  letter-spacing: 1px;
}
.spin-btn:hover{ transform: translateY(-1px); }
.spin-btn:active{ transform: scale(.96); }

/* SEGMENTOS */
.segment{
  position:absolute;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  transform-origin:50% 50%;
  pointer-events:none;
}

.seg-figure{
  position:absolute;
  top:4%;
  left:50%;
  transform:translate(-50%,0) rotate(var(--neg));
  width:min(128px,40%);
  display:grid;
  place-items:center;
  animation: bob 4s ease-in-out infinite;
}
@keyframes bob{
  0%,100%{transform: translate(-50%,0) rotate(var(--neg))}
  50%{transform: translate(-50%,-5px) rotate(var(--neg))}
}

/* “Sticker glossy” para las imágenes */
.img-wrap{
  width:100%;
  aspect-ratio:1;
  border-radius:18px;
  overflow:hidden;
  background: rgba(255,255,255,.95);
  box-shadow:
    0 14px 30px rgba(15,23,42,.18),
    inset 0 0 0 4px rgba(255,255,255,.85);
  position:relative;
}
.img-wrap::before{
  content:"";
  position:absolute;
  inset:0;
  background: linear-gradient(135deg, rgba(255,255,255,.65), transparent 55%);
  opacity:.9;
  pointer-events:none;
}
.img-wrap img{
  width:100%;
  height:100%;
  object-fit:cover;
}

/* INFO */
.info .title{
  font-size: clamp(1.55rem, 1.1rem + 1.2vw, 2.15rem);
  letter-spacing: .2px;
}
.info .subtitle{
  color: var(--muted);
  margin: 10px 0 14px;
  font-size: .98rem;
}

/* premios en modo “burbujas” */
.prizes{
  display:flex;
  flex-wrap:wrap;
  gap:9px;
}

.badge{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:8px 12px;
  border-radius:999px;

  background:
    radial-gradient(circle at 25% 25%, rgba(255,255,255,.9), rgba(255,255,255,.6) 35%, rgba(143,227,220,.22) 100%);
  border: 1px solid rgba(31,78,95,.12);
  box-shadow: 0 12px 22px rgba(31,78,95,.10);
  font-size: .82rem;
}

.dot{
  width:10px;
  height:10px;
  border-radius:50%;
  background: linear-gradient(90deg, var(--bubble-coral), var(--bubble-main));
  box-shadow: 0 8px 14px rgba(255,111,97,.25);
}

.result{
  margin-top:10px;
  font-weight: 900;
  background: rgba(255,255,255,.65);
  border: 1px solid rgba(31,78,95,.10);
  padding: 10px 12px;
  border-radius: 16px;
  box-shadow: 0 10px 22px rgba(31,78,95,.10);
}

/* FOOTER */
.foot{
  margin-top:14px;
  display:flex;
  justify-content:flex-end;
  font-size:.82rem;
  color: var(--muted);
}
@media (max-width:600px){
  .foot{ justify-content:center; text-align:center; }
}

/* FX CANVAS */
.fx{
  position:fixed;
  inset:0;
  pointer-events:none;
  z-index: 60;
}

/* MODAL */
.modal {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 50;
  background: rgba(11,49,64,.55);
  backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
}
.modal.show { display:flex; }
.modal-backdrop { position:absolute; inset:0; }

.modal-dialog{
  position: relative;
  margin: 0 auto;
  width: 90vw;
  max-width: 440px;
  max-height: 82vh;
  overflow:auto;
  background:
    radial-gradient(circle at 20% 15%, rgba(255,255,255,.95), rgba(255,255,255,.75) 40%, rgba(143,227,220,.18) 100%);
  border-radius: 20px;
  padding: 18px;
  box-shadow: 0 30px 70px rgba(0,0,0,.35);
  border: 1px solid rgba(255,255,255,.35);
}

.modal-content{
  margin: 16px 0 10px;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:10px;
  text-align:center;
}

.modal-image-wrap{
  width: 62vw;
  max-width: 240px;
  aspect-ratio:1/1;
  border-radius: 18px;
  overflow:hidden;
  background:#fff;
  box-shadow: 0 14px 30px rgba(15,23,42,.16), inset 0 0 0 4px rgba(255,255,255,.9);
  position:relative;
}
.modal-image-wrap::before{
  content:"";
  position:absolute;
  inset:0;
  background: linear-gradient(135deg, rgba(255,255,255,.65), transparent 55%);
  pointer-events:none;
}
.modal-image-wrap img{ width:100%; height:100%; object-fit:cover; }

.modal-title{
  font-size: 1.05rem;
  font-weight: 900;
  padding: 0 6px;
  color: var(--deep);
}

.modal-close{
  position:absolute;
  top:10px;
  right:10px;
  background: rgba(255,255,255,.75);
  border: 1px solid rgba(31,78,95,.14);
  border-radius: 12px;
  padding: 6px 10px;
  cursor:pointer;
  font-size: .85rem;
}

.btn-cta{
  margin-top: 8px;
  padding: 12px 14px;
  border:none;
  border-radius: 14px;
  background:
    radial-gradient(circle at 30% 25%, rgba(255,255,255,.25), transparent 40%),
    linear-gradient(135deg, var(--bubble-coral), #ff9a8c);
  color:#fff;
  font-weight: 900;
  cursor:pointer;
  box-shadow: 0 16px 34px rgba(255,111,97,.40);
}

/* móvil peque */
@media (max-width:650px){
  .seg-figure{ top:3%; width: min(96px, 32%); }
  .wheel{ --size: min(350px, 90vw); }
  .aura{ width: var(--size); height: var(--size); top:-12px; }
  .center{ width: 38%; }
  .spin-btn{ font-size: .95rem; }
}
