/* ============================================================
   DeliveryX — Paleta SOLO aqua + morado (colores del logo)
   ============================================================ */

:root {
  /* Aqua */
  --aqua: #2DD4BF;
  --aqua-deep: #14B8A6;
  --aqua-soft: #CCFBF1;
  --aqua-tint: #ECFEFF;

  /* Morado */
  --purple: #7C3AED;
  --purple-deep: #5B21B6;
  --purple-soft: #E9D5FF;
  --purple-tint: #F5F0FF;
  --purple-light: #A78BFA;

  /* Oscuros */
  --navy: #1E1B4B;
  --navy-deep: #0F0E1A;

  /* Neutros */
  --text: #0F172A;
  --text-muted: #64748B;
  --text-soft: #94A3B8;
  --slate-50: #F8FAFC;
  --slate-100: #F1F5F9;
  --border: #ECECEC;

  /* Gradientes (solo aqua → morado del logo) */
  --grad: linear-gradient(135deg, #2DD4BF 0%, #7C3AED 100%);
  --grad-bg-dark: radial-gradient(ellipse 800px 600px at 85% -10%, rgba(124, 58, 237, 0.5), transparent 60%),
                  radial-gradient(ellipse 700px 500px at 0% 100%, rgba(45, 212, 191, 0.4), transparent 60%),
                  linear-gradient(135deg, #0F0E1A 0%, #1E1B4B 55%, #2E1065 100%);

  /* Tipografía */
  --font-display: 'Plus Jakarta Sans', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--text);
  background: #fff;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

h1, h2, h3, h4, h5 {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.1;
  margin: 0;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Gradiente para palabras clave */
.grad-text {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

/* ============================================================
   BOTONES
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.98rem;
  transition: transform 0.2s, box-shadow 0.2s;
  border: none;
  cursor: pointer;
  white-space: nowrap;
}
.btn-primary {
  background: var(--grad);
  color: #fff;
  box-shadow: 0 0 40px rgba(124, 58, 237, 0.45), 0 12px 28px rgba(45, 212, 191, 0.25);
}
.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 0 60px rgba(124, 58, 237, 0.65), 0 18px 36px rgba(45, 212, 191, 0.35);
}
.btn-outline {
  background: transparent;
  color: var(--purple-deep);
  border: 2px solid var(--purple-soft);
}
.btn-outline:hover { background: var(--purple-tint); border-color: var(--purple); }

.btn-dark-outline {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #fff;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.btn-dark-outline:hover { background: rgba(255, 255, 255, 0.14); border-color: rgba(255, 255, 255, 0.3); }

.btn-sm { padding: 10px 20px; font-size: 0.88rem; }
.btn-lg { padding: 16px 32px; font-size: 1.04rem; }

/* ============================================================
   HEADER / NAVEGACIÓN
   ============================================================ */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.88);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.25rem;
}
.brand img { width: 38px; height: 38px; object-fit: contain; }
.brand em {
  font-style: normal;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.nav-links { display: flex; gap: 32px; }
.nav-links a {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-muted);
  transition: color 0.2s;
  position: relative;
}
.nav-links a:hover { color: var(--purple); }
.nav-links a.active { color: var(--text); }
.nav-links a.active::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -8px;
  height: 3px;
  border-radius: 999px;
  background: var(--grad);
}

.menu-toggle { display: none; }

/* ============================================================
   HERO (oscuro dramático)
   ============================================================ */
.hero {
  position: relative;
  overflow: hidden;
  padding: 100px 0 160px;
  background: var(--grad-bg-dark);
  color: #fff;
}
.hero-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(110px);
  z-index: 0;
  pointer-events: none;
  opacity: 0.6;
}
.hero-glow.purple { width: 520px; height: 520px; background: var(--purple); top: -150px; right: -120px; }
.hero-glow.aqua   { width: 440px; height: 440px; background: var(--aqua); bottom: -100px; left: -100px; }

.hero-pattern {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 56px 56px;
  z-index: 0;
  pointer-events: none;
  -webkit-mask-image: radial-gradient(ellipse at center, black 40%, transparent 80%);
  mask-image: radial-gradient(ellipse at center, black 40%, transparent 80%);
}

.hero-inner {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 60px;
  align-items: center;
  position: relative;
  z-index: 2;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.92);
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 24px;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.chip-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--aqua);
  box-shadow: 0 0 14px rgba(45, 212, 191, 0.95);
}

.hero h1 {
  font-size: clamp(2.4rem, 5.5vw, 4.2rem);
  color: #fff;
  line-height: 1.05;
  margin-bottom: 24px;
}
.hero-lead {
  font-size: 1.12rem;
  color: rgba(255, 255, 255, 0.72);
  max-width: 540px;
  margin: 0 0 36px;
}
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }

/* ============================================================
   DEVICE MOCKUP (dashboard)
   ============================================================ */
.device {
  position: relative;
  max-width: 420px;
  margin: 0 auto;
  z-index: 2;
}
.device-shell {
  position: relative;
  background: linear-gradient(180deg, #1A1730 0%, #0F0E1A 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 28px;
  padding: 24px;
  box-shadow:
    0 0 80px rgba(124, 58, 237, 0.45),
    0 0 60px rgba(45, 212, 191, 0.22),
    0 40px 80px rgba(0, 0, 0, 0.55);
}
.device-shell::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 30px;
  background: linear-gradient(135deg, rgba(45, 212, 191, 0.5), rgba(124, 58, 237, 0.5));
  z-index: -1;
  filter: blur(10px);
  opacity: 0.7;
}

.device-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.device-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 800;
  color: #fff;
  font-size: 0.95rem;
}
.device-logo-mark {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--grad);
  box-shadow: 0 0 14px rgba(124, 58, 237, 0.6);
}
.device-time { color: rgba(255, 255, 255, 0.4); font-size: 0.82rem; font-variant-numeric: tabular-nums; }

.device-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}
.device-stat {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 10px 8px;
  text-align: center;
}
.device-stat strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 800;
  color: #fff;
}
.device-stat span {
  display: block;
  font-size: 0.66rem;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.device-stat.accent strong { color: var(--aqua); }

.device-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.device-card-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.4), rgba(45, 212, 191, 0.4));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}
.device-card-text { flex: 1; min-width: 0; }
.device-card-text strong {
  display: block;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 700;
  font-family: var(--font-display);
}
.device-card-text span {
  display: block;
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.76rem;
  margin-top: 2px;
}
.device-badge {
  background: rgba(45, 212, 191, 0.15);
  color: #5EEAD4;
  border: 1px solid rgba(45, 212, 191, 0.4);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.66rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.device-progress {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.device-progress-label {
  font-size: 0.74rem;
  color: rgba(255, 255, 255, 0.6);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.device-progress-pct {
  font-family: var(--font-display);
  font-weight: 800;
  color: var(--aqua);
  font-size: 0.86rem;
}
.device-bar {
  height: 6px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 16px;
}
.device-bar-fill {
  height: 100%;
  width: 78%;
  background: var(--grad);
  border-radius: 999px;
  box-shadow: 0 0 12px rgba(45, 212, 191, 0.6);
}

.device-btn {
  width: 100%;
  background: var(--grad);
  color: #fff;
  border: none;
  padding: 12px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.9rem;
  font-family: var(--font-display);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 10px 26px rgba(124, 58, 237, 0.4);
}

/* Pills flotantes alrededor del mockup */
.mock-float {
  position: absolute;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(26, 23, 48, 0.85);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 9px 15px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  color: #fff;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
  z-index: 3;
  white-space: nowrap;
}
.mock-float-dot { width: 8px; height: 8px; border-radius: 50%; }
.mock-float-dot.aqua { background: var(--aqua); box-shadow: 0 0 10px var(--aqua); }
.mock-float-dot.purple { background: var(--purple-light); box-shadow: 0 0 10px var(--purple-light); }

.mock-float.top { top: 8%; left: -50px; animation: float 6s ease-in-out infinite; }
.mock-float.bottom { bottom: 12%; right: -50px; animation: float 6s ease-in-out infinite 1s; }
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

/* ============================================================
   SECCIÓN: PROBLEMA
   ============================================================ */
.section { padding: 100px 0; position: relative; }
.section-light { background: #FFFFFF; }
.section-tint { background: linear-gradient(180deg, var(--purple-tint) 0%, var(--aqua-tint) 100%); }
.section-dark {
  background: var(--grad-bg-dark);
  color: #fff;
  position: relative;
  overflow: hidden;
}

.section-head {
  text-align: center;
  max-width: 760px;
  margin: 0 auto 60px;
}
.eyebrow {
  display: inline-block;
  background: var(--purple-tint);
  color: var(--purple-deep);
  padding: 6px 16px;
  border-radius: 999px;
  font-family: var(--font-display);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 22px;
}
.eyebrow.aqua {
  background: var(--aqua-soft);
  color: #0F766E;
}
.section h2 {
  font-size: clamp(1.9rem, 4vw, 2.8rem);
  margin-bottom: 16px;
}
.section-sub {
  color: var(--text-muted);
  font-size: 1.08rem;
  margin: 0;
}

/* Problema — bullets de dolor con icono X */
.pain-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
  max-width: 920px;
  margin: 0 auto;
}
.pain-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: #FFFFFF;
  border: 1px solid var(--border);
  padding: 18px 20px;
  border-radius: 14px;
  transition: transform 0.25s, box-shadow 0.25s;
}
.pain-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 40px rgba(124, 58, 237, 0.12);
}
.pain-icon {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--purple-soft);
  color: var(--purple-deep);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
}
.pain-item p {
  margin: 0;
  font-size: 0.96rem;
  color: var(--text);
  font-weight: 500;
}

/* ============================================================
   PROPUESTA DE VALOR — 4 cards
   ============================================================ */
.value-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}
.value-card {
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 32px 28px;
  transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s;
  position: relative;
}
.value-card:hover {
  transform: translateY(-6px);
  border-color: rgba(124, 58, 237, 0.22);
  box-shadow: 0 30px 60px rgba(124, 58, 237, 0.15);
}
.value-icon {
  width: 60px;
  height: 60px;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  margin-bottom: 20px;
}
.value-icon.aqua {
  background: linear-gradient(135deg, var(--aqua), var(--aqua-deep));
  box-shadow: 0 14px 30px rgba(45, 212, 191, 0.4);
}
.value-icon.purple {
  background: linear-gradient(135deg, var(--purple-light), var(--purple));
  box-shadow: 0 14px 30px rgba(124, 58, 237, 0.4);
}
.value-card h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 10px;
}
.value-card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.98rem;
}

/* ============================================================
   MÓDULOS — bloques alternados (zigzag)
   ============================================================ */
.module {
  display: grid;
  grid-template-columns: 1fr 1.05fr;
  gap: 70px;
  align-items: center;
  padding: 60px 0;
}
.module:nth-child(even) .module-visual { order: -1; }
.module-tag {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 14px;
}
.module-tag.aqua { color: var(--aqua-deep); }
.module-tag.purple { color: var(--purple-deep); }
.module h3 {
  font-size: clamp(1.7rem, 3vw, 2.2rem);
  margin-bottom: 14px;
}
.module-desc {
  color: var(--text-muted);
  font-size: 1.04rem;
  margin: 0 0 24px;
}
.module-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 18px;
}
.module-list li {
  position: relative;
  padding-left: 26px;
  color: var(--text);
  font-size: 0.93rem;
  line-height: 1.45;
}
.module-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 4px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--aqua-soft);
}
.module-list li::after {
  content: '✓';
  position: absolute;
  left: 3px;
  top: 2px;
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--aqua-deep);
}

/* Visual del módulo — caja decorada con icon + textos sample */
.module-visual {
  position: relative;
}
.module-card {
  position: relative;
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 28px;
  box-shadow: 0 30px 60px rgba(124, 58, 237, 0.12), 0 0 50px rgba(45, 212, 191, 0.08);
}
.module-card::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 24px;
  background: var(--grad);
  z-index: -1;
  filter: blur(14px);
  opacity: 0.35;
}
.module-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.module-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--grad);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}
.module-card-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.95rem;
}
.module-card-meta { color: var(--text-soft); font-size: 0.78rem; }
.module-rows { display: flex; flex-direction: column; gap: 10px; }
.module-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: var(--slate-50);
  border-radius: 10px;
  font-size: 0.86rem;
}
.module-row-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.module-row-dot.aqua { background: var(--aqua); box-shadow: 0 0 8px var(--aqua); }
.module-row-dot.purple { background: var(--purple); box-shadow: 0 0 8px var(--purple); }
.module-row-dot.muted { background: var(--text-soft); }
.module-row-label { flex: 1; color: var(--text); font-weight: 600; }
.module-row-val { color: var(--text-muted); font-size: 0.78rem; }
.module-row-tag {
  background: var(--aqua-soft);
  color: var(--aqua-deep);
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.module-row-tag.purple { background: var(--purple-soft); color: var(--purple-deep); }

/* ============================================================
   FLUJO OPERATIVO (timeline horizontal con 7 steps)
   ============================================================ */
.flow-timeline {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 12px;
  position: relative;
  margin-top: 30px;
}
.flow-timeline::before {
  content: '';
  position: absolute;
  top: 36px;
  left: 6%;
  right: 6%;
  height: 3px;
  background: linear-gradient(90deg, var(--aqua), var(--purple));
  border-radius: 999px;
  z-index: 0;
  opacity: 0.4;
}
.flow-step {
  text-align: center;
  position: relative;
  z-index: 1;
}
.flow-step-circle {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: #FFFFFF;
  border: 3px solid var(--purple-soft);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.5rem;
  margin-bottom: 14px;
  color: var(--purple-deep);
  box-shadow: 0 12px 24px rgba(124, 58, 237, 0.15);
  transition: transform 0.25s;
}
.flow-step:nth-child(odd) .flow-step-circle {
  background: var(--grad);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 14px 30px rgba(124, 58, 237, 0.35);
}
.flow-step:hover .flow-step-circle { transform: scale(1.08); }
.flow-step-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.92rem;
  margin-bottom: 4px;
  color: var(--text);
}
.flow-step-desc {
  color: var(--text-muted);
  font-size: 0.78rem;
  line-height: 1.4;
}

/* ============================================================
   BENEFICIOS — 6 mini-cards
   ============================================================ */
.benefits-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.benefit {
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px 22px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  transition: transform 0.25s, box-shadow 0.25s;
}
.benefit:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(124, 58, 237, 0.12);
}
.benefit-icon {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--aqua-soft);
  color: var(--aqua-deep);
  display: flex;
  align-items: center;
  justify-content: center;
}
.benefit:nth-child(even) .benefit-icon {
  background: var(--purple-soft);
  color: var(--purple-deep);
}
.benefit-text strong {
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 4px;
}
.benefit-text span { color: var(--text-muted); font-size: 0.9rem; }

/* ============================================================
   ROLES — 4 cards de persona
   ============================================================ */
.roles-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}
.role {
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 26px 22px;
  text-align: center;
  transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
}
.role:hover {
  transform: translateY(-5px);
  border-color: rgba(124, 58, 237, 0.22);
  box-shadow: 0 24px 50px rgba(124, 58, 237, 0.15);
}
.role-avatar {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: var(--grad);
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.4rem;
  box-shadow: 0 14px 28px rgba(124, 58, 237, 0.35);
}
.role h4 {
  font-size: 1.05rem;
  margin-bottom: 8px;
}
.role p { color: var(--text-muted); font-size: 0.9rem; margin: 0; }

/* ============================================================
   CTA FINAL (gradiente fuerte)
   ============================================================ */
.final-cta {
  background: var(--grad);
  border-radius: 32px;
  padding: 60px 48px;
  text-align: center;
  color: #fff;
  position: relative;
  overflow: hidden;
  box-shadow:
    0 0 80px rgba(124, 58, 237, 0.45),
    0 30px 60px rgba(45, 212, 191, 0.3),
    0 15px 30px rgba(0, 0, 0, 0.15);
}
.final-cta::before {
  content: '';
  position: absolute;
  top: -40px;
  right: -40px;
  width: 320px;
  height: 320px;
  background-image: radial-gradient(circle, rgba(255, 255, 255, 0.3) 1.5px, transparent 1.7px);
  background-size: 20px 20px;
  border-radius: 50%;
  -webkit-mask-image: radial-gradient(circle, black 50%, transparent 80%);
  mask-image: radial-gradient(circle, black 50%, transparent 80%);
  pointer-events: none;
}
.final-cta h2 {
  font-size: clamp(1.8rem, 3.6vw, 2.6rem);
  color: #fff;
  margin-bottom: 14px;
}
.final-cta p {
  color: rgba(255, 255, 255, 0.85);
  font-size: 1.08rem;
  margin: 0 auto 32px;
  max-width: 560px;
}
.final-cta .btn-primary {
  background: #fff;
  color: var(--purple-deep);
  box-shadow: 0 0 30px rgba(255, 255, 255, 0.5), 0 14px 30px rgba(0, 0, 0, 0.25);
}
.final-cta .btn-primary:hover {
  box-shadow: 0 0 40px rgba(255, 255, 255, 0.7), 0 18px 40px rgba(0, 0, 0, 0.35);
}

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  background: var(--navy-deep);
  color: rgba(255, 255, 255, 0.7);
  padding: 50px 0 30px;
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.brand-dark { color: #fff; }
.brand-dark em {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.footer-links { display: flex; gap: 24px; flex-wrap: wrap; }
.footer-links a {
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.92rem;
  transition: color 0.2s;
}
.footer-links a:hover { color: var(--aqua); }
.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  margin-top: 30px;
  padding-top: 20px;
  font-size: 0.84rem;
  color: rgba(255, 255, 255, 0.5);
  text-align: center;
}

/* ============================================================
   PÁGINAS INTERNAS — Hero compacto oscuro
   ============================================================ */
.page-hero {
  position: relative;
  overflow: hidden;
  padding: 80px 0 100px;
  background: var(--grad-bg-dark);
  color: #fff;
  text-align: center;
}
.page-hero h1 {
  color: #fff;
  font-size: clamp(2.2rem, 4.6vw, 3.4rem);
  max-width: 880px;
  margin: 0 auto 18px;
}
.page-hero .hero-lead {
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

/* ============================================================
   INFORMACIÓN DE CONTACTO
   ============================================================ */
.contact-wrap {
  max-width: 900px;
  margin: 0 auto;
}

.contact-info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}
.contact-card {
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 22px;
  display: flex;
  gap: 14px;
  align-items: center;
}
.contact-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--grad);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 12px 24px rgba(124, 58, 237, 0.3);
}
.contact-card strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1rem;
}
.contact-card a, .contact-card span { color: var(--text-muted); font-size: 0.9rem; }

