/* ejGames — la web. El sistema de la app: carbón cálido, un solo rojo y tres
   formas del logo (el disco es Jugar, el anillo es el progreso, la ranura es
   dónde estás). Sin dependencias. */

:root {
  --bg: #141315;
  --panel: #1c1b1e;
  --lift: #262428;
  --lift-2: #302d32;
  --text: #f5f2ee;
  --soft: #d6d1cb;
  --muted: #a8a29c;
  --red: #ff3a2d;
  --display: "Segoe UI Variable Display", "Onest", system-ui, sans-serif;
  --body: "Segoe UI Variable Text", "Onest", system-ui, sans-serif;
  --pad: 32px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--bg); }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.5 var(--body); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
img { display: block; }
svg { display: block; }
.grow { flex: 1; }
.muted { color: var(--muted); }
.center { text-align: center; justify-content: center; margin-left: auto; margin-right: auto; }
.wrap { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 var(--pad); }
.skip { position: absolute; left: -9999px; top: 8px; z-index: 100; padding: 10px 16px; border-radius: 20px; background: var(--text); color: var(--bg); font-weight: 700; }
.skip:focus { left: 16px; }
:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; }

/* ── navegación ── */
.nav { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 8px; height: 72px; padding: 0 var(--pad); background: color-mix(in srgb, var(--bg) 78%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.nav-logo svg { width: 40px; height: 40px; transition: transform 0.3s ease; }
.nav-logo:hover svg { transform: rotate(-14deg); }
.nav-links { display: flex; gap: 4px; margin-left: 24px; }
.nav-links a { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px 14px 0; font-family: var(--display); font-size: 15px; font-weight: 600; color: var(--muted); }
.nav-links a::after { content: ""; width: 22px; height: 5px; border-radius: 1.5px; background: transparent; transition: background 0.2s; }
.nav-links a:hover { color: var(--text); }
.nav-links a:hover::after { background: var(--red); }

.pill { display: inline-flex; align-items: center; justify-content: center; gap: 10px; height: 44px; padding: 0 20px; border-radius: 22px; background: var(--lift); font-weight: 600; font-size: 14px; white-space: nowrap; transition: transform 0.15s ease, background 0.15s ease; }
.pill:hover { transform: translateY(-2px); background: var(--lift-2); }
.pill.light { background: var(--text); color: var(--bg); }
.pill.light:hover { background: #fff; }
.pill.lg { height: 60px; padding: 0 30px; border-radius: 30px; font-size: 17px; }
.pill svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ── héroe: el muro de carátulas y la moneda ── */
.hero { position: relative; min-height: calc(100vh - 72px); min-height: max(760px, calc(100svh - 72px)); display: flex; align-items: center; overflow: hidden; padding: 60px 0; }
.wall { position: absolute; inset: -160px -200px -160px 38%; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 18px; transform: perspective(1400px) rotateX(18deg) rotateY(-22deg) rotateZ(6deg); opacity: 0.55; pointer-events: none;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 30%, #000 80%, transparent), linear-gradient(transparent, #000 20%, #000 80%, transparent); -webkit-mask-composite: source-in;
  mask-image: linear-gradient(90deg, transparent, #000 30%, #000 80%, transparent), linear-gradient(transparent, #000 20%, #000 80%, transparent); mask-composite: intersect; }
.col { display: flex; flex-direction: column; gap: 18px; animation: up 40s linear infinite; will-change: transform; }
.col.slow { animation-duration: 55s; }
.col.down { animation-name: down; }
.col img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 16px; background: var(--panel); box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5); }
@keyframes up { to { transform: translateY(calc(-50% - 9px)); } }
@keyframes down { from { transform: translateY(calc(-50% - 9px)); } to { transform: translateY(0); } }
.glow { position: absolute; left: -10%; top: 10%; width: 780px; height: 780px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 58, 45, 0.22), transparent 62%); filter: blur(20px); animation: breathe 7s ease-in-out infinite; pointer-events: none; }
@keyframes breathe { 50% { transform: scale(1.12); opacity: 0.7; } }
.hero-in { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: flex-start; gap: 26px; max-width: 640px; }
.kicker { display: inline-flex; align-items: center; gap: 10px; height: 36px; padding: 0 16px 0 8px; border-radius: 18px; background: var(--panel); font-size: 14px; font-weight: 600; }
.kicker i { width: 22px; height: 5px; border-radius: 1.5px; background: var(--red); }
.kicker.soft { padding: 0 14px; background: rgba(245, 242, 238, 0.12); }
.big { font-family: var(--display); font-size: clamp(56px, 8vw, 104px); font-weight: 900; letter-spacing: -0.06em; line-height: 0.92; }
.big em { font-style: normal; color: var(--red); }
.lead { font-size: 20px; line-height: 1.5; color: var(--soft); max-width: 540px; }
.cta { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.fine { font-size: 13px; color: var(--muted); }
.in { animation: rise 0.9s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.in.d1 { animation-delay: 0.08s; }
.in.d2 { animation-delay: 0.16s; }
.in.d3 { animation-delay: 0.24s; }
.in.d4 { animation-delay: 0.32s; }
@keyframes rise { from { opacity: 0; transform: translateY(28px); } }

/* La moneda en 3D: dos caras y un canto hecho de capas. */
.coin-stage { position: absolute; right: 14%; top: 50%; width: 300px; height: 300px; margin-top: -150px; perspective: 1100px; z-index: 3; animation: float 6s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-22px); } }
.coin { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; animation: spin 7s cubic-bezier(0.6, 0, 0.4, 1) infinite; }
@keyframes spin {
  0% { transform: rotateY(-25deg) rotateX(8deg); }
  45%, 50% { transform: rotateY(155deg) rotateX(8deg); }
  95%, 100% { transform: rotateY(335deg) rotateX(8deg); }
}
.face, .edge { position: absolute; inset: 0; border-radius: 50%; }
.edge { background: #c42419; transform: translateZ(var(--z)); }
.face svg { width: 100%; height: 100%; }
.face.front { transform: translateZ(12px); }
.face.back { transform: rotateY(180deg) translateZ(12px); }
.coin-shadow { position: absolute; left: 12%; right: 12%; bottom: -90px; height: 36px; border-radius: 50%; background: radial-gradient(rgba(0, 0, 0, 0.6), transparent 70%); filter: blur(6px); animation: shadow 6s ease-in-out infinite; }
@keyframes shadow { 50% { transform: scale(0.82); opacity: 0.6; } }

/* ── cinta ── */
.ribbon { display: flex; gap: 56px; padding: 26px 0; border-block: 1px solid rgba(245, 242, 238, 0.06); overflow: hidden; }
.ribbon-track { display: flex; gap: 56px; flex: none; animation: slide 34s linear infinite; }
.ribbon span { display: flex; align-items: center; gap: 14px; font-family: var(--display); font-size: 22px; font-weight: 700; white-space: nowrap; color: var(--soft); }
.ribbon span::before { content: ""; width: 12px; height: 12px; border-radius: 50%; background: var(--red); }
@keyframes slide { to { transform: translateX(calc(-100% - 56px)); } }

/* ── secciones ── */
.sec { padding: 140px 0 0; }
.sec-head { display: flex; flex-direction: column; gap: 16px; max-width: 1000px; margin-bottom: 56px; }
.eyebrow { font-size: 14px; font-weight: 700; color: var(--red); letter-spacing: 0.02em; }
.h2 { font-family: var(--display); font-size: clamp(40px, 5.4vw, 64px); font-weight: 900; letter-spacing: -0.05em; line-height: 0.98; }
.p { font-size: 18px; line-height: 1.6; color: var(--soft); }
.sec-head .p { max-width: 760px; }
.p.narrow { max-width: 420px; }

/* Aparecer con el scroll: con animation-timeline donde se puede; si no, main.js añade .is-in. */
@supports (animation-timeline: view()) {
  .reveal { animation: reveal linear both; animation-timeline: view(); animation-range: entry 0% cover 28%; }
  .tilt { animation: tilt linear both; animation-timeline: view(); animation-range: entry 0% cover 50%; }
}
@keyframes reveal { from { opacity: 0; transform: translateY(60px) scale(0.97); } }
@keyframes tilt { from { transform: perspective(1600px) rotateX(24deg) scale(0.88); opacity: 0.2; } }
.no-sda .reveal, .no-sda .tilt { opacity: 0; transform: translateY(60px) scale(0.97); transition: opacity 0.8s ease, transform 0.9s cubic-bezier(0.2, 0.8, 0.2, 1); }
.no-sda .tilt { transform: perspective(1600px) rotateX(24deg) scale(0.88); }
.no-sda .is-in { opacity: 1; transform: none; }

/* La app en pantalla. */
.shot { position: relative; border-radius: 28px; overflow: hidden; background: var(--bg); box-shadow: 0 0 0 1px rgba(245, 242, 238, 0.08), 0 60px 120px rgba(0, 0, 0, 0.6), 0 0 140px rgba(255, 58, 45, 0.12); }
.app-top { display: flex; align-items: center; gap: 6px; height: 58px; padding: 0 20px; }
.app-top svg { width: 30px; height: 30px; margin-right: 18px; }
.app-top .tab { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 6px 12px 0; font-family: var(--display); font-size: 14px; font-weight: 600; color: var(--muted); }
.app-top .tab::after { content: ""; width: 20px; height: 4px; border-radius: 1.5px; }
.app-top .tab.on { color: var(--text); }
.app-top .tab.on::after { background: var(--red); }
.app-hero { position: relative; margin: 4px 20px 0; height: 340px; border-radius: 24px; overflow: hidden; background: var(--panel); }
.app-hero img.bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 70% 40%; }
.app-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(20, 19, 21, 0.94), rgba(20, 19, 21, 0.6) 35%, transparent 65%); }
.app-hero-in { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: flex-start; gap: 14px; height: 100%; padding: 34px 40px; }
.app-logo { width: 340px; max-width: 60%; }
.app-meta { font-size: 15px; color: var(--soft); }
.disc-btn { display: inline-flex; align-items: center; gap: 12px; margin-top: auto; font-family: var(--display); font-size: 18px; font-weight: 700; }
.disc { width: 58px; height: 58px; border-radius: 50%; background: var(--red); display: grid; place-items: center; flex: none; animation: pulse 2.4s ease-in-out infinite; }
.disc::before { content: ""; margin-left: 5px; border-left: 17px solid var(--bg); border-top: 10px solid transparent; border-bottom: 10px solid transparent; }
.disc.xl { width: 110px; height: 110px; }
.disc.xl::before { margin-left: 9px; border-left-width: 32px; border-top-width: 19px; border-bottom-width: 19px; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 58, 45, 0.5); } 50% { box-shadow: 0 0 0 16px rgba(255, 58, 45, 0); } }
.app-row { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 16px; padding: 24px 20px 26px; }
.app-row div { display: flex; flex-direction: column; gap: 8px; }
.app-row img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 12px; background: var(--panel); transition: transform 0.25s ease; }
.app-row div::after { content: ""; width: 20px; height: 4px; border-radius: 1.5px; }
.app-row div.on img { transform: translateY(-6px); box-shadow: 0 14px 30px rgba(0, 0, 0, 0.5); }
.app-row div.on::after { background: var(--red); }

