/* ════════════════════════════════════════════════
     TOKENS
  ════════════════════════════════════════════════ */
:root {
  --bg: #000;
  --bg2: #080808;
  --white: #fff;
  --grey: #888;
  --soft: #ccc;
  --red: #e63535;
  --ig-blue: #0095f6;
  --ig-bdr: #dbdbdb;
  --ig-grey: #8e8e8e;
  --mono: "Montserrat", sans-serif;
  --sans: "Montserrat", sans-serif;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  /* ── Paleta Saga Creadoras ── */
  --rasp: #d4005a;
  --rasp-deep: #9e0044;
  --rasp-glow: rgba(212, 0, 90, 0.3);
  --ink: #1a1015;
  --muted: #9a7d88;
  /* Layout mobile-first */
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --pad-x: clamp(16px, 5vw, 28px);
  --pad-y: clamp(16px, 4vw, 44px);
  --content-max: min(440px, 100%);
  --anchor-bottom: calc(var(--safe-bottom) + 20px);
  --anchor-reserve: calc(var(--safe-bottom) + 88px);
  --app-height: 100dvh;
  --app-height-px: 100dvh;
}

/* ════════════════════════════════════════════════
     RESET
  ════════════════════════════════════════════════ */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}
html {
  width: 100%;
  max-width: 100vw;
  height: 100%;
  height: var(--app-height-px, var(--app-height));
  overflow: hidden;
  overscroll-behavior: none;
}
body {
  width: 100%;
  max-width: 100vw;
  min-height: 100%;
  min-height: var(--app-height-px, var(--app-height));
  height: 100%;
  height: var(--app-height-px, var(--app-height));
  overflow: hidden;
  overflow-wrap: break-word;
  background: var(--bg);
  color: var(--white);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}
button,
input {
  font-family: inherit;
}
button,
.hw,
.opt:not(.locked),
.btn--ghost,
.ig-go,
.sthumb:not(.st-ghost),
.st-left,
.st-right,
.st-close,
.cta-btn {
  cursor: pointer;
}
video {
  display: block;
}

/* ════════════════════════════════════════════════
     SCREEN SYSTEM
  ════════════════════════════════════════════════ */
/* ════════════════════════════════════════════════
   MSG SCENE — lock screen premium
   ════════════════════════════════════════════════ */
#msg-scene {
  position: fixed;
  inset: var(--safe-top) var(--safe-right) var(--safe-bottom) var(--safe-left);
  z-index: 999;
  background: #000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: clamp(6px, 1.5vh, 16px);
  padding: max(10px, calc(var(--safe-top) + 6px)) var(--pad-x)
    max(10px, calc(var(--safe-bottom) + 10px));
  max-height: var(--app-height-px, var(--app-height));
  overflow: hidden;
  cursor: pointer;
  transition: opacity 0.9s ease;
  outline: none;
  -webkit-user-select: none;
  user-select: none;
}
#msg-scene.hide {
  opacity: 0;
  pointer-events: none;
}
#msg-scene.tap-flash #msg-card {
  transform: scale(0.98);
  transition: transform 0.12s ease;
}
#msg-scene.starting {
  pointer-events: none;
}
#msg-scene.starting::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 20;
  pointer-events: none;
  background: radial-gradient(
    circle at 50% 62%,
    rgba(212, 0, 90, 0.35) 0%,
    transparent 65%
  );
  animation: msgTapFlash 0.22s ease-out forwards;
}
@keyframes msgTapFlash {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

/* Fondo: vignette + grain sutil */
#msg-scene-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(
      ellipse 120% 80% at 50% 18%,
      rgba(212, 0, 90, 0.07) 0%,
      transparent 55%
    ),
    radial-gradient(
      ellipse 90% 70% at 50% 100%,
      rgba(30, 8, 18, 0.85) 0%,
      transparent 50%
    ),
    radial-gradient(circle at 50% 40%, #0a0608 0%, #000 72%);
}
#msg-scene-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

/* Barra de estado — lock screen */
#msg-statusbar {
  position: relative;
  top: auto;
  left: auto;
  right: auto;
  flex: 0 0 auto;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(4px, 1vh, 8px);
  pointer-events: none;
  z-index: 2;
  transition:
    opacity 0.7s ease,
    transform 0.7s ease;
}
#msg-scene.notify-active #msg-statusbar {
  opacity: 0.42;
  transform: scale(0.96);
}
#msg-time {
  font-family: var(--mono);
  font-size: clamp(56px, 15vw, 88px);
  font-weight: 200;
  letter-spacing: -0.02em;
  color: #fff;
  line-height: 1;
  text-shadow: 0 2px 40px rgba(0, 0, 0, 0.5);
}
#msg-date {
  font-family: var(--mono);
  font-size: clamp(12px, 3.2vw, 14px);
  font-weight: 400;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.45);
  text-transform: lowercase;
}

/* Notificación */
#msg-thread {
  position: relative;
  z-index: 2;
  flex: 0 1 auto;
  margin: auto 0;
  width: min(340px, calc(100% - 2 * var(--pad-x)));
  max-width: 340px;
  min-width: 0;
  opacity: 0;
  transform: translateY(-18px) scale(0.98);
  filter: blur(4px);
  transition:
    opacity 0.5s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.55s cubic-bezier(0.22, 1, 0.36, 1),
    filter 0.45s ease;
}
#msg-thread.show {
  opacity: 1;
  transform: translateY(0) scale(1);
  filter: blur(0);
}
#msg-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 16px 12px;
  border-radius: 20px;
  background: rgba(18, 12, 15, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  box-shadow:
    0 4px 24px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(212, 0, 90, 0.04) inset;
  transition:
    box-shadow 0.5s ease,
    border-color 0.5s ease,
    transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
#msg-thread.ready #msg-card {
  border-color: rgba(212, 0, 90, 0.22);
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(212, 0, 90, 0.12) inset,
    0 0 48px var(--rasp-glow);
}

#msg-head {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 12px;
  align-items: center;
}
#msg-avatar-wrap {
  position: relative;
  width: 40px;
  height: 40px;
}
#msg-avatar {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: linear-gradient(145deg, var(--rasp) 0%, var(--rasp-deep) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  box-shadow: 0 4px 14px rgba(212, 0, 90, 0.35);
}
#msg-avatar.pulse-once {
  animation: msgAvatarPulse 0.65s ease-out;
}
@keyframes msgAvatarPulse {
  0% {
    transform: scale(1);
  }
  35% {
    transform: scale(1.08);
    box-shadow: 0 0 24px var(--rasp-glow);
  }
  100% {
    transform: scale(1);
  }
}
#msg-unread {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--rasp);
  border: 2px solid rgba(18, 12, 15, 0.95);
  box-shadow: 0 0 8px var(--rasp-glow);
  transition:
    opacity 0.35s ease,
    transform 0.35s ease;
}
#msg-unread.hide {
  opacity: 0;
  transform: scale(0);
}

#msg-meta {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px 10px;
  min-width: 0;
}
#msg-sender {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--rasp);
}
#msg-now {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.38);
  letter-spacing: 0.04em;
}
#msg-now::before {
  content: "·";
  margin-right: 6px;
  opacity: 0.5;
}