/* ============================================================
   DEMO — journey de paquete (animado)
   ============================================================ */
.journey {
  background: linear-gradient(180deg, var(--purple-tint) 0%, var(--aqua-tint) 100%);
  border-radius: 32px;
  padding: 60px 40px;
  position: relative;
  overflow: hidden;
}
.journey-track { position: relative; padding: 50px 30px 20px; }
.journey-line {
  position: absolute;
  top: 88px;
  left: 8%;
  right: 8%;
  height: 6px;
  background: rgba(124, 58, 237, 0.15);
  border-radius: 999px;
}
.journey-progress {
  position: absolute;
  top: 88px;
  left: 8%;
  height: 6px;
  background: var(--grad);
  border-radius: 999px;
  width: 0;
  transition: width 0.7s ease;
  box-shadow: 0 4px 14px rgba(124, 58, 237, 0.4);
}
.journey-package {
  position: absolute;
  top: 56px;
  left: 8%;
  font-size: 2.4rem;
  transform: translateX(-50%);
  transition: left 0.7s ease;
  z-index: 3;
  filter: drop-shadow(0 8px 12px rgba(0, 0, 0, 0.15));
}
.stations {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  position: relative;
  z-index: 2;
  padding-top: 60px;
}
.station {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}
.station-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
  border: 3px solid #fff;
  transition: all 0.35s;
}
.station.active .station-icon {
  background: var(--grad);
  color: #fff;
  transform: scale(1.12);
  box-shadow: 0 0 0 8px rgba(124, 58, 237, 0.16), 0 8px 22px rgba(124, 58, 237, 0.4);
}
.station-label {
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--text-muted);
}
.station.active .station-label { color: var(--text); }

.journey-panel {
  margin: 40px auto 24px;
  max-width: 580px;
  background: #fff;
  border-radius: 20px;
  padding: 28px;
  text-align: center;
  box-shadow: 0 20px 40px rgba(124, 58, 237, 0.12);
}
.journey-panel-emoji { font-size: 2.4rem; margin-bottom: 8px; }
.journey-panel h3 { font-size: 1.25rem; margin-bottom: 6px; }
.journey-panel p { color: var(--text-muted); margin: 0; }

.journey-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 8px;
}
.ctrl-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #fff;
  border: none;
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--purple);
  box-shadow: 0 6px 14px rgba(124, 58, 237, 0.15);
}
.journey-dots { display: flex; gap: 8px; }
.journey-dots span {
  width: 8px; height: 8px; border-radius: 50%;
  background: rgba(124, 58, 237, 0.25);
  cursor: pointer;
}
.journey-dots span.active { width: 28px; border-radius: 999px; background: var(--grad); }

/* ============================================================
   DEMO · JUEGO DE 7 NIVELES (escenarios + preguntas)
   ============================================================ */
.show-section { padding: 50px 0 100px; }

.show {
  max-width: 1100px;
  margin: 0 auto;
  background: #FFFFFF;
  border-radius: 28px;
  box-shadow:
    0 0 80px rgba(124, 58, 237, 0.18),
    0 30px 60px rgba(45, 212, 191, 0.12),
    0 0 0 1px var(--border);
  overflow: hidden;
}

