:root{
  --pink:#ff3fb4;
  --purple:#6d28d9;
  --cyan:#22d3ee;
  --text:#0f1220;
  --muted:#6b7280;
  --glass: rgba(255,255,255,.74);
  --r1:14px;
  --r2:18px;
  --r3:22px;
  --shadow1: 0 12px 28px rgba(0,0,0,.10);
  --shadow2: 0 22px 60px rgba(0,0,0,.14);

  /* ✅ variables que se llenan desde index.php */
  --pattern-bg: url("/assets/img/redes.png");
  --state-dot: rgba(239,68,68,1);
}

*{box-sizing:border-box}
html,body{height:100%}

/* ✅ FIX: móvil “fijo”, sin gelatina lateral y sin scroll raro */
html, body{
  width:100%;
  max-width:100%;
  overflow-x:hidden;
  overscroll-behavior: none;
  -webkit-overflow-scrolling: auto;
  touch-action: pan-y;
}

body{
  margin:0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial;
  color:var(--text);
  background:
    radial-gradient(1100px 600px at 10% -10%, rgba(255,63,180,.16), transparent 60%),
    radial-gradient(1100px 600px at 90% -10%, rgba(109,40,217,.14), transparent 60%),
    radial-gradient(900px 520px at 50% 110%, rgba(34,211,238,.10), transparent 60%),
    linear-gradient(180deg, #ffffff, #f6f7ff);
  overflow-x:hidden;
}

/* ✅✅ FONDO FOTOTECA */
body::before{
  content:"";
  position:fixed;
  inset:0;
  background-image: var(--pattern-bg);
  background-repeat: repeat;
  background-size: 160px auto;
  background-position: 0 0;
  opacity: .38;
  pointer-events:none;
  z-index:0;
  mix-blend-mode: normal;
  filter: saturate(1.10) contrast(1.05);
}

header, .wrap, .mobile-overlay, .mobile-panel { position:relative; z-index:1; }

/* Header */
header{
  position:sticky;
  top:0;
  z-index:50;
  background: rgba(255,255,255,.86);
  backdrop-filter: blur(10px);
  border-bottom:1px solid rgba(17,24,39,.08);
}

.navbar{
  width:100%;
  padding:12px 18px;
  display:flex;
  align-items:center;
  gap:12px;
}

.brand{
  display:flex;
  align-items:center;
  gap:12px;
  text-decoration:none;
  color:inherit;
  min-width: 180px;
}
.brand img{ height:64px; width:auto; display:block; }
.brand .sub{ display:flex; flex-direction:column; line-height:1; }
.brand .sub b{ font-size:16px; letter-spacing:-.02em; }
.brand .sub span{ font-size:12px; color:var(--muted); margin-top:4px; }

.menu-desktop{
  flex:1;
  display:flex;
  justify-content:center;
  gap:10px;
  flex-wrap:wrap;
}
.menu-desktop a{
  text-decoration:none;
  font-weight:1000;
  font-size:13px;
  padding:10px 14px;
  border-radius:999px;
  border:1px solid rgba(17,24,39,.10);
  background: rgba(255,255,255,.92);
  color:var(--text);
  box-shadow: 0 10px 18px rgba(0,0,0,.06);
}
.menu-desktop a.cta{
  color:#fff;
  border:0;
  background: linear-gradient(135deg, rgba(255,63,180,1), rgba(109,40,217,1));
  box-shadow: 0 18px 44px rgba(109,40,217,.18);
}

.state{
  display:flex;
  align-items:center;
  gap:10px;
  padding:10px 14px;
  border-radius:999px;
  border:1px solid rgba(17,24,39,.10);
  background: rgba(255,255,255,.92);
  font-size:13px;
  white-space:nowrap;
  box-shadow: 0 10px 18px rgba(0,0,0,.06);
}
.dot{
  width:10px;height:10px;border-radius:999px;
  background: var(--state-dot);
  box-shadow:0 0 0 6px rgba(0,0,0,.06);
}

/* Burger */
.burger{
  display:none;
  width:46px;
  height:44px;
  border-radius: 14px;
  border:1px solid rgba(17,24,39,.12);
  background: rgba(255,255,255,.92);
  cursor:pointer;
  box-shadow: 0 10px 18px rgba(0,0,0,.06);
  margin-left:auto;
}
.burger span{
  display:block;
  width:22px;
  height:3px;
  margin:4px auto;
  border-radius:99px;
  background: linear-gradient(90deg, rgba(255,63,180,1), rgba(109,40,217,1));
}

/* Menú móvil */
.mobile-overlay{
  position:fixed;
  inset:0;
  background: rgba(0,0,0,.35);
  display:none;
  z-index: 9998;
}
.mobile-overlay.open{ display:block; }

.mobile-panel{
  position:fixed;
  left:12px;
  right:12px;
  top: calc(env(safe-area-inset-top, 0px) + 76px);
  display:none;
  z-index: 9999;
  padding:12px;
  border-radius: 18px;
  border:1px solid rgba(17,24,39,.10);
  background: rgba(255,255,255,.98);
  backdrop-filter: blur(10px);
  box-shadow: 0 22px 70px rgba(0,0,0,.28);
  max-height: calc(100vh - (env(safe-area-inset-top, 0px) + 110px));
  overflow:auto;
  -webkit-overflow-scrolling: touch;
  pointer-events:auto;
}
.mobile-panel.open{ display:block; }
.mobile-panel a{
  display:flex;
  width:100%;
  justify-content:center;
  align-items:center;
  padding:14px 14px;
  margin:10px 0;
  font-size:13px;
  font-weight:1100;
  text-decoration:none;
  border-radius:999px;
  border:1px solid rgba(17,24,39,.10);
  background: rgba(255,255,255,.92);
  color: var(--text);
  box-shadow: 0 10px 18px rgba(0,0,0,.06);
  pointer-events:auto;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.mobile-panel a.cta{
  color:#fff;
  border:0;
  background: linear-gradient(135deg, rgba(255,63,180,1), rgba(109,40,217,1));
  box-shadow: 0 18px 44px rgba(109,40,217,.18);
}

/* Layout */
.wrap{ padding:18px; }

.container{
  max-width: 1600px;
  margin: 0 auto;
  display: grid;
  gap: 16px;

  /* ✅ Responsive real: 12px en móvil -> ~96px en desktop */
  padding-inline: clamp(12px, 6vw, 96px);
}

/* Cards */
.card{
  background: var(--glass);
  border:1px solid rgba(255,255,255,.70);
  border-radius: var(--r3);
  box-shadow: var(--shadow2);
  overflow:hidden;
  backdrop-filter: blur(10px);
}
.card .pad{ padding:16px; }

/* Progress */
.percent-wrap{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  padding:14px 16px;
  border-bottom:1px solid rgba(17,24,39,.08);
  flex-wrap:wrap;
}
.percent-wrap .left{
  display:flex;
  align-items:center;
  gap:12px;
  flex-wrap:wrap;
}
.percent-wrap b{ font-size:12px; letter-spacing:.12em; }
.progress{
  width:520px;
  max-width:55vw;
  height:16px;
  border-radius:999px;
  border:1px solid rgba(17,24,39,.12);
  background: rgba(255,255,255,.88);
  overflow:hidden;
}
.progress > div{
  height:100%;
  width: var(--progress, 0%);
  background: linear-gradient(90deg, rgba(255,63,180,1), rgba(109,40,217,1), rgba(34,211,238,1));
}

.pill{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:8px 12px;
  border-radius:999px;
  border:1px solid rgba(17,24,39,.10);
  background: rgba(255,255,255,.92);
  font-weight:900;
  font-size:12px;
  box-shadow: 0 10px 18px rgba(0,0,0,.06);
}

/* Content */
.small{ color:var(--muted); font-size:13px; margin:0 0 10px; }
.h-title{ margin:0 0 6px; font-size:26px; font-weight:1100; letter-spacing:-.02em; }

/* Hero */
.hero-bleed{ margin: 12px -16px 0; }
.heroimg{
  width:100%;
  display:block;
  aspect-ratio:auto;
  height:auto;
  object-fit:contain;
  padding:0;
  background:transparent;
  border:0;
  box-shadow:none;
  border-radius:0;
}

/* Chips */
.chipsRow{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin:10px 0 6px;
}
.chip{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:8px 12px;
  border-radius:999px;
  background: rgba(255,255,255,.92);
  border:1px solid rgba(17,24,39,.10);
  box-shadow: 0 10px 18px rgba(0,0,0,.06);
  font-size:12px;
  font-weight:900;
}
.chip .cDot{
  width:10px; height:10px; border-radius:999px;
  background: linear-gradient(135deg, rgba(255,63,180,1), rgba(109,40,217,1));
  box-shadow:0 0 0 6px rgba(109,40,217,.10);
}

/* Buttons */
.btnrow{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  margin-top:12px;
}
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:12px 16px;
  border-radius: 999px;
  font-weight:1100;
  text-decoration:none;
  border:1px solid rgba(17,24,39,.10);
  background: rgba(255,255,255,.92);
  color: var(--text);
  box-shadow: 0 10px 18px rgba(0,0,0,.06);
}
.btn-dark{
  border:0;
  color:#fff;
  background: linear-gradient(135deg, rgba(255,63,180,1), rgba(109,40,217,1));
  box-shadow: 0 18px 44px rgba(109,40,217,.18);
}
.btn-disabled{ opacity:.55; cursor:not-allowed; box-shadow:none !important; }

.soldout{
  margin-top:10px;
  padding:12px 14px;
  border-radius: var(--r2);
  border:1px dashed rgba(239,68,68,.40);
  background:rgba(239,68,68,.08);
  font-weight:900;
  color:rgba(127,29,29,1);
}

/* Desc */
.desc-block{
  margin-top:12px;
  border-radius: var(--r2);
  border:1px solid rgba(17,24,39,.10);
  background: rgba(255,255,255,.80);
  padding:14px;
  box-shadow: 0 12px 24px rgba(0,0,0,.06);
}
.desc-lead{
  margin:0 0 10px;
  font-weight:1100;
  font-size:15px;
  background: linear-gradient(90deg, rgba(255,63,180,1), rgba(109,40,217,1));
  -webkit-background-clip:text;
  background-clip:text;
  color:transparent;
}
.desc-list{
  margin:0;
  padding-left:18px;
  display:grid;
  gap:8px;
}
.desc-list li{
  font-size:14px;
  line-height:1.45;
  font-weight:900;
  color: rgba(17,24,39,.90);
}

/* Ads */
.ads-head{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
  padding:14px 16px;
  border-bottom:1px solid rgba(17,24,39,.08);
}
.ads-head h3{
  margin:0;
  font-size:16px;
  font-weight:1200;
  letter-spacing:-.01em;
}
.ads-head p{
  margin:0;
  color:var(--muted);
  font-size:13px;
  font-weight:900;
}

.ads-wrap{ padding:14px 16px 16px; }
.ads-viewport{ position:relative; overflow:hidden; }
.ads-track{
  display:flex;
  gap:12px;
  overflow-x:auto;
  scroll-snap-type:x mandatory;
  scroll-behavior:smooth;
  padding-bottom:10px;
  -webkit-overflow-scrolling: touch;
}
.ads-track::-webkit-scrollbar{ height:10px; }
.ads-track::-webkit-scrollbar-thumb{ background: rgba(0,0,0,.12); border-radius:999px; }

.adcard{
  scroll-snap-align:start;
  flex: 0 0 360px;
  max-width: 360px;
  border-radius: 18px;
  border:1px solid rgba(17,24,39,.10);
  background: rgba(255,255,255,.92);
  box-shadow: 0 12px 28px rgba(0,0,0,.08);
  overflow:hidden;
  text-decoration:none;
  color:inherit;
  display:flex;
  flex-direction:column;
}
.adimg{
  height:180px;
  background:#fafafa;
  border-bottom:1px solid rgba(17,24,39,.08);
  display:flex;
  align-items:center;
  justify-content:center;
}
.adimg img{ width:100%; height:100%; object-fit:contain; display:block; }
.adbody{ padding:12px 12px 14px; }
.adtitle{ margin:0 0 6px; font-size:14px; font-weight:1200; }
.addesc{
  margin:0;
  font-size:13px;
  color: rgba(17,24,39,.78);
  font-weight:900;
  line-height:1.45;
  display:-webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow:hidden;
}

.ads-btn{
  position:absolute;
  top:50%;
  transform:translateY(-50%);
  width:44px; height:44px;
  border-radius:999px;
  border:1px solid rgba(17,24,39,.12);
  background: rgba(255,255,255,.92);
  box-shadow: 0 10px 18px rgba(0,0,0,.08);
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:center;
  z-index:2;
}
.ads-btn:active{ transform:translateY(-50%) scale(.98); }
.ads-btn.prev{ left:8px; }
.ads-btn.next{ right:8px; }

/* Afiliados */
.aff-card{
  position:relative;
  overflow:hidden;
  border-radius: var(--r3);
  border:1px solid rgba(255,255,255,.75);
  background: rgba(255,255,255,.80);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow2);
}
.aff-inner{
  position:relative;
  z-index:2;
  display:grid;
  grid-template-columns: 1.15fr .85fr;
  gap:16px;
  align-items:center;
  padding:18px;
}
.aff-kicker{
  display:inline-flex;
  align-items:center;
  gap:10px;
  padding:8px 12px;
  border-radius:999px;
  border:1px solid rgba(17,24,39,.10);
  background: rgba(255,255,255,.92);
  font-weight:1000;
  font-size:12px;
  box-shadow: 0 10px 18px rgba(0,0,0,.06);
}
.aff-kicker i{
  width:10px;height:10px;border-radius:999px;
  background: linear-gradient(135deg, rgba(255,63,180,1), rgba(109,40,217,1));
  box-shadow: 0 0 0 6px rgba(109,40,217,.12);
}
.aff-title{
  margin:12px 0 8px;
  font-size:24px;
  font-weight:1200;
  letter-spacing:-.02em;
  background: linear-gradient(90deg, rgba(255,63,180,1), rgba(109,40,217,1));
  -webkit-background-clip:text;
  background-clip:text;
  color:transparent;
}
.aff-text{
  margin:0;
  color: rgba(17,24,39,.85);
  font-weight:900;
  line-height:1.55;
  font-size:14px;
}
.aff-grid{
  margin-top:14px;
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:10px;
}
.aff-item{
  border:1px solid rgba(17,24,39,.10);
  background: rgba(255,255,255,.86);
  border-radius: 16px;
  padding:12px;
  box-shadow: 0 10px 18px rgba(0,0,0,.05);
}
.aff-item b{ display:block; font-size:13px; font-weight:1200; margin-bottom:6px; }
.aff-item span{ color: rgba(17,24,39,.70); font-weight:900; font-size:13px; line-height:1.35; }
.aff-actions{
  margin-top:14px;
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}
.aff-img{
  width:100%;
  height:260px;
  object-fit:contain;
  border-radius: 18px;
  border:1px solid rgba(17,24,39,.10);
  background: rgba(255,255,255,.88);
  box-shadow: 0 12px 28px rgba(0,0,0,.10);
  padding:10px;
}
.aff-note{
  margin-top:10px;
  color: rgba(17,24,39,.65);
  font-weight:900;
  font-size:12px;
}
.aff-card::before{
  content:"";
  position:absolute;
  inset:-50px;
  background:
    radial-gradient(520px 280px at 10% 20%, rgba(255,63,180,.18), transparent 55%),
    radial-gradient(520px 280px at 90% 20%, rgba(109,40,217,.16), transparent 55%),
    radial-gradient(620px 320px at 50% 120%, rgba(34,211,238,.12), transparent 55%);
  z-index:1;
}

