/* ============ Fuentes ============ */
@font-face { font-family: Syne; src: url("fonts/Syne-ExtraBold.woff2") format("woff2"); font-weight: 800; font-display: swap; }
@font-face { font-family: Allo; src: url("fonts/AlloVariableFriendly.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

/* ============ Colores de la marca ============ */
:root {
  --night: #2a1f5c;
  --deep: #0e0a24;
  --cream: #f2eee6;
  --lavender: #cfc4ff;
  --panel: #342a6c;
  --ink: #2a1d6e;
  --green: #5fd068;
  --green-d: #3f9a4a;
  --bounce: cubic-bezier(.3, 1.6, .5, 1);
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--deep); color: var(--cream);
  font: 400 17px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased; overflow: hidden;
}
a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }

/* ============ Cabecera fija ============ */
.top {
  position: fixed; z-index: 10; left: 0; right: 0; top: 0;
  display: flex; justify-content: space-between; align-items: center;
  padding: calc(14px + var(--safe-t)) 18px 14px;
  pointer-events: none;
}
.top > * { pointer-events: auto; }
.wordmark { font: 800 20px Syne; letter-spacing: .08em; text-decoration: none; }
.lang { display: flex; padding: 3px; border-radius: 99px; border: 1px solid rgba(207,196,255,.3); }
.lang button {
  min-width: 34px; padding: 4px 8px; border-radius: 99px; font-size: 12px; font-weight: 700; letter-spacing: .04em;
  color: var(--lavender); opacity: .7; transition: background .2s, color .2s, opacity .2s;
}
.lang button.on { background: var(--cream); color: var(--deep); opacity: 1; }

/* Puntos laterales (uno por juego) */
.dots { position: fixed; z-index: 10; right: 12px; top: 50%; translate: 0 -50%; display: grid; gap: 10px; }
.dots button { width: 8px; height: 8px; border-radius: 50%; background: rgba(242,238,230,.3); transition: height .3s var(--bounce), background .3s; }
.dots button.on { height: 22px; border-radius: 99px; background: var(--cream); }

/* ============ Feed vertical tipo Reels ============ */
.feed {
  height: 100dvh; overflow-y: auto; scroll-snap-type: y mandatory;
  overscroll-behavior: contain; scrollbar-width: none;
}
.feed::-webkit-scrollbar { display: none; }
.slide {
  position: relative; height: 100dvh; overflow: hidden;
  scroll-snap-align: start; scroll-snap-stop: always;
  display: grid; place-items: center;
  padding: calc(64px + var(--safe-t)) 20px calc(64px + var(--safe-b));
}
.slide-in { position: relative; width: 100%; max-width: 1040px; }