/* Burbuja + anillo CTA */
#msg-bubble-wrap {
  position: relative;
  margin-left: 52px;
}
#msg-ring {
  position: absolute;
  inset: -6px;
  border-radius: 18px;
  border: 1px solid rgba(212, 0, 90, 0.35);
  opacity: 0;
  pointer-events: none;
}
#msg-thread.ready #msg-ring {
  opacity: 1;
  animation: msgRingPulse 2.4s ease-out infinite;
}
@keyframes msgRingPulse {
  0% {
    transform: scale(1);
    opacity: 0.55;
  }
  70% {
    transform: scale(1.04);
    opacity: 0;
  }
  100% {
    transform: scale(1.04);
    opacity: 0;
  }
}

#msg-bubble {
  position: relative;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 4px 16px 16px 16px;
  padding: 14px 18px;
  min-width: 72px;
  display: flex;
  align-items: center;
}

#msg-text {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}
#msg-thread.show .msg-line-primary {
  animation: msgLineIn 0.42s cubic-bezier(0.22, 1, 0.36, 1) 0.12s both;
}
#msg-thread.show .msg-line-sub {
  animation: msgLineIn 0.42s cubic-bezier(0.22, 1, 0.36, 1) 0.22s both;
}
@keyframes msgLineIn {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.msg-line-primary {
  font-family: var(--sans);
  font-size: clamp(16px, 4vw, 18px);
  font-weight: 500;
  color: #f5f5f5;
  line-height: 1.45;
}
.msg-line-sub {
  font-family: var(--sans);
  font-size: clamp(12px, 3.2vw, 13px);
  font-weight: 400;
  color: var(--muted);
  line-height: 1.4;
}

/* Hint toca para abrir */
#msg-open {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding-top: 4px;
  margin-left: 52px;
  animation: msgBounce 1.8s ease-in-out infinite;
}
#msg-open.show {
  display: flex;
  animation:
    msgOpenIn 0.4s cubic-bezier(0.22, 1, 0.36, 1) both,
    msgBounce 1.8s ease-in-out 0.45s infinite;
}
@keyframes msgOpenIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
#msg-open-label {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.72);
}
#msg-open-arrow {
  font-size: 14px;
  color: var(--rasp);
  filter: drop-shadow(0 0 6px var(--rasp-glow));
}
@keyframes msgBounce {
  0%,
  100% {
    opacity: 0.65;
    transform: translateY(0);
  }
  50% {
    opacity: 1;
    transform: translateY(5px);
  }
}

/* Skip — dos líneas legibles */
#entry-skip-links {
  position: relative;
  bottom: auto;
  left: auto;
  transform: none;
  flex: 0 0 auto;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: min(320px, 100%);
  max-width: 100%;
  padding: 0;
  pointer-events: auto;
}
.entry-skip-link {
  font-family: var(--mono);
  font-size: clamp(10px, 2.6vw, 11px);
  font-weight: 500;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.28);
  text-decoration: none;
  text-align: center;
  line-height: 1.4;
  transition: color 0.25s ease;
  cursor: pointer;
}
.entry-skip-link:hover,
.entry-skip-link:focus-visible {
  color: rgba(255, 255, 255, 0.55);
  outline: none;
}
.entry-skip-link--saga {
  color: rgba(255, 255, 255, 0.4);
  letter-spacing: 0.1em;
}
.entry-skip-link--saga:hover,
.entry-skip-link--saga:focus-visible {
  color: var(--rasp);
}

.screen {
  position: fixed;
  inset: var(--safe-top) var(--safe-right) var(--safe-bottom) var(--safe-left);
  max-width: 100vw;
  max-height: var(--app-height-px, var(--app-height));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--pad-y) var(--pad-x);
  opacity: 0;
  pointer-events: none;
  transition: opacity 1.15s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 10;
  overflow: hidden;
  min-width: 0;
  min-height: 0;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  text-align: center;
}
.screen.show {
  opacity: 1;
  pointer-events: all;
  z-index: 100;
}
.screen.overy {
  overflow-x: hidden;
  overflow-y: auto;
  justify-content: flex-start;
  align-items: center;
  -webkit-overflow-scrolling: touch;
  scroll-padding-bottom: var(--anchor-reserve);
}

/* Bloques de contenido: centrados y sin desbordar horizontal */
.qi,
.qq,
.qresp,
.opts,
.tw,
.avm-card,
.igl,
#ld-title,
#ld-classify,
#ld-status,
#ld-sub2,
.ld-bar,
.happy-unlock-card,
.bubble {
  width: 100%;
  max-width: var(--content-max);
  margin-inline: auto;
  min-width: 0;
}

/* fade-up helper */
.fu {
  opacity: 0;
  transform: translateY(10px);
  transition:
    opacity 0.6s var(--ease),
    transform 0.6s var(--ease);
}
.fu.in {
  opacity: 1;
  transform: none;
}

/* ════════════════════════════════════════════════
     SHARED BUTTON
  ════════════════════════════════════════════════ */
/* ── Tamaño base: todos los botones de continuar de la saga ── */
:root {
  --btn-w: 280px;
  --btn-w-wide: min(100%, 360px);
  --btn-h: 46px;
  --btn-fs: 11px;
  --btn-ls: 0.15em;
  --btn-px: 18px;
}

.btn {
  background: var(--rasp);
  border: none;
  color: #fff;
  font-family: var(--mono);
  font-size: var(--btn-fs);
  font-weight: 700;
  letter-spacing: var(--btn-ls);
  line-height: 1.2;
  width: var(--btn-w);
  max-width: min(var(--btn-w), calc(100% - 2 * var(--pad-x)));
  min-height: var(--btn-h);
  padding: 0 var(--btn-px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  white-space: normal;
  hyphens: auto;
  cursor: pointer;
  border-radius: 2px;
  position: relative;
  overflow: hidden; /* mantiene el shimmer dentro */
  flex-shrink: 0;
  transition:
    background 0.3s ease,
    border-color 0.3s ease,
    color 0.3s ease,
    transform 0.22s ease;
  box-shadow: 0 4px 18px rgba(212, 0, 90, 0.22);
  animation: btnRings 2.1s ease-out infinite;
}
/* Shimmer diagonal al hover — clipeado por overflow:hidden del padre */
.btn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    108deg,
    transparent 30%,
    rgba(255, 255, 255, 0.22) 50%,
    transparent 70%
  );
  transform: translateX(-100%);
  transition: transform 0s;
  pointer-events: none;
}
.btn:hover {
  background: var(--rasp-deep);
  transform: translateY(-2px);
  box-shadow: 0 10px 32px rgba(212, 0, 90, 0.42);
  animation: none;
}
.btn:hover::after {
  transform: translateX(100%);
  transition: transform 0.52s ease;
}
.btn:active {
  transform: translateY(0);
}