/* Footer */
footer{ margin-top:6px; color:var(--muted); font-size:13px; }
.footer-row{ display:flex; align-items:center; justify-content:center; gap:12px; flex-wrap:wrap; }
.admin-link{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-size:12px;
  font-weight:1100;
  padding:8px 12px;
  border-radius:999px;
  border:1px solid rgba(17,24,39,.10);
  background:rgba(255,255,255,.92);
  color:var(--text);
  text-decoration:none;
  box-shadow:0 10px 18px rgba(0,0,0,.06);
}

/* =========================
   RESULTS v2 (sin imágenes)
   ========================= */
.res2{
  display:grid;
  grid-template-columns: 1.2fr .8fr;
  gap:14px;
}

.res2-panel{
  border-radius: var(--r2);
  border:1px solid rgba(17,24,39,.10);
  background: rgba(255,255,255,.82);
  box-shadow: 0 12px 24px rgba(0,0,0,.06);
  overflow:hidden;
}

.res2-head{
  padding:14px 16px;
  border-bottom:1px solid rgba(17,24,39,.08);
  background: linear-gradient(135deg,
    rgba(255,63,180,.14),
    rgba(109,40,217,.10),
    rgba(34,211,238,.10)
  );
}
.res2-title{
  font-weight:1200;
  letter-spacing:.12em;
  font-size:13px;
}
.res2-sub{
  margin-top:4px;
  font-size:13px;
  font-weight:900;
  color: rgba(17,24,39,.65);
}