/* Header con progreso */
.show-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 28px;
  background: linear-gradient(90deg, var(--navy-deep), var(--navy));
  color: #fff;
  gap: 20px;
  flex-wrap: wrap;
}
.show-progress { flex: 1; min-width: 240px; }
.show-stage-label {
  display: block;
  font-family: var(--font-display);
  font-size: 0.92rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 8px;
}
.show-stage-label strong { color: #fff; }
.show-stage-label span { color: var(--aqua); }
.show-progress-bar {
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  overflow: hidden;
}
.show-progress-fill {
  height: 100%;
  width: 14%;
  background: var(--grad);
  border-radius: 999px;
  box-shadow: 0 0 14px rgba(45, 212, 191, 0.6);
  transition: width 0.5s ease;
}

/* Score (videogame style) */
.show-score-block {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  padding: 10px 18px;
  border-radius: 999px;
  font-family: var(--font-display);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.show-score-star { font-size: 1.2rem; filter: drop-shadow(0 0 8px rgba(251, 191, 36, 0.8)); }
.show-score-block strong {
  font-size: 1.3rem;
  font-weight: 800;
  color: #FBBF24;
  transition: transform 0.4s cubic-bezier(0.5, -0.5, 0.5, 1.5);
}
.show-score-block strong.bump { transform: scale(1.4); }
.show-score-max { font-size: 0.85rem; color: rgba(255, 255, 255, 0.55); }

.show-skip-btn {
  margin-left: 12px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 6px 14px;
  border-radius: 8px;
  font-family: 'Courier New', monospace;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.05em;
  transition: background 0.15s, color 0.15s, transform 0.1s;
}
.show-skip-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}
.show-skip-btn:active { transform: translateY(1px); }

/* Viewer con dos capas (crossfade) */
.show-viewer {
  position: relative;
  width: 100%;
  height: 380px;
  overflow: hidden;
  background: #E0F2FE;
}

/* ============================================================
   Pixel-art platformer viewer
   ============================================================ */
.pixel-viewer {
  background: #0B0A1F;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  border-bottom: 4px solid #1E1B4B;
  box-shadow: inset 0 -8px 0 rgba(0,0,0,0.4);
  /* Mantener proporción del canvas (480x216 = 2.22:1) en cualquier ancho */
  aspect-ratio: 480 / 216;
  height: auto;
}
.pixel-viewer canvas {
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  -ms-interpolation-mode: nearest-neighbor;
  background: #0B0A1F;
}

/* Intro overlay antes de cada nivel */
.px-intro {
  position: absolute;
  inset: 0;
  background: rgba(11, 10, 31, 0.85);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 12;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.px-intro.show { opacity: 1; pointer-events: auto; }
.px-intro-box {
  text-align: center;
  color: #fff;
  padding: 28px 42px;
  border: 3px solid #2DD4BF;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(124,58,237,0.4), rgba(45,212,191,0.2));
  box-shadow:
    0 0 0 3px #0B0A1F,
    0 0 40px rgba(45, 212, 191, 0.5),
    0 0 80px rgba(124, 58, 237, 0.4);
  font-family: 'Courier New', 'Consolas', monospace;
  max-width: 92%;
}
.px-intro-title {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: 0.2em;
  color: #FBBF24;
  text-shadow: 2px 2px 0 #92400E, 0 0 18px rgba(251,191,36,0.6);
  margin-bottom: 6px;
}
.px-intro-sub {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 18px;
  color: #fff;
  text-shadow: 2px 2px 0 #1E1B4B;
}
.px-intro-keys {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 18px;
  font-size: 0.85rem;
  color: #C4B5FD;
  flex-wrap: wrap;
}
.px-key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  padding: 0 6px;
  background: #1E1B4B;
  border: 2px solid #7C3AED;
  border-radius: 4px;
  color: #fff;
  font-weight: 800;
  box-shadow: 0 3px 0 #4C1D95;
  font-size: 0.9rem;
}
.px-sep { color: #7C3AED; }
.px-intro-btn {
  font-family: 'Courier New', 'Consolas', monospace;
  font-weight: 800;
  letter-spacing: 0.18em;
  background: linear-gradient(135deg, #FBBF24, #F97316);
  color: #1E1B4B;
  border: 3px solid #1E1B4B;
  padding: 12px 28px;
  font-size: 1rem;
  cursor: pointer;
  box-shadow: 0 5px 0 #92400E, 0 12px 30px rgba(251, 191, 36, 0.4);
  transition: transform 0.12s, box-shadow 0.12s;
  border-radius: 4px;
}
.px-intro-btn:hover { transform: translateY(-2px); box-shadow: 0 7px 0 #92400E, 0 16px 36px rgba(251,191,36,0.5); }
.px-intro-btn:active { transform: translateY(3px); box-shadow: 0 2px 0 #92400E; }

/* D-pad táctil — sólo visible en touch / móvil */
.px-touch {
  position: absolute;
  inset: auto 0 0 0;
  padding: 12px 16px;
  display: none;
  justify-content: center;
  align-items: flex-end;
  z-index: 11;
  pointer-events: none;
}
.px-touch button {
  pointer-events: auto;
  font-family: 'Courier New', monospace;
  font-weight: 800;
  border: 3px solid #1E1B4B;
  background: linear-gradient(135deg, #7C3AED, #5B21B6);
  color: #fff;
  border-radius: 8px;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 4px 0 rgba(0,0,0,0.4);
  touch-action: manipulation;
}
.px-dpad {
  width: 52px;
  height: 52px;
  font-size: 1.4rem;
}
.px-left { margin-right: 8px; }
.px-jump {
  width: 72px;
  height: 52px;
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  background: linear-gradient(135deg, #FBBF24, #F97316);
  color: #1E1B4B;
}
.px-jump-big {
  width: 140px;
  height: 60px;
  font-size: 1rem;
  letter-spacing: 0.15em;
}
.px-touch button:active { transform: translateY(2px); box-shadow: 0 2px 0 rgba(0,0,0,0.4); }
.px-touch .px-dpad-group {
  display: flex;
}
@media (hover: none) and (pointer: coarse) {
  .px-touch { display: flex; }
}

/* ============================================================
   Pop-ups DENTRO del videojuego (pregunta, feedback, final)
   ============================================================ */
.px-popup {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(11, 10, 31, 0.78);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  z-index: 13;
  opacity: 0;
  pointer-events: none;
  padding: 18px;
  transition: opacity 0.22s ease;
  font-family: 'Courier New', 'Consolas', monospace;
}
.px-popup.show { opacity: 1; pointer-events: auto; }

.px-popup-card {
  width: 100%;
  max-width: 540px;
  max-height: calc(100% - 8px);
  overflow-y: auto;
  background: linear-gradient(135deg, rgba(30, 27, 75, 0.96), rgba(11, 10, 31, 0.96));
  border: 3px solid #2DD4BF;
  border-radius: 6px;
  box-shadow:
    0 0 0 3px #0B0A1F,
    0 0 30px rgba(45, 212, 191, 0.45),
    0 0 60px rgba(124, 58, 237, 0.35);
  color: #fff;
  padding: 18px 22px;
  animation: pxPopIn 0.32s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes pxPopIn {
  0% { transform: scale(0.7) translateY(20px); opacity: 0; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}

.px-popup-header { margin-bottom: 14px; }
.px-popup-tag {
  display: inline-block;
  background: linear-gradient(135deg, #FBBF24, #F97316);
  color: #1E1B4B;
  padding: 3px 10px;
  font-weight: 800;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  border: 2px solid #1E1B4B;
  box-shadow: 0 2px 0 #92400E;
  margin-bottom: 10px;
  border-radius: 3px;
}
.px-popup-question-text {
  font-size: clamp(0.95rem, 2.2vw, 1.2rem);
  font-weight: 800;
  margin: 0;
  line-height: 1.3;
  color: #fff;
  text-shadow: 2px 2px 0 #1E1B4B;
  font-family: 'Plus Jakarta Sans', sans-serif;
}

.px-popup-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.px-popup-opt {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #1E1B4B;
  border: 2px solid #7C3AED;
  color: #fff;
  padding: 10px 14px;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.9rem;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 3px 0 #4C1D95;
  transition: transform 0.1s, background 0.15s, border-color 0.15s;
  border-radius: 3px;
}
.px-popup-opt:hover:not(:disabled) {
  background: #2D2563;
  border-color: #A78BFA;
  transform: translateX(2px);
}
.px-popup-opt:active:not(:disabled) {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #4C1D95;
}
.px-popup-opt-letter {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #2DD4BF, #7C3AED);
  color: #fff;
  font-weight: 800;
  font-size: 0.85rem;
  border: 2px solid #0B0A1F;
  border-radius: 2px;
}
.px-popup-opt-text {
  flex: 1;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
}
.px-popup-opt.correct {
  background: #064E3B;
  border-color: #10B981;
  box-shadow: 0 3px 0 #064E3B, 0 0 20px rgba(16, 185, 129, 0.4);
}
.px-popup-opt.wrong {
  background: #7F1D1D;
  border-color: #EF4444;
  box-shadow: 0 3px 0 #7F1D1D, 0 0 20px rgba(239, 68, 68, 0.4);
}
.px-popup-opt:disabled { cursor: default; opacity: 0.85; }

/* Feedback */
.px-popup-feedback { text-align: center; }
.px-popup-fb-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 800;
  border: 3px solid currentColor;
  border-radius: 50%;
  color: #10B981;
  box-shadow: 0 0 24px currentColor;
}
.px-popup-feedback.wrong .px-popup-fb-icon { color: #EF4444; }
.px-popup-fb-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.2rem;
  margin: 4px 0 8px;
  letter-spacing: 0.08em;
  text-shadow: 2px 2px 0 #1E1B4B;
}
.px-popup-fb-text {
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  color: #C4B5FD;
  margin: 0 0 14px;
  line-height: 1.4;
}
.px-popup-mod {
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  background: rgba(45, 212, 191, 0.1);
  border: 2px solid rgba(45, 212, 191, 0.3);
  padding: 10px 12px;
  margin-bottom: 14px;
  border-radius: 3px;
}
.px-popup-mod-icon { font-size: 1.4rem; flex-shrink: 0; }
.px-popup-mod-info { display: flex; flex-direction: column; font-family: 'Inter', sans-serif; }
.px-popup-mod-info strong { color: #2DD4BF; font-size: 0.85rem; }
.px-popup-mod-info span { color: #C4B5FD; font-size: 0.75rem; }

.px-popup-btn {
  display: inline-block;
  font-family: 'Courier New', monospace;
  font-weight: 800;
  letter-spacing: 0.14em;
  background: linear-gradient(135deg, #FBBF24, #F97316);
  color: #1E1B4B;
  border: 3px solid #1E1B4B;
  padding: 10px 22px;
  font-size: 0.9rem;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 4px 0 #92400E, 0 10px 24px rgba(251, 191, 36, 0.35);
  transition: transform 0.1s, box-shadow 0.1s;
  border-radius: 3px;
}
.px-popup-fallback {
  margin-top: 12px;
  font-size: 0.75rem;
  color: rgba(255,255,255,0.55);
  font-family: 'Inter', sans-serif;
}
.px-popup-link {
  background: none;
  border: none;
  color: #2DD4BF;
  text-decoration: underline;
  cursor: pointer;
  font-size: inherit;
  font-family: inherit;
  padding: 0;
}
.px-popup-link:hover { color: #5EEAD4; }

.px-popup-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 0 #92400E, 0 14px 30px rgba(251, 191, 36, 0.45); }
.px-popup-btn:active { transform: translateY(2px); box-shadow: 0 2px 0 #92400E; }
.px-popup-btn-cta {
  background: linear-gradient(135deg, #2DD4BF, #7C3AED);
  color: #fff;
  box-shadow: 0 4px 0 #0F766E, 0 10px 24px rgba(124, 58, 237, 0.4);
}
.px-popup-btn-cta:hover { box-shadow: 0 6px 0 #0F766E, 0 14px 30px rgba(124, 58, 237, 0.5); }
.px-popup-btn-cta:active { box-shadow: 0 2px 0 #0F766E; }
.px-popup-btn-ghost {
  background: transparent;
  color: #C4B5FD;
  border-color: #7C3AED;
  box-shadow: 0 4px 0 #4C1D95;
}
.px-popup-btn-ghost:hover { background: rgba(124, 58, 237, 0.15); box-shadow: 0 6px 0 #4C1D95; }
.px-popup-btn-ghost:active { box-shadow: 0 2px 0 #4C1D95; }

/* Final */
.px-popup-final { text-align: center; padding-top: 14px; }
.px-popup-trophy {
  font-size: 3rem;
  filter: drop-shadow(0 0 16px rgba(251, 191, 36, 0.7));
  animation: pxTrophyBounce 1.6s ease-in-out infinite;
}
@keyframes pxTrophyBounce {
  0%, 100% { transform: translateY(0) rotate(-4deg); }
  50% { transform: translateY(-6px) rotate(4deg); }
}
.px-popup-final-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.4rem;
  margin: 4px 0 10px;
  letter-spacing: 0.1em;
  background: linear-gradient(135deg, #2DD4BF, #FBBF24);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 2px 2px 0 rgba(30, 27, 75, 0.4);
}
.px-popup-final-score {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  background: #1E1B4B;
  border: 2px solid #FBBF24;
  padding: 6px 16px;
  border-radius: 3px;
  margin-bottom: 8px;
}
.px-popup-final-score strong { font-size: 1.5rem; color: #FBBF24; font-weight: 800; }
.px-popup-final-score span { font-size: 0.75rem; color: #C4B5FD; letter-spacing: 0.1em; font-weight: 700; }
.px-popup-final-stars { font-size: 1.4rem; margin-bottom: 8px; letter-spacing: 0.2em; }
.px-popup-final-stars span { color: #FBBF24; text-shadow: 0 0 8px rgba(251, 191, 36, 0.6); }
.px-popup-final-stars span.dim { color: rgba(124, 58, 237, 0.3); text-shadow: none; }
.px-popup-final-msg {
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  color: #C4B5FD;
  margin: 0 0 12px;
  line-height: 1.4;
}
.px-popup-final-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin-bottom: 14px;
}
.px-popup-final-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(45, 212, 191, 0.15);
  border: 2px solid rgba(45, 212, 191, 0.5);
  padding: 4px 10px;
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 0.75rem;
  color: #2DD4BF;
  border-radius: 3px;
}
.px-popup-final-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

/* Ocultar el panel inferior viejo — todo sucede en el canvas ahora */
.show-panel { display: none; }
.show-dots { display: none; }

/* ============================================================
   MODO GUIADO — tutorial interactivo con Carlos
   ============================================================ */
.gd-section {
  background:
    radial-gradient(circle at 80% -20%, rgba(45, 212, 191, 0.15), transparent 50%),
    radial-gradient(circle at 20% 110%, rgba(124, 58, 237, 0.25), transparent 50%),
    linear-gradient(180deg, #1E1B4B 0%, #312E81 50%, #1E1B4B 100%);
  color: #fff;
  position: relative;
  overflow: hidden;
}
.gd-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle, rgba(255,255,255,0.05) 1px, transparent 1px);
  background-size: 24px 24px;
  pointer-events: none;
}
.gd-section .container { position: relative; z-index: 1; }
.gd-header { text-align: center; max-width: 760px; margin: 0 auto 32px; }
.gd-header h2 {
  font-size: clamp(1.7rem, 4vw, 2.4rem);
  margin: 14px 0 12px;
  color: #fff;
  text-shadow: 0 2px 24px rgba(0,0,0,0.4);
}
.gd-section .hero-lead {
  color: #C4B5FD;
  text-align: center;
  margin-left: auto;
  margin-right: auto;
}
.gd-section .chip {
  background: rgba(11, 10, 31, 0.6);
  border: 1px solid rgba(45, 212, 191, 0.4);
  color: #fff;
  backdrop-filter: blur(8px);
}

.gd-game {
  position: relative;
  max-width: 940px;
  margin: 0 auto;
  background: #1E1B4B;
  border-radius: 16px;
  overflow: hidden;
  box-shadow:
    0 0 0 1px var(--border),
    0 30px 60px rgba(124, 58, 237, 0.18),
    0 0 80px rgba(45, 212, 191, 0.10);
}

.gd-hud {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 14px 20px;
  background: linear-gradient(135deg, #1E1B4B 0%, #4C1D95 100%);
  color: #fff;
  font-family: 'Courier New', monospace;
}
.gd-stage-label {
  font-size: 0.88rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.gd-stage-label strong { color: #FBBF24; }
.gd-bar {
  flex: 1;
  height: 8px;
  background: rgba(255,255,255,0.1);
  border-radius: 4px;
  overflow: hidden;
}
.gd-fill {
  height: 100%;
  background: linear-gradient(90deg, #2DD4BF, #7C3AED, #FBBF24);
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 4px;
}

/* Chip de guía dentro del HUD */
.gd-guide-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: #0B0A1F;
  border: 2px solid #2DD4BF;
  border-radius: 6px;
  font-family: 'Courier New', monospace;
  font-size: 0.78rem;
  color: #E0E7FF;
  box-shadow: 0 0 0 2px rgba(45, 212, 191, 0.15), 0 4px 0 rgba(0, 0, 0, 0.4);
}
.gd-guide-chip-label {
  color: #2DD4BF;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.gd-guide-chip strong {
  color: #FBBF24;
  font-weight: 800;
  letter-spacing: 0.04em;
}
.gd-guide-chip-status {
  color: #A78BFA;
  font-size: 0.72rem;
  padding-left: 8px;
  border-left: 1px solid rgba(255,255,255,0.15);
}

/* Botón de reiniciar en el HUD */
.gd-reset-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 2px solid rgba(167, 139, 250, 0.35);
  color: #E0E7FF;
  font-family: 'Courier New', monospace;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s, transform 0.1s;
}
.gd-reset-btn:hover {
  border-color: #2DD4BF;
  background: rgba(45, 212, 191, 0.12);
  color: #FFFFFF;
}
.gd-reset-btn:active {
  transform: translateY(1px);
}
.gd-reset-icon {
  font-size: 1rem;
  line-height: 1;
  transition: transform 0.3s;
}
.gd-reset-btn:hover .gd-reset-icon {
  transform: rotate(-180deg);
}

.gd-viewport {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #0B0A1F;
  overflow: hidden;
}

/* Asegura que [hidden] sobrescriba display:flex en los overlays */
.gd-dialog[hidden],
.gd-choices[hidden],
.gd-step-done[hidden],
.gd-final[hidden] {
  display: none !important;
}
.gd-viewport canvas {
  width: 100%;
  height: 100%;
  display: block;
  image-rendering: pixelated;
  -ms-interpolation-mode: nearest-neighbor;
}

/* Globo de diálogo de Carlos */
.gd-dialog {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 16px;
  background: #FFFFFF;
  border: 4px solid #1E1B4B;
  border-radius: 12px;
  padding: 14px 18px 18px;
  box-shadow:
    0 6px 0 #1E1B4B,
    0 12px 30px rgba(0,0,0,0.4);
  z-index: 10;
  animation: gd-dialog-in 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes gd-dialog-in {
  from { transform: translateY(20px) scale(0.95); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}
.gd-dialog-name {
  display: inline-block;
  background: linear-gradient(135deg, #2DD4BF, #7C3AED);
  color: #fff;
  font-family: 'Courier New', monospace;
  font-weight: 800;
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  padding: 3px 12px;
  border-radius: 4px;
  margin-bottom: 8px;
  border: 2px solid #1E1B4B;
}
.gd-dialog-text {
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  line-height: 1.45;
  margin: 0 0 12px;
  color: #1E1B4B;
  font-weight: 500;
}
.gd-next-btn {
  background: linear-gradient(135deg, #FBBF24, #F97316);
  color: #1E1B4B;
  font-family: 'Courier New', monospace;
  font-weight: 800;
  letter-spacing: 0.12em;
  border: 3px solid #1E1B4B;
  padding: 8px 18px;
  border-radius: 6px;
  cursor: pointer;
  box-shadow: 0 4px 0 #92400E;
  transition: transform 0.1s, box-shadow 0.1s;
  font-size: 0.85rem;
}
.gd-next-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 0 #92400E; }
.gd-next-btn:active { transform: translateY(2px); box-shadow: 0 2px 0 #92400E; }
.gd-next-btn span { display: inline-block; margin-left: 6px; }

/* Opciones (choices) */
/* Backdrop oscuro que oscurece la escena cuando aparece el pop-up */
.gd-choices {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(11, 10, 31, 0.55);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  animation: gd-backdrop-in 0.2s ease-out;
}
@keyframes gd-backdrop-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Card pop-up modal — centrada, prominente */
.gd-choices-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 560px;
  background: #FFFFFF;
  border: 4px solid #1E1B4B;
  border-radius: 16px;
  padding: 20px 22px 22px;
  box-shadow:
    0 10px 0 #4C1D95,
    0 20px 60px rgba(0, 0, 0, 0.5),
    inset 0 0 0 2px rgba(124, 58, 237, 0.08);
  animation: gd-popup-in 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes gd-popup-in {
  from { transform: translateY(20px) scale(0.92); opacity: 0; }
  to   { transform: translateY(0) scale(1); opacity: 1; }
}

/* Header con tag "PREGUNTA" y texto destacado */
.gd-choice-header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding-bottom: 12px;
  border-bottom: 2px dashed rgba(124, 58, 237, 0.25);
  margin-bottom: 4px;
}
.gd-choice-tag {
  display: inline-block;
  background: #1E1B4B;
  color: #FBBF24;
  font-family: 'Courier New', monospace;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  padding: 4px 12px;
  border-radius: 4px;
  box-shadow: 0 2px 0 #4C1D95;
}
.gd-choice-header-setup .gd-choice-tag {
  background: #0F766E;
  color: #FFFFFF;
  box-shadow: 0 2px 0 #134E4A;
}
.gd-choice-question-text {
  margin: 0;
  font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1.3;
  color: #1E1B4B;
  letter-spacing: -0.01em;
}

/* ===== Feedback popup (modal de corrección) ===== */
.gd-feedback-card {
  text-align: left;
}
.gd-feedback-ok { border-color: #10B981; box-shadow: 0 10px 0 #047857, 0 20px 60px rgba(16, 185, 129, 0.35); }
.gd-feedback-no { border-color: #EF4444; box-shadow: 0 10px 0 #B91C1C, 0 20px 60px rgba(239, 68, 68, 0.35); }
.gd-feedback-tag {
  background: #10B981;
  color: #FFFFFF;
  box-shadow: 0 2px 0 #047857;
}
.gd-feedback-no .gd-feedback-tag {
  background: #EF4444;
  color: #FFFFFF;
  box-shadow: 0 2px 0 #B91C1C;
}
.gd-feedback-text {
  font-size: 0.98rem;
  font-weight: 600;
  color: #1E1B4B;
  line-height: 1.4;
}
.gd-feedback-btn {
  align-self: stretch;
  margin-top: 8px;
  background: linear-gradient(135deg, #2DD4BF, #7C3AED);
  color: #fff;
  border: none;
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  padding: 12px 22px;
  border-radius: 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 4px 0 #4C1D95;
  transition: transform 0.1s, box-shadow 0.1s, filter 0.15s;
}
.gd-feedback-btn:hover { filter: brightness(1.1); }
.gd-feedback-btn:active { transform: translateY(2px); box-shadow: 0 2px 0 #4C1D95; }
.gd-feedback-btn span { font-size: 0.85rem; }

/* ===== Sub-step input (input libre dentro del modal) ===== */
.gd-input-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  background: #F5F3FF;
  border: 3px solid #7C3AED;
  border-radius: 10px;
  padding: 10px 14px;
}
.gd-input-affix {
  font-family: 'Courier New', monospace;
  font-size: 1.1rem;
  font-weight: 800;
  color: #4C1D95;
}
.gd-input-field {
  flex: 1;
  background: transparent;
  border: 0;
  outline: 0;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.2rem;
  font-weight: 800;
  color: #1E1B4B;
  text-align: left;
}
.gd-input-field::placeholder {
  color: rgba(76, 29, 149, 0.3);
  font-style: italic;
  font-weight: 600;
}
.gd-input-error {
  animation: gd-shake 0.4s;
}
@keyframes gd-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

/* ===== Camión cargando paquetes (animación final del paso 2) ===== */
.gd-truck-overlay {
  position: absolute;
  inset: 0;
  z-index: 25;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(11, 10, 31, 0.92);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: gd-backdrop-in 0.3s ease-out;
}
.gd-truck-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 18px 24px;
  background: #FFFFFF;
  border: 4px solid #1E1B4B;
  border-radius: 14px;
  box-shadow: 0 8px 0 #4C1D95;
  max-width: 80%;
}
.gd-truck-scene {
  position: relative;
  width: 360px;
  height: 100px;
}
.gd-truck-body {
  position: absolute;
  bottom: 8px;
  right: 0;
  width: 180px;
  height: 70px;
  animation: gd-truck-arrive 0.7s ease-out both;
}
@keyframes gd-truck-arrive {
  from { transform: translateX(220px); }
  to { transform: translateX(0); }
}
.gd-truck-cabin {
  position: absolute;
  bottom: 12px;
  right: 0;
  width: 60px;
  height: 42px;
  background: linear-gradient(135deg, #2DD4BF, #0F766E);
  border-radius: 6px 8px 0 0;
  border: 2px solid #134E4A;
}
.gd-truck-cabin::before {
  content: '';
  position: absolute;
  top: 6px;
  left: 8px;
  right: 8px;
  height: 14px;
  background: #BAE6FD;
  border-radius: 3px;
}
.gd-truck-cargo {
  position: absolute;
  bottom: 12px;
  right: 60px;
  width: 116px;
  height: 52px;
  background: #1E1B4B;
  border: 2px solid #0F0E1A;
  border-radius: 4px;
}
.gd-truck-cargo::before {
  content: 'DELIVERYX';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #FBBF24;
  font-family: 'Courier New', monospace;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.1em;
}
.gd-truck-wheel {
  position: absolute;
  bottom: -2px;
  width: 16px;
  height: 16px;
  background: #0F0E1A;
  border-radius: 50%;
  border: 2px solid #475569;
  animation: gd-wheel-spin 0.8s linear infinite;
}
.gd-truck-wheel-1 { right: 16px; }
.gd-truck-wheel-2 { right: 140px; }
@keyframes gd-wheel-spin {
  to { transform: rotate(360deg); }
}
.gd-truck-pkg {
  position: absolute;
  bottom: 8px;
  font-size: 22px;
  animation: gd-pkg-load 0.6s cubic-bezier(0.4, 0, 0.2, 1) both;
}
.gd-truck-pkg-1 { left: 24px; animation-delay: 0.9s; }
.gd-truck-pkg-2 { left: 56px; animation-delay: 1.2s; }
.gd-truck-pkg-3 { left: 88px; animation-delay: 1.5s; filter: drop-shadow(0 0 8px #2DD4BF); }
.gd-truck-pkg-4 { left: 120px; animation-delay: 1.8s; }
@keyframes gd-pkg-load {
  0% { transform: translateY(-200px) scale(0.5); opacity: 0; }
  50% { transform: translateY(0) scale(1); opacity: 1; }
  80% { transform: translateY(0) scale(1); opacity: 1; }
  100% { transform: translateX(200px) translateY(0); opacity: 0; }
}
.gd-truck-label {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.92rem;
  font-weight: 700;
  color: #1E1B4B;
  text-align: center;
}
.gd-truck-done .gd-truck-body {
  animation: gd-truck-leave 0.6s ease-in both;
}
@keyframes gd-truck-leave {
  to { transform: translateX(-300px); }
}

/* ============================================================
   Tag pequeño con el destino (almacén o casa)
   ============================================================ */
.gd-truck-tag {
  background: #FBBF24;
  color: #1E1B4B;
  font-family: 'Courier New', monospace;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  padding: 4px 12px;
  border-radius: 4px;
  box-shadow: 0 2px 0 #B45309;
  margin-bottom: 6px;
}
.gd-truck-label strong { color: #4C1D95; font-weight: 800; }

/* ============================================================
   Escena: camión → ALMACÉN (hacia almacén)
   ============================================================ */
.gd-warehouse-scene {
  position: relative;
  width: 420px;
  max-width: 100%;
  height: 140px;
}

/* Edificio del almacén — gris industrial grande */
.gd-warehouse-building {
  position: absolute;
  bottom: 0;
  left: 12px;
  width: 200px;
  height: 124px;
  background: #475569;
  border: 3px solid #1E293B;
  border-radius: 4px 4px 0 0;
  animation: gd-fade-in 0.3s ease-out both;
}
.gd-warehouse-roof {
  position: absolute;
  top: -16px;
  left: -10px;
  right: -10px;
  height: 18px;
  background: #1E293B;
  border-radius: 3px;
}
.gd-warehouse-sign {
  position: absolute;
  top: 10px;
  left: 0;
  right: 0;
  text-align: center;
  font-family: 'Courier New', monospace;
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  color: #FBBF24;
  text-shadow: 1px 1px 0 #0F0E1A;
}
.gd-warehouse-door {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 50px;
  background: #0F0E1A;
  border: 2px solid #FBBF24;
  border-bottom: 0;
  border-radius: 4px 4px 0 0;
}
.gd-warehouse-door::before {
  content: '';
  position: absolute;
  top: 8px;
  left: 8px;
  right: 8px;
  bottom: 4px;
  background: repeating-linear-gradient(0deg, #1E293B 0, #1E293B 3px, #334155 3px, #334155 6px);
  border-radius: 2px;
}
.gd-warehouse-window {
  position: absolute;
  width: 22px;
  height: 18px;
  background: #BAE6FD;
  border: 2px solid #1E293B;
}
.gd-warehouse-window.w1 { top: 40px; left: 18px; }
.gd-warehouse-window.w2 { top: 40px; right: 18px; }

/* Variante CD (Centro de Distribución) — un poco más moderno, color azulado */
.gd-warehouse-building-cd {
  background: #475569;
  border-color: #2DD4BF;
}
.gd-warehouse-building-cd .gd-warehouse-roof {
  background: #2DD4BF;
}
.gd-warehouse-building-cd .gd-warehouse-sign {
  color: #2DD4BF;
  text-shadow: 1px 1px 0 #0F0E1A;
  font-size: 1.1rem;
  letter-spacing: 0.22em;
}
.gd-warehouse-building-cd .gd-warehouse-door {
  border-color: #2DD4BF;
}
.gd-warehouse-building-cd .gd-warehouse-window {
  background: #2DD4BF;
}

/* ============================================================
   Paquetería (oficina chica de DeliveryX)
   ============================================================ */
.gd-truck-tag-paq { background: #7C3AED; box-shadow: 0 2px 0 #4C1D95; color: #FFFFFF; }
.gd-paqueteria-building {
  position: absolute;
  bottom: 0;
  left: 16px;
  width: 150px;
  height: 100px;
  background: #1E1B4B;
  border: 3px solid #2DD4BF;
  border-radius: 4px 4px 0 0;
  animation: gd-fade-in 0.3s ease-out both;
}
.gd-paqueteria-roof {
  position: absolute;
  top: -10px;
  left: -8px;
  right: -8px;
  height: 12px;
  background: #2DD4BF;
  border-radius: 3px;
}
.gd-paqueteria-sign {
  position: absolute;
  top: 8px;
  left: 0;
  right: 0;
  text-align: center;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #FFFFFF;
}
.gd-paqueteria-sign::after {
  content: '';
  display: block;
  width: 60%;
  height: 2px;
  background: linear-gradient(90deg, transparent, #2DD4BF, transparent);
  margin: 4px auto 0;
}
.gd-paqueteria-door {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 36px;
  height: 50px;
  background: #0F0E1A;
  border: 2px solid #FBBF24;
  border-bottom: 0;
  border-radius: 4px 4px 0 0;
}
.gd-paqueteria-door::before {
  content: '';
  position: absolute;
  top: 50%;
  right: 5px;
  width: 4px;
  height: 4px;
  background: #FBBF24;
  border-radius: 50%;
}
.gd-paqueteria-window {
  position: absolute;
  width: 20px;
  height: 16px;
  background: #FBBF24;
  border: 2px solid #1E1B4B;
}
.gd-paqueteria-window.pw1 { top: 38px; left: 14px; }
.gd-paqueteria-window.pw2 { top: 38px; right: 14px; }

/* Reusar gd-loading-scene para paquetería: el camión queda parado igual */

/* Camión que llega y se queda */
.gd-truck-body-arrive {
  animation: gd-truck-arrive-stop 1s cubic-bezier(0.34, 1.2, 0.64, 1) both !important;
}
@keyframes gd-truck-arrive-stop {
  from { transform: translateX(280px); }
  to { transform: translateX(0); }
}
.gd-warehouse-scene .gd-truck-body {
  bottom: 8px;
  right: 16px;
}

/* Paquetes que descargan hacia el almacén */
.gd-pkg-unload {
  position: absolute;
  font-size: 22px;
  bottom: 14px;
  right: 110px;
  opacity: 0;
  animation: gd-pkg-unload-anim 0.9s cubic-bezier(0.4, 0, 0.2, 1) both;
}
.gd-pkg-unload.pkg-1 { animation-delay: 1.4s; }
.gd-pkg-unload.pkg-2 {
  animation-delay: 1.8s;
  filter: drop-shadow(0 0 8px #2DD4BF);
}
.gd-pkg-unload.pkg-3 { animation-delay: 2.2s; }
@keyframes gd-pkg-unload-anim {
  0% { opacity: 0; transform: translateX(0) translateY(0) scale(0.7); }
  20% { opacity: 1; transform: translateX(0) translateY(0) scale(1); }
  100% { opacity: 0; transform: translateX(-140px) translateY(-30px) scale(0.6); }
}

/* ============================================================
   Escena: camión → CASA (hacia entrega)
   ============================================================ */
.gd-delivery-scene {
  position: relative;
  width: 420px;
  max-width: 100%;
  height: 150px;
}

/* Casa estilo cartoon */
.gd-house {
  position: absolute;
  bottom: 0;
  left: 20px;
  width: 170px;
  height: 130px;
  animation: gd-fade-in 0.3s ease-out both;
}
.gd-house-roof {
  position: absolute;
  top: 0;
  left: -10px;
  right: -10px;
  height: 50px;
  background: #DC2626;
  clip-path: polygon(50% 0%, 100% 100%, 0% 100%);
  filter: drop-shadow(0 3px 0 #7F1D1D);
}
.gd-house-body {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 80px;
  background: #FEF3C7;
  border: 3px solid #A16207;
  border-radius: 0 0 3px 3px;
}
.gd-house-door {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 36px;
  height: 52px;
  background: #92400E;
  border: 2px solid #451A03;
  border-bottom: 0;
  border-radius: 4px 4px 0 0;
}
.gd-house-door::after {
  content: '';
  position: absolute;
  top: 50%;
  right: 6px;
  width: 4px;
  height: 4px;
  background: #FBBF24;
  border-radius: 50%;
}
.gd-house-window {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 28px;
  height: 24px;
  background: #7DD3FC;
  border: 2px solid #1E293B;
}
.gd-house-window::before, .gd-house-window::after {
  content: '';
  position: absolute;
  background: #1E293B;
}
.gd-house-window::before { top: 0; left: 50%; width: 2px; height: 100%; transform: translateX(-50%); }
.gd-house-window::after { left: 0; top: 50%; width: 100%; height: 2px; transform: translateY(-50%); }
.gd-house-chimney {
  position: absolute;
  top: 6px;
  right: 24px;
  width: 16px;
  height: 28px;
  background: #7F1D1D;
  border: 2px solid #1E293B;
  z-index: -1;
}

/* Persona que aparece en la puerta */
.gd-person {
  position: absolute;
  bottom: 52px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  opacity: 0;
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.gd-person-head {
  width: 14px;
  height: 14px;
  background: #FED7AA;
  border: 2px solid #92400E;
  border-radius: 50%;
  margin: 0 auto 2px;
}
.gd-person-body {
  width: 22px;
  height: 24px;
  background: #7C3AED;
  border: 2px solid #4C1D95;
  border-radius: 4px 4px 0 0;
  margin: 0 auto;
}
.gd-person-out {
  opacity: 1 !important;
  transform: translateX(-50%) translateY(0) !important;
}

.gd-delivery-scene .gd-truck-body {
  bottom: 8px;
  right: 16px;
}

/* Paquete entregado: sale del camión y va hacia la puerta */
.gd-pkg-deliver {
  position: absolute;
  font-size: 24px;
  bottom: 26px;
  right: 96px;
  opacity: 0;
  animation: gd-pkg-deliver-anim 1.6s cubic-bezier(0.4, 0, 0.2, 1) 1.4s both;
  filter: drop-shadow(0 0 8px #2DD4BF);
}
@keyframes gd-pkg-deliver-anim {
  0% { opacity: 0; transform: translateY(0) scale(0.5); }
  15% { opacity: 1; transform: translateY(0) scale(1); }
  60% { opacity: 1; transform: translateX(-150px) translateY(-18px) scale(1); }
  100% { opacity: 0; transform: translateX(-150px) translateY(-8px) scale(0.7); }
}

@keyframes gd-fade-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   Animación: TRUCK-RETURN (paquete devuelto al remitente)
   ============================================================ */
.gd-truck-tag-return { background: #F97316; box-shadow: 0 2px 0 #9A3412; color: #FFFFFF; }
.gd-return-scene {
  position: relative;
  width: 400px;
  max-width: 100%;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.gd-return-arrow {
  position: absolute;
  top: 20px;
  left: 30px;
  right: 30px;
  display: flex;
  align-items: center;
  pointer-events: none;
}
.gd-return-arrow-line {
  flex: 1;
  height: 4px;
  background: repeating-linear-gradient(90deg, #F97316 0, #F97316 8px, transparent 8px, transparent 14px);
}
.gd-return-arrow-head {
  font-size: 1.6rem;
  color: #F97316;
  font-weight: 800;
  margin-left: -8px;
}
.gd-truck-body-return {
  position: absolute;
  bottom: 10px;
  right: 30px;
  animation: gd-truck-return-anim 2.4s cubic-bezier(0.5, 0, 0.5, 1) both !important;
}
@keyframes gd-truck-return-anim {
  0% { transform: translateX(0); }
  100% { transform: translateX(-260px); }
}
.gd-return-pkg {
  position: absolute;
  bottom: 38px;
  right: 60px;
  font-size: 22px;
  animation: gd-return-pkg-anim 2.4s cubic-bezier(0.5, 0, 0.5, 1) both;
  filter: drop-shadow(0 0 8px #F97316);
}
@keyframes gd-return-pkg-anim {
  0% { transform: translateX(0); }
  100% { transform: translateX(-260px); }
}

/* ============================================================
   Animación: DELIVERY-SUCCESS (entrega exitosa)
   ============================================================ */
.gd-truck-tag-success { background: #10B981; box-shadow: 0 2px 0 #047857; color: #FFFFFF; }
.gd-success-scene {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 8px 16px;
}
.gd-success-check {
  position: relative;
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.gd-success-check-circle {
  width: 70px;
  height: 70px;
  background: linear-gradient(135deg, #10B981, #047857);
  color: #fff;
  font-size: 2.2rem;
  font-weight: 800;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.2), 0 0 20px rgba(16, 185, 129, 0.5);
  animation: gd-success-pop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes gd-success-pop {
  0% { transform: scale(0); }
  60% { transform: scale(1.15); }
  100% { transform: scale(1); }
}
.gd-success-evidences {
  display: flex;
  gap: 14px;
}
.gd-evidence-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 12px;
  background: #F0FDF4;
  border: 2px solid #10B981;
  border-radius: 8px;
  min-width: 60px;
  opacity: 0;
  transform: translateY(10px);
  animation: gd-evidence-pop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
.gd-evidence-1 { animation-delay: 0.6s; }
.gd-evidence-2 { animation-delay: 0.85s; }
.gd-evidence-3 { animation-delay: 1.1s; }
@keyframes gd-evidence-pop {
  to { opacity: 1; transform: translateY(0); }
}
.gd-evidence-icon { font-size: 1.4rem; }
.gd-evidence-label {
  font-family: 'Inter', sans-serif;
  font-size: 0.7rem;
  font-weight: 700;
  color: #047857;
}

/* ============================================================
   Animación: CLOSING-BATCH (cierre masivo + facturación)
   ============================================================ */
.gd-truck-tag-batch { background: #7C3AED; box-shadow: 0 2px 0 #4C1D95; color: #FFFFFF; }
.gd-closing-card { max-width: 520px; }
.gd-closing-scene {
  display: flex;
  gap: 16px;
  width: 100%;
  align-items: stretch;
}
.gd-closing-guides {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px;
  background: #F5F3FF;
  border: 2px solid #7C3AED;
  border-radius: 8px;
}
.gd-closing-guide {
  font-family: 'Courier New', monospace;
  font-size: 0.72rem;
  font-weight: 700;
  color: #4C1D95;
  padding: 5px 8px;
  background: #FFFFFF;
  border: 1px solid #DDD6FE;
  border-radius: 4px;
  transition: all 0.3s;
}
.gd-closing-guide[data-status="closing"] {
  color: #94A3B8;
  border-color: #E2E8F0;
}
.gd-closing-guide[data-status="closed"] {
  color: #047857;
  background: #ECFDF5;
  border-color: #10B981;
  font-weight: 800;
}
.gd-closing-yours {
  position: relative;
}
.gd-closing-yours::before {
  content: '★';
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  color: #FBBF24;
  font-size: 0.85rem;
}
.gd-closing-invoice {
  flex-shrink: 0;
  width: 140px;
  background: #1E1B4B;
  border: 2px solid #2DD4BF;
  border-radius: 8px;
  padding: 12px 10px;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
}
.gd-closing-invoice-label {
  font-family: 'Courier New', monospace;
  font-size: 0.6rem;
  font-weight: 800;
  color: #2DD4BF;
  letter-spacing: 0.08em;
}
.gd-closing-invoice-amount {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.3rem;
  font-weight: 800;
  color: #FBBF24;
  letter-spacing: 0.02em;
}
.gd-closing-invoice-status {
  font-family: 'Courier New', monospace;
  font-size: 0.62rem;
  font-weight: 700;
  color: #FCA5A5;
  letter-spacing: 0.06em;
  animation: gd-closing-pulse 1s ease-in-out infinite;
}
.gd-closing-invoice-status.done {
  color: #10B981;
  animation: none;
}
@keyframes gd-closing-pulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

/* ============================================================
   Botón de acción grande (subStep type='action')
   ============================================================ */
.gd-action-btn {
  font-size: 1.05rem;
  padding: 14px 28px;
  background: linear-gradient(135deg, #2DD4BF, #7C3AED, #FBBF24);
  background-size: 200% 100%;
  animation: gd-action-shine 3s ease-in-out infinite;
}
@keyframes gd-action-shine {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}
.gd-action-btn-loading {
  opacity: 0.7;
  cursor: wait;
}

/* ============================================================
   Animación: UPLOAD-FILES (foto + factura → nube DeliveryX)
   ============================================================ */
.gd-truck-tag-upload { background: #3B82F6; box-shadow: 0 2px 0 #1E40AF; color: #FFFFFF; }
.gd-upload-scene {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 8px 16px;
  width: 100%;
  justify-content: center;
}
.gd-upload-files {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.gd-upload-file {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: #F5F3FF;
  border: 2px solid #7C3AED;
  border-radius: 6px;
  animation: gd-upload-fly 1.6s ease-in-out infinite;
}
.gd-upload-file-1 { animation-delay: 0s; }
.gd-upload-file-2 { animation-delay: 0.3s; }
@keyframes gd-upload-fly {
  0%, 100% { transform: translateY(0); opacity: 1; }
  50% { transform: translateY(-6px); opacity: 0.9; }
}
.gd-upload-file-icon {
  font-size: 1.4rem;
}
.gd-upload-file-name {
  font-family: 'Courier New', monospace;
  font-size: 0.72rem;
  font-weight: 700;
  color: #4C1D95;
}
.gd-upload-arrow {
  font-size: 1.6rem;
  color: #3B82F6;
  font-weight: 800;
  animation: gd-upload-arrow-pulse 0.8s ease-in-out infinite;
}
@keyframes gd-upload-arrow-pulse {
  0%, 100% { transform: translateY(0); opacity: 1; }
  50% { transform: translateY(-4px); opacity: 0.6; }
}
.gd-upload-cloud {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 16px;
  background: #1E1B4B;
  border: 3px solid #2DD4BF;
  border-radius: 12px;
  min-width: 80px;
}
.gd-upload-cloud-icon {
  font-size: 2rem;
  color: #2DD4BF;
  filter: drop-shadow(0 0 6px rgba(45, 212, 191, 0.6));
}
.gd-upload-cloud-label {
  font-family: 'Courier New', monospace;
  font-size: 0.68rem;
  font-weight: 800;
  color: #2DD4BF;
  letter-spacing: 0.08em;
}
.gd-upload-progress {
  width: 240px;
  height: 6px;
  background: #E0E7FF;
  border-radius: 3px;
  overflow: hidden;
  margin: 6px auto 0;
}
.gd-upload-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #2DD4BF, #7C3AED);
  border-radius: 3px;
  width: 0%;
  animation: gd-upload-progress-fill 2s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
@keyframes gd-upload-progress-fill {
  to { width: 100%; }
}
.gd-truck-label.gd-upload-done { color: #10B981 !important; font-weight: 800; }

/* ============================================================
   SubStep type='dialog' — texto entre acciones
   ============================================================ */
.gd-substep-dialog-text {
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  color: #4C1D95;
  line-height: 1.5;
  margin: 8px 0 14px;
  text-align: left;
}

/* ============================================================
   Animación: INVOICING-BATCH (facturación manual)
   ============================================================ */
.gd-truck-tag-invoice { background: #FBBF24; box-shadow: 0 2px 0 #B45309; color: #1E1B4B; }
.gd-invoicing-scene {
  display: flex;
  gap: 16px;
  width: 100%;
  align-items: stretch;
}
.gd-invoicing-list {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px;
  background: #FFFBEB;
  border: 2px solid #FBBF24;
  border-radius: 8px;
}
.gd-invoicing-row {
  display: grid;
  grid-template-columns: 70px 50px 1fr;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  background: #FFFFFF;
  border: 1px solid #FDE68A;
  border-radius: 4px;
  font-family: 'Courier New', monospace;
  font-size: 0.7rem;
  font-weight: 700;
  transition: all 0.3s;
}
.gd-invoicing-row[data-status="pending"] {
  color: #94A3B8;
  border-color: #E2E8F0;
}
.gd-invoicing-row[data-status="invoiced"] {
  color: #B45309;
  background: #FFFBEB;
  border-color: #FBBF24;
}
.gd-invoicing-yours {
  position: relative;
}
.gd-invoicing-yours::after {
  content: '★';
  position: absolute;
  left: -14px;
  top: 50%;
  transform: translateY(-50%);
  color: #FBBF24;
  font-size: 0.85rem;
}
.gd-inv-guide { font-weight: 800; }
.gd-inv-amount { color: #047857; font-weight: 800; text-align: right; }
.gd-inv-status { text-align: right; font-size: 0.65rem; }

.gd-invoicing-total {
  flex-shrink: 0;
  width: 140px;
  background: #1E1B4B;
  border: 2px solid #FBBF24;
  border-radius: 8px;
  padding: 12px 10px;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
}
.gd-invoicing-total-label {
  font-family: 'Courier New', monospace;
  font-size: 0.58rem;
  font-weight: 800;
  color: #FBBF24;
  letter-spacing: 0.08em;
}
.gd-invoicing-total-amount {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.3rem;
  font-weight: 800;
  color: #10B981;
  letter-spacing: 0.02em;
}
.gd-invoicing-total-count {
  font-family: 'Courier New', monospace;
  font-size: 0.62rem;
  font-weight: 700;
  color: #C4B5FD;
  letter-spacing: 0.06em;
}

/* ============================================================
   Animación: WAREHOUSE-LOADING (cargar camioneta desde almacén)
   ============================================================ */
.gd-loading-scene .gd-truck-body-parked {
  position: absolute;
  bottom: 8px;
  right: 30px;
  animation: gd-fade-in 0.3s ease-out both !important;
}
.gd-pkg-load {
  position: absolute;
  font-size: 22px;
  bottom: 18px;
  left: 180px;
  opacity: 0;
  animation: gd-pkg-load-anim 1s cubic-bezier(0.4, 0, 0.2, 1) both;
}
.gd-pkg-load.pkg-1 { animation-delay: 0.4s; }
.gd-pkg-load.pkg-2 {
  animation-delay: 0.9s;
  filter: drop-shadow(0 0 8px #2DD4BF);
}
.gd-pkg-load.pkg-3 { animation-delay: 1.4s; }
@keyframes gd-pkg-load-anim {
  0% { opacity: 0; transform: translateX(0) translateY(0) scale(0.7); }
  20% { opacity: 1; transform: translateX(0) translateY(0) scale(1); }
  60% { opacity: 1; transform: translateX(80px) translateY(-15px) scale(1); }
  100% { opacity: 0; transform: translateX(140px) translateY(0) scale(0.6); }
}

/* ============================================================
   Animación: TRUCK-ON-ROUTE (camión en ruta con líneas de velocidad)
   ============================================================ */
.gd-truck-tag-route { background: #3B82F6; box-shadow: 0 2px 0 #1E40AF; color: #FFFFFF; }
.gd-route-scene {
  position: relative;
  width: 460px;
  max-width: 100%;
  height: 150px;
  overflow: hidden;
  border-radius: 8px;
  background: linear-gradient(to bottom, #DBEAFE 0%, #FEF3C7 70%, #92400E 100%);
}
.gd-route-sky {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 60%;
  background: linear-gradient(to bottom, #93C5FD 0%, #DBEAFE 70%, transparent 100%);
}
.gd-route-mountains {
  position: absolute;
  bottom: 35%;
  left: 0;
  right: 0;
  height: 40px;
  background:
    radial-gradient(ellipse at 25% 100%, #6B7280 0%, #6B7280 22px, transparent 22px),
    radial-gradient(ellipse at 60% 100%, #4B5563 0%, #4B5563 28px, transparent 28px),
    radial-gradient(ellipse at 85% 100%, #6B7280 0%, #6B7280 20px, transparent 20px);
}
.gd-route-trees {
  position: absolute;
  bottom: 32%;
  left: 0;
  right: 0;
  height: 30px;
}
.gd-route-tree {
  position: absolute;
  bottom: 0;
  font-size: 1.6rem;
  animation: gd-route-tree-move 2s linear infinite;
}
.gd-route-tree.t1 { left: 80%; animation-delay: 0s; }
.gd-route-tree.t2 { left: 100%; animation-delay: 0.5s; }
.gd-route-tree.t3 { left: 120%; animation-delay: 1s; }
.gd-route-tree.t4 { left: 140%; animation-delay: 1.5s; }
@keyframes gd-route-tree-move {
  from { transform: translateX(0); }
  to { transform: translateX(-200%); }
}
.gd-route-road {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 25%;
  background: #475569;
}
.gd-route-road-lines {
  position: absolute;
  bottom: 12%;
  left: 0;
  right: 0;
  height: 4px;
  background: repeating-linear-gradient(90deg, #FBBF24 0, #FBBF24 30px, transparent 30px, transparent 50px);
  animation: gd-route-line-move 0.5s linear infinite;
}
@keyframes gd-route-line-move {
  from { background-position: 0 0; }
  to { background-position: -80px 0; }
}
.gd-route-truck {
  position: absolute;
  bottom: 14%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  animation: gd-route-truck-bob 0.3s ease-in-out infinite;
}
@keyframes gd-route-truck-bob {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(-2px); }
}
.gd-route-scene .gd-truck-body-driving {
  position: relative;
  bottom: auto;
  right: auto;
  animation: none !important;
}
.gd-route-speed-lines {
  position: absolute;
  top: 50%;
  right: 100%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-right: 4px;
}
.gd-route-speed-lines span {
  display: block;
  height: 3px;
  background: linear-gradient(to left, #fff, transparent);
  border-radius: 2px;
  animation: gd-speed-line 0.4s linear infinite;
}
.gd-route-speed-lines span:nth-child(1) { width: 24px; animation-delay: 0s; }
.gd-route-speed-lines span:nth-child(2) { width: 32px; animation-delay: 0.1s; }
.gd-route-speed-lines span:nth-child(3) { width: 20px; animation-delay: 0.2s; }
@keyframes gd-speed-line {
  0% { opacity: 0; transform: translateX(20px); }
  50% { opacity: 1; transform: translateX(0); }
  100% { opacity: 0; transform: translateX(-20px); }
}

/* ============================================================
   Animaciones intermedias del paso 2 (overlay genérico)
   ============================================================ */
.gd-anim-overlay {
  position: absolute;
  inset: 0;
  z-index: 26;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(11, 10, 31, 0.92);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  padding: 16px;
  animation: gd-backdrop-in 0.3s ease-out;
}
.gd-anim-overlay.gd-anim-out {
  animation: gd-fade-out 0.35s ease-in forwards;
}
@keyframes gd-fade-out {
  to { opacity: 0; }
}
.gd-anim-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 16px 20px 18px;
  background: #FFFFFF;
  border: 4px solid #1E1B4B;
  border-radius: 14px;
  box-shadow: 0 8px 0 #4C1D95;
  max-width: 92%;
  max-height: 92%;
}
.gd-anim-label {
  background: #2DD4BF;
  color: #0B0A1F;
  font-family: 'Courier New', monospace;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  padding: 4px 12px;
  border-radius: 4px;
  box-shadow: 0 2px 0 #0F766E;
}
.gd-anim-sublabel {
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  color: #4C1D95;
  text-align: center;
}

/* --- Manual: contenedor del browser mockup --- */
.gd-anim-browser {
  width: 560px;
  max-width: 100%;
  aspect-ratio: 5/4;
  position: relative;
}
.gd-anim-browser .gd-browser-mockup {
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
}

/* --- API: dos nodos + canal de transferencia --- */
.gd-api-scene {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 8px;
  min-width: 480px;
}
.gd-api-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 14px;
  background: #1E1B4B;
  border: 3px solid #7C3AED;
  border-radius: 12px;
  min-width: 96px;
  animation: gd-api-pulse 2s ease-in-out infinite;
}
.gd-api-server {
  border-color: #2DD4BF;
  animation-delay: 1s;
}
@keyframes gd-api-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(124, 58, 237, 0.4); }
  50% { box-shadow: 0 0 0 8px rgba(124, 58, 237, 0); }
}
.gd-api-server { animation-name: gd-api-pulse-aqua; }
@keyframes gd-api-pulse-aqua {
  0%, 100% { box-shadow: 0 0 0 0 rgba(45, 212, 191, 0.4); }
  50% { box-shadow: 0 0 0 8px rgba(45, 212, 191, 0); }
}
.gd-api-node-icon {
  font-size: 1.6rem;
  filter: drop-shadow(0 0 6px rgba(255,255,255,0.3));
}
.gd-api-node-label {
  font-family: 'Courier New', monospace;
  font-size: 0.72rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.05em;
}
.gd-api-channel {
  position: relative;
  flex: 1;
  height: 40px;
  display: flex;
  align-items: center;
}
.gd-api-line {
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, #7C3AED, #2DD4BF);
  position: relative;
}
.gd-api-line::before, .gd-api-line::after {
  content: '';
  position: absolute;
  top: -3px;
  width: 8px;
  height: 8px;
  background: #FBBF24;
  border-radius: 50%;
}
.gd-api-line::before { left: 0; }
.gd-api-line::after { right: 0; }
.gd-api-packet {
  position: absolute;
  top: -8px;
  font-family: 'Courier New', monospace;
  font-size: 0.7rem;
  font-weight: 800;
  color: #1E1B4B;
  background: #FBBF24;
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid #B45309;
  white-space: nowrap;
  opacity: 0;
  animation: gd-api-fly 1.4s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}
.gd-api-packet.p1 { animation-delay: 0s; }
.gd-api-packet.p2 { animation-delay: 0.5s; background: #2DD4BF; color: #0B0A1F; }
.gd-api-packet.p3 { animation-delay: 1s; background: #10B981; color: #fff; animation-direction: reverse; }
@keyframes gd-api-fly {
  0% { left: 0; opacity: 0; transform: scale(0.7); }
  15% { opacity: 1; transform: scale(1); }
  85% { opacity: 1; transform: scale(1); }
  100% { left: calc(100% - 60px); opacity: 0; transform: scale(0.7); }
}

/* --- Escaneo: paquete con código + laser --- */
.gd-scan-scene {
  position: relative;
  width: 280px;
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.gd-scan-package {
  width: 200px;
  height: 130px;
  background: #A16207;
  border: 3px solid #7C2D12;
  border-radius: 6px;
  padding: 18px 14px 10px;
  position: relative;
  box-shadow: 0 6px 0 rgba(0,0,0,0.3);
}
.gd-scan-package::before {
  content: '';
  position: absolute;
  top: 8px;
  left: 16px;
  right: 16px;
  height: 6px;
  background: #FBBF24;
  border-radius: 1px;
}
.gd-scan-barcode {
  display: flex;
  gap: 2px;
  align-items: flex-end;
  height: 60px;
  margin-bottom: 6px;
  background: #FEF3C7;
  padding: 6px;
  border-radius: 2px;
}
.gd-scan-barcode span {
  display: block;
  width: 4px;
  height: 100%;
  background: #0F0E1A;
}
.gd-scan-barcode span:nth-child(2n) { width: 2px; height: 80%; }
.gd-scan-barcode span:nth-child(3n) { width: 6px; }
.gd-scan-barcode span:nth-child(5n) { width: 3px; height: 90%; }
.gd-scan-code {
  font-family: 'Courier New', monospace;
  font-size: 0.75rem;
  font-weight: 800;
  color: #FEF3C7;
  text-align: center;
  letter-spacing: 0.08em;
}
.gd-scan-laser {
  position: absolute;
  top: 10%;
  left: 0;
  width: 100%;
  height: 2px;
  background: #EF4444;
  box-shadow: 0 0 8px #EF4444;
  animation: gd-laser-scan 1.8s ease-in-out infinite;
}
.gd-scan-beam {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom, rgba(239, 68, 68, 0.12), transparent);
  opacity: 0;
  animation: gd-beam-flash 1.8s ease-in-out infinite;
}
@keyframes gd-laser-scan {
  0%, 100% { top: 5%; }
  50% { top: 90%; }
}
@keyframes gd-beam-flash {
  0%, 100% { opacity: 0; }
  50% { opacity: 1; }
}
.gd-anim-sublabel.gd-scan-ok {
  color: #10B981;
  font-weight: 700;
}

/* --- Form unificado (paso 2 final) --- */
.gd-form-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 10px;
}
.gd-form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.gd-form-field-label {
  font-family: 'Inter', sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  color: #1E1B4B;
}
.gd-form-req {
  color: #EF4444;
  margin-right: 4px;
}
.gd-form-seg {
  display: flex;
  gap: 8px;
}
.gd-form-seg-btn {
  flex: 1;
  padding: 9px 12px;
  background: #FAF5FF;
  color: #1E1B4B;
  border: 2px solid #7C3AED;
  border-radius: 8px;
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}
.gd-form-seg-btn:hover:not(.selected) {
  background: #EDE9FE;
}
.gd-form-seg-btn.selected {
  background: linear-gradient(135deg, #2DD4BF, #7C3AED);
  color: #fff;
  border-color: #1E1B4B;
  transform: translateY(-1px);
  box-shadow: 0 3px 0 #4C1D95;
}
.gd-form-input-row {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #FAF5FF;
  border: 2px solid #7C3AED;
  border-radius: 8px;
  padding: 8px 12px;
}
.gd-form-input-affix {
  font-family: 'Courier New', monospace;
  font-size: 0.95rem;
  font-weight: 800;
  color: #4C1D95;
}
.gd-form-input {
  flex: 1;
  background: transparent;
  border: 0;
  outline: 0;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: #1E1B4B;
}
.gd-form-input::placeholder {
  color: rgba(76, 29, 149, 0.3);
  font-style: italic;
  font-weight: 600;
}
.gd-choice {
  background: #FAF5FF;
  border: 3px solid #7C3AED;
  border-radius: 10px;
  padding: 11px 16px;
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  color: #1E1B4B;
  cursor: pointer;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: 0 4px 0 #4C1D95, 0 6px 20px rgba(124, 58, 237, 0.2);
  transition: transform 0.12s, box-shadow 0.12s, border-color 0.15s, background 0.15s;
  animation: gd-choice-in 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  animation-fill-mode: backwards;
}
.gd-choice:nth-child(1) { animation-delay: 0.05s; }
.gd-choice:nth-child(2) { animation-delay: 0.15s; }
.gd-choice:nth-child(3) { animation-delay: 0.25s; }
@keyframes gd-choice-in {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.gd-choice:hover:not(:disabled) {
  transform: translateX(4px) translateY(-2px);
  background: #F5F3FF;
  border-color: #2DD4BF;
  box-shadow: 0 6px 0 #4C1D95;
}
.gd-choice:active:not(:disabled) {
  transform: translateY(2px);
  box-shadow: 0 2px 0 #4C1D95;
}
.gd-choice.correct {
  background: #ECFDF5;
  border-color: #10B981;
  box-shadow: 0 4px 0 #047857, 0 0 30px rgba(16, 185, 129, 0.4);
}
.gd-choice.wrong {
  background: #FEF2F2;
  border-color: #EF4444;
  box-shadow: 0 4px 0 #B91C1C;
}
.gd-choice-icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #2DD4BF, #7C3AED);
  color: #fff;
  font-weight: 800;
  border-radius: 8px;
  border: 2px solid #1E1B4B;
  font-size: 1.1rem;
}
.gd-choice-sprite {
  width: 64px;
  height: 64px;
  background: #FAF5FF;
  border: 2px solid #1E1B4B;
  border-radius: 8px;
  padding: 0;
  overflow: hidden;
}
.gd-choice-sprite canvas {
  width: 100%;
  height: 100%;
  display: block;
  image-rendering: pixelated;
  -ms-interpolation-mode: nearest-neighbor;
}
.gd-choice-text { flex: 1; line-height: 1.3; }

/* Tarjeta de paso completado */
/* Step-done y Final: pop-ups CENTRADOS dentro del viewport (no cubren todo) */
.gd-step-done, .gd-final {
  position: absolute;
  inset: 0;
  z-index: 22;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(11, 10, 31, 0.55);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  animation: gd-backdrop-in 0.2s ease-out;
}
.gd-step-done-info,
.gd-final-card {
  background: #FFFFFF;
  color: #1E1B4B;
  border: 4px solid #1E1B4B;
  border-radius: 16px;
  padding: 18px 22px 20px;
  max-width: 420px;
  box-shadow: 0 10px 0 #4C1D95, 0 20px 60px rgba(0, 0, 0, 0.5);
  animation: gd-popup-in 0.32s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
}
.gd-step-done-info h3 {
  margin: 4px 0 2px;
  font-size: 1.05rem;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 800;
  background: linear-gradient(135deg, #2DD4BF, #7C3AED);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.gd-step-done-info p {
  margin: 0;
  font-size: 0.85rem;
  color: #4C1D95;
  line-height: 1.4;
}
.gd-step-done-info .gd-step-icon {
  font-size: 1.8rem;
  margin: 0 0 2px;
  filter: drop-shadow(0 0 8px rgba(45, 212, 191, 0.5));
  color: #10B981;
}
.gd-step-done-info .gd-next-btn { margin-top: 8px; align-self: center; }

/* Meta de la app preview (tag + caption) — vive dentro de la info izquierda */
.gd-app-preview-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  margin: 14px 0 4px;
  padding-top: 12px;
  border-top: 1px dashed rgba(124, 58, 237, 0.4);
}
.gd-app-preview-meta[hidden] { display: none; }
.gd-app-preview-tag {
  display: inline-block;
  background: #2DD4BF;
  color: #0B0A1F;
  font-family: 'Courier New', monospace;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  padding: 4px 10px;
  border-radius: 4px;
  box-shadow: 0 2px 0 #0F766E;
}
.gd-app-preview-caption {
  font-family: 'Inter', sans-serif;
  font-size: 0.78rem;
  color: #A78BFA;
  font-style: italic;
  line-height: 1.3;
}

/* Bloque derecho: SOLO el mockup, ocupando todo el alto del step-done */
.gd-app-preview {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  align-self: stretch;
}
.gd-app-preview[hidden] { display: none; }
.gd-phone-mockup {
  position: relative;
  height: 100%;
  max-height: 100%;
  aspect-ratio: 9 / 16;
  background: #0F0E1A;
  border: 3px solid #1E1B4B;
  border-radius: 26px;
  padding: 10px 5px;
  box-shadow:
    0 0 0 1px #2DD4BF inset,
    0 14px 34px rgba(45, 212, 191, 0.25),
    0 20px 56px rgba(0, 0, 0, 0.55);
  overflow: hidden;
  animation: gd-phone-in 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Mockup pequeño para el screenshot flotante en viewport */
.gd-phone-mockup-small {
  height: auto;
  width: 110px;
  aspect-ratio: 9 / 16;
  border-radius: 18px;
  border-width: 2px;
  padding: 6px 3px;
  cursor: zoom-in;
  transform-origin: top right;
  transition:
    width 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
    border-radius 0.35s ease,
    box-shadow 0.3s ease;
}
.gd-phone-mockup-small:hover {
  width: 240px;
  border-radius: 26px;
  border-width: 3px;
  box-shadow:
    0 0 0 2px #2DD4BF inset,
    0 22px 50px rgba(45, 212, 191, 0.4),
    0 30px 80px rgba(0, 0, 0, 0.7);
  cursor: zoom-out;
  z-index: 12;
}
/* Cuando el viewport tiene un mockup en hover, permite que se salga */
.gd-viewport:has(.gd-phone-mockup-small:hover) {
  overflow: visible;
  z-index: 5;
}
.gd-phone-mockup-small .gd-phone-notch {
  width: 28px;
  height: 4px;
  top: 4px;
  transition: width 0.35s ease, height 0.35s ease;
}
.gd-phone-mockup-small:hover .gd-phone-notch {
  width: 60px;
  height: 7px;
}
.gd-phone-mockup-small img {
  border-radius: 11px;
}
.gd-phone-mockup-small:hover img {
  border-radius: 18px;
}

/* Pantalla de la app en vivo dentro del viewport — al lado de Carlos */
.gd-app-float {
  position: absolute;
  top: 14px;
  right: 14px;
  bottom: 14px;
  z-index: 8;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  animation: gd-app-float-in 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.gd-app-float[hidden] { display: none; }
@keyframes gd-app-float-in {
  from { transform: translateX(30px) scale(0.92); opacity: 0; }
  to   { transform: translateX(0) scale(1); opacity: 1; }
}
.gd-app-float-tag {
  background: #2DD4BF;
  color: #0B0A1F;
  font-family: 'Courier New', monospace;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  padding: 4px 10px;
  border-radius: 4px;
  box-shadow: 0 2px 0 #0F766E;
  flex-shrink: 0;
}

/* Mockup tutorial: ocupa todo el alto del float, ancho calculado por aspect-ratio */
.gd-phone-mockup-tutorial {
  height: 100%;
  width: auto;
  aspect-ratio: 9 / 16;
  flex: 1 1 auto;
  min-height: 0;
}

/* Wrapper genérico que aloja phone-mockup o browser-mockup */
.gd-mockup-wrap {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

/* ============================================================
   Browser mockup (sistema web DeliveryX)
   ============================================================ */
.gd-browser-mockup {
  position: relative;
  height: 100%;
  max-height: 100%;
  aspect-ratio: 5 / 4;
  background: #1A1D2E;
  border: 3px solid #1E1B4B;
  border-radius: 10px;
  padding: 0;
  box-shadow:
    0 0 0 1px #2DD4BF inset,
    0 14px 34px rgba(45, 212, 191, 0.25),
    0 20px 56px rgba(0, 0, 0, 0.55);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: gd-phone-in 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Title bar de browser (tres puntos) */
.browser-titlebar {
  height: 5%;
  min-height: 12px;
  background: #0F0E1A;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 8px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.browser-titlebar-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #EF4444;
}
.browser-titlebar-dot.yellow { background: #FBBF24; }
.browser-titlebar-dot.green { background: #10B981; }
.browser-titlebar-url {
  flex: 1;
  text-align: center;
  font-family: 'Courier New', monospace;
  font-size: 6.5px;
  color: #A78BFA;
  letter-spacing: 0.03em;
}

/* App layout: sidebar + content */
.browser-app {
  flex: 1;
  display: flex;
  min-height: 0;
}
.browser-sidebar {
  width: 25%;
  background: #0F0E1A;
  border-right: 1px solid rgba(255,255,255,0.05);
  display: flex;
  flex-direction: column;
  font-family: 'Inter', sans-serif;
}
.browser-sidebar-section {
  padding: 5% 8%;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.browser-sidebar-logo {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 7.5px;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.05em;
}
.browser-sidebar-logo::before {
  content: '◆';
  color: #2DD4BF;
  font-size: 9px;
}
.browser-sidebar-user {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 6px;
  color: #A78BFA;
}
.browser-sidebar-user::before {
  content: '👤';
  font-size: 7px;
}
.browser-sidebar-toggle {
  font-size: 6.5px;
  color: #A78BFA;
  font-weight: 600;
}
.browser-sidebar-tab {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 7px;
  color: #2DD4BF;
  font-weight: 600;
}
.browser-sidebar-tab::before {
  content: '●';
  margin-right: 5px;
  color: #2DD4BF;
}
.browser-sidebar-close {
  color: #EF4444;
  font-size: 8px;
}
.browser-sidebar-spacer { flex: 1; }
.browser-sidebar-menu {
  font-size: 6.5px;
  color: #A78BFA;
  border-top: 1px solid rgba(255,255,255,0.05);
  padding: 5% 8%;
}

/* Content area */
.browser-content {
  flex: 1;
  background: #1A1D2E;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}
.browser-toolbar {
  height: 8%;
  min-height: 14px;
  background: #1A1D2E;
  border-bottom: 1px solid #EF4444;
  display: flex;
  align-items: center;
  padding: 0 10px;
  gap: 4px;
}
.browser-toolbar-btn {
  background: #EF4444;
  color: #fff;
  width: 12px;
  height: 12px;
  border-radius: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 7px;
}
.browser-toolbar-btn.save { background: #F97316; }
.browser-form {
  flex: 1;
  padding: 2% 3%;
  overflow-y: auto;
  font-family: 'Inter', sans-serif;
}
.browser-section-title {
  background: #1E1B4B;
  color: #fff;
  font-size: 7px;
  font-weight: 800;
  letter-spacing: 0.06em;
  padding: 3px 0;
  text-align: center;
  margin: 6px 0 5px;
  border-radius: 2px;
}
.browser-fields {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
}
.browser-field {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.browser-field-label {
  font-size: 5.5px;
  color: #fff;
  font-weight: 600;
}
.browser-field-label .req {
  color: #EF4444;
  margin-right: 1px;
}
.browser-field-input {
  background: #0F0E1A;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 2px;
  padding: 2px 4px;
  font-size: 5.5px;
  color: #E0E7FF;
  min-height: 10px;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.browser-field-input.placeholder {
  color: rgba(255,255,255,0.25);
  font-style: italic;
}
.browser-field-input.search::after {
  content: '🔍';
  float: right;
  font-size: 5px;
}

/* Reveal animations para el browser mockup */
.app-screen-animated .browser-sidebar { animation: app-reveal 0.35s 0.05s both; }
.app-screen-animated .browser-toolbar { animation: app-reveal 0.35s 0.2s both; }
.app-screen-animated .browser-section.s-cliente { animation: app-reveal 0.35s 0.35s both; }
.app-screen-animated .browser-section.s-remitente { animation: app-reveal 0.35s 0.55s both; }
.app-screen-animated .browser-section.s-destinatario { animation: app-reveal 0.35s 0.85s both; }
.app-screen-animated .browser-section.s-envio { animation: app-reveal 0.35s 1.2s both; }

/* Cuando el float está visible, el dialog de Carlos no debe overlap.
   El dialog se contrae a la mitad izquierda. */
.gd-viewport:has(.gd-app-float:not([hidden])) .gd-dialog {
  right: 42%;
}

/* Animación de reveal por secciones (de arriba hacia abajo, tipo tutorial) */
.app-screen-animated .app-screen-header { animation: app-reveal 0.35s 0.05s both; }
.app-screen-animated .app-screen-title { animation: app-reveal 0.35s 0.25s both; }
.app-screen-animated .app-toast { animation: app-reveal 0.35s 0.4s both; }
.app-screen-animated .app-anim-1 { animation: app-reveal 0.35s 0.45s both; }
.app-screen-animated .app-anim-2 { animation: app-reveal 0.35s 0.7s both; }
.app-screen-animated .app-anim-3 { animation: app-reveal 0.35s 0.95s both; }
.app-screen-animated .app-anim-4 { animation: app-reveal 0.35s 1.2s both; }
.app-screen-animated .app-anim-5 { animation: app-reveal 0.35s 1.45s both; }
.app-screen-animated .app-button { animation: app-reveal 0.35s 1.7s both; }
@keyframes app-reveal {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes gd-phone-in {
  from { transform: translateY(20px) rotate(-3deg); opacity: 0; }
  to   { transform: translateY(0) rotate(0); opacity: 1; }
}
.gd-phone-notch {
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 6px;
  background: #0B0A1F;
  border-radius: 4px;
  z-index: 2;
}
.gd-phone-mockup img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  border-radius: 14px;
  display: block;
}

/* ============================================================
   Mockup dinámico — replica la UI de DeliveryX para datos en vivo
   ============================================================ */
.app-screen {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 14px;
  overflow: hidden;
  background: #0A0C1E;
  display: flex;
  flex-direction: column;
  font-family: 'Inter', system-ui, sans-serif;
  color: #fff;
  --statusbar-h: 6%;
  --header-h: 10%;
  --navbar-h: 6%;
}
.app-screen-statusbar {
  flex: 0 0 auto;
  height: var(--statusbar-h);
  min-height: 14px;
  background: #1E1B4B;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 5%;
  font-size: 7px;
  color: #fff;
}
.app-screen-statusbar-time { letter-spacing: 0; }
.app-screen-statusbar-icons { letter-spacing: 0.05em; }
.app-screen-header {
  flex: 0 0 auto;
  height: var(--header-h);
  min-height: 22px;
  background: linear-gradient(to bottom, #1E1B4B 0%, #2A1F66 100%);
  display: flex;
  align-items: center;
  padding: 0 6%;
  gap: 6%;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: #fff;
}
.app-screen-back {
  font-size: 12px;
  width: 12px;
  line-height: 1;
}
.app-screen-logo {
  flex: 1;
  text-align: center;
  background: linear-gradient(135deg, #A78BFA, #2DD4BF);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  letter-spacing: 0.18em;
}
.app-screen-body {
  flex: 1 1 auto;
  padding: 4% 6%;
  overflow: hidden;
  min-height: 0;
}
.app-screen-title {
  font-size: 10px;
  font-weight: 800;
  text-align: center;
  margin: 0 0 8% 0;
  color: #fff;
}
.app-field {
  position: relative;
  margin-bottom: 5%;
  padding: 7% 6% 4%;
  border: 1px solid rgba(167, 139, 250, 0.35);
  border-radius: 5px;
  min-height: 14px;
}
.app-field-label {
  position: absolute;
  top: -5px;
  left: 8px;
  background: #0A0C1E;
  padding: 0 4px;
  font-size: 6px;
  font-weight: 500;
  color: #A78BFA;
  letter-spacing: 0.04em;
}
.app-field-value {
  font-size: 8px;
  color: #E0E7FF;
  display: inline-block;
  line-height: 1.2;
  min-height: 9px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.app-field-value-placeholder {
  color: rgba(255,255,255,0.35);
  font-style: italic;
}
.app-field-arrow {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-30%);
  color: #94A3B8;
  font-size: 7px;
}
.app-button {
  background: linear-gradient(135deg, #60A5FA, #2563EB);
  color: #fff;
  text-align: center;
  padding: 6% 0;
  border-radius: 20px;
  font-size: 9px;
  font-weight: 700;
  margin-top: 4%;
  letter-spacing: 0.02em;
  box-shadow: 0 1px 0 rgba(0,0,0,0.3);
}
.app-button-disabled {
  background: #1E293B;
  color: rgba(255,255,255,0.35);
  box-shadow: none;
}
.app-screen-navbar {
  flex: 0 0 auto;
  height: var(--navbar-h);
  min-height: 12px;
  background: #4C1D95;
  display: flex;
  align-items: center;
  justify-content: space-around;
  font-size: 9px;
  color: #fff;
}

/* Cursor de typing (parpadeante) */
.app-field-caret::after {
  content: '|';
  color: #2DD4BF;
  font-weight: 800;
  animation: app-caret-blink 0.8s steps(2) infinite;
  margin-left: 1px;
}
@keyframes app-caret-blink {
  0%, 50% { opacity: 1; }
  50.01%, 100% { opacity: 0; }
}

/* Banner toast (ej: "Grupo creado exitosamente") */
.app-toast {
  background: #E0E7FF;
  color: #1E1B4B;
  font-size: 7px;
  font-weight: 600;
  padding: 4% 5%;
  margin: 0 0 5% 0;
  border-radius: 4px;
}

/* Card numerada estilo "Documentación" */
.app-card {
  position: relative;
  padding: 6% 5% 5%;
  margin-bottom: 5%;
  border: 1px solid rgba(167, 139, 250, 0.25);
  border-radius: 6px;
}
.app-card-num {
  position: absolute;
  top: 6%;
  left: 5%;
  width: 14px;
  height: 14px;
  background: #312E81;
  color: #fff;
  font-size: 7px;
  font-weight: 800;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.app-card-title {
  font-size: 8px;
  font-weight: 700;
  color: #fff;
  margin: 0 0 4% 22%;
  padding-left: 0;
}
.app-card-body {
  margin-left: 0;
}
.app-card-value {
  font-size: 7.5px;
  color: #E0E7FF;
  line-height: 1.3;
  margin-bottom: 3%;
  display: block;
}
.app-card-meta {
  font-size: 6.5px;
  color: #A78BFA;
  font-style: italic;
  margin-bottom: 4%;
}
.app-card-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 7px;
  color: #2DD4BF;
  font-weight: 700;
  margin-top: 2%;
}
.app-card-status::before {
  content: '✓';
  font-size: 8px;
}
.app-card-actions {
  display: flex;
  gap: 4%;
  margin-top: 4%;
}
.app-btn-outline {
  flex: 1;
  background: transparent;
  border: 1px solid rgba(167, 139, 250, 0.4);
  color: #E0E7FF;
  text-align: center;
  padding: 4% 0;
  border-radius: 14px;
  font-size: 7px;
  font-weight: 600;
}

/* Checkbox aqua estilo Material */
.app-check {
  display: flex;
  align-items: center;
  gap: 5%;
  margin: 3% 0 4% 0;
  font-size: 7.5px;
  color: #E0E7FF;
}
.app-check-box {
  width: 10px;
  height: 10px;
  background: #2DD4BF;
  border-radius: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #0B0A1F;
  font-size: 7px;
  font-weight: 800;
}
.app-check-box::before { content: '✓'; }
@keyframes gd-card-in {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.gd-final h3 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.2rem;
  margin: 6px 0 4px;
  background: linear-gradient(135deg, #2DD4BF, #7C3AED);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.gd-final p {
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  color: #4C1D95;
  margin: 0 0 12px;
  max-width: 360px;
  text-align: center;
}
.gd-final-trophy {
  font-size: 2.4rem;
  filter: drop-shadow(0 0 14px rgba(251, 191, 36, 0.6));
  animation: gd-trophy 1.6s ease-in-out infinite;
}
@keyframes gd-trophy {
  0%, 100% { transform: translateY(0) rotate(-4deg); }
  50% { transform: translateY(-8px) rotate(4deg); }
}
.gd-final-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

@media (max-width: 768px) {
  .gd-dialog-text { font-size: 0.85rem; }
  .gd-choice { padding: 10px 14px; font-size: 0.85rem; }
  .gd-choice-icon { width: 30px; height: 30px; font-size: 0.95rem; }
  .gd-step-done h3, .gd-final h3 { font-size: 1.15rem; }
  .gd-step-done p, .gd-final p { font-size: 0.85rem; }
}
.show-scene {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.7s ease;
}
.show-scene.active { opacity: 1; }
.show-scene svg { width: 100%; height: 100%; display: block; }

/* Score popup — chip pixel-art (mismo lenguaje que pop-ups y D-pad) */
.show-points-pop {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: 'Courier New', 'Consolas', monospace;
  font-weight: 800;
  font-size: 1.4rem;
  letter-spacing: 0.08em;
  color: #FBBF24;
  background: #0B0A1F;
  padding: 6px 16px;
  border: 3px solid currentColor;
  border-radius: 4px;
  /* Outline pixel + sombra de profundidad sólida (no glow difuso) */
  box-shadow:
    0 0 0 2px #0B0A1F,
    0 4px 0 rgba(0, 0, 0, 0.55);
  text-shadow: 2px 2px 0 #0B0A1F;
  pointer-events: none;
  opacity: 0;
  z-index: 10;
  white-space: nowrap;
}
.show-points-pop.show { animation: show-pts 1.2s ease forwards; }
@keyframes show-pts {
  0% { transform: translate(-50%, -30%) scale(0.6); opacity: 0; }
  20% { transform: translate(-50%, -50%) scale(1.2); opacity: 1; }
  60% { transform: translate(-50%, -60%) scale(1); opacity: 1; }
  100% { transform: translate(-50%, -100%) scale(0.9); opacity: 0; }
}

/* Level complete toast */
.show-level-toast {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(-100px);
  background: linear-gradient(135deg, var(--aqua), var(--purple));
  color: #fff;
  font-family: var(--font-display);
  font-weight: 800;
  padding: 12px 24px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 0 40px rgba(124, 58, 237, 0.5), 0 14px 30px rgba(45, 212, 191, 0.3);
  opacity: 0;
  z-index: 11;
  pointer-events: none;
  letter-spacing: 0.02em;
  font-size: 1rem;
}
.show-level-toast.show { animation: show-toast 2.4s ease forwards; }
.show-level-toast-icon { font-size: 1.3rem; }
@keyframes show-toast {
  0% { transform: translateX(-50%) translateY(-100px); opacity: 0; }
  15%, 70% { transform: translateX(-50%) translateY(0); opacity: 1; }
  100% { transform: translateX(-50%) translateY(-100px); opacity: 0; }
}

/* Panel inferior (cambia entre pregunta / feedback / final) */
.show-panel {
  border-top: 1px solid var(--border);
  background: linear-gradient(135deg, #FFFFFF 0%, #F8FAFC 100%);
}

/* Caption / narrativa (parte superior del panel pregunta) */
.show-caption {
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 24px 32px 18px;
}
.show-caption-num {
  flex-shrink: 0;
  width: 64px;
  height: 64px;
  border-radius: 18px;
  background: var(--grad);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.4rem;
  box-shadow: 0 14px 30px rgba(124, 58, 237, 0.35);
}
.show-caption-text { flex: 1; min-width: 0; }
.show-caption-text h3 {
  font-size: clamp(1.15rem, 2.4vw, 1.5rem);
  margin: 0 0 6px;
}
.show-caption-text p {
  margin: 0 0 10px;
  color: var(--text-muted);
  font-size: 0.98rem;
  line-height: 1.55;
}
/* Pregunta + opciones (parte inferior del panel pregunta) */
.show-question {
  padding: 0 32px 28px;
  animation: showq-in 0.5s ease;
}
@keyframes showq-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
.show-question h4 {
  font-family: var(--font-display);
  font-size: clamp(1.05rem, 2.2vw, 1.3rem);
  font-weight: 800;
  margin: 0 0 16px;
  color: var(--text);
  line-height: 1.3;
}
.show-options { display: flex; flex-direction: column; gap: 10px; }
.show-opt {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #FFFFFF;
  border: 2px solid var(--border);
  padding: 14px 18px;
  border-radius: 14px;
  font-family: var(--font-body);
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: transform 0.2s, border-color 0.2s, background 0.2s, box-shadow 0.2s;
}
.show-opt:hover {
  border-color: var(--purple);
  background: var(--purple-tint);
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(124, 58, 237, 0.15);
}
.show-opt:disabled { cursor: default; }
.show-opt.correct {
  border-color: var(--aqua);
  background: var(--aqua-soft);
  color: #0F766E;
  animation: showq-correct 0.5s ease;
}
.show-opt.wrong {
  border-color: #EF4444;
  background: #FEE2E2;
  color: #991B1B;
  animation: showq-wrong 0.5s ease;
}
.show-opt-letter {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--purple-tint);
  color: var(--purple-deep);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 800;
}
.show-opt.correct .show-opt-letter { background: var(--aqua); color: #fff; }
.show-opt.wrong .show-opt-letter { background: #EF4444; color: #fff; }
@keyframes showq-correct {
  0% { transform: scale(1); } 40% { transform: scale(1.03); } 100% { transform: scale(1); }
}
@keyframes showq-wrong {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); } 40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); } 80% { transform: translateX(4px); }
}

/* Panel feedback */
.show-panel-feedback {
  padding: 32px 32px 36px;
  text-align: center;
  animation: showq-in 0.4s ease;
}
.show-fb-icon {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  font-weight: 800;
  color: #fff;
}
.show-panel-feedback.correct .show-fb-icon {
  background: linear-gradient(135deg, var(--aqua), var(--aqua-deep));
  box-shadow: 0 0 36px rgba(45, 212, 191, 0.6);
  animation: show-fb-bounce 0.5s ease;
}
.show-panel-feedback.wrong .show-fb-icon {
  background: linear-gradient(135deg, #FB923C, #EF4444);
  box-shadow: 0 0 36px rgba(239, 68, 68, 0.55);
  animation: show-fb-bounce 0.5s ease;
}
@keyframes show-fb-bounce {
  0% { transform: scale(0); } 60% { transform: scale(1.18); } 100% { transform: scale(1); }
}
.show-panel-feedback h3 {
  font-size: clamp(1.3rem, 3vw, 1.7rem);
  margin: 0 0 10px;
}
.show-panel-feedback > p {
  color: var(--text-muted);
  max-width: 560px;
  margin: 0 auto 22px;
}
.show-fb-module {
  display: flex;
  align-items: center;
  gap: 14px;
  background: linear-gradient(135deg, var(--aqua-tint), var(--purple-tint));
  border-radius: 16px;
  padding: 16px 20px;
  max-width: 480px;
  margin: 0 auto 24px;
  text-align: left;
  border: 1px solid rgba(124, 58, 237, 0.12);
}
.show-fb-mod-icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 13px;
  background: var(--grad);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  box-shadow: 0 10px 22px rgba(124, 58, 237, 0.3);
}
.show-fb-module strong {
  display: block;
  font-family: var(--font-display);
  font-size: 0.98rem;
  margin-bottom: 2px;
}
.show-fb-module span { color: var(--text-muted); font-size: 0.88rem; }

/* Panel FINAL */
.show-panel-final {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, var(--aqua-tint), var(--purple-tint));
  padding: 50px 36px 60px;
  text-align: center;
}
.show-final-trophy {
  font-size: 5rem;
  margin-bottom: 16px;
  animation: show-trophy 3s ease-in-out infinite;
  filter: drop-shadow(0 14px 28px rgba(124, 58, 237, 0.4));
}
@keyframes show-trophy {
  0%, 100% { transform: translateY(0) rotate(-3deg); }
  50% { transform: translateY(-12px) rotate(3deg); }
}
.show-panel-final h2 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  margin: 0 0 16px;
}
.show-final-score-row {
  font-family: var(--font-display);
  font-size: 1.4rem;
  margin: 0 0 8px;
}
.show-final-score-row strong {
  font-size: 2.4rem;
  font-weight: 800;
  color: var(--purple-deep);
  margin-right: 6px;
}
.show-final-score-row > span:nth-child(2) {
  color: var(--text-muted);
  font-size: 1rem;
  font-weight: 600;
  margin-right: 14px;
}
.show-stars {
  display: inline-flex;
  gap: 4px;
  font-size: 1.4rem;
  vertical-align: middle;
}
.show-stars span {
  filter: drop-shadow(0 0 8px rgba(251, 191, 36, 0.6));
  transition: transform 0.4s ease;
}
.show-stars span.dim { filter: grayscale(1); opacity: 0.35; }
.show-final-msg { color: var(--text-muted); margin: 0 0 26px; max-width: 520px; margin-left: auto; margin-right: auto; }

/* Badges */
.show-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin: 0 0 28px;
}
.show-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #FFFFFF;
  border: 2px solid var(--purple-soft);
  padding: 8px 16px;
  border-radius: 999px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.86rem;
  color: var(--purple-deep);
  box-shadow: 0 10px 24px rgba(124, 58, 237, 0.18);
  animation: show-badge-pop 0.5s ease backwards;
}
.show-badge:nth-child(1) { animation-delay: 0.1s; }
.show-badge:nth-child(2) { animation-delay: 0.25s; }
.show-badge:nth-child(3) { animation-delay: 0.4s; }
.show-badge:nth-child(4) { animation-delay: 0.55s; }
@keyframes show-badge-pop {
  0% { opacity: 0; transform: scale(0.6); }
  60% { transform: scale(1.1); }
  100% { opacity: 1; transform: scale(1); }
}
.show-badge-icon { font-size: 1.1rem; }

.show-final-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}
.show-final-confetti {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.show-final-confetti .conf {
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 2px;
  animation: show-conf 4s linear infinite;
}
.show-final-confetti .c1 { background: var(--aqua); left: 5%; animation-delay: 0s; }
.show-final-confetti .c2 { background: var(--purple); left: 15%; animation-delay: 0.3s; }
.show-final-confetti .c3 { background: #FBBF24; left: 30%; animation-delay: 0.6s; border-radius: 50%; }
.show-final-confetti .c4 { background: #F472B6; left: 45%; animation-delay: 0.9s; }
.show-final-confetti .c5 { background: var(--aqua-deep); left: 60%; animation-delay: 1.2s; border-radius: 50%; }
.show-final-confetti .c6 { background: var(--purple-light); left: 72%; animation-delay: 1.5s; }
.show-final-confetti .c7 { background: #34D399; left: 85%; animation-delay: 1.8s; }
.show-final-confetti .c8 { background: #FB923C; left: 95%; animation-delay: 2.1s; border-radius: 50%; }
@keyframes show-conf {
  0% { transform: translateY(-40px) rotate(0deg); opacity: 1; }
  100% { transform: translateY(520px) rotate(720deg); opacity: 0; }
}

/* Dots */
.show-dots {
  display: flex;
  justify-content: center;
  gap: 10px;
  padding: 20px 28px 28px;
  background: #FFFFFF;
}
.show-dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border);
  cursor: pointer;
  transition: all 0.25s;
}
.show-dots span:hover { transform: scale(1.2); background: var(--purple-soft); }
.show-dots span.active {
  width: 32px;
  border-radius: 999px;
  background: var(--grad);
}

/* ===== ANIMACIONES INTERNAS DE LAS ESCENAS ===== */
/* Cursor parpadeando (escena 1) */
.s-cursor {
  animation: s-blink 1s steps(2) infinite;
}
@keyframes s-blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

/* Sun pulse */
.s-sun {
  transform-box: fill-box;
  transform-origin: center;
  animation: s-sun 4s ease-in-out infinite;
}
@keyframes s-sun {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

/* Nubes */
.s-cloud { animation: s-cloud-drift 30s linear infinite; }
@keyframes s-cloud-drift {
  from { transform: translateX(-150px); }
  to { transform: translateX(1300px); }
}

/* Camión que rueda en su sitio (ruedas girando) */
.s-wheel {
  transform-box: fill-box;
  transform-origin: center;
  animation: s-wheel 0.6s linear infinite;
}
@keyframes s-wheel {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Camión que avanza ligero (idle) */
.s-truck-idle {
  animation: s-truck-idle 0.4s ease-in-out infinite;
}
@keyframes s-truck-idle {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-2px); }
}

/* Suelo en movimiento (para sensación de avance del camión) */
.s-road-line {
  stroke-dasharray: 30 24;
  animation: s-road-flow 1s linear infinite;
}
@keyframes s-road-flow {
  from { stroke-dashoffset: 0; }
  to { stroke-dashoffset: -54; }
}

/* Cajas siendo escaneadas (escena almacén) */
.s-scan-beam {
  transform-box: fill-box;
  transform-origin: center top;
  animation: s-scan 1.4s ease-in-out infinite;
}
@keyframes s-scan {
  0%, 100% { transform: scaleY(0.6); opacity: 0.4; }
  50% { transform: scaleY(1); opacity: 0.9; }
}

/* Checkmark drawing (escenas con docs / cierre) */
.s-check-draw {
  stroke-dasharray: 30;
  stroke-dashoffset: 30;
  animation: s-check 1s ease forwards;
}
@keyframes s-check {
  to { stroke-dashoffset: 0; }
}

/* Stamp "CERRADA" pulse */
.s-stamp {
  transform-box: fill-box;
  transform-origin: center;
  animation: s-stamp 2s ease infinite;
}
@keyframes s-stamp {
  0%, 100% { transform: rotate(-12deg) scale(1); }
  50% { transform: rotate(-12deg) scale(1.05); }
}

/* Puerta abriéndose */
.s-door {
  transform-box: fill-box;
  transform-origin: left center;
  animation: s-door 3s ease-in-out infinite;
}
@keyframes s-door {
  0%, 30%, 100% { transform: rotateY(0deg); }
  60%, 80% { transform: rotateY(-60deg); }
}

/* Confetti sutil (cierre) */
.s-confetti {
  animation: s-conf 2.4s linear infinite;
}
@keyframes s-conf {
  0% { transform: translateY(-20px) rotate(0deg); opacity: 0; }
  20% { opacity: 1; }
  100% { transform: translateY(180px) rotate(540deg); opacity: 0; }
}

/* Caption num pulse on stage change */
.show-caption-num { animation: s-num-pop 0.5s ease; }
@keyframes s-num-pop {
  0% { transform: scale(0.6); opacity: 0; }
  60% { transform: scale(1.08); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

@media (max-width: 768px) {
  /* HUD del platformer en columna */
  .show-head {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 12px 16px;
  }
  .show-stage-label { font-size: 0.78rem; }
  .show-score-block { align-self: flex-end; padding: 6px 12px; font-size: 0.9rem; }
  /* El viewer usa aspect-ratio 480/216 desde .pixel-viewer, height auto */
  .show-viewer { height: auto; }
  /* Intro pop-up del platformer compacto */
  .px-intro-box { padding: 16px 20px; max-width: 88%; }
  .px-intro-title { font-size: 1rem; letter-spacing: 0.12em; }
  .px-intro-sub { font-size: 0.85rem; }
  .px-intro-keys { font-size: 0.75rem; gap: 6px; }
  .px-intro-btn { font-size: 0.85rem; padding: 10px 22px; }
  /* Popups de pregunta/feedback/final compactos */
  .px-popup-card { padding: 14px 16px; }
  .px-popup-tag { font-size: 0.65rem; padding: 3px 8px; }
  .px-popup-question-text { font-size: 0.95rem; }
  .px-popup-opt { padding: 9px 12px; font-size: 0.82rem; gap: 10px; }
  .px-popup-opt-letter { width: 22px; height: 22px; font-size: 0.75rem; }
  .px-popup-fb-icon { width: 44px; height: 44px; font-size: 1.5rem; }
  .px-popup-fb-title { font-size: 1.05rem; }
  .px-popup-fb-text { font-size: 0.78rem; }
  .px-popup-btn { font-size: 0.78rem; padding: 9px 18px; }
  .px-popup-final-title { font-size: 1.15rem; }
  .px-popup-final-score strong { font-size: 1.25rem; }
  .px-popup-trophy { font-size: 2.4rem; }

  /* ===== MODO GUIADO ===== */
  .gd-section { padding: 40px 0 50px; }
  .gd-header h2 { font-size: 1.45rem; }
  .gd-header { margin-bottom: 22px; }
  .gd-section .hero-lead { font-size: 0.88rem; }
  .gd-hud {
    padding: 10px 14px;
    gap: 10px;
    flex-wrap: wrap;
  }
  .gd-stage-label { font-size: 0.72rem; }
  .gd-guide-chip {
    width: 100%;
    justify-content: space-between;
    font-size: 0.72rem;
    padding: 5px 10px;
  }
  .gd-guide-chip-status { font-size: 0.68rem; padding-left: 6px; }
  .gd-reset-btn { padding: 5px 9px; font-size: 0.66rem; }
  .gd-reset-label { display: none; }
  .gd-reset-icon { font-size: 1.05rem; }
  .gd-dialog { left: 10px; right: 10px; bottom: 10px; padding: 10px 14px 12px; }
  .gd-dialog-name { font-size: 0.65rem; padding: 2px 8px; }
  .gd-dialog-text { font-size: 0.78rem; margin-bottom: 8px; }
  .gd-next-btn { font-size: 0.72rem; padding: 7px 14px; }
  .gd-choices { padding: 12px; }
  .gd-choices-card { padding: 14px 14px 16px; border-width: 3px; border-radius: 12px; gap: 8px; }
  .gd-choice-header { padding-bottom: 8px; gap: 6px; }
  .gd-choice-tag { font-size: 0.62rem; padding: 3px 9px; letter-spacing: 0.1em; }
  .gd-choice-question-text { font-size: 0.88rem; line-height: 1.25; }
  .gd-choice { padding: 8px 12px; font-size: 0.78rem; gap: 10px; border-radius: 8px; }
  .gd-choice-icon { width: 28px; height: 28px; font-size: 0.85rem; }
  .gd-choice-sprite { width: 44px; height: 44px; border-width: 2px; }
  .gd-choice-text { line-height: 1.25; }
  .gd-step-done, .gd-final { inset: 10px; padding: 14px; gap: 12px; }
  .gd-step-done { flex-direction: column; align-items: center; text-align: center; overflow-y: auto; }
  .gd-step-done-info { width: 100%; }
  .gd-step-done-info h3 { text-align: center; }
  .gd-step-done-info .gd-next-btn { align-self: center; margin-top: 10px; }
  .gd-step-done h3, .gd-final h3 { font-size: 1.05rem; }
  .gd-step-done p, .gd-final p { font-size: 0.78rem; margin-bottom: 8px; }
  .gd-phone-mockup { width: 120px; }
  .gd-app-preview-tag { font-size: 0.58rem; padding: 3px 8px; }
  .gd-app-preview-caption { font-size: 0.66rem; max-width: 140px; }
  .gd-final-trophy { font-size: 2.6rem; }
  .gd-final-actions a, .gd-final-actions button { font-size: 0.82rem; padding: 8px 14px; }
}

/* Pantallas MUY chicas (< 420px) */
@media (max-width: 420px) {
  .show-head { padding: 10px 12px; }
  .show-stage-label { font-size: 0.7rem; }
  .show-score-block { font-size: 0.8rem; padding: 5px 10px; }
  .gd-header h2 { font-size: 1.2rem; }
  .gd-section .hero-lead { font-size: 0.8rem; }
  .px-popup-question-text { font-size: 0.85rem; }
  .px-popup-opt { padding: 7px 10px; font-size: 0.75rem; }
  .gd-dialog-text { font-size: 0.72rem; }
  .gd-choice { font-size: 0.72rem; padding: 7px 10px; }
  .gd-choice-sprite { width: 38px; height: 38px; }
}

/* ============================================================
   JUEGO ANTERIOR — desuso, conservado por compat
   ============================================================ */

.jgame {
  max-width: 1100px;
  margin: 0 auto;
  background: #FFFFFF;
  border-radius: 28px;
  box-shadow:
    0 0 80px rgba(124, 58, 237, 0.18),
    0 30px 60px rgba(45, 212, 191, 0.12),
    0 0 0 1px var(--border);
  overflow: hidden;
  position: relative;
}

/* HUD (header con progreso + score) */
.jgame-hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 28px;
  background: linear-gradient(90deg, var(--navy-deep), var(--navy));
  color: #fff;
  gap: 20px;
}
.jgame-progress { flex: 1; max-width: 560px; }
.jgame-progress-text {
  display: block;
  font-family: var(--font-display);
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 8px;
}
.jgame-progress-text strong { color: #fff; font-size: 1.05rem; }
.jgame-package {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 6px;
  color: var(--aqua);
  font-weight: 800;
}
.jgame-progress-bar {
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  overflow: hidden;
}
.jgame-progress-fill {
  height: 100%;
  width: 0;
  background: var(--grad);
  border-radius: 999px;
  box-shadow: 0 0 14px rgba(45, 212, 191, 0.6);
  transition: width 0.6s ease;
}
.jgame-score {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  padding: 8px 16px;
  border-radius: 999px;
  font-family: var(--font-display);
}
.jgame-score-star { font-size: 1.1rem; filter: drop-shadow(0 0 6px rgba(251, 191, 36, 0.6)); }
.jgame-score strong { font-size: 1.15rem; font-weight: 800; color: #FBBF24; }
.jgame-score span { font-size: 0.8rem; color: rgba(255, 255, 255, 0.6); }

/* MUNDO (la escena fluida con personaje) */
.jworld {
  position: relative;
  width: 100%;
  height: 360px;
  overflow: hidden;
  background: #E0F2FE;
}
.jworld-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

/* Sol pulse */
.jsun {
  transform-box: fill-box;
  transform-origin: center;
  animation: jsun-pulse 4s ease-in-out infinite;
}
.jsun-glow {
  transform-box: fill-box;
  transform-origin: center;
  animation: jsun-glow 4s ease-in-out infinite;
}
@keyframes jsun-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}
@keyframes jsun-glow {
  0%, 100% { opacity: 0.2; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(1.15); }
}

/* Nubes drift */
.jcloud { animation-timing-function: linear; animation-iteration-count: infinite; }
.jcloud-1 { animation: jcloud-1 38s linear infinite; }
.jcloud-2 { animation: jcloud-2 50s linear infinite; }
.jcloud-3 { animation: jcloud-3 60s linear infinite; }
@keyframes jcloud-1 {
  from { transform: translateX(-160px); }
  to { transform: translateX(1360px); }
}
@keyframes jcloud-2 {
  from { transform: translateX(-160px); }
  to { transform: translateX(1360px); }
}
@keyframes jcloud-3 {
  from { transform: translateX(-160px); }
  to { transform: translateX(1360px); }
}

/* Luz del semáforo blink */
.jlight {
  animation: jlight-blink 2s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: center;
}
@keyframes jlight-blink {
  0%, 90%, 100% { fill: #10B981; }
  92%, 96% { fill: #FBBF24; }
}

/* Checkpoints flotando sobre el mundo */
.jcheckpoint {
  position: absolute;
  top: 38%;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: #FFFFFF;
  border: 3px solid var(--purple-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  box-shadow: 0 10px 24px rgba(124, 58, 237, 0.25);
  transform: translateX(-50%);
  z-index: 5;
  animation: jcp-bob 2s ease-in-out infinite;
  transition: all 0.3s;
}
.jcheckpoint.done {
  background: var(--grad);
  border-color: transparent;
  box-shadow: 0 14px 28px rgba(45, 212, 191, 0.5);
}
.jcheckpoint.done .jcheckpoint-pin { filter: grayscale(1) brightness(2); }
.jcheckpoint.active {
  transform: translateX(-50%) scale(1.25);
  box-shadow: 0 0 0 8px rgba(124, 58, 237, 0.2), 0 14px 28px rgba(124, 58, 237, 0.5);
  background: var(--grad);
  border-color: transparent;
  animation: jcp-pulse 1.2s ease-in-out infinite;
}
@keyframes jcp-bob {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -6px; }
}
@keyframes jcp-pulse {
  0%, 100% { box-shadow: 0 0 0 8px rgba(124, 58, 237, 0.15), 0 14px 28px rgba(124, 58, 237, 0.5); }
  50% { box-shadow: 0 0 0 16px rgba(124, 58, 237, 0.0), 0 14px 28px rgba(124, 58, 237, 0.6); }
}

/* Personaje Carlos */
.jchar {
  position: absolute;
  bottom: 4%;
  left: 5%;
  width: 70px;
  height: 110px;
  z-index: 10;
  transition: left 2.6s cubic-bezier(0.45, 0.1, 0.25, 1);
  transform: translateX(-50%);
}
.jchar svg { width: 100%; height: 100%; display: block; }

/* Walking animation: bounce + legs alternating + arms swing */
.jchar.walking svg { animation: jchar-bounce 0.45s ease-in-out infinite; }
.jchar.walking .jleg-l { animation: jleg-l 0.45s ease-in-out infinite; }
.jchar.walking .jleg-r { animation: jleg-r 0.45s ease-in-out infinite; }
.jchar.walking .jarm-l { animation: jarm-l 0.45s ease-in-out infinite; }
.jchar.walking .jarm-r { animation: jarm-r 0.45s ease-in-out infinite; }

@keyframes jchar-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}
.jleg, .jarm { transform-box: fill-box; }
.jleg-l, .jarm-r { transform-origin: top center; }
.jleg-r, .jarm-l { transform-origin: top center; }
@keyframes jleg-l {
  0%, 100% { transform: rotate(-14deg); }
  50% { transform: rotate(14deg); }
}
@keyframes jleg-r {
  0%, 100% { transform: rotate(14deg); }
  50% { transform: rotate(-14deg); }
}
@keyframes jarm-l {
  0%, 100% { transform: rotate(10deg); }
  50% { transform: rotate(-10deg); }
}
@keyframes jarm-r {
  0%, 100% { transform: rotate(-10deg); }
  50% { transform: rotate(10deg); }
}

/* Idle: leve respiración */
.jchar:not(.walking) svg { animation: jchar-breathe 3s ease-in-out infinite; }
@keyframes jchar-breathe {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-1px) scale(1.01); }
}

/* Estado entregado: paquete desaparece */
.jchar.delivered .jpkg { opacity: 0; transition: opacity 0.4s ease; }

/* PANEL: narrativa + pregunta + opciones */
.jpanel {
  padding: 32px 36px;
  animation: jpanel-in 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
@keyframes jpanel-in {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
.jpanel-narrative {
  background: linear-gradient(135deg, var(--aqua-tint), var(--purple-tint));
  border-radius: 14px;
  padding: 16px 20px;
  margin-bottom: 22px;
  border-left: 4px solid var(--purple);
  color: var(--text);
  font-size: 0.98rem;
  line-height: 1.55;
  font-style: italic;
}
.jpanel-narrative strong { font-style: normal; color: var(--purple-deep); font-family: var(--font-display); }
.jpanel-question {
  font-size: clamp(1.25rem, 2.6vw, 1.7rem);
  margin: 0 0 22px;
  line-height: 1.25;
}
.jpanel-options { display: flex; flex-direction: column; gap: 11px; }

.jopt {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #FFFFFF;
  border: 2px solid var(--border);
  padding: 14px 18px;
  border-radius: 14px;
  font-family: var(--font-body);
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: transform 0.2s, border-color 0.2s, background 0.2s, box-shadow 0.2s;
}
.jopt:hover {
  border-color: var(--purple);
  background: var(--purple-tint);
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(124, 58, 237, 0.15);
}
.jopt:disabled { cursor: default; }
.jopt.correct {
  border-color: var(--aqua);
  background: var(--aqua-soft);
  color: #0F766E;
  animation: jopt-correct 0.5s ease;
}
.jopt.wrong {
  border-color: #EF4444;
  background: #FEE2E2;
  color: #991B1B;
  animation: jopt-wrong 0.5s ease;
}
.jopt-letter {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--purple-tint);
  color: var(--purple-deep);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.92rem;
}
.jopt.correct .jopt-letter { background: var(--aqua); color: #fff; }
.jopt.wrong .jopt-letter { background: #EF4444; color: #fff; }
@keyframes jopt-correct {
  0% { transform: scale(1); }
  40% { transform: scale(1.03); }
  100% { transform: scale(1); }
}
@keyframes jopt-wrong {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

/* Feedback panel (después de responder) */
.jpanel-feedback {
  text-align: center;
  padding: 36px 36px 40px;
}
.jpanel-feedback-icon {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  font-weight: 800;
  color: #fff;
}
.jpanel-feedback.correct .jpanel-feedback-icon {
  background: linear-gradient(135deg, var(--aqua), var(--aqua-deep));
  box-shadow: 0 0 36px rgba(45, 212, 191, 0.5);
  animation: jfb-bounce 0.5s ease;
}
.jpanel-feedback.wrong .jpanel-feedback-icon {
  background: linear-gradient(135deg, #FB923C, #EF4444);
  box-shadow: 0 0 36px rgba(239, 68, 68, 0.5);
  animation: jfb-bounce 0.5s ease;
}
@keyframes jfb-bounce {
  0% { transform: scale(0); }
  60% { transform: scale(1.15); }
  100% { transform: scale(1); }
}
.jpanel-feedback h3 {
  font-size: clamp(1.3rem, 3vw, 1.7rem);
  margin: 0 0 10px;
}
.jpanel-feedback > p {
  color: var(--text-muted);
  max-width: 540px;
  margin: 0 auto 22px;
}

.jmodule {
  display: flex;
  align-items: center;
  gap: 14px;
  background: linear-gradient(135deg, var(--aqua-tint), var(--purple-tint));
  border-radius: 16px;
  padding: 16px 20px;
  max-width: 460px;
  margin: 0 auto 24px;
  text-align: left;
  border: 1px solid rgba(124, 58, 237, 0.12);
}
.jmodule-icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 13px;
  background: var(--grad);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  box-shadow: 0 10px 22px rgba(124, 58, 237, 0.3);
}
.jmodule strong {
  display: block;
  font-family: var(--font-display);
  font-size: 0.98rem;
  margin-bottom: 2px;
}
.jmodule span { color: var(--text-muted); font-size: 0.88rem; }

/* Final */
.jpanel-final {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, var(--aqua-tint), var(--purple-tint));
  padding: 50px 36px 60px;
  text-align: center;
}
.jfinal-trophy {
  font-size: 4.6rem;
  margin-bottom: 14px;
  animation: jtrophy 3s ease-in-out infinite;
  filter: drop-shadow(0 12px 24px rgba(124, 58, 237, 0.35));
}
@keyframes jtrophy {
  0%, 100% { transform: translateY(0) rotate(-3deg); }
  50% { transform: translateY(-10px) rotate(3deg); }
}
.jpanel-final h2 { font-size: clamp(1.8rem, 4vw, 2.4rem); margin: 0 0 14px; }
.jfinal-story { color: var(--text); font-size: 1rem; max-width: 540px; margin: 0 auto 14px; line-height: 1.55; }
.jfinal-story strong { color: var(--purple-deep); font-family: var(--font-display); }
.jfinal-sub { color: var(--text-muted); margin: 0 0 26px; }
.jfinal-sub strong { color: var(--purple-deep); font-size: 1.2rem; }
.jfinal-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

.jfinal-confetti {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.conf {
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 2px;
  animation: jconfetti 4s linear infinite;
}
.c1 { background: var(--aqua); left: 5%; animation-delay: 0s; }
.c2 { background: var(--purple); left: 15%; animation-delay: 0.3s; }
.c3 { background: #FBBF24; left: 30%; animation-delay: 0.6s; border-radius: 50%; }
.c4 { background: #F472B6; left: 45%; animation-delay: 0.9s; }
.c5 { background: var(--aqua-deep); left: 60%; animation-delay: 1.2s; border-radius: 50%; }
.c6 { background: var(--purple-light); left: 72%; animation-delay: 1.5s; }
.c7 { background: #34D399; left: 85%; animation-delay: 1.8s; }
.c8 { background: #FB923C; left: 95%; animation-delay: 2.1s; border-radius: 50%; }
@keyframes jconfetti {
  0% { transform: translateY(-40px) rotate(0deg); opacity: 1; }
  100% { transform: translateY(500px) rotate(720deg); opacity: 0; }
}

/* Responsive */
@media (max-width: 700px) {
  .jworld { height: 260px; }
  .jchar { width: 50px; height: 80px; }
  .jcheckpoint { width: 40px; height: 40px; font-size: 1.1rem; top: 40%; }
  .jgame-hud { flex-direction: column; align-items: stretch; padding: 16px 20px; }
  .jgame-progress { max-width: none; }
  .jpanel { padding: 24px 22px; }
}

/* ============================================================
   (juego anterior, ahora desuso pero conservado por si...)
   ============================================================ */
.game-section { padding: 60px 0 120px; }

.game {
  max-width: 980px;
  margin: 0 auto;
  background: #FFFFFF;
  border-radius: 28px;
  box-shadow:
    0 0 80px rgba(124, 58, 237, 0.18),
    0 30px 60px rgba(45, 212, 191, 0.12),
    0 0 0 1px var(--border);
  overflow: hidden;
  position: relative;
}

/* Header con progreso + score */
.game-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 28px;
  background: linear-gradient(90deg, var(--navy-deep), var(--navy));
  color: #fff;
  gap: 20px;
}
.game-progress { flex: 1; max-width: 520px; }
.game-progress-text {
  display: block;
  font-family: var(--font-display);
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.65);
  margin-bottom: 8px;
}
.game-progress-text strong { color: #fff; font-size: 1.1rem; }
.game-progress-bar {
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  overflow: hidden;
}
.game-progress-fill {
  height: 100%;
  width: 16.66%;
  background: var(--grad);
  border-radius: 999px;
  box-shadow: 0 0 14px rgba(45, 212, 191, 0.6);
  transition: width 0.5s ease;
}
.game-score {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  padding: 8px 16px;
  border-radius: 999px;
  font-family: var(--font-display);
}
.game-score-star { font-size: 1.1rem; filter: drop-shadow(0 0 6px rgba(251, 191, 36, 0.6)); }
.game-score strong { font-size: 1.15rem; font-weight: 800; color: #FBBF24; }
.game-score span { font-size: 0.8rem; color: rgba(255, 255, 255, 0.6); }

/* Stage = escena + contenido */
.game-stage {
  display: grid;
  grid-template-columns: 1fr;
  animation: stage-in 0.5s ease;
}
@keyframes stage-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Escena ilustrada (colorida, varía por nivel) */
.game-scene {
  min-height: 280px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.game-scene svg { max-width: 100%; height: 240px; display: block; }

/* Contenido con pregunta + opciones */
.game-content {
  padding: 36px 36px 40px;
  background: #FFFFFF;
}
.game-tag {
  display: inline-block;
  background: var(--purple-tint);
  color: var(--purple-deep);
  padding: 5px 14px;
  border-radius: 999px;
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 16px;
}
.game-question {
  font-size: clamp(1.4rem, 3vw, 2rem);
  margin: 0 0 24px;
  line-height: 1.2;
}

/* Botones de opciones */
.game-options { display: flex; flex-direction: column; gap: 12px; }
.game-option {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #FFFFFF;
  border: 2px solid var(--border);
  padding: 16px 20px;
  border-radius: 16px;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: transform 0.2s, border-color 0.2s, background 0.2s, box-shadow 0.2s;
  width: 100%;
}
.game-option:hover {
  border-color: var(--purple);
  background: var(--purple-tint);
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(124, 58, 237, 0.15);
}
.game-option:disabled { cursor: default; }
.game-option.correct {
  border-color: var(--aqua);
  background: var(--aqua-soft);
  color: #0F766E;
  animation: correct-pop 0.5s ease;
}
.game-option.wrong {
  border-color: #EF4444;
  background: #FEE2E2;
  color: #991B1B;
  animation: wrong-shake 0.5s ease;
}
.game-option-letter {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--purple-tint);
  color: var(--purple-deep);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 800;
}
.game-option.correct .game-option-letter {
  background: var(--aqua);
  color: #fff;
}
.game-option.wrong .game-option-letter {
  background: #EF4444;
  color: #fff;
}

@keyframes correct-pop {
  0% { transform: scale(1); }
  40% { transform: scale(1.04); }
  100% { transform: scale(1); }
}
@keyframes wrong-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-6px); }
  80% { transform: translateX(6px); }
}

/* Feedback (overlay tras responder) */
.game-feedback {
  padding: 40px 36px;
  text-align: center;
  animation: stage-in 0.4s ease;
}
.game-feedback-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  margin: 0 auto 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.4rem;
  font-weight: 800;
  color: #fff;
}
.game-feedback.correct .game-feedback-icon {
  background: linear-gradient(135deg, var(--aqua), var(--aqua-deep));
  box-shadow: 0 0 40px rgba(45, 212, 191, 0.5);
  animation: bounce-in 0.5s ease;
}
.game-feedback.wrong .game-feedback-icon {
  background: linear-gradient(135deg, #FB923C, #EF4444);
  box-shadow: 0 0 40px rgba(239, 68, 68, 0.5);
  animation: bounce-in 0.5s ease;
}
@keyframes bounce-in {
  0% { transform: scale(0); }
  60% { transform: scale(1.15); }
  100% { transform: scale(1); }
}
.game-feedback h3 {
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  margin: 0 0 10px;
}
.game-feedback > p {
  color: var(--text-muted);
  font-size: 1rem;
  max-width: 540px;
  margin: 0 auto 26px;
}

/* Card del módulo que resolvió la situación */
.game-module-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: linear-gradient(135deg, var(--aqua-tint), var(--purple-tint));
  border-radius: 18px;
  padding: 18px 22px;
  max-width: 480px;
  margin: 0 auto 28px;
  text-align: left;
  border: 1px solid rgba(124, 58, 237, 0.12);
}
.game-module-icon {
  flex-shrink: 0;
  width: 50px;
  height: 50px;
  border-radius: 14px;
  background: var(--grad);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  box-shadow: 0 10px 24px rgba(124, 58, 237, 0.3);
}
.game-module-card strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1rem;
  margin-bottom: 2px;
}
.game-module-card span { color: var(--text-muted); font-size: 0.9rem; }

/* Pantalla final */
.game-final {
  padding: 50px 36px 60px;
  text-align: center;
  position: relative;
  overflow: hidden;
  animation: stage-in 0.5s ease;
  background: linear-gradient(180deg, var(--purple-tint) 0%, var(--aqua-tint) 100%);
}
.game-final-trophy {
  font-size: 5rem;
  margin-bottom: 16px;
  animation: trophy-float 3s ease-in-out infinite;
  filter: drop-shadow(0 12px 24px rgba(124, 58, 237, 0.35));
}
@keyframes trophy-float {
  0%, 100% { transform: translateY(0) rotate(-3deg); }
  50% { transform: translateY(-10px) rotate(3deg); }
}
.game-final h2 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  margin: 0 0 14px;
}
.game-final > p {
  color: var(--text-muted);
  font-size: 1.05rem;
  margin: 0 0 8px;
}
.game-final > p strong { color: var(--purple-deep); font-size: 1.3rem; }
.game-final-sub { max-width: 520px; margin: 6px auto 28px !important; }
.game-final-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

/* Confetti */
.game-final-confetti {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.conf {
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 2px;
  animation: confetti-fall 4s linear infinite;
}
.c1 { background: var(--aqua); left: 5%; animation-delay: 0s; }
.c2 { background: var(--purple); left: 15%; animation-delay: 0.3s; }
.c3 { background: #FBBF24; left: 30%; animation-delay: 0.6s; border-radius: 50%; }
.c4 { background: #F472B6; left: 45%; animation-delay: 0.9s; }
.c5 { background: var(--aqua-deep); left: 60%; animation-delay: 1.2s; border-radius: 50%; }
.c6 { background: var(--purple-light); left: 72%; animation-delay: 1.5s; }
.c7 { background: #34D399; left: 85%; animation-delay: 1.8s; }
.c8 { background: #FB923C; left: 95%; animation-delay: 2.1s; border-radius: 50%; }
@keyframes confetti-fall {
  0% { transform: translateY(-40px) rotate(0deg); opacity: 1; }
  100% { transform: translateY(500px) rotate(720deg); opacity: 0; }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 960px) {
  .nav-links { display: none; }
  .hero-inner { grid-template-columns: 1fr; gap: 48px; }
  .pain-grid,
  .value-grid,
  .benefits-grid,
  .roles-grid { grid-template-columns: repeat(2, 1fr); }
  .module { grid-template-columns: 1fr; gap: 40px; }
  .module:nth-child(even) .module-visual { order: 0; }
  .module-list { grid-template-columns: 1fr; }
  .flow-timeline { grid-template-columns: repeat(2, 1fr); }
  .flow-timeline::before { display: none; }
}
@media (max-width: 600px) {
  .section { padding: 70px 0; }
  .hero { padding: 60px 0 100px; }
  .pain-grid,
  .value-grid,
  .benefits-grid,
  .roles-grid { grid-template-columns: 1fr; }
  .flow-timeline { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .final-cta { padding: 40px 24px; border-radius: 24px; }
  .footer-inner { flex-direction: column; text-align: center; }

  .game-head { flex-direction: column; align-items: stretch; padding: 16px 20px; }
  .game-progress { max-width: none; }
  .game-content { padding: 28px 22px 32px; }
  .game-scene { min-height: 220px; }
  .game-scene svg { height: 200px; }
}