/* Dos anillos concéntricos que se expanden y desvanecen — efecto sonar */
@keyframes btnRings {
  0% {
    box-shadow:
      0 4px 18px rgba(212, 0, 90, 0.22),
      0 0 0 0 rgba(212, 0, 90, 0.6),
      0 0 0 0 rgba(212, 0, 90, 0.28);
  }
  55% {
    box-shadow:
      0 4px 18px rgba(212, 0, 90, 0.22),
      0 0 0 12px rgba(212, 0, 90, 0),
      0 0 0 24px rgba(212, 0, 90, 0.12);
  }
  100% {
    box-shadow:
      0 4px 18px rgba(212, 0, 90, 0.22),
      0 0 0 14px rgba(212, 0, 90, 0),
      0 0 0 28px rgba(212, 0, 90, 0);
  }
}

/* Botón de continuar en flujo (p. ej. final de S1) */
.btn-flow {
  margin-top: 30px;
}

.btn-anchor {
  position: fixed;
  bottom: var(--anchor-bottom);
  left: 50%;
  transform: translateX(-50%);
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.5s var(--ease),
    visibility 0s linear 0.5s,
    transform 0.22s ease,
    background 0.3s ease,
    border-color 0.3s ease,
    color 0.3s ease;
  z-index: 150;
}
.btn-anchor.show {
  opacity: 1;
  visibility: visible;
  transition:
    opacity 0.5s var(--ease),
    visibility 0s,
    transform 0.22s ease,
    background 0.3s ease,
    border-color 0.3s ease,
    color 0.3s ease;
}
/* Conservar centrado al hover/active (sin esto el botón salta a la izquierda) */
.btn.btn-anchor:hover {
  transform: translateX(-50%) translateY(-2px);
}
.btn.btn-anchor:active {
  transform: translateX(-50%) translateY(0);
}

/* ════════════════════════════════════════════════
     S0 — LOADING
  ════════════════════════════════════════════════ */
#s0 {
  background: #000;
  gap: 20px;
}

#ld-title {
  font-family: var(--mono);
  font-size: clamp(13px, 3.2vw, 16px);
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--rasp);
  text-align: center;
  min-height: 1.4em;
  animation: titleFlicker 0.08s step-end infinite;
}
@keyframes titleFlicker {
  0%,
  94% {
    opacity: 1;
  }
  95%,
  97% {
    opacity: 0.6;
  }
  96%,
  98% {
    opacity: 0.9;
  }
  100% {
    opacity: 1;
  }
}
#ld-classify {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.22em;
  color: #3a3a3a;
  text-align: center;
  margin-top: 6px;
  animation: blip 3s ease-in-out infinite;
}
#ld-status {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 400;
  color: var(--grey);
  letter-spacing: 0.1em;
  text-align: center;
  min-height: 1.4em;
  animation: blip 1.8s ease-in-out infinite;
}
#ld-sub2 {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 400;
  color: #3a3a3a;
  letter-spacing: 0.1em;
  text-align: center;
  margin-top: 4px;
}
.ld-bar {
  width: 180px;
  height: 1px;
  background: #161616;
  overflow: hidden;
}
.ld-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--rasp-deep), var(--rasp));
  width: 0%;
  transition: width 2.8s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes blip {
  0%,
  100% {
    opacity: 0.4;
  }
  50% {
    opacity: 1;
  }
}

/* Cursor de escritura */
.tw-cursor {
  display: inline-block;
  width: 2px;
  height: 0.9em;
  background: var(--rasp);
  margin-left: 2px;
  vertical-align: text-bottom;
  animation: cur-blink 0.65s step-end infinite;
}
@keyframes cur-blink {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0;
  }
}

/* ════════════════════════════════════════════════
     S1 — OPENING
  ════════════════════════════════════════════════ */
#s1 {
  background: #000;
  padding: max(var(--pad-y), calc(var(--safe-top) + 24px)) var(--pad-x);
  align-items: center;
  text-align: center;
}
#s1 .blur-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse 80% 60% at 50% 40%, #1a0a08 0%, #000 65%);
  opacity: 0;
  transition: opacity 2s ease;
}
.tw {
  position: relative;
  z-index: 2;
  max-width: 500px;
  width: 100%;
  text-align: center;
}
.tl {
  opacity: 0;
  transform: translateY(7px);
  transition:
    opacity 0.38s ease,
    transform 0.38s ease;
  line-height: 1.5;
  margin-bottom: 8px;
  font-size: clamp(19px, 4.5vw, 30px);
  font-weight: 400;
  color: var(--white);
}
.tl.in {
  opacity: 1;
  transform: none;
}
.tl.sm {
  font-size: clamp(16px, 3.2vw, 20px);
  font-weight: 300;
  color: var(--soft);
}
.tl.xl {
  font-size: clamp(24px, 6vw, 40px);
  font-weight: 700;
}
.tl.cd {
  color: #bbb;
}
.tl.sp {
  height: 14px;
}

/* ════════════════════════════════════════════════
     S2 — ORION (avatar player)
  ════════════════════════════════════════════════ */
#s2 {
  background: #000;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: var(--pad-y) var(--pad-x);
  padding-bottom: var(--anchor-reserve);
  overflow-x: hidden;
  overflow-y: auto;
}

/* ════════════════════════════════════════════════
     S3 — QUIZ
  ════════════════════════════════════════════════ */
#s3 {
  background: #080808;
  gap: 18px;
  padding-top: max(var(--pad-y), calc(var(--safe-top) + 12px));
  padding-bottom: var(--anchor-reserve);
}

.qi {
  font-size: clamp(13px, 2.4vw, 15px);
  color: var(--grey);
  text-align: center;
  line-height: 1.65;
  max-width: 360px;
}
.qq {
  font-size: clamp(20px, 4.8vw, 30px);
  font-weight: 700;
  text-align: center;
  max-width: 380px;
}

.opts {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 450px;
}
.opt {
  border: 1px solid #1e1e1e;
  padding: 14px 18px;
  border-radius: 8px;
  cursor: pointer;
  font-size: clamp(15px, 3.2vw, 16px);
  color: var(--soft);
  line-height: 1.6;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: rgba(255, 255, 255, 0.018);
  transition:
    border-color 0.25s,
    background 0.25s,
    color 0.25s;
}
.opt:hover {
  border-color: #484848;
  background: rgba(255, 255, 255, 0.05);
  color: var(--white);
}
.opt .ico {
  flex-shrink: 0;
  margin-top: 1px;
  font-size: 15px;
}
.opt.locked {
  opacity: 0.55;
  pointer-events: none;
  border-style: dashed;
  border-color: #333;
  color: #777;
}

.qresp {
  text-align: center;
  max-width: 380px;
  display: none;
}
.qresp p {
  font-size: clamp(16px, 3.4vw, 22px);
  line-height: 1.65;
  white-space: pre-line;
}

/* ════════════════════════════════════════════════
     S4 — AVATAR POST-QUIZ
  ════════════════════════════════════════════════ */
#s4 {
  background: #000;
  padding: 0;
}
.av-full {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}
.av-fb {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  color: #333;
  z-index: 1;
}

/* ════════════════════════════════════════════════
     S5 — REWIND / HAPPY
  ════════════════════════════════════════════════ */
#s5 {
  background: #000;
}