.res2-list{
  padding:14px 14px 10px;
  display:grid;
  gap:10px;
}

.res2-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:12px 12px;
  border-radius: var(--r2);
  background: rgba(255,255,255,.92);
  border:1px solid rgba(17,24,39,.10);
  box-shadow: 0 10px 18px rgba(0,0,0,.05);
}

.res2-left{
  display:flex;
  align-items:center;
  gap:10px;
  min-width: 0;
}
.res2-left .lbl{
  font-weight:1100;
  font-size:13px;
  letter-spacing:.02em;
  white-space:nowrap;
}

.res2-row .num{
  font-weight:1300;
  font-size:22px;
  letter-spacing:.08em;
  padding:8px 12px;
  border-radius: 14px;
  background: rgba(255,255,255,.95);
  border:1px solid rgba(17,24,39,.12);
  min-width: 120px;
  text-align:center;
}

.ball{
  width:34px;
  height:34px;
  border-radius:999px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-weight:1200;
  color:#fff;
  box-shadow: 0 12px 24px rgba(0,0,0,.18);
  flex:0 0 auto;
}
.ball.b1{ background: linear-gradient(135deg, rgba(255,63,180,1), rgba(109,40,217,1)); }
.ball.b2{ background: linear-gradient(135deg, rgba(34,211,238,1), rgba(109,40,217,1)); }
.ball.b3{ background: linear-gradient(135deg, rgba(255,63,180,1), rgba(34,211,238,1)); }
.ball.b4{ background: linear-gradient(135deg, rgba(109,40,217,1), rgba(255,63,180,1)); }