/* Las tres formas. */
.shapes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.shape { display: flex; flex-direction: column; gap: 18px; min-height: 360px; padding: 34px; border-radius: 30px; background: var(--panel); transition: transform 0.3s ease, background 0.3s ease; }
.shape:hover { transform: translateY(-6px); background: var(--lift); }
.demo { height: 150px; display: flex; align-items: center; }
.shape h3 { font-family: var(--display); font-size: 30px; font-weight: 800; letter-spacing: -0.03em; }
.ring { position: relative; width: 130px; height: 130px; display: grid; place-items: center; flex: none; }
.ring svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 9; stroke-linecap: round; }
.ring .bg { stroke: var(--lift-2); }
.ring .fg { stroke: var(--red); stroke-dasharray: 0 100; animation: fill 4s cubic-bezier(0.6, 0, 0.2, 1) infinite; }
@keyframes fill { 0% { stroke-dasharray: 0 100; } 70%, 100% { stroke-dasharray: 100 100; } }
.ring b { position: relative; font-family: var(--display); font-size: 22px; }
.ring.sm { width: 84px; height: 84px; }
.ring.sm img { position: relative; width: 52px; height: 52px; border-radius: 50%; object-fit: cover; }
.ring.xs { width: 52px; height: 52px; }
.ring.xs circle { stroke-width: 8; }
.tabs-demo { position: relative; display: flex; gap: 26px; font-family: var(--display); font-size: 20px; font-weight: 600; color: var(--muted); }
.tabs-demo span { padding-bottom: 16px; }
.tabs-demo i { position: absolute; left: 0; bottom: 0; width: 26px; height: 6px; border-radius: 2px; background: var(--red); animation: hop 4.5s cubic-bezier(0.7, 0, 0.2, 1) infinite; }
@keyframes hop { 0%, 20% { transform: translateX(12px); } 33%, 53% { transform: translateX(92px); } 66%, 86% { transform: translateX(186px); } 100% { transform: translateX(12px); } }

