/* ============ Fuentes ============ */
@font-face {
  font-family: Syne;
  src: url("assets/fonts/Syne-ExtraBold.woff2") format("woff2");
  font-weight: 800;
  font-display: swap;
}
@font-face {
  font-family: Allo;
  src: url("assets/fonts/AlloVariableFriendly.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

/* ============ Colores de la marca ============ */
:root {
  --night: #2a1f5c;      /* morado noche */
  --deep: #0e0a24;       /* morado profundo */
  --cream: #f2eee6;
  --lavender: #cfc4ff;
  --panel: #342a6c;
  --green: #5fd068;
  --green-d: #3f9a4a;
  --mint: #7fe0a9;       /* fondo de la tarjeta de Tokka */
  --ink: #2a1d6e;        /* contorno del logo de Tokka */
  --gutter: clamp(16px, 5vw, 64px);
  --bounce: cubic-bezier(.3, 1.6, .5, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--deep);
  color: var(--cream);
  font: 400 clamp(16px, 1.1vw + 12px, 19px)/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
body.locked { overflow: hidden; }
h1, h2, h3 { margin: 0; font-weight: 800; }
p { margin: 0 0 1em; }
a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

.kicker { font-size: 14px; letter-spacing: .18em; text-transform: uppercase; color: var(--lavender); opacity: .8; margin-bottom: 12px; }

/* ============ 0. Entrada ============ */
.gate {
  position: fixed; inset: 0; z-index: 50;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 28px;
  background: linear-gradient(var(--night), var(--deep));
  transition: opacity .7s ease .25s, visibility 0s linear .95s;
}
.gate-hola {
  font: 800 clamp(44px, 9vw, 104px)/1 Syne;
  color: var(--cream);
  animation: breathe 2.6s ease-in-out infinite;
  transition: transform .35s ease-in, opacity .35s ease-in, letter-spacing .35s;
}
.gate-hola:hover { letter-spacing: .04em; }
.gate-quiet { font-size: 14px; color: var(--lavender); opacity: .55; transition: opacity .2s; }
.gate-quiet:hover { opacity: 1; }
@keyframes breathe { 50% { transform: scale(1.05); opacity: .8; } }

.gate.out { opacity: 0; visibility: hidden; }
.gate.out .gate-hola { animation: none; transform: scale(.6); opacity: 0; }
.gate.out .gate-quiet { opacity: 0; }

/* ============ Barra superior ============ */
.nav {
  position: fixed; inset: 0 0 auto; z-index: 10;
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px var(--gutter);
  opacity: 0; transform: translateY(-10px);
  transition: opacity .6s, transform .6s, background .4s;
}
body.entered .nav { opacity: 1; transform: none; transition-delay: 2.2s, 2.2s, 0s; }
.nav.scrolled { background: rgba(14, 10, 36, .7); backdrop-filter: blur(12px); transition-delay: 0s !important; }
.nav-logo { font: 800 20px Syne; letter-spacing: .08em; text-decoration: none; }
.nav nav { display: flex; gap: 28px; }
.nav nav a { text-decoration: none; color: var(--lavender); font-size: 15px; transition: color .2s; }
.nav nav a:hover { color: #fff; }
.nav nav { align-items: center; }
.lang-btn {
  padding: 4px 12px; border-radius: 99px; font-size: 13px; font-weight: 700; letter-spacing: .04em;
  color: var(--lavender); border: 1px solid rgba(207,196,255,.3); transition: background .2s, color .2s;
}
.lang-btn:hover { background: var(--cream); color: var(--ink); }

/* ============ 1. Inicio ============ */
.hero {
  min-height: 100svh; position: relative; overflow: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 28px; padding: 0 var(--gutter);
  background: linear-gradient(var(--night), var(--deep));
  text-align: center;
}

.wordmark-float { animation: float 5s ease-in-out 2s infinite alternate; }
.wordmark {
  display: inline-flex; gap: .06em;
  font: 800 clamp(44px, 14.5vw, 190px)/1 Syne;
  color: var(--cream);
  opacity: 0;
  /* sombra larga abajo-derecha = volumen */
  text-shadow:
    .008em .011em 0 rgba(18,11,48,.55), .016em .021em 0 rgba(18,11,48,.55),
    .024em .032em 0 rgba(18,11,48,.55), .032em .043em 0 rgba(18,11,48,.55),
    .040em .053em 0 rgba(18,11,48,.55), .048em .064em 0 rgba(18,11,48,.55),
    .056em .075em 0 rgba(18,11,48,.55), .064em .085em 0 rgba(18,11,48,.55),
    .072em .096em 0 rgba(18,11,48,.55), .080em .107em 0 rgba(18,11,48,.55);
}
/* Animación "C · Peso": llega separada y transparente, se junta de golpe y tiembla.
   --delay = cuándo entra la voz (lo pone script.js) */
.hero.play .wordmark {
  animation:
    join .25s cubic-bezier(.2, .8, .3, 1) var(--delay) both,
    shake .32s linear calc(var(--delay) + .2s);
}
@keyframes join {
  0%   { gap: .96em; opacity: 0; }
  15%  { opacity: .3; }
  100% { gap: .06em; opacity: 1; }
}
@keyframes shake {
  15% { transform: translateX(.03em); }
  30% { transform: translateX(-.025em); }
  45% { transform: translateX(.018em); }
  60% { transform: translateX(-.012em); }
  75% { transform: translateX(.006em); }
}
@keyframes float { to { transform: translateY(-8px); } }

/* Fichas del inicio: una por cada campanita */
.hero-tk {
  position: absolute; left: var(--x); top: var(--y);
  width: clamp(34px, 5vw, 62px); aspect-ratio: 1;
  translate: -50% -50%; rotate: var(--r);
  font-size: clamp(9px, 1.2vw, 15px);
  opacity: 0;
}
.hero.play .hero-tk {
  animation:
    tkpop .55s var(--bounce) calc(var(--delay) + var(--t)) both,
    bob 3.2s ease-in-out calc(var(--delay) + 1s) infinite alternate;
}
.hero-tk:nth-of-type(even) { animation-duration: .55s, 4s !important; }
@keyframes tkpop { from { transform: scale(0) rotate(-40deg); opacity: 0; } to { opacity: 1; } }
@keyframes bob { from { opacity: 1; } to { opacity: 1; transform: translateY(-14px) rotate(6deg); } }

.tagline { font-size: clamp(18px, 2.2vw, 24px); color: var(--lavender); opacity: 0; }
.tagline em { font-style: normal; color: var(--cream); }
.hero.play .tagline { animation: rise .8s ease calc(var(--delay) + .9s) both; }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

.sound-btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 10px 18px 10px 14px; border-radius: 99px;
  background: rgba(255,255,255,.06); border: 1px solid rgba(207,196,255,.2);
  color: var(--lavender); font-size: 15px; opacity: 0;
  transition: background .2s, color .2s;
}
.hero.play .sound-btn { animation: rise .8s ease calc(var(--delay) + 1.3s) both; }
.sound-btn:hover { background: rgba(255,255,255,.12); color: #fff; }
.sound-btn svg { width: 22px; fill: currentColor; }
.sound-btn .wave { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.sound-btn.playing .wave { animation: pulse .5s ease-in-out infinite alternate; }
@keyframes pulse { to { opacity: .3; } }

.scroll-hint { position: absolute; bottom: 32px; width: 2px; height: 48px; background: rgba(207,196,255,.15); overflow: hidden; }
.scroll-hint span { display: block; width: 100%; height: 40%; background: var(--lavender); animation: drip 2s ease-in-out infinite; }
@keyframes drip { from { transform: translateY(-100%); } to { transform: translateY(260%); } }

/* ============ Fichas (las mismas del juego) ============ */
.tk {
  position: absolute; inset: 4%;
  display: grid; place-items: center;
  border-radius: 28%;
  background: var(--c);
  box-shadow: inset 0 -.32em 0 var(--d), 0 .2em .3em rgba(10,6,24,.35);
}
.tk svg { width: 42%; fill: #fff; margin-top: -.25em; }
.c0 { --c: #ff5d6c; --d: #b8434e; }
.c1 { --c: #ffc23d; --d: #b88b2c; }
.c2 { --c: #4fa8ff; --d: #3979b8; }
.c3 { --c: #a57bff; --d: #7758b8; }
.c4 { --c: #5fd068; --d: #44964b; }

/* ============ 2. Nuestro juego ============ */
.games { padding: clamp(80px, 12vw, 150px) var(--gutter); text-align: center; }
.games-title { font: 800 clamp(34px, 5.5vw, 72px)/1.05 Syne; margin-bottom: clamp(40px, 6vw, 72px); }
.games-title span { color: var(--lavender); }

.game-card {
  max-width: 1100px; margin: 0 auto; text-align: left;
  background: var(--mint); color: var(--ink);
  border-radius: clamp(24px, 4vw, 44px);
  overflow: hidden; position: relative;
  box-shadow: 0 40px 100px rgba(0,0,0,.45);
  transition: transform .5s var(--bounce), box-shadow .5s;
}
.game-card:not(.open):hover { transform: translateY(-6px); }

.game-head {
  display: grid; grid-template-columns: 1.15fr .85fr; align-items: center; gap: 24px;
  padding: clamp(28px, 5vw, 64px) clamp(24px, 5vw, 64px);
}
.game-intro { align-self: center; }

/* Logo de Tokka: se dibuja en un canvas con el mismo código del juego (script.js) */
.tokka-logo { display: block; width: min(500px, 100%); margin: 0 0 20px -12px; cursor: pointer; }

.pitch { font: 800 clamp(22px, 2.4vw, 32px)/1.2 Syne; max-width: 16em; }
.pitch b {
  font-weight: inherit;
  background: linear-gradient(transparent 58%, #fff4e4 58%, #fff4e4 92%, transparent 92%);   /* subrayado tipo marcador */
}
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tags span { padding: 4px 12px; border-radius: 99px; background: rgba(42,29,110,.12); font-size: 14px; font-weight: 600; }

.expand-btn {
  display: inline-flex; align-items: center; gap: 14px; margin-top: 8px;
  padding: 14px 16px 14px 26px; border-radius: 99px;
  background: var(--ink); color: #fff4e4;
  font: 800 19px Allo, sans-serif;
  transition: transform .2s var(--bounce), background .2s;
}
.expand-btn:hover { transform: scale(1.04); background: #3a2a8f; }
.plus { position: relative; width: 30px; height: 30px; border-radius: 50%; background: #fff4e4; transition: transform .5s var(--bounce); }
.plus::before, .plus::after { content: ""; position: absolute; left: 50%; top: 50%; width: 12px; height: 2.5px; border-radius: 2px; background: var(--ink); translate: -50% -50%; }
.plus::after { rotate: 90deg; }
.game-card.open .plus { transform: rotate(135deg); }

/* Móvil con capturas que se van turnando */
.phone {
  position: relative; justify-self: center;
  width: min(250px, 62vw); aspect-ratio: 9 / 16;
  border: 10px solid #07050f; border-radius: 40px; overflow: hidden;
  box-shadow: 0 30px 60px rgba(42,29,110,.45);
  rotate: 6deg;
  transition: rotate .6s var(--bounce), translate .6s var(--bounce);
}
.game-card:hover .phone { rotate: 2deg; translate: 0 -12px; }
.phone img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: 0;
  transition: opacity .9s;
}
.phone img.is-on { opacity: 1; }

/* Parte desplegable: animar la fila de 0fr a 1fr */
.game-more { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .8s cubic-bezier(.6, 0, .2, 1); position: relative; z-index: 1; }
.game-card.open .game-more { grid-template-rows: 1fr; }
.game-more-inner { overflow: hidden; background: #6fd49b; }
.game-more-inner > * { opacity: 0; transform: translateY(30px); transition: opacity .5s, transform .6s var(--bounce); }
.game-card.open .game-more-inner > * { opacity: 1; transform: none; }
.game-card.open .game-more-inner > :nth-child(1) { transition-delay: .35s; }
.game-card.open .game-more-inner > :nth-child(2) { transition-delay: .5s; }

.how {
  display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 6vw, 72px); align-items: center;
  padding: clamp(40px, 6vw, 72px) clamp(24px, 5vw, 64px);
}
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 28px; }
.steps li { display: flex; gap: 18px; align-items: flex-start; }
.steps b {
  flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px;
  background: var(--ink); color: #fff4e4; font: 900 22px Allo, sans-serif;
}
.steps h3 { font: 800 clamp(20px, 2vw, 26px) Syne; margin-bottom: 2px; }
.steps p { margin: 0; opacity: .85; }

.game-foot {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 24px;
  padding: 28px clamp(24px, 5vw, 64px) clamp(32px, 5vw, 56px);
  border-top: 2px dashed rgba(42,29,110,.2);
}
.honest { max-width: 30em; margin: 0; }

/* Tablero animado */
.demo { position: relative; width: min(360px, 100%); justify-self: center; font-size: clamp(12px, 3.4vw, 15px); }
.demo-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.order { padding: 12px 16px; border-radius: 16px; background: var(--panel); box-shadow: 0 6px 0 #221a4c; }
.mini { display: grid; grid-template-columns: repeat(3, 12px); grid-auto-rows: 12px; gap: 3px; }
.mini i { border-radius: 3px; }
.score { font: 900 2.6em/1 Allo, sans-serif; color: #fff4e4; text-shadow: 0 .06em 0 var(--ink), 0 0 .04em var(--ink); }
.board {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: .5em; padding: .9em;
  border-radius: 24px; background: #3a2d74;
  box-shadow: 0 24px 50px rgba(42,29,110,.4);
}
.cell { position: relative; aspect-ratio: 1; border-radius: 22%; background: rgba(14,10,36,.35); }
.tk.old { filter: saturate(.7) brightness(.8); }
.tk.drop { animation: drop .38s var(--bounce) both; }
.tk.glow { animation: glow .45s ease-in-out infinite alternate; }
.tk.cash { animation: cash .45s ease-in forwards; }
.tk.fade { transition: opacity .4s, transform .4s; opacity: 0; transform: scale(.6); }
@keyframes drop { from { transform: translateY(-70%) scale(1.25); opacity: 0; } }
@keyframes glow { to { transform: scale(1.07); filter: brightness(1.2); box-shadow: inset 0 -.32em 0 var(--d), 0 0 0 .22em rgba(255,255,255,.55); } }
@keyframes cash { 30% { transform: scale(1.2); } 100% { transform: scale(0) rotate(30deg); opacity: 0; } }

.finger {
  position: absolute; left: 50%; top: 110%; width: 2.4em; height: 2.4em; border-radius: 50%;
  background: rgba(255,255,255,.35); border: 2px solid #fff;
  translate: -50% -50%; opacity: 0; pointer-events: none;
  transition: left .55s ease-in-out, top .55s ease-in-out, opacity .3s;
}
.finger.show { opacity: 1; }
.finger.tap { animation: tap .3s ease-out; }
@keyframes tap { 50% { transform: scale(.65); } }

.shout {
  position: absolute; left: 50%; top: 58%;
  font: 900 4.2em/1 Allo, sans-serif;
  background: linear-gradient(#fff1a8, #ffb02e); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 .05em 0 var(--ink)) drop-shadow(0 0 .03em var(--ink)) drop-shadow(0 0 .03em var(--ink));
  translate: -50% -50%; rotate: -6deg; opacity: 0; pointer-events: none;
}
.shout.pop { animation: shout 1.1s var(--bounce) both; }
@keyframes shout {
  0% { transform: scale(.2); opacity: 0; }
  25% { transform: scale(1.1); opacity: 1; }
  75% { transform: scale(1); opacity: 1; }
  100% { transform: scale(1.15) translateY(-.3em); opacity: 0; }
}

/* Botones */
.buttons { display: flex; flex-wrap: wrap; gap: 14px; }
.btn {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  min-width: 170px; padding: 12px 26px; border-radius: 18px;
  font: 800 22px/1.1 Allo, sans-serif; text-decoration: none; cursor: pointer;
  transition: transform .15s;
}
.btn small { font: 500 12px system-ui, sans-serif; opacity: .8; margin-top: 4px; }
.btn:hover { transform: translateY(-2px); }
.btn-play { background: var(--green); color: #fff; box-shadow: 0 5px 0 var(--green-d); }
.btn-ghost { background: var(--ink); color: #fff4e4; box-shadow: 0 5px 0 #170f45; }
.btn-cream { background: var(--cream); color: var(--ink); box-shadow: 0 5px 0 #b9b0c9; }
.btn.is-soon { cursor: default; }

/* ============ 3. Contacto ============ */
.contact {
  padding: clamp(100px, 14vw, 180px) var(--gutter);
  background: linear-gradient(var(--deep), var(--night));
  text-align: center;
}
.contact-title { font: 800 clamp(48px, 9vw, 120px)/1 Syne; margin-bottom: 40px; }
.games .kicker { margin-bottom: clamp(28px, 4vw, 48px); }
.contact-text { color: var(--lavender); margin-bottom: 36px; }

.footer {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px;
  padding: 32px var(--gutter); background: var(--night);
  border-top: 1px solid rgba(207,196,255,.1);
}
.footer p { margin: 0; font-size: 14px; color: var(--lavender); opacity: .7; }

/* ============ Aparecer al hacer scroll ============ */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .8s ease, transform .8s cubic-bezier(.2, .8, .3, 1); }
.reveal.in { opacity: 1; transform: none; }

/* ============ Móvil ============ */
@media (max-width: 820px) {
  .game-head, .how { grid-template-columns: 1fr; }
  .game-intro { text-align: center; padding-bottom: 0; }
  .tokka-logo { margin-inline: auto; }
  .pitch { margin-inline: auto; }
  .tags { justify-content: center; }
  .phone { width: min(240px, 62vw); }
  .game-foot { flex-direction: column; text-align: center; }
  .buttons { justify-content: center; }
  .nav nav { gap: 18px; }
}

/* Si la persona pide menos movimiento, lo quitamos */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01s !important; animation-iteration-count: 1 !important; transition: none !important; }
}