.res2-note{
  padding: 10px 14px 14px;
  font-size:12px;
  font-weight:900;
  color: rgba(17,24,39,.55);
}

/* Winner */
.res2-winner{
  position:relative;
  border-radius: var(--r2);
  border:1px solid rgba(17,24,39,.10);
  overflow:hidden;
  box-shadow: 0 12px 24px rgba(0,0,0,.06);
  display:flex;
  align-items:center;
  justify-content:center;
  padding:18px;
  background: radial-gradient(600px 320px at 30% 20%, rgba(255,63,180,.22), transparent 55%),
              radial-gradient(620px 340px at 70% 30%, rgba(34,211,238,.18), transparent 55%),
              linear-gradient(135deg, rgba(109,40,217,.10), rgba(255,255,255,.70));
}

/* confetti (CSS) */
.res2-winner::before{
  content:"";
  position:absolute;
  inset:-40px;
  opacity:.35;
  background:
    radial-gradient(circle at 10% 20%, rgba(255,63,180,1) 0 4px, transparent 5px),
    radial-gradient(circle at 30% 40%, rgba(34,211,238,1) 0 3px, transparent 4px),
    radial-gradient(circle at 70% 30%, rgba(109,40,217,1) 0 4px, transparent 5px),
    radial-gradient(circle at 85% 60%, rgba(255,63,180,1) 0 3px, transparent 4px);
  filter: blur(.2px);
  pointer-events:none;
}
.res2-winner::after{
  content:"";
  position:absolute;
  inset:0;
  background: linear-gradient(180deg, transparent, rgba(255,255,255,.55));
  pointer-events:none;
}