/* Fondo de Tokka: el mismo degradado del juego con luces desenfocadas */
.s-tokka { background: radial-gradient(120% 70% at 50% 35%, #3a2d78 0%, var(--night) 40%, var(--deep) 100%); }
.bokeh i {
  position: absolute; border-radius: 50%; filter: blur(2px); opacity: .18;
  animation: float 14s ease-in-out infinite alternate;
}
.bokeh i:nth-child(1) { width: 220px; height: 220px; left: -80px; top: 18%; background: #4fa8ff; }
.bokeh i:nth-child(2) { width: 160px; height: 160px; right: -50px; top: 55%; background: #ff5d6c; animation-delay: -4s; }
.bokeh i:nth-child(3) { width: 120px; height: 120px; left: 12%; bottom: -40px; background: #5fd068; animation-delay: -8s; }
.bokeh i:nth-child(4) { width: 90px; height: 90px; right: 18%; top: 8%; background: #a57bff; animation-delay: -2s; }
@keyframes float { to { transform: translate(30px, -40px) scale(1.15); } }

.s-tokka .slide-in { display: grid; gap: 18px; justify-items: center; text-align: center; }
.info { display: grid; justify-items: center; gap: 12px; width: 100%; }
.tokka-logo { display: block; width: min(360px, 82vw); cursor: pointer; margin-bottom: -6px; }
.pitch { margin: 0; max-width: 30ch; color: var(--lavender); font-size: 17px; }
.tags { display: flex; gap: 8px; margin: 0; flex-wrap: wrap; justify-content: center; }
.tags span { padding: 3px 11px; border-radius: 99px; background: rgba(207,196,255,.1); font-size: 13px; font-weight: 600; color: var(--lavender); }

/* Botón JUGAR con el estilo del juego */
.play {
  margin-top: 6px; display: inline-grid; place-items: center;
  width: min(300px, 78vw); height: 68px; border-radius: 99px;
  background: var(--green); box-shadow: 0 8px 0 var(--green-d), 0 18px 30px rgba(10,6,24,.45);
  font: 900 34px/1 Allo, sans-serif; letter-spacing: .02em; text-decoration: none;
  color: #fff4e4; -webkit-text-stroke: 7px var(--ink); paint-order: stroke fill;
  transition: transform .12s, box-shadow .12s;
  animation: nudge 2.8s ease-in-out 2s infinite;
}
.play:active { transform: translateY(6px); box-shadow: 0 2px 0 var(--green-d), 0 8px 16px rgba(10,6,24,.45); animation: none; }
@keyframes nudge { 0%, 88%, 100% { scale: 1; } 94% { scale: 1.06; } }

/* Indicador "desliza" */
.swipe {
  position: absolute; left: 50%; bottom: calc(14px + var(--safe-b)); translate: -50% 0;
  display: grid; justify-items: center; gap: 2px;
  font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--lavender); opacity: .7;
}
.swipe b { width: 12px; height: 12px; border-right: 2px solid; border-bottom: 2px solid; rotate: 45deg; animation: hint 1.6s ease-in-out infinite; }
@keyframes hint { 50% { translate: 0 5px; } }

/* ============ Tablero animado ============ */
.demo { position: relative; width: min(300px, 74vw); font-size: clamp(11px, 3vw, 13px); }
.demo-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.order { padding: 10px 14px; border-radius: 14px; background: var(--panel); box-shadow: 0 5px 0 #221a4c; min-height: 62px; }
.mini { display: grid; grid-template-columns: repeat(3, 11px); grid-auto-rows: 11px; 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: 22px; background: #3a2d74; box-shadow: 0 24px 50px rgba(10,6,24,.5);
}
.cell { position: relative; aspect-ratio: 1; border-radius: 22%; background: rgba(14,10,36,.35); }

.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; }
.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: 115%; 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; white-space: nowrap;
}
.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; }
}

/* ============ Próximamente ============ */
.s-soon { background: linear-gradient(var(--deep), var(--night)); }
.soon { display: grid; justify-items: center; text-align: center; gap: 14px; max-width: 420px; }
.soon h2 { margin: 0; font: 800 clamp(30px, 8vw, 44px)/1.1 Syne; }
.soon p { margin: 0; color: var(--lavender); }
.soon-tk { position: relative; width: 84px; height: 84px; font-size: 22px; margin-bottom: 8px; }
.soon-tk .tk { inset: 0; animation: spin 3.2s var(--bounce) infinite; }
@keyframes spin { 0%, 60% { transform: rotate(0); } 80%, 100% { transform: rotate(90deg); } }
.ghost {
  margin-top: 8px; padding: 12px 24px; border-radius: 99px; text-decoration: none; font-weight: 700;
  border: 1px solid rgba(207,196,255,.35); transition: background .2s;
}
.ghost:hover { background: rgba(207,196,255,.1); }

/* ============ Pantallas anchas: tablero a la izquierda, info a la derecha ============ */
@media (min-width: 860px) and (min-height: 560px) {
  .s-tokka .slide-in { grid-template-columns: auto auto; gap: 72px; align-items: center; justify-content: center; text-align: left; }
  .info { justify-items: start; }
  .tokka-logo { width: 420px; margin-left: -18px; }
  .pitch { font-size: 19px; }
  .tags { justify-content: start; }
  .demo { width: 340px; font-size: 14px; }
}
/* Móviles bajitos: el tablero más pequeño para que quepa el botón */
@media (max-height: 760px) and (max-width: 859px) {
  .slide { padding-top: calc(52px + var(--safe-t)); padding-bottom: calc(44px + var(--safe-b)); }
  .demo { width: min(210px, 56vw); font-size: 9px; }
  .order { min-height: 0; padding: 8px 10px; }
  .mini { grid-template-columns: repeat(3, 8px); grid-auto-rows: 8px; gap: 2px; }
  .tokka-logo { width: min(250px, 68vw); }
  .s-tokka .slide-in { gap: 8px; }
  .info { gap: 8px; }
  .pitch { font-size: 15px; }
  .tags { display: none; }
  .play { height: 56px; font-size: 28px; }
  .swipe span { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