.glitch-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}
.hw {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  cursor: pointer;
  text-align: center;
  z-index: 2;
  padding-bottom: 48px;
}

.hv {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 0;
  object-fit: cover;
  background: #111;
  z-index: 0;
}
.happy-unlock {
  position: absolute;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
  background: rgba(0, 0, 0, 0.62);
  cursor: pointer;
  transition:
    opacity 0.55s ease,
    visibility 0.55s ease;
}
.happy-unlock.hide {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.happy-unlock-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  max-width: min(340px, 88vw);
  padding: 28px 24px;
  text-align: center;
  background: rgba(12, 12, 12, 0.88);
  border: 1px solid rgba(212, 0, 90, 0.35);
  border-radius: 16px;
  box-shadow:
    0 18px 48px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(255, 255, 255, 0.04) inset;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.happy-unlock-title {
  font-family: var(--mono);
  font-size: clamp(14px, 3.4vw, 18px);
  font-weight: 600;
  letter-spacing: 0.08em;
  color: #fff;
  text-transform: uppercase;
  margin: 0;
}
.happy-unlock-hint {
  font-size: clamp(12px, 2.8vw, 15px);
  color: rgba(255, 255, 255, 0.72);
  font-style: italic;
  letter-spacing: 0.03em;
  line-height: 1.55;
  margin: 0;
}
.hfb {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 0;
  background: #111;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 96px;
  z-index: 0;
}
/* Gradiente sobre el video para legibilidad del texto */
#s5::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.82) 0%,
    rgba(0, 0, 0, 0.1) 50%,
    transparent 100%
  );
  z-index: 1;
  pointer-events: none;
}

.bubble {
  background: rgba(10, 10, 10, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 15px 20px;
  position: relative;
  font-size: clamp(15px, 3.5vw, 18px);
  line-height: 1.6;
  display: none;
  animation: bpop 0.38s var(--ease) forwards;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 3;
  max-width: 300px;
}
.bubble::before {
  content: "";
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  border: 8px solid transparent;
  border-bottom: 8px solid #222;
  border-top: 0;
}
.bubble.show {
  display: block;
}
@keyframes bpop {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.tap-h {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  font-family: var(--mono);
  letter-spacing: 0.12em;
  animation: blip 2.2s ease-in-out infinite;
}

/* Variante outline — panel / teatro (misma caja que .btn) */
.btn--ghost {
  background: transparent;
  border: 1px solid rgba(212, 0, 90, 0.45);
  color: var(--muted);
  box-shadow:
    0 4px 18px rgba(212, 0, 90, 0.12),
    0 0 0 0 rgba(212, 0, 90, 0.5),
    0 0 0 0 rgba(212, 0, 90, 0.22);
}
.btn--ghost::after {
  background: linear-gradient(
    105deg,
    transparent 35%,
    rgba(255, 255, 255, 0.14) 50%,
    transparent 65%
  );
}
.btn--ghost:hover {
  background: var(--rasp);
  border-color: var(--rasp);
  color: #fff;
}
.btn--ghost:hover::after {
  transition: transform 0.45s ease;
}

/* ════════════════════════════════════════════════
     S7 — IG LOGIN
  ════════════════════════════════════════════════ */
#s7 {
  background: #fafafa;
  color: #262626;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: var(--pad-y) var(--pad-x);
  overflow: hidden;
}
.igl {
  width: 100%;
  max-width: min(350px, 100%);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 14px;
  padding: 0;
}
.ig-hint {
  font-size: clamp(13px, 3.2vw, 15px);
  color: #555;
  text-align: center;
  line-height: 1.55;
  margin-bottom: 4px;
}
.ig-logo {
  font-size: clamp(32px, 8vw, 36px);
  font-style: italic;
  font-weight: 700;
  color: #262626;
  letter-spacing: -1px;
  text-align: center;
  align-self: center;
  margin-bottom: 6px;
}
.ig-field {
  width: 100%;
  padding: 10px 14px;
  background: #fafafa;
  border: 1px solid var(--ig-bdr);
  border-radius: 6px;
  font-size: 14px;
  color: #262626;
  outline: none;
}
.ig-field:focus {
  border-color: #a8a8a8;
}
.ig-go {
  width: 100%;
  padding: 10px;
  background: var(--ig-blue);
  border: none;
  border-radius: 8px;
  color: #fff;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  transition: opacity 0.2s;
}
.ig-go:active {
  opacity: 0.82;
}
#s7 .ig-go {
  margin-top: 6px;
}

/* IG spinner */
.ig-loader {
  position: fixed;
  inset: 0;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s;
}
.ig-loader.on {
  opacity: 1;
  pointer-events: all;
}
.ig-spin {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid #ddd;
  border-top-color: #262626;
  animation: spin 0.75s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ════════════════════════════════════════════════
     S8 — IG HOME
  ════════════════════════════════════════════════ */
#s8 {
  background: #fafafa;
  color: #262626;
  padding: 0;
  justify-content: flex-start;
  overflow-x: hidden;
  overflow-y: auto;
  align-items: stretch;
}

.ig-top {
  position: sticky;
  top: 0;
  background: #fafafa;
  border-bottom: 1px solid var(--ig-bdr);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  z-index: 20;
}
.ig-top-logo {
  font-size: 22px;
  font-style: italic;
  font-weight: 700;
  color: #262626;
}
.ig-top-ico {
  display: flex;
  gap: 18px;
  font-size: 21px;
  color: #262626;
}

.ig-srow {
  padding: 12px 14px;
  display: flex;
  gap: 13px;
  overflow-x: auto;
  scrollbar-width: none;
  width: 100%;
  border-bottom: 1px solid #efefef;
}
.ig-srow::-webkit-scrollbar {
  display: none;
}

.sthumb {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
  cursor: pointer;
}
.strim {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #e2e2e2;
  display: flex;
  align-items: center;
  justify-content: center;
}
.strim.live {
  background: linear-gradient(
    45deg,
    #f09433,
    #e6683c,
    #dc2743,
    #cc2366,
    #bc1888
  );
  padding: 2.5px;
}
.strim.live .strim-in {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: #fafafa;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.stav {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  object-position: center center;
  background: #e8e8e8;
  display: block;
}
.stname {
  font-size: 11px;
  color: #262626;
  max-width: 66px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.stname.bold {
  font-weight: 700;
}
.st-ghost .strim {
  background: #f0f0f0;
}
.st-ghost .stname {
  color: #d0d0d0;
}

/* ── Feed decorativo borroso ── */
.ig-feed-wrap {
  position: relative;
  flex: 1;
  width: 100%;
  overflow: hidden;
  min-height: 0;
}
.ig-feed {
  filter: blur(3.5px);
  opacity: 0.55;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
}
.ig-feed-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(250, 250, 250, 0) 0%,
    rgba(250, 250, 250, 0.55) 45%,
    rgba(250, 250, 250, 0.92) 75%,
    rgba(250, 250, 250, 1) 100%
  );
  pointer-events: none;
  z-index: 2;
}
.ig-cta {
  position: absolute;
  top: 16px;
  left: 0;
  right: 0;
  text-align: center;
  color: #262626;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.7;
  z-index: 3;
  animation: blip 2.5s ease-in-out infinite;
}