.win-badge{
  position:relative;
  z-index:2;
  width:min(320px, 92%);
  border-radius: 22px;
  background: rgba(255,255,255,.92);
  border:1px solid rgba(17,24,39,.12);
  box-shadow: 0 18px 50px rgba(0,0,0,.18);
  padding:18px 16px;
  text-align:center;
}

.win-badge .k{
  font-size:12px;
  letter-spacing:.18em;
  font-weight:1200;
  color: rgba(17,24,39,.60);
}
.win-badge .big{
  margin:10px 0 8px;
  font-size:54px;
  font-weight:1300;
  letter-spacing:.10em;
  background: linear-gradient(90deg, rgba(255,63,180,1), rgba(109,40,217,1));
  -webkit-background-clip:text;
  background-clip:text;
  color:transparent;
}
.win-badge .s{
  font-size:12px;
  font-weight:1100;
  color: rgba(17,24,39,.60);
}

.win-tag{
  position:absolute;
  z-index:2;
  bottom:14px;
  right:14px;
  padding:10px 14px;
  border-radius:999px;
  color:#fff;
  font-weight:1200;
  letter-spacing:.06em;
  background: linear-gradient(135deg, rgba(255,63,180,1), rgba(109,40,217,1));
  box-shadow: 0 18px 44px rgba(109,40,217,.22);
}

