/* Retos Netlife — pantalla del participante */
:root {
  --bg: #0a0612;
  --bg-2: #170a24;
  --ink: #ffffff;
  --ink-2: rgba(255, 255, 255, .78);
  --ink-3: rgba(255, 255, 255, .55);
  --line: rgba(255, 255, 255, .16);
  --glass: rgba(255, 255, 255, .06);
  --yellow: #ffd21f;
  --orange: #ff7a00;
  --red: #e3174a;
  --magenta: #a3195b;
  --ok: #2ee6a0;
  --bad: #ff5470;
  --brand: linear-gradient(100deg, var(--yellow) 0%, var(--orange) 45%, var(--red) 82%, var(--magenta) 100%);
  --display: 'Poppins', system-ui, sans-serif;
  --body: 'Roboto', system-ui, sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { height: 100%; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: radial-gradient(120% 90% at 50% 0%, var(--bg-2) 0%, var(--bg) 62%);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.45;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

#bg, #fx, .vignette, .flash { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; }
#bg { z-index: 0; }
.vignette { z-index: 1; background: radial-gradient(ellipse at center, transparent 45%, rgba(5, 2, 10, .72) 100%); }
.flash { z-index: 2; opacity: 0; }
.flash.is-ok { background: radial-gradient(ellipse at center, transparent 40%, rgba(46, 230, 160, .32) 100%); }
.flash.is-bad { background: radial-gradient(ellipse at center, transparent 40%, rgba(255, 84, 112, .34) 100%); }
#fx { z-index: 60; }

/* ---------- Cabecera ---------- */
.top {
  position: relative;
  z-index: 10;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
  padding: max(14px, env(safe-area-inset-top)) clamp(16px, 4vw, 44px) 10px;
}
.top__logo { height: clamp(34px, 5.2vh, 58px); width: auto; display: block; }

.progress { grid-column: 2; min-width: 0; list-style: none; margin: 0; padding: 0; display: flex; justify-content: center; gap: clamp(4px, 1vw, 8px); }
.progress li {
  position: relative;
  flex: 0 1 clamp(26px, 6vw, 64px);
  min-width: 6px;
  height: 8px;
  border-radius: 99px;
  background: rgba(255, 255, 255, .16);
  overflow: hidden;
}
.progress li::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .5s var(--ease);
  background: var(--brand);
}
.progress li.is-current::after { transform: scaleX(.5); }
.progress li.is-ok::after { transform: scaleX(1); background: var(--ok); }
.progress li.is-bad::after { transform: scaleX(1); background: var(--bad); }

.icon-btn {
  grid-column: 3;
  width: 48px; height: 48px;
  display: grid; place-items: center;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--glass);
  color: var(--ink);
  cursor: pointer;
  transition: background .2s, transform .2s var(--ease);
}
.icon-btn:hover { background: rgba(255, 255, 255, .12); }
.icon-btn:active { transform: scale(.94); }
.ico { width: 22px; height: 22px; fill: currentColor; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.icon-btn[aria-pressed='true'] .ico--off, .icon-btn[aria-pressed='false'] .ico--on { display: none; }

:focus-visible { outline: 3px solid var(--yellow); outline-offset: 3px; }
h2:focus { outline: none; }

/* ---------- Escenario ---------- */
.stage {
  position: relative;
  z-index: 5;
  flex: 1;
  display: grid;
  place-items: center;
  padding: clamp(8px, 2vh, 28px) clamp(16px, 4vw, 44px) calc(28px + var(--sheet-h, 0px));
  transition: padding-bottom .35s var(--ease);
}
.screen { width: min(1080px, 100%); }

.eyebrow {
  margin: 0;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(.8rem, .7rem + .5vw, 1.15rem);
  letter-spacing: .28em;
  text-transform: uppercase;
  color: var(--yellow);
}

/* ---------- Botón principal ---------- */
.cta {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 60px;
  padding: 16px clamp(28px, 4vw, 48px);
  border: 0;
  border-radius: 99px;
  background: var(--brand);
  background-size: 180% 100%;
  color: #1b0a05;
  font-family: var(--display);
  font-weight: 800;
  font-style: italic;
  font-size: clamp(1.1rem, 1rem + .7vw, 1.6rem);
  text-transform: uppercase;
  letter-spacing: .02em;
  cursor: pointer;
  box-shadow: 0 10px 34px -8px rgba(255, 122, 0, .75), inset 0 1px 0 rgba(255, 255, 255, .45);
  transition: transform .2s var(--ease), background-position .5s var(--ease), box-shadow .2s;
  isolation: isolate;
}
.cta::before {
  content: '';
  position: absolute;
  inset: -6px;
  z-index: -1;
  border-radius: inherit;
  border: 2px solid rgba(255, 170, 0, .6);
  animation: cta-pulse 1.9s ease-out infinite;
}
.cta svg { width: 1.2em; height: 1.2em; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; transition: transform .2s var(--ease); }
.cta:hover { transform: translateY(-2px); background-position: 100% 0; }
.cta:hover svg { transform: translateX(4px); }
.cta:active { transform: scale(.97); }
.cta:disabled { filter: grayscale(1); opacity: .5; cursor: not-allowed; }
.cta:disabled::before { animation: none; opacity: 0; }
.cta--sm { min-height: 54px; padding: 12px 28px; font-size: clamp(1rem, .9rem + .4vw, 1.25rem); flex-shrink: 0; }
@keyframes cta-pulse { from { transform: scale(.96); opacity: .9; } to { transform: scale(1.14, 1.32); opacity: 0; } }

/* ---------- Inicio ---------- */
.intro { display: flex; flex-direction: column; align-items: center; text-align: center; gap: clamp(10px, 1.8vh, 20px); }
.intro__title {
  margin: 0;
  max-width: 16ch;
  font-family: var(--display);
  font-weight: 900;
  font-style: italic;
  font-size: clamp(2.3rem, 1.2rem + 5.6vw, 5.6rem);
  line-height: .98;
  text-transform: uppercase;
  letter-spacing: -.01em;
  background: linear-gradient(180deg, #fff 30%, #ffe9c2 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 6px 26px rgba(255, 122, 0, .45));
  padding: 0 .08em; /* la itálica no se recorta */
}
.intro__sub { margin: 0; max-width: 46ch; color: var(--ink-2); font-size: clamp(1rem, .9rem + .6vw, 1.4rem); }
.chips { list-style: none; margin: 4px 0 10px; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.chips li {
  padding: 7px 14px;
  border-radius: 99px;
  border: 1px solid var(--line);
  background: var(--glass);
  font-size: clamp(.82rem, .78rem + .25vw, 1rem);
  font-weight: 500;
  color: var(--ink-2);
}

.radar { position: relative; width: clamp(120px, 20vh, 200px); aspect-ratio: 1; display: grid; place-items: center; margin-bottom: 4px; }
.radar__ring { position: absolute; inset: 0; border-radius: 50%; }
.radar__ring--1 { border: 2px dashed rgba(255, 170, 0, .55); animation: spin 18s linear infinite; }
.radar__ring--2 { inset: 13%; border: 2px solid transparent; border-top-color: var(--red); border-left-color: rgba(227, 23, 74, .25); animation: spin 5s linear infinite reverse; }
.radar__ring--3 { inset: -14%; border: 1px solid rgba(255, 255, 255, .22); animation: ping 2.8s ease-out infinite; }
.radar__sweep { position: absolute; inset: 6%; border-radius: 50%; background: conic-gradient(from 0deg, rgba(255, 122, 0, .5), transparent 28%); animation: spin 3.4s linear infinite; mask: radial-gradient(circle, transparent 46%, #000 47%); -webkit-mask: radial-gradient(circle, transparent 46%, #000 47%); }
.radar__shield { position: relative; width: 44%; filter: drop-shadow(0 8px 22px rgba(255, 122, 0, .65)); animation: bob 3.2s ease-in-out infinite; }
.radar__check { stroke-dasharray: 40; stroke-dashoffset: 40; animation: draw 3.2s ease-in-out infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes ping { from { transform: scale(.72); opacity: .9; } to { transform: scale(1.12); opacity: 0; } }
@keyframes bob { 50% { transform: translateY(-6px); } }
@keyframes draw { 0%, 12% { stroke-dashoffset: 40; } 38%, 88% { stroke-dashoffset: 0; } 100% { stroke-dashoffset: 40; } }

/* ---------- Reto ---------- */
.quiz { position: relative; }
.quiz__ghost {
  position: absolute;
  right: -2%;
  top: 0;
  transform: translateY(-34%);
  z-index: -1;
  font-family: var(--display);
  font-weight: 900;
  font-style: italic;
  font-size: clamp(9rem, 30vw, 22rem);
  line-height: .8;
  color: transparent;
  -webkit-text-stroke: 2px rgba(255, 255, 255, .1);
  pointer-events: none;
}
.quiz__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-bottom: clamp(10px, 1.6vh, 18px); }
.tag {
  padding: 6px 16px 5px;
  border-radius: 8px;
  background: var(--brand);
  color: #1b0a05;
  font-family: var(--display);
  font-weight: 900;
  font-style: italic;
  font-size: clamp(.95rem, .85rem + .5vw, 1.3rem);
  text-transform: uppercase;
  transform: skewX(-8deg);
}
.topic {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(.8rem, .74rem + .4vw, 1.1rem);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--yellow);
}
.quiz__text {
  margin: 0 0 clamp(16px, 2.6vh, 30px);
  max-width: 34ch;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(1.25rem, .95rem + 1.75vw, 2.5rem);
  line-height: 1.2;
  text-wrap: balance;
}
.quiz__text .w { display: inline-block; white-space: pre; }

.options { display: grid; gap: clamp(10px, 1.4vh, 16px); }
@media (min-width: 800px) { .options { grid-template-columns: 1fr 1fr; } }

.opt {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 72px;
  padding: 14px 18px 14px 14px;
  border: 1.5px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(255, 255, 255, .1), rgba(255, 255, 255, .03));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--ink);
  font: 500 clamp(1rem, .92rem + .5vw, 1.4rem)/1.3 var(--body);
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  transition: border-color .2s, box-shadow .25s, background .25s, opacity .3s, transform .2s var(--ease);
}
.opt::before { /* brillo que barre al pasar el cursor */
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, .16) 50%, transparent 65%);
  transform: translateX(-100%);
  transition: transform .6s var(--ease);
  pointer-events: none;
}
.opt__key {
  flex: 0 0 auto;
  width: 46px; height: 46px;
  display: grid; place-items: center;
  border-radius: 13px;
  background: var(--brand);
  color: #1b0a05;
  font-family: var(--display);
  font-weight: 900;
  font-style: italic;
  font-size: 1.3rem;
  transition: background .25s, color .25s;
}
.opt__key svg { width: 26px; height: 26px; stroke: currentColor; stroke-width: 3.4; stroke-linecap: round; stroke-linejoin: round; fill: none; }
.opt__label { flex: 1; }