/* Placeholder avatar stories */
.st-av-ph {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #e8e8e8;
}

/* ── Posts del feed ── */
.igp {
  border-bottom: 1px solid #efefef;
}
.igp-head {
  display: flex;
  align-items: center;
  padding: 10px 12px;
  gap: 10px;
}
.igp-av {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  flex-shrink: 0;
}
.igp-info {
  flex: 1;
}
.igp-user {
  font-size: 13px;
  font-weight: 600;
  color: #262626;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.igp-loc {
  font-size: 11px;
  color: #8e8e8e;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.igp-more {
  font-size: 16px;
  color: #262626;
  letter-spacing: 1px;
}
.igp-img {
  width: 100%;
  height: clamp(200px, 52vw, 300px);
  background: #f0f0f0;
}
.igp-img--tall {
  height: clamp(220px, 58vw, 340px);
}
.igp-actions {
  display: flex;
  justify-content: space-between;
  padding: 10px 14px 6px;
  font-size: 22px;
}
.igp-left {
  display: flex;
  gap: 14px;
}
.igp-likes {
  padding: 0 14px 4px;
  font-size: 13px;
  font-weight: 600;
  color: #262626;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.igp-caption {
  padding: 0 14px 4px;
  font-size: 13px;
  color: #262626;
  line-height: 1.4;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.igp-time {
  padding: 0 14px 12px;
  font-size: 11px;
  color: #8e8e8e;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* ════════════════════════════════════════════════
     STORY PLAYER
  ════════════════════════════════════════════════ */
#s9 {
  background: #000;
  padding: 0;
}

.story-shell {
  position: fixed;
  inset: 0;
  background: #0e0e0e;
}

.st-prog {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  gap: 3px;
  padding: max(10px, calc(var(--safe-top) + 6px)) 10px 0;
  z-index: 30;
}
.stseg {
  flex: 1;
  height: 2px;
  background: rgba(255, 255, 255, 0.28);
  border-radius: 1px;
  overflow: hidden;
}
.stseg-f {
  height: 100%;
  background: #fff;
  width: 0%;
}
.stseg.done .stseg-f {
  width: 100%;
  transition: none;
}

.st-head {
  position: absolute;
  top: max(22px, calc(var(--safe-top) + 14px));
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  padding: 8px 12px;
  z-index: 30;
}
.st-av {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  object-position: top center;
  background: #777;
  display: block;
  flex-shrink: 0;
}
.st-info {
  margin-left: 10px;
  flex: 1;
}
.st-name {
  color: #fff;
  font-weight: 600;
  font-size: 14px;
}
.st-time {
  color: rgba(255, 255, 255, 0.6);
  font-size: 11px;
}
.st-close {
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
}

.st-vwrap {
  position: absolute;
  inset: 0;
}
.st-vid {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.st-left {
  position: absolute;
  left: 0;
  top: 0;
  width: 34%;
  height: 100%;
  z-index: 20;
  cursor: pointer;
}
.st-right {
  position: absolute;
  right: 0;
  top: 0;
  width: 66%;
  height: 100%;
  z-index: 20;
  cursor: pointer;
}

/* ════════════════════════════════════════════════
     SISTEMA CINEMATOGRÁFICO
  ════════════════════════════════════════════════ */

/* Velo oscuro para transiciones y blackouts */
#cine-veil {
  position: fixed;
  inset: var(--safe-top) var(--safe-right) var(--safe-bottom) var(--safe-left);
  background: #000;
  opacity: 0;
  pointer-events: none;
  z-index: 800;
}

/* Línea roja de escaneo — pre-purga */
#scan-line {
  position: fixed;
  left: 0;
  right: 0;
  height: 1px;
  top: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    var(--red) 30%,
    var(--red) 70%,
    transparent 100%
  );
  box-shadow: 0 0 12px 2px var(--red);
  opacity: 0;
  z-index: 790;
  pointer-events: none;
}

/* Revelación palabra a palabra */
.wrd {
  opacity: 0;
  transition: opacity 0.5s ease;
  display: inline;
}
.wrd.on {
  opacity: 1;
}

/* Fade lento para elementos clave (más dramático que .fu) */
.fu-slow {
  opacity: 0;
  transform: translateY(6px);
  transition:
    opacity 1.4s ease,
    transform 1.4s ease;
}
.fu-slow.in {
  opacity: 1;
  transform: none;
}

/* Texto que pulsa — señal de vida antes de la purga */
@keyframes softPulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.55;
  }
}
.soft-pulse {
  animation: softPulse 2s ease-in-out infinite;
}

/* Flash de una sola palabra en el centro */
.word-flash {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 760;
  pointer-events: none;
  font-size: clamp(28px, 7vw, 54px);
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.06em;
  opacity: 0;
  transition: opacity 0.55s ease;
}

/* Transición de panel más suave en S6 */
.panel {
  transition: opacity 0.7s ease;
}

/* ════════════════════════════════════════════════
     S6 — WhatsApp ORION
  ════════════════════════════════════════════════ */
#s6 {
  --wc-header: #140810;
  --wc-header-border: rgba(212, 0, 90, 0.12);
  --wc-chat-bg: #10080c;
  --wc-bubble-in: #1e1419;
  --wc-bubble-shadow: 0 1px 0.5px rgba(0, 0, 0, 0.22);
  --wc-input-bg: #1a1218;
  --wc-input-field: #221820;
  --wc-icon: rgba(255, 255, 255, 0.88);
  --wc-icon-muted: #7a6270;
  --wc-date-bg: rgba(26, 16, 21, 0.92);
  --wc-enc-bg: rgba(212, 0, 90, 0.08);
  background: var(--wc-chat-bg);
  width: 100%;
  max-width: 100%;
  height: 100%;
  min-height: 0;
  text-align: left;
  flex-direction: column;
  justify-content: flex-start;
  align-items: stretch;
  align-content: stretch;
  padding: 0;
  overflow: hidden;
}
#s6 > .wc-header,
#s6 > .wc-bar {
  width: 100%;
  flex-shrink: 0;
}
#s6 > .wc-msgs {
  width: 100%;
  flex: 1 1 auto;
  min-height: 0;
  /* Safari iOS: flex hijo necesita height:0 para llenar el espacio restante */
  height: 0;
}

