/* Web pública de Zentral Pad (zentralpad.com): página de expectación con el nombre, una frase, el correo de contacto y
   unas escenas animadas con trozos de la app (ranking, estadísticas, nivel y partido). Solo HTML y CSS, sin JavaScript
   ni estilos en línea (F-14). Fuentes de la app (web/fonts): Space Grotesk para títulos y cifras, Inter para el texto */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url(fonts/inter-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url(fonts/inter-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(fonts/space-grotesk-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(fonts/space-grotesk-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}


/* Cifras animadas: números enteros que interpolan solos (contador CSS) */
@property --pts { syntax: '<integer>'; inherits: false; initial-value: 180; }
@property --games { syntax: '<integer>'; inherits: false; initial-value: 0; }
@property --wins { syntax: '<integer>'; inherits: false; initial-value: 0; }
@property --lv { syntax: '<integer>'; inherits: false; initial-value: 42; }

:root {
  /* Colores de la app (web/app.css) */
  --bg: #050b0c;
  --hero-ink: #eaf3f2;
  --hero-muted: #9fb3b1;
  --surface: #ffffff;
  --line: #d8e3e1;
  --line-soft: #e7efee;
  --ink: #0b1a1c;
  --ink-muted: #596f72;
  --accent: #00bfa6;
  --accent-text: #007c6c;
  --accent-soft: #e1f7f3;
  --green-text: #177f4c;
  --green-soft: #e3f8ee;
  --coral: #ff5a46;
  --amber: #f5a623;
  --violet: #8b5cf6;
  --font: 'Inter', system-ui, sans-serif;
  --font-display: 'Space Grotesk', 'Inter', sans-serif;
  --loop: 20s;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background:
    radial-gradient(50% 60% at 78% 45%, rgba(0, 191, 166, 0.22), transparent 70%),
    radial-gradient(40% 50% at 5% 100%, rgba(0, 191, 166, 0.10), transparent 70%),
    var(--bg);
  color: var(--hero-ink);
  font: 400 16px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.page {
  flex: 1;
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  align-items: center;
  gap: 56px;
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  padding: 48px 24px;
}
.brand {
  margin: 0 0 24px;
  font: 700 clamp(64px, 11vw, 136px)/0.92 var(--font-display);
  letter-spacing: -0.045em;
}
.brand span { display: block; color: var(--accent); }
.lead { margin: 0 0 40px; max-width: 24ch; color: var(--hero-ink); font-size: clamp(20px, 2.4vw, 26px); line-height: 1.35; }
.contact { margin: 0; color: var(--hero-muted); font-size: 15px; }
.contact a {
  display: inline-block;
  margin-top: 4px;
  color: var(--hero-ink);
  font-weight: 600;
  font-size: 18px;
  text-decoration: none;
  border-bottom: 2px solid var(--accent);
}
.contact a:hover { color: var(--accent); }
.contact a:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
footer { padding: 0 24px 24px; color: var(--hero-muted); font-size: 13px; text-align: center; }

/* ---------- Escenario: cuatro escenas de 5 s cada una, en bucle ---------- */
.stage { position: relative; height: 470px; max-width: 400px; width: 100%; justify-self: center; }
.scene {
  position: absolute;
  inset: 0 0 30px;
  opacity: 0;
  animation: scene var(--loop) infinite both;
  animation-delay: var(--d);
}
.s1 { --d: 0s; }
.s2 { --d: 5s; }
.s3 { --d: 10s; }
.s4 { --d: 15s; }
.scene * { animation-delay: var(--d); }
@keyframes scene {
  0% { opacity: 0; transform: translateY(24px) scale(0.97); }
  3%, 22% { opacity: 1; transform: none; }
  25%, 100% { opacity: 0; transform: translateY(-24px) scale(0.97); }
}
.caption {
  margin: 0 0 14px;
  color: var(--hero-ink);
  font: 700 22px/1.2 var(--font-display);
  letter-spacing: -0.01em;
  text-align: center;
}
.card {
  background: var(--surface);
  color: var(--ink);
  border-radius: 18px;
  padding: 20px;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.06);
}
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.card-head b { font: 700 18px/1 var(--font-display); }
.card-head span { color: var(--ink-muted); font-size: 12.5px; }

/* Puntos de avance bajo las escenas */
.dots { position: absolute; left: 0; right: 0; bottom: 0; display: flex; justify-content: center; gap: 8px; }
.dots i { width: 22px; height: 4px; border-radius: 2px; background: rgba(234, 243, 242, 0.18); overflow: hidden; position: relative; }
.dots i::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  animation: dot var(--loop) linear infinite both;
}
.dots i:nth-child(2)::after { animation-delay: 5s; }
.dots i:nth-child(3)::after { animation-delay: 10s; }
.dots i:nth-child(4)::after { animation-delay: 15s; }
@keyframes dot {
  0% { transform: scaleX(0); }
  25% { transform: scaleX(1); }
  25.01%, 100% { transform: scaleX(0); }
}

/* Escena 1: ranking. Los números de puesto no se mueven; las filas sí */
.rank { display: grid; grid-template-columns: 26px 1fr; gap: 6px; }
.pos { margin: 0; padding: 0; list-style: none; }
.pos li { height: 56px; display: grid; place-items: center; color: var(--ink-muted); font: 700 15px/1 var(--font-display); }
.rows { position: relative; height: 280px; }
.row {
  position: absolute;
  left: 0;
  right: 0;
  height: 50px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  border-radius: 12px;
  font-size: 14.5px;
  font-weight: 500;
}
.row span { flex: 1; }
.row em { font: 700 14px/1 var(--font-display); font-style: normal; color: var(--ink-muted); }
.r1 { top: 3px; }
.r2 { top: 59px; animation: down var(--loop) infinite both; }
.r3 { top: 115px; animation: down var(--loop) infinite both; }
.r4 { top: 171px; animation: down var(--loop) infinite both; }
.me {
  top: 227px;
  z-index: 1;
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1.5px var(--accent);
  font-weight: 700;
  animation: climb var(--loop) infinite both;
}
.me em { color: var(--accent-text); }
.pts { counter-reset: pts var(--pts); animation: pts var(--loop) infinite both; }
.pts::after { content: '1.' counter(pts); } /* separador de miles: «1.» y tres cifras */
.up {
  color: var(--green-text);
  background: var(--green-soft);
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 12px;
  opacity: 0;
  animation: pop var(--loop) infinite both;
}
@keyframes climb {
  0%, 6% { transform: translateY(0); box-shadow: inset 0 0 0 1.5px var(--accent); }
  13%, 100% { transform: translateY(-168px); box-shadow: inset 0 0 0 1.5px var(--accent), 0 12px 28px rgba(0, 124, 108, 0.25); }
}
@keyframes down {
  0%, 6% { transform: translateY(0); }
  13%, 100% { transform: translateY(56px); }
}
@keyframes pts {
  0%, 6% { --pts: 180; }
  13%, 100% { --pts: 342; }
}
@keyframes pop {
  0%, 12% { opacity: 0; transform: scale(0.6); }
  14% { opacity: 1; transform: scale(1.15); }
  16%, 100% { opacity: 1; transform: scale(1); }
}
.av {
  width: 32px;
  height: 32px;
  flex: none;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  font: 700 11px/1 var(--font);
  font-style: normal;
}
.a0 { background: var(--accent-text); }
.a1 { background: var(--violet); }
.a2 { background: var(--coral); }
.a3 { background: #3b82c4; }
.a4 { background: var(--amber); }

/* Escena 2: estadísticas */
.stats { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.kpi .label { display: block; color: var(--ink-muted); font-size: 13px; margin-bottom: 4px; }
.games { font: 700 64px/1 var(--font-display); letter-spacing: -0.03em; counter-reset: g var(--games); animation: games var(--loop) infinite both; }
.games::after { content: counter(g); }
@keyframes games {
  0%, 3% { --games: 0; }
  14%, 100% { --games: 128; }
}
.ring { position: relative; width: 104px; height: 104px; display: grid; place-content: center; text-align: center; }
.ring svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 9; }
.ring .track { stroke: var(--line-soft); }
.ring .fill {
  stroke: var(--accent);
  stroke-linecap: round;
  stroke-dasharray: 201;
  stroke-dashoffset: 201;
  animation: ring var(--loop) infinite both;
}
@keyframes ring {
  0%, 4% { stroke-dashoffset: 201; }
  15%, 100% { stroke-dashoffset: 72; }
}
.wins { position: relative; font: 700 24px/1 var(--font-display); counter-reset: w var(--wins); animation: wins var(--loop) infinite both; }
.wins::after { content: counter(w) ' %'; }
.ring span { position: relative; color: var(--ink-muted); font-size: 11px; }
@keyframes wins {
  0%, 4% { --wins: 0; }
  15%, 100% { --wins: 64; }
}
.bars { display: flex; align-items: flex-end; gap: 8px; height: 110px; padding-top: 8px; border-top: 1px solid var(--line-soft); }
.bars i {
  flex: 1;
  border-radius: 6px 6px 2px 2px;
  background: var(--accent-soft);
  transform-origin: bottom;
  animation: bar var(--loop) infinite both;
}
.bars i:nth-child(1) { height: 35%; }
.bars i:nth-child(2) { height: 48%; }
.bars i:nth-child(3) { height: 40%; }
.bars i:nth-child(4) { height: 62%; }
.bars i:nth-child(5) { height: 55%; }
.bars i:nth-child(6) { height: 74%; }
.bars i:nth-child(7) { height: 82%; }
.bars i:nth-child(8) { height: 100%; background: var(--accent); }
.s2 .bars i:nth-child(2) { animation-delay: calc(var(--d) + 0.1s); }
.s2 .bars i:nth-child(3) { animation-delay: calc(var(--d) + 0.2s); }
.s2 .bars i:nth-child(4) { animation-delay: calc(var(--d) + 0.3s); }
.s2 .bars i:nth-child(5) { animation-delay: calc(var(--d) + 0.4s); }
.s2 .bars i:nth-child(6) { animation-delay: calc(var(--d) + 0.5s); }
.s2 .bars i:nth-child(7) { animation-delay: calc(var(--d) + 0.6s); }
.s2 .bars i:nth-child(8) { animation-delay: calc(var(--d) + 0.7s); }
@keyframes bar {
  0%, 4% { transform: scaleY(0); }
  10%, 100% { transform: scaleY(1); }
}
.bars-legend { display: flex; justify-content: space-between; margin-top: 6px; color: var(--ink-muted); font-size: 11.5px; }

/* Escena 3: nivel */
.level { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.level b { font: 700 72px/1 var(--font-display); letter-spacing: -0.03em; }
.lv { counter-reset: lv var(--lv); animation: lv var(--loop) infinite both; }
.lv::after { content: counter(lv, decimal-leading-zero); }
@keyframes lv {
  0%, 4% { --lv: 42; }
  15%, 100% { --lv: 87; }
}
.chip {
  color: var(--green-text);
  background: var(--green-soft);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 13px;
  white-space: nowrap;
  opacity: 0;
  animation: pop var(--loop) infinite both;
}
.chart { display: block; width: 100%; height: 170px; overflow: visible; }
.chart .grid { fill: none; stroke: var(--line-soft); stroke-width: 1; }
.chart .line {
  fill: none;
  stroke: var(--accent);
  stroke-width: 3.5;
  stroke-linecap: round;
  stroke-dasharray: 400;
  stroke-dashoffset: 400;
  vector-effect: non-scaling-stroke;
  animation: draw var(--loop) infinite both;
}
.chart .area { fill: rgba(0, 191, 166, 0.12); opacity: 0; animation: fade var(--loop) infinite both; }
.chart .dot { fill: var(--accent); stroke: #fff; stroke-width: 3; opacity: 0; animation: fade var(--loop) infinite both; }
@keyframes draw {
  0%, 4% { stroke-dashoffset: 400; }
  15%, 100% { stroke-dashoffset: 0; }
}
@keyframes fade {
  0%, 13% { opacity: 0; }
  16%, 100% { opacity: 1; }
}

/* Escena 4: partido registrado y logro */
.match { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; margin-bottom: 16px; }
.team { display: flex; align-items: center; gap: 14px; padding: 14px 16px; font-size: 14.5px; color: var(--ink-muted); }
.team + .team { border-top: 1px solid var(--line-soft); }
.team span { flex: 1; }
.team b { width: 22px; text-align: center; font: 700 26px/1 var(--font-display); }
.team.win { color: var(--ink); font-weight: 600; background: var(--accent-soft); }
.team.win b { color: var(--accent-text); }
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.facts span { color: var(--ink-muted); font-size: 11.5px; line-height: 1.3; text-align: center; }
.facts b { display: block; color: var(--ink); font: 700 18px/1.3 var(--font-display); }
.toast {
  position: relative;
  margin: 18px auto 0;
  display: flex;
  align-items: center;
  gap: 12px;
  width: max-content;
  max-width: 100%;
  padding: 12px 18px 12px 12px;
  border-radius: 14px;
  background: #0b1a1c;
  color: #fff;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(0, 191, 166, 0.5);
  font-size: 13px;
  line-height: 1.3;
  opacity: 0;
  transform: translateY(20px);
  animation: toast var(--loop) infinite both;
}
.toast i { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: rgba(245, 166, 35, 0.2); font-style: normal; font-size: 19px; }
.toast b { display: block; color: var(--accent); font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; }
@keyframes toast {
  0%, 9% { opacity: 0; transform: translateY(20px) scale(0.95); }
  12%, 100% { opacity: 1; transform: none; }
}

@media (max-width: 880px) {
  .page { grid-template-columns: 1fr; gap: 40px; padding: 40px 20px 32px; }
  .intro { text-align: center; }
  .lead { margin-inline: auto; margin-bottom: 28px; }
}
@media (max-width: 380px) {
  .card { padding: 16px; }
  .games { font-size: 52px; }
  .level b { font-size: 60px; }
}
/* Sin movimiento: se queda fija la primera escena, ya terminada */
@media (prefers-reduced-motion: reduce) {
  .scene:not(.s1), .dots { display: none; }
  .stage { height: 420px; }
  .scene, .scene * { animation-delay: -3s !important; animation-play-state: paused !important; }
}