.opt:not(:disabled):hover { border-color: var(--orange); box-shadow: 0 10px 34px -12px rgba(255, 122, 0, .8); transform: translateY(-2px); }
.opt:not(:disabled):hover::before { transform: translateX(100%); }
.opt:not(:disabled):active { transform: scale(.985); }
.opt:disabled { cursor: default; }

.opt.is-correct { border-color: var(--ok); background: linear-gradient(135deg, rgba(46, 230, 160, .26), rgba(46, 230, 160, .08)); box-shadow: 0 0 0 3px rgba(46, 230, 160, .22), 0 14px 40px -14px rgba(46, 230, 160, .8); }
.opt.is-correct .opt__key { background: var(--ok); color: #04261a; }
.opt.is-wrong { border-color: var(--bad); background: linear-gradient(135deg, rgba(255, 84, 112, .24), rgba(255, 84, 112, .07)); }
.opt.is-wrong .opt__key { background: var(--bad); color: #2a0510; }
.opt.is-dim { opacity: .38; }

/* ---------- Mensaje al revelar ---------- */
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; padding: 0 clamp(10px, 3vw, 32px) max(12px, env(safe-area-inset-bottom)); pointer-events: none; }
.sheet__inner {
  position: relative;
  width: min(1080px, 100%);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: clamp(12px, 2vw, 22px);
  padding: clamp(14px, 2vh, 22px) clamp(16px, 2.4vw, 28px);
  border-radius: 22px;
  border: 1px solid var(--line);
  background: rgba(20, 10, 30, .9);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 -18px 60px -10px rgba(0, 0, 0, .8);
  pointer-events: auto;
  overflow: hidden;
}
.sheet__inner::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: var(--ok); }
.sheet.is-bad .sheet__inner::before { background: var(--bad); }
.sheet__badge { flex: 0 0 auto; width: clamp(48px, 6vw, 68px); aspect-ratio: 1; display: grid; place-items: center; border-radius: 50%; background: var(--ok); color: #04261a; }
.sheet.is-bad .sheet__badge { background: var(--bad); color: #2a0510; }
.sheet__badge svg { width: 56%; height: 56%; stroke: currentColor; stroke-width: 3.4; stroke-linecap: round; stroke-linejoin: round; fill: none; }
.sheet__body { flex: 1; min-width: 0; }
.sheet__title { margin: 0 0 2px; font-family: var(--display); font-weight: 900; font-style: italic; font-size: clamp(1.25rem, 1.05rem + 1vw, 2rem); text-transform: uppercase; color: var(--ok); line-height: 1.1; }
.sheet.is-bad .sheet__title { color: var(--bad); }
.sheet__answer { margin: 4px 0 4px; font-weight: 700; font-size: clamp(.95rem, .9rem + .3vw, 1.2rem); color: var(--ink); }
.sheet__text { margin: 0; color: var(--ink-2); font-size: clamp(.95rem, .88rem + .35vw, 1.2rem); }
@media (max-width: 720px) {
  .sheet__inner { flex-wrap: wrap; }
  .sheet__body { flex-basis: calc(100% - 70px); }
  .sheet .cta { width: 100%; justify-content: center; }
}

/* ---------- Cortinilla ---------- */
.stinger { position: fixed; inset: 0; z-index: 50; pointer-events: none; overflow: hidden; visibility: hidden; }
.stinger__bar { position: absolute; top: -10%; bottom: -10%; left: -25%; width: 150%; transform-origin: left center; }
.stinger__bar--a { background: var(--brand); }
.stinger__bar--b { background: #12061c; }
.stinger__label { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #1b0a05; font-family: var(--display); font-style: italic; text-transform: uppercase; line-height: .85; }
.stinger__label small { font-weight: 800; font-size: clamp(1.4rem, 5vw, 3.4rem); letter-spacing: .3em; margin-right: -.3em; }
.stinger__label b { font-weight: 900; font-size: clamp(8rem, 34vw, 24rem); color: #fff; text-shadow: 0 10px 0 rgba(27, 10, 5, .28); }

/* ---------- Resultado ---------- */
.result { display: flex; flex-direction: column; align-items: center; text-align: center; gap: clamp(6px, 1.2vh, 14px); }
.ring { position: relative; width: clamp(180px, 30vh, 320px); aspect-ratio: 1; }
.ring svg { width: 100%; height: 100%; overflow: visible; }
.ring__track { fill: none; stroke: rgba(255, 255, 255, .12); stroke-width: 14; }
.ring__bar { fill: none; stroke: url(#gRing); stroke-width: 14; stroke-linecap: round; stroke-dasharray: 540.4; stroke-dashoffset: 540.4; filter: drop-shadow(0 0 14px rgba(255, 122, 0, .8)); }
.ring__num { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; font-family: var(--display); line-height: 1; }
.ring__num strong { font-weight: 900; font-style: italic; font-size: clamp(4.2rem, 13vh, 8.5rem); padding-right: .06em; }
.ring__num span { margin-top: 4px; font-weight: 700; font-size: clamp(1rem, 2.6vh, 1.5rem); color: var(--ink-3); text-transform: uppercase; letter-spacing: .14em; }
.result__label { margin: 0; font-family: var(--display); font-weight: 700; font-size: clamp(.95rem, .9rem + .4vw, 1.3rem); letter-spacing: .2em; text-transform: uppercase; color: var(--ink-2); }
.result__title {
  margin: 4px 0 0;
  font-family: var(--display);
  font-weight: 900;
  font-style: italic;
  font-size: clamp(2rem, 1.2rem + 4vw, 4.4rem);
  line-height: 1;
  text-transform: uppercase;
  background: var(--brand);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  padding: 0 .08em;
}
.result__sub { margin: 0; max-width: 44ch; color: var(--ink-2); font-size: clamp(1rem, .92rem + .45vw, 1.35rem); }
.recap { list-style: none; margin: 8px 0 14px; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.recap li { display: flex; align-items: center; gap: 8px; padding: 6px 14px 6px 6px; border-radius: 99px; border: 1px solid var(--line); background: var(--glass); font-weight: 500; font-size: .95rem; color: var(--ink-2); }
.recap i { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; background: var(--ok); color: #04261a; }
.recap li.is-bad i { background: var(--bad); color: #2a0510; }
.recap svg { width: 15px; height: 15px; stroke: currentColor; stroke-width: 3.6; stroke-linecap: round; stroke-linejoin: round; fill: none; }
.idle { width: min(260px, 60%); height: 4px; margin-top: 18px; border-radius: 99px; background: rgba(255, 255, 255, .12); overflow: hidden; }
.idle span { display: block; height: 100%; background: rgba(255, 255, 255, .5); transform-origin: left; }

/* ---------- Pantallas bajas (apaisado en móvil) ---------- */
@media (max-height: 560px) {
  .radar { display: none; }
  .ring { width: 150px; }
  .ring__num strong { font-size: 3.6rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .radar__check { stroke-dashoffset: 0; }
}