/* Header */
.wc-header {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: max(12px, calc(var(--safe-top) + 8px)) 10px 10px 6px;
  background: var(--wc-header);
  border-bottom: 1px solid var(--wc-header-border);
  flex-shrink: 0;
  z-index: 2;
}
.wc-hbtn {
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  color: var(--wc-icon);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 0;
}
.wc-hbtn svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}
.wc-hbtn-back svg {
  width: 26px;
  height: 26px;
}
.wc-av {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  object-position: top;
  background: #2a1a20;
  flex-shrink: 0;
}
.wc-info {
  flex: 1;
  min-width: 0;
  text-align: left;
}
.wc-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--white);
  letter-spacing: 0.02em;
  line-height: 1.2;
  text-align: left;
}
.wc-status {
  font-size: 12px;
  color: var(--rasp);
  letter-spacing: 0.01em;
  line-height: 1.3;
}
.wc-header-actions {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.wc-header-actions .wc-hbtn svg {
  width: 20px;
  height: 20px;
}
.wc-brand {
  font-size: 8px;
  color: rgba(212, 0, 90, 0.45);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 600;
  margin-top: 1px;
}

/* Aviso cifrado (dentro del chat) */
.wc-enc {
  align-self: center;
  max-width: 92%;
  font-size: 11px;
  color: #b8a0aa;
  background: var(--wc-enc-bg);
  border-radius: 8px;
  padding: 6px 12px;
  line-height: 1.45;
  text-align: center;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04);
}
.wc-enc-lock svg {
  width: 12px;
  height: 12px;
  fill: var(--rasp);
  flex-shrink: 0;
}

/* Chip de fecha */
.wc-date {
  align-self: center;
  font-size: 11px;
  font-weight: 500;
  color: #c8b4be;
  background: var(--wc-date-bg);
  border-radius: 8px;
  padding: 5px 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  box-shadow: 0 1px 0.5px rgba(0, 0, 0, 0.18);
  flex-shrink: 0;
}

/* Área de mensajes */
.wc-msgs {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 10px 12px max(16px, calc(var(--safe-bottom) + 8px));
  display: flex;
  flex-direction: column;
  gap: 3px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  background-color: var(--wc-chat-bg);
  background-image:
    radial-gradient(
      circle at 20% 18%,
      rgba(212, 0, 90, 0.04) 0,
      transparent 42%
    ),
    radial-gradient(
      circle at 82% 72%,
      rgba(158, 0, 68, 0.05) 0,
      transparent 38%
    ),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Cg fill='%23d4005a' fill-opacity='0.045'%3E%3Ccircle cx='18' cy='22' r='3'/%3E%3Cpath d='M88 14l2 4 4 1-3 3 1 4-4-2-4 2 1-4-3-3 4-1z'/%3E%3Cpath d='M34 78c0-4 3-7 7-7s7 3 7 7-3 7-7 7-7-3-7-7z'/%3E%3Cpath d='M72 88h8v2h-8zM76 84h2v10h-2z'/%3E%3Cpath d='M14 54c2-2 5-2 7 0s2 5 0 7-5 2-7 0-2-5 0-7z'/%3E%3C/g%3E%3C/svg%3E");
  background-size:
    auto,
    auto,
    120px 120px;
}
/* Empuja el hilo hacia abajo (Safari iOS no respeta bien ::before en flex) */
.wc-chat-spacer {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  pointer-events: none;
}
.wc-msgs > .wc-enc {
  margin: 6px 0 10px;
  flex-shrink: 0;
}
.wc-msgs > .wc-date {
  margin: 2px 0 14px;
  flex-shrink: 0;
}

/* Burbuja recibida (chat 1:1, sin avatar) */
.wc-bubble {
  position: relative;
  max-width: 92%;
  align-self: flex-start;
  margin: 2px 0 2px 8px;
  filter: drop-shadow(var(--wc-bubble-shadow));
  flex-shrink: 0;
}
.wc-bubble:has(.wc-audio) {
  width: min(88%, 320px);
  min-width: min(78vw, 280px);
}
.wc-bubble + .wc-bubble {
  margin-top: 1px;
}
.wc-bubble:not(:last-child) {
  margin-bottom: 1px;
}

/* Burbuja de audio */
.wc-audio {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--wc-bubble-in);
  border-radius: 0 8px 8px 8px;
  padding: 8px 10px 20px 8px;
  width: 100%;
  min-width: 0;
}
/* Cola de burbuja entrante */
.wc-audio::before,
.wc-link-msg::before {
  content: "";
  position: absolute;
  left: -6px;
  top: 0;
  width: 8px;
  height: 13px;
  background: var(--wc-bubble-in);
  clip-path: polygon(100% 0, 0 0, 100% 100%);
}
.wc-play {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: rgba(212, 0, 90, 0.18);
  color: var(--rasp);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
  transition:
    transform 0.15s ease,
    background 0.15s ease;
}
.wc-play svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
  margin-left: 2px;
}
.wc-play.is-paused svg {
  margin-left: 0;
}
.wc-play:active {
  transform: scale(0.92);
}

.wc-audio-body {
  flex: 1 1 0;
  min-width: 0;
  width: 100%;
  padding-top: 2px;
}

/* Waveform — barras repartidas en todo el ancho (estilo WhatsApp) */
.wc-waveform {
  display: flex;
  align-items: center;
  justify-content: stretch;
  gap: 2px;
  height: 28px;
  width: 100%;
  margin-bottom: 2px;
}
.wc-waveform span {
  display: block;
  flex: 1 1 0;
  min-width: 2px;
  max-width: 5px;
  border-radius: 1px;
  background: #5a3a4a;
  transition: background 0.1s ease;
  align-self: center;
}
/* Alturas naturales de onda (patrón cíclico para N barras) */
.wc-waveform span:nth-child(22n + 1) {
  height: 6px;
}
.wc-waveform span:nth-child(22n + 2) {
  height: 12px;
}
.wc-waveform span:nth-child(22n + 3) {
  height: 20px;
}
.wc-waveform span:nth-child(22n + 4) {
  height: 26px;
}
.wc-waveform span:nth-child(22n + 5) {
  height: 18px;
}
.wc-waveform span:nth-child(22n + 6) {
  height: 24px;
}
.wc-waveform span:nth-child(22n + 7) {
  height: 14px;
}
.wc-waveform span:nth-child(22n + 8) {
  height: 22px;
}
.wc-waveform span:nth-child(22n + 9) {
  height: 28px;
}
.wc-waveform span:nth-child(22n + 10) {
  height: 20px;
}
.wc-waveform span:nth-child(22n + 11) {
  height: 16px;
}
.wc-waveform span:nth-child(22n + 12) {
  height: 24px;
}
.wc-waveform span:nth-child(22n + 13) {
  height: 28px;
}
.wc-waveform span:nth-child(22n + 14) {
  height: 22px;
}
.wc-waveform span:nth-child(22n + 15) {
  height: 18px;
}
.wc-waveform span:nth-child(22n + 16) {
  height: 26px;
}
.wc-waveform span:nth-child(22n + 17) {
  height: 14px;
}
.wc-waveform span:nth-child(22n + 18) {
  height: 20px;
}
.wc-waveform span:nth-child(22n + 19) {
  height: 10px;
}
.wc-waveform span:nth-child(22n + 20) {
  height: 16px;
}
.wc-waveform span:nth-child(22n + 21) {
  height: 8px;
}
.wc-waveform span:nth-child(22n + 22) {
  height: 5px;
}

/* Barras ya reproducidas */
.wc-waveform span.wc-bar-done {
  background: var(--rasp);
}