/* Mobile */
@media (max-width: 900px){
  body::before{ opacity: .28; background-size: 140px auto; }

  /* ✅ FIX: en móvil ocupar ancho real y “sentirse” más fijo */
  .wrap{ padding:0; }
  .container{ padding-inline: 12px; }

  .navbar{ flex-wrap:wrap; padding:10px 12px; gap:10px; }
  .brand{ min-width:unset; gap:10px; }
  .brand img{ height:46px; }
  .brand .sub b{ font-size:15px; }
  .brand .sub span{ font-size:11px; }

  .burger{ display:block; }
  .menu-desktop{ display:none; }

  .state{
    width:100%;
    justify-content:center;
    padding:8px 12px;
    font-size:12px;
  }

  .percent-wrap{ gap:10px; padding:12px; }
  .percent-wrap .left{ width:100%; }
  .progress{ width:100%; max-width:100%; }

  .h-title{ font-size:22px; line-height:1.12; }

  /* ✅ Hero más consistente en móvil */
  .heroimg{
    width:100%;
    height:auto;
    max-height: clamp(320px, 55vh, 520px);
    object-fit: contain;
    padding:0;
  }

  .adcard{ flex-basis: 82vw; max-width: 82vw; }
  .ads-btn{ display:none; }

  .aff-inner{ grid-template-columns: 1fr; }
  .aff-img{ height:220px; }
  .aff-grid{ grid-template-columns:1fr; }

  /* Results v2 responsive */
  .res2{ grid-template-columns: 1fr; }
  .res2-row .num{ font-size:20px; min-width: 110px; }
  .win-badge .big{ font-size:46px; }
}

@media (max-width: 420px){
  .h-title{ font-size:20px; }
  .chip{ font-size:11px; }
}