/* © 2026 AGUCCLabs. Todos los derechos reservados. Ver LICENSE. */
/* Toldu · estilos comunes del mercado */

/* Fuentes incluidas en el juego (licencia OFL): cargan sin conexión y dentro de la app. */

@font-face {
  font-family: 'Chango';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fuentes/chango-latin-ext-400-normal.woff2') format('woff2');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}

@font-face {
  font-family: 'Figtree';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fuentes/figtree-latin-ext-400-normal.woff2') format('woff2');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}

@font-face {
  font-family: 'Figtree';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('fuentes/figtree-latin-ext-600-normal.woff2') format('woff2');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}

@font-face {
  font-family: 'Figtree';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url('fuentes/figtree-latin-ext-800-normal.woff2') format('woff2');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}

@font-face {
  font-family: 'Chango';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fuentes/chango-latin-400-normal.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: 'Figtree';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fuentes/figtree-latin-400-normal.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: 'Figtree';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('fuentes/figtree-latin-600-normal.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: 'Figtree';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url('fuentes/figtree-latin-800-normal.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;
}

:root {
  --api: #9a48b8;
  --tumbo: #ffb520;
  --frutilla: #ef476f;
  --limonada: #a6d63a;
  --hierbabuena: #1fb5a5;
  --somo: #f3ead2;
  --mocochinchi: #96502a;
  --noche: #17131f;
  --puesto: #221c2d;
  --puesto-2: #2c2539;
  --borde: #3d3450;
  --texto: #fbf7ee;
  --texto-suave: #b3aac2;
  --radio: 16px;
  --titulo: 'Chango', 'Figtree', system-ui, sans-serif;
  --cuerpo: 'Figtree', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --aguayo: repeating-linear-gradient(90deg,
      var(--t1, var(--frutilla)) 0 26px, var(--noche) 26px 32px,
      var(--t2, var(--tumbo)) 32px 44px, var(--noche) 44px 50px,
      var(--t3, var(--hierbabuena)) 50px 76px, var(--noche) 76px 82px,
      var(--t4, var(--api)) 82px 94px, var(--noche) 94px 100px,
      var(--t5, var(--limonada)) 100px 112px, var(--noche) 112px 118px);
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  /* En la app Android la página va debajo de la barra de estado: se deja su espacio. */
  padding-top: var(--safe-area-inset-top, env(safe-area-inset-top, 0px));
  padding-bottom: var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px));
  background: var(--noche);
  color: var(--texto);
  font-family: var(--cuerpo);
  font-size: 16px;
  line-height: 1.45;
  -webkit-tap-highlight-color: transparent;
}

h1,
h2,
h3 {
  font-family: var(--titulo);
  font-weight: 400;
  line-height: 1.1;
  margin: 0;
}

a {
  color: var(--tumbo);
}

button {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 3px solid var(--tumbo);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

.solo-lector {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.franja-aguayo {
  height: 8px;
  background: var(--aguayo);
}

/* ---------- Logo ---------- */

.logo {
  display: inline-flex;
  line-height: 0;
}

.logo svg {
  display: block;
  border-radius: 12px;
  box-shadow: 0 4px 14px #0006;
}

/* ---------- Botones ---------- */

.boton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 10px 20px;
  border: 0;
  border-radius: 999px;
  background: var(--tumbo);
  color: var(--noche);
  font-weight: 800;
  font-size: 16px;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.12s ease, filter 0.12s ease;
}

.boton:hover {
  filter: brightness(1.08);
}

.boton:active {
  transform: scale(0.97);
}

.boton:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.boton.secundario {
  background: var(--puesto-2);
  color: var(--texto);
  box-shadow: inset 0 0 0 2px var(--borde);
}

.boton.frutilla {
  background: var(--frutilla);
  color: #fff;
}

.boton.hierbabuena {
  background: var(--hierbabuena);
  color: var(--noche);
}

.boton-icono {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 12px;
  background: var(--puesto-2);
  color: var(--texto);
  cursor: pointer;
  text-decoration: none;
}

.boton-icono svg {
  width: 22px;
  height: 22px;
}

/* ---------- Yapa ---------- */

.yapa-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px 6px 8px;
  border-radius: 999px;
  background: var(--puesto-2);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.yapa-icono {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #ffe08a, var(--tumbo) 55%, #d98a00);
  box-shadow: inset 0 0 0 2px #fff3;
}

.yapa-chip.brilla {
  animation: brilla 0.6s ease;
}

@keyframes brilla {
  40% {
    transform: scale(1.15);
    background: #4a3b16;
  }
}

/* ---------- Avisos ---------- */

.avisos {
  position: fixed;
  left: 50%;
  top: 76px;
  transform: translateX(-50%);
  display: grid;
  gap: 8px;
  z-index: 60;
  pointer-events: none;
  width: min(92vw, 420px);
}

.aviso {
  justify-self: center;
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--somo);
  color: var(--noche);
  font-weight: 800;
  box-shadow: 0 8px 24px #0008;
  animation: entra 0.2s ease;
  text-align: center;
}

.aviso.exito {
  background: var(--limonada);
}

.aviso.alerta {
  background: var(--frutilla);
  color: #fff;
}

.aviso.sale {
  opacity: 0;
  transform: translateY(-6px);
  transition: 0.3s ease;
}

@keyframes entra {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
}

.flotante {
  position: fixed;
  transform: translate(-50%, 0);
  font-family: var(--titulo);
  font-size: 22px;
  color: var(--tumbo);
  text-shadow: 0 2px 0 var(--noche);
  pointer-events: none;
  z-index: 70;
  animation: sube 1s ease-out forwards;
}

@keyframes sube {
  to {
    opacity: 0;
    transform: translate(-50%, -60px);
  }
}

/* ---------- Ventana ---------- */

.ventana-fondo {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 16px;
  background: #0b0910cc;
  z-index: 50;
  animation: aparece 0.16s ease;
}

.ventana-fondo.sale {
  opacity: 0;
  transition: opacity 0.16s ease;
}

@keyframes aparece {
  from {
    opacity: 0;
  }
}

.ventana {
  position: relative;
  width: min(100%, 380px);
  padding: 28px 22px 22px;
  border-radius: 24px;
  background: var(--puesto);
  box-shadow: 0 0 0 2px var(--borde), 0 24px 60px #000a;
  text-align: center;
  animation: salta 0.25s cubic-bezier(0.2, 1.4, 0.4, 1);
}

@keyframes salta {
  from {
    transform: scale(0.9);
  }
}

.ventana h2 {
  font-size: 28px;
  margin-bottom: 8px;
}

.ventana p {
  margin: 0 0 18px;
  color: var(--texto-suave);
}

.ventana-casera {
  width: 96px;
  margin: -70px auto 6px;
}

.ventana-botones {
  display: grid;
  gap: 10px;
}

textarea.codigo {
  width: 100%;
  margin: 0 0 14px;
  padding: 10px;
  border-radius: 12px;
  border: 2px solid var(--borde);
  background: var(--noche);
  color: var(--texto);
  font: 12px/1.4 ui-monospace, monospace;
  word-break: break-all;
  resize: none;
}

/* ---------- Papel picado ---------- */

.confeti {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 80;
  overflow: hidden;
}

.confeti i {
  position: absolute;
  width: 9px;
  height: 13px;
  border-radius: 2px;
}

/* ---------- Anuncio de prueba ---------- */

.anuncio-demo {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  background: #000e;
  color: #fff;
}

.anuncio-demo div {
  display: grid;
  gap: 8px;
  place-items: center;
  font-size: 22px;
}

.anuncio-demo span {
  font-family: var(--titulo);
  font-size: 48px;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