/* Animación mientras suena */
@keyframes wcBar {
  0%,
  100% {
    transform: scaleY(1);
  }
  50% {
    transform: scaleY(0.35);
  }
}
.wc-waveform.wc-playing span {
  animation: wcBar 0.8s ease-in-out infinite;
}
.wc-waveform.wc-playing span:nth-child(odd) {
  animation-delay: 0s;
}
.wc-waveform.wc-playing span:nth-child(even) {
  animation-delay: 0.4s;
}
.wc-waveform.wc-playing span:nth-child(3n) {
  animation-delay: 0.2s;
}
.wc-waveform.wc-playing span.wc-bar-done {
  background: var(--rasp);
}

.wc-audio-meta {
  position: absolute;
  right: 8px;
  bottom: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.wc-timer {
  font-size: 11px;
  color: #8a7080;
  letter-spacing: 0.02em;
}
.wc-time {
  font-size: 11px;
  color: #8a7080;
  letter-spacing: 0.02em;
}

/* Burbuja link final */
.wc-bubble-link {
  cursor: pointer;
}
.wc-link-msg {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--wc-bubble-in);
  border-radius: 0 8px 8px 8px;
  padding: 8px 10px 22px 10px;
  color: var(--soft);
  font-size: 14px;
  line-height: 1.55;
  max-width: 100%;
}
.wc-link-msg:hover {
  background: #241a21;
}
.wc-link-icon {
  font-size: 16px;
  flex-shrink: 0;
  margin-top: 1px;
}
.wc-link-text {
  padding-right: 28px;
}
.wc-link-msg em {
  color: var(--rasp);
  font-style: normal;
}
.wc-link-msg .wc-time {
  position: absolute;
  right: 8px;
  bottom: 4px;
}

/* Barra inferior */
.wc-bar {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 6px 8px;
  background: var(--wc-input-bg);
  border-top: 1px solid var(--wc-header-border);
  flex-shrink: 0;
  padding-bottom: max(8px, calc(var(--safe-bottom) + 6px));
}
.wc-bar-field {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--wc-input-field);
  border-radius: 24px;
  padding: 8px 12px;
  min-height: 44px;
}
.wc-bar-emoji,
.wc-bar-attach,
.wc-bar-camera {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--wc-icon-muted);
}
.wc-bar-emoji svg,
.wc-bar-attach svg,
.wc-bar-camera svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}
.wc-bar-input {
  flex: 1;
  font-size: 15px;
  color: #6a5560;
  line-height: 1.2;
}
.wc-bar-mic {
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 50%;
  background: var(--rasp);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 0;
  box-shadow: 0 2px 8px var(--rasp-glow);
}
.wc-bar-mic svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

/* ════════════════════════════════════════════════
     STORY CTA — overlay final sobre la última story
  ════════════════════════════════════════════════ */
#story-cta-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.92) 0%,
    rgba(0, 0, 0, 0.4) 55%,
    transparent 100%
  );
  opacity: 0;
  transition: opacity 0.7s ease;
  pointer-events: none;
}
#story-cta-overlay.show {
  opacity: 1;
  pointer-events: all;
}

.st-cta-box {
  width: 100%;
  max-width: min(480px, 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: clamp(20px, 5vw, 32px) var(--pad-x)
    max(28px, calc(var(--safe-bottom) + 20px));
  gap: 10px;
  box-sizing: border-box;
}

.st-cta-label {
  font-size: clamp(18px, 4.5vw, 24px);
  font-weight: 700;
  color: var(--white);
  line-height: 1.3;
}

.st-cta-sub {
  font-size: clamp(13px, 3vw, 16px);
  color: rgba(255, 255, 255, 0.65);
  margin-bottom: 6px;
}

.st-cta-btn {
  display: inline-block;
  width: 100%;
  padding: 16px 24px;
  background: var(--rasp);
  color: #fff;
  font-family: var(--mono);
  font-size: clamp(13px, 3vw, 15px);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-decoration: none;
  border-radius: 4px;
  text-align: center;
  box-shadow: 0 0 28px var(--rasp-glow);
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease;
}
.st-cta-btn:active {
  transform: scale(0.97);
  box-shadow: 0 0 14px var(--rasp-glow);
}

.st-cta-note {
  font-size: clamp(11px, 2.2vw, 13px);
  color: rgba(255, 255, 255, 0.3);
  line-height: 1.8;
  font-style: italic;
  margin-top: 4px;
}

/* ════════════════════════════════════════════════
     S2 — AVATAR AUDIO PLAYER
  ════════════════════════════════════════════════ */
/* Fondo cinematográfico con viñeta */
.avm-bg {
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse at 50% 50%, #1a0d14 0%, #000 70%);
  z-index: 0;
}

/* Tarjeta central — centrada en ambos ejes */
.avm-card {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  width: 100%;
  max-width: min(400px, 100%);
  text-align: center;
  flex-shrink: 0;
}

/* Avatar circular con SVG ring */
.avm-avatar-wrap {
  position: relative;
  width: 120px;
  height: 120px;
}

.avm-ring-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.avm-ring-track {
  fill: none;
  stroke: rgba(212, 0, 90, 0.15);
  stroke-width: 4;
}

.avm-ring-fill {
  fill: none;
  stroke: var(--rasp);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-dasharray: 339.3; /* 2π × 54 */
  stroke-dashoffset: 339.3;
  transition: stroke-dashoffset 0.4s linear;
  filter: drop-shadow(0 0 6px var(--rasp));
}

.avm-avatar {
  position: absolute;
  inset: 10px;
  width: calc(100% - 20px);
  height: calc(100% - 20px);
  border-radius: 50%;
  object-fit: cover;
  object-position: top center;
  background: #1a0d14;
  display: block;
}

/* Fase intro */
#avm-intro {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

/* Texto "tiene algo por contarte" */
.avm-teaser {
  font-size: clamp(13px, 2.6vw, 15px);
  color: var(--muted);
  letter-spacing: 0.04em;
  margin-top: -6px;
  font-style: italic;
}

/* Botón intro */
.avm-btn-intro {
  margin-top: 6px;
}

/* Ring pulsante en el intro */
@keyframes avmPulse {
  0%,
  100% {
    opacity: 0.5;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.04);
  }
}
.avm-pulse {
  animation: avmPulse 2s ease-in-out infinite;
}

/* Botón player — oculto hasta que termina el video */
.avm-btn {
  opacity: 0;
  transform: translateY(10px);
  transition:
    opacity 0.6s ease,
    transform 0.6s ease;
  pointer-events: none;
  margin-top: 8px;
}
.avm-btn.in {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}
#s2 .avm-btn.in {
  position: fixed;
  bottom: var(--anchor-bottom);
  left: 50%;
  transform: translateX(-50%);
  margin-top: 0;
  z-index: 150;
}
#s2 .avm-btn.in:hover {
  transform: translateX(-50%) translateY(-2px);
}
#s2 .avm-btn.in:active {
  transform: translateX(-50%) translateY(0);
}

/* Nombre y subtítulo */
.avm-name {
  font-size: clamp(13px, 2.8vw, 16px);
  font-weight: 700;
  color: var(--white);
  letter-spacing: 0.04em;
  margin-top: 4px;
}
.avm-sub {
  font-size: clamp(11px, 2.2vw, 13px);
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: -8px;
}

