@font-face {
  font-family: 'Clash Display';
  src: url('../vendor/ClashDisplay-Bold.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: 'Plus Jakarta Sans';
  src: url('../vendor/PlusJakartaSans-Regular.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Plus Jakarta Sans';
  src: url('../vendor/PlusJakartaSans-Medium.woff2') format('woff2');
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: 'Plus Jakarta Sans';
  src: url('../vendor/PlusJakartaSans-SemiBold.woff2') format('woff2');
  font-weight: 600;
  font-display: swap;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html, body { width: 100%; height: 100%; overflow: hidden; background: #0a0a0a; color: #fff; }
body { font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif; -webkit-font-smoothing: antialiased; }

#pantalla { position: relative; width: 100vw; height: 100vh; overflow: hidden; }

.escena {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: none;
}
.escena.active { opacity: 1; visibility: visible; pointer-events: auto; }

.magenta { color: #D91A8A; }
.x { color: #D91A8A; }

/* E0 */
.e0-center { text-align: center; }
.e0-logo { margin-bottom: 32px; }
.e0-logo-img { max-width: 340px; height: auto; background: #fff; border-radius: 8px; padding: 20px 28px; }
.e0-logo-fallback { font-family: 'Clash Display', sans-serif; font-size: 72px; font-weight: 700; }
.e0-konnexia { font-family: 'Clash Display', sans-serif; font-size: 48px; font-weight: 700; margin-top: 16px; }
.e0-sub { color: #9CA3AF; font-size: 14px; margin-top: 6px; }
.e0-fecha { position: absolute; bottom: 48px; left: 50%; transform: translateX(-50%); color: #9CA3AF; font-size: 18px; }

/* E1 */
.e1-center { text-align: center; }
.e1-frase { font-family: 'Clash Display', sans-serif; font-weight: 700; font-size: clamp(72px, 10vw, 140px); line-height: 1.1; }
.e1-linea { opacity: 0; transform: translateY(30px); }
.e1-sub { color: #9CA3AF; font-size: 32px; margin-top: 48px; opacity: 0; transform: translateY(20px); }

/* E2, E3, E4, E6 grafo */
.grafo-svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.e2-titulo { position: absolute; top: 32px; left: 50%; transform: translateX(-50%); font-size: 28px; color: #9CA3AF; z-index: 2; }
.e3-frase {
  position: absolute; bottom: 0; left: 0; right: 0;
  height: 200px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(10, 10, 10, 0.9);
  font-size: clamp(24px, 2.5vw, 36px); color: #fff; text-align: center;
  max-width: 100%; padding: 0 60px;
  z-index: 2; font-weight: 500;
}

/* E4 */
.e4-titulo { position: absolute; top: 60px; left: 50%; transform: translateX(-50%); text-align: center; z-index: 2; }
.e4-main { font-family: 'Clash Display', sans-serif; font-size: 56px; font-weight: 700; }
.e4-sub { color: #9CA3AF; font-size: 24px; margin-top: 8px; }

/* E5 */
.e5-center { text-align: center; }
.e5-juego { font-family: 'Clash Display', sans-serif; font-size: clamp(72px, 9vw, 120px); font-weight: 700; }
.e5-subtitulo { color: #9CA3AF; font-size: 28px; margin-top: 24px; max-width: 700px; }
.e5-crono { font-family: 'Clash Display', sans-serif; font-size: 180px; font-weight: 700; margin-top: 48px; letter-spacing: 8px; }
.e5-crono.warn { color: #D91A8A; }
.e5-crono.blink { animation: blink 0.5s infinite; }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.2; } }

/* E6 */
.e6-red-texto {
  position: absolute; bottom: 60px; left: 50%; transform: translateX(-50%);
  color: #9CA3AF; font-size: 32px; z-index: 2; text-align: center;
}
.e6-overlay {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; z-index: 3; padding: 40px;
}
.e6-main { font-family: 'Clash Display', sans-serif; font-size: clamp(48px, 7vw, 96px); font-weight: 700; }
.e6-sub { color: #9CA3AF; font-size: 32px; margin-top: 24px; max-width: 800px; }

/* Header logos */
.header-logos {
  position: absolute; top: 20px; left: 24px; right: 24px;
  display: flex; justify-content: space-between; align-items: center;
  z-index: 10;
}
.header-logo-ese { height: 36px; width: auto; background: #fff; border-radius: 6px; padding: 4px 8px; }
.header-konnexia { font-family: 'Clash Display', sans-serif; font-size: 20px; font-weight: 700; }

/* Banner mensaje */
.banner-mensaje {
  position: absolute; inset: 0;
  background: #D91A8A;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Clash Display', sans-serif;
  font-size: clamp(48px, 6vw, 96px);
  font-weight: 700;
  text-align: center;
  padding: 40px;
  z-index: 100;
  word-break: break-word;
}

/* Fullscreen button */
.btn-fullscreen {
  position: absolute; bottom: 16px; right: 16px;
  background: rgba(255,255,255,0.1); border: none; color: #fff;
  width: 44px; height: 44px; border-radius: 8px;
  font-size: 20px; cursor: pointer; z-index: 50;
  opacity: 0.6; transition: opacity 0.3s;
}
.btn-fullscreen.hidden { opacity: 0; pointer-events: none; }

/* Footer ERK */
.footer-erk {
  position: fixed; bottom: 8px; left: 16px; z-index: 5;
}
.footer-erk a { color: #9CA3AF; opacity: 0.35; font-size: 12px; text-decoration: none; }

/* Cluster labels E3 */
.cluster-label {
  font-family: 'Clash Display', sans-serif;
  font-weight: 700;
  text-anchor: middle;
}

/* Node text */
.node-name {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 600;
  fill: #fff;
  text-anchor: middle;
}
.node-empresa {
  font-family: 'Plus Jakarta Sans', sans-serif;
  fill: #9CA3AF;
  text-anchor: middle;
}
.node-etiqueta {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 15px;
  fill: #ccc;
  text-anchor: middle;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .escena { transition: none !important; }
  .e0-center, .e1-linea, .e1-sub { opacity: 1 !important; transform: none !important; }
  .e5-crono.blink { animation: none !important; }
  * { animation-duration: 0s !important; transition-duration: 0s !important; }
}