/* Funciones en mosaico. */
.bento { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 18px; }
.card { position: relative; display: flex; flex-direction: column; gap: 12px; padding: 30px; border-radius: 30px; background: var(--panel); overflow: hidden; min-height: 300px; }
.card.tall { min-height: 340px; }
.card h3 { font-family: var(--display); font-size: 28px; font-weight: 800; letter-spacing: -0.03em; }
.card .p { font-size: 16px; }
.c2 { grid-column: span 2; }
.c3 { grid-column: span 3; }
.c4 { grid-column: span 4; }
.card .art { position: absolute; right: -30px; bottom: -40px; display: flex; gap: 12px; transform: rotate(-8deg); }
.card .art img { width: 120px; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 12px; box-shadow: 0 20px 40px rgba(0, 0, 0, 0.45); transition: transform 0.4s ease; }
.card:hover .art img:nth-child(1), .card:hover .art img:nth-child(3) { transform: translateY(-14px); }
.card:hover .art img:nth-child(2) { transform: translateY(-26px); }
.boxes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: auto; }
.boxes img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 12px; background: var(--lift); }
.dl { display: flex; align-items: center; gap: 20px; margin-top: auto; padding: 16px; border-radius: 22px; background: var(--bg); }
.dl b { font-family: var(--display); font-size: 20px; }
.steps { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.steps span { display: flex; align-items: center; gap: 7px; }
.steps i { width: 9px; height: 9px; border-radius: 50%; background: var(--lift-2); }
.steps .on { color: var(--text); }
.steps .on i { width: 20px; height: 5px; border-radius: 1.5px; background: var(--red); }
.mini-stat { display: flex; align-items: baseline; gap: 8px; margin-top: auto; }
.mini-stat b { font-family: var(--display); font-size: 84px; font-weight: 900; letter-spacing: -0.06em; line-height: 1; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; }
.chips span { padding: 7px 14px; border-radius: 16px; background: var(--lift); font-size: 14px; font-weight: 600; }

/* En partida. */
.ov { position: relative; height: 620px; border-radius: 30px; overflow: hidden; background: var(--panel); }
.ov-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ov::after { content: ""; position: absolute; inset: 0; background: rgba(14, 13, 15, 0.5); }
.toast { position: absolute; z-index: 2; right: 28px; top: 28px; display: flex; align-items: center; gap: 14px; width: 380px; max-width: calc(100% - 56px); padding: 10px 22px 10px 10px; border-radius: 40px; background: var(--panel); box-shadow: 0 14px 40px rgba(0, 0, 0, 0.4); animation: toast 6s cubic-bezier(0.2, 0.9, 0.25, 1.1) infinite; }
@keyframes toast { 0%, 8% { opacity: 0; transform: translateY(-30px); } 16%, 70% { opacity: 1; transform: none; } 80%, 100% { opacity: 0; transform: translateY(-16px); } }
.toast small { display: block; font-size: 12px; color: var(--muted); }
.toast b { font-family: var(--display); font-size: 17px; }
.dock { position: absolute; z-index: 2; left: 50%; bottom: 36px; transform: translateX(-50%); display: flex; gap: 6px; padding: 14px 18px 18px; border-radius: 44px; background: var(--panel); box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45); }
.act { display: flex; flex-direction: column; align-items: center; gap: 7px; width: 84px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.act > span { width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center; background: var(--lift); color: var(--text); }
.act svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.dock-slot { position: absolute; bottom: 7px; left: 49px; width: 22px; height: 5px; border-radius: 1.5px; background: var(--red); animation: dock 9s cubic-bezier(0.7, 0, 0.2, 1) infinite; }
@keyframes dock { 0%, 12% { transform: translateX(0); } 17%, 29% { transform: translateX(90px); } 34%, 46% { transform: translateX(180px); } 51%, 63% { transform: translateX(270px); } 68%, 80% { transform: translateX(360px); } 85%, 100% { transform: translateX(450px); } }

/* Final: mete la moneda. */
.final { position: relative; margin: 140px 0 0; padding: 120px 0 130px; text-align: center; overflow: hidden; }
.final::before { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse 50% 48% at 50% 50%, rgba(255, 58, 45, 0.2), transparent); pointer-events: none; }
.final .wrap { position: relative; }
.final .big { font-size: clamp(64px, 10vw, 120px); }
.final .lead { margin-top: 22px; }
.final .cta { margin-top: 34px; }
.slot-wrap { position: relative; width: 260px; height: 150px; margin: 0 auto 40px; perspective: 600px; }
.slot { position: absolute; z-index: 1; left: 50%; bottom: 0; width: 180px; height: 22px; margin-left: -90px; border-radius: 6px; background: #0a090b; box-shadow: inset 0 3px 8px rgba(0, 0, 0, 0.8), 0 0 0 6px var(--panel); }
.drop-clip { position: absolute; left: 0; right: 0; top: -60px; bottom: 11px; overflow: hidden; }
.drop { position: absolute; left: 50%; top: 60px; width: 110px; height: 110px; margin-left: -55px; animation: insert 3.6s cubic-bezier(0.5, 0, 0.75, 0) infinite; }
.drop svg { width: 100%; height: 100%; }
@keyframes insert { 0% { transform: translateY(-40px); opacity: 0; } 15% { opacity: 1; } 55% { transform: translateY(20px) rotateX(0); } 75% { transform: translateY(64px) rotateX(78deg); opacity: 1; } 82%, 100% { transform: translateY(82px) rotateX(90deg); opacity: 0; } }

.foot { display: flex; flex-wrap: wrap; align-items: center; gap: 22px; padding: 34px var(--pad) 40px; border-top: 1px solid rgba(245, 242, 238, 0.06); font-size: 14px; color: var(--muted); }
.foot svg { width: 28px; height: 28px; }
.foot a:hover { color: var(--text); }
.foot .strong { color: var(--text); font-weight: 600; }

@media (max-width: 980px) {
  :root { --pad: 20px; }
  .nav-links, .nav .ghost span { display: none; }
  .nav .ghost { width: 44px; padding: 0; }
  .coin-stage { display: none; }
  .wall { inset: -100px -260px -100px 25%; opacity: 0.35; }
  .shapes, .bento { grid-template-columns: minmax(0, 1fr); }
  .c2, .c3, .c4 { grid-column: auto; }
  .card .art { opacity: 0.5; }
  .app-row { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .app-row div:nth-child(n + 5) { display: none; }
  .app-top { gap: 0; padding: 0 12px; }
  .app-top svg { margin-right: 6px; }
  .app-top .tab:last-child { display: none; }
  .app-hero { height: 280px; margin: 4px 12px 0; }
  .app-row { padding: 18px 12px 20px; gap: 10px; }
  .app-hero-in { padding: 24px; }
  .sec { padding-top: 100px; }
  .ov { height: 520px; }
  .dock { gap: 0; padding: 12px 10px 8px; transform: translateX(-50%) scale(0.72); transform-origin: bottom center; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .no-sda .reveal, .no-sda .tilt { opacity: 1; transform: none; }
}