/* Timer */
.avm-timer {
  font-family: "Courier New", monospace;
  font-size: clamp(12px, 2.4vw, 14px);
  color: var(--rasp);
  letter-spacing: 0.12em;
}

/* Waveform */
.avm-wave {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: nowrap;
  gap: clamp(2px, 0.8vw, 3px);
  height: 40px;
  width: 100%;
  max-width: min(300px, 92vw);
  overflow: hidden;
}

.avm-wave span {
  display: block;
  width: 3px;
  border-radius: 2px;
  background: var(--rasp);
  opacity: 0.35;
  height: 6px;
  transition:
    height 0.15s ease,
    opacity 0.15s ease;
}

/* Alturas base con patrón de onda natural */
.avm-wave span:nth-child(1) {
  height: 8px;
}
.avm-wave span:nth-child(2) {
  height: 14px;
}
.avm-wave span:nth-child(3) {
  height: 22px;
}
.avm-wave span:nth-child(4) {
  height: 30px;
}
.avm-wave span:nth-child(5) {
  height: 24px;
}
.avm-wave span:nth-child(6) {
  height: 16px;
}
.avm-wave span:nth-child(7) {
  height: 28px;
}
.avm-wave span:nth-child(8) {
  height: 34px;
}
.avm-wave span:nth-child(9) {
  height: 26px;
}
.avm-wave span:nth-child(10) {
  height: 18px;
}
.avm-wave span:nth-child(11) {
  height: 32px;
}
.avm-wave span:nth-child(12) {
  height: 38px;
}
.avm-wave span:nth-child(13) {
  height: 34px;
}
.avm-wave span:nth-child(14) {
  height: 28px;
}
.avm-wave span:nth-child(15) {
  height: 20px;
}
.avm-wave span:nth-child(16) {
  height: 34px;
}
.avm-wave span:nth-child(17) {
  height: 38px;
}
.avm-wave span:nth-child(18) {
  height: 30px;
}
.avm-wave span:nth-child(19) {
  height: 22px;
}
.avm-wave span:nth-child(20) {
  height: 28px;
}
.avm-wave span:nth-child(21) {
  height: 20px;
}
.avm-wave span:nth-child(22) {
  height: 14px;
}
.avm-wave span:nth-child(23) {
  height: 22px;
}
.avm-wave span:nth-child(24) {
  height: 30px;
}
.avm-wave span:nth-child(25) {
  height: 18px;
}
.avm-wave span:nth-child(26) {
  height: 12px;
}
.avm-wave span:nth-child(27) {
  height: 8px;
}
.avm-wave span:nth-child(28) {
  height: 6px;
}

/* Estado activo — animación de ondas */
@keyframes avmBar {
  0%,
  100% {
    transform: scaleY(1);
  }
  50% {
    transform: scaleY(0.3);
  }
}

.avm-wave.playing span {
  opacity: 0.9;
  animation: avmBar 0.9s ease-in-out infinite;
}
.avm-wave.playing span:nth-child(odd) {
  animation-delay: 0s;
}
.avm-wave.playing span:nth-child(even) {
  animation-delay: 0.45s;
}
.avm-wave.playing span:nth-child(3n) {
  animation-delay: 0.22s;
}
.avm-wave.playing span:nth-child(4n) {
  animation-delay: 0.67s;
}

/* ════════════════════════════════════════════════
   RESPONSIVE — mobile-first, pantallas cortas/estrechas
  ════════════════════════════════════════════════ */

/* Pantallas muy estrechas */
@media (max-width: 360px) {
  :root {
    --btn-w: min(100%, 260px);
  }
  .wc-hbtn {
    width: 36px;
    height: 36px;
  }
  .wc-name {
    font-size: 15px;
  }
  .opt {
    padding: 12px 14px;
  }
}

/* Altura reducida (móvil horizontal, iPhone SE, barras del navegador) */
@media (max-height: 700px) {
  #msg-time {
    font-size: clamp(40px, 12vw, 64px);
  }
  #s1 {
    padding: 32px var(--pad-x);
  }
  .tl.sp {
    height: 8px;
  }
  .avm-avatar-wrap {
    width: 96px;
    height: 96px;
  }
  .avm-wave {
    height: 28px;
    max-width: min(260px, 88vw);
  }
  .avm-card {
    gap: 10px;
  }
  #s3 {
    gap: 12px;
  }
  .opts {
    gap: 8px;
  }
}

@media (max-height: 560px) {
  #msg-scene {
    gap: 4px;
    padding-top: max(6px, var(--safe-top));
    padding-bottom: max(6px, calc(var(--safe-bottom) + 6px));
  }
  #msg-card {
    padding: 12px 14px 10px;
    gap: 8px;
  }
  #msg-bubble-wrap,
  #msg-open {
    margin-left: 48px;
  }
  .avm-avatar-wrap {
    width: 80px;
    height: 80px;
  }
  .avm-wave span {
    width: 2px;
  }
  .happy-unlock-card {
    padding: 20px 18px;
  }
}

/* Landscape en móvil */
@media (max-height: 500px) and (orientation: landscape) {
  .screen:not(.overy):not(#s5):not(#s6):not(#s9) {
    padding: 12px var(--pad-x);
    overflow-y: auto;
    justify-content: flex-start;
  }
  #s1 {
    padding-top: 12px;
  }
  #s3.overy,
  #s8.overy {
    padding-top: 12px;
    padding-bottom: calc(var(--safe-bottom) + 64px);
  }
  .btn-anchor,
  #s2 .avm-btn.in {
    bottom: max(12px, var(--safe-bottom));
  }
  #msg-time {
    font-size: clamp(32px, 10vw, 48px);
  }
}

/* Pantallas muy bajas: scroll interno en vez de recorte */
@media (max-height: 620px) {
  #s0,
  #s1,
  #s2 {
    overflow-y: auto;
    justify-content: flex-start;
  }
  #s3 {
    padding-bottom: var(--anchor-reserve);
  }
}

/* Tablets y escritorio — contenido centrado sin estirarse de más */
@media (min-width: 768px) {
  .screen.overy {
    padding-left: max(var(--pad-x), calc(50% - 240px));
    padding-right: max(var(--pad-x), calc(50% - 240px));
  }
  /* Videos verticales: columna tipo móvil para no recortar en landscape */
  #s4.screen,
  #s5.screen,
  #s6.screen {
    max-width: min(480px, 100%);
    left: 50%;
    right: auto;
    width: min(480px, calc(100% - var(--safe-left) - var(--safe-right)));
    height: 100%;
    max-height: var(--app-height-px, var(--app-height));
    transform: translateX(-50%);
  }
  #s6.screen {
    border-left: 1px solid var(--wc-header-border);
    border-right: 1px solid var(--wc-header-border);
  }
  #s9 .story-shell {
    max-width: 480px;
    left: 50%;
    right: auto;
    width: min(480px, calc(100% - var(--safe-left) - var(--safe-right)));
    transform: translateX(-50%);
  }
  .av-full,
  .hv,
  .st-vid {
    object-fit: contain;
    object-position: center center;
    background: #000;
  }
}
