@font-face {
  font-family: "Bricolage";
  src: url("/fuentes/bricolage-ext.woff2") format("woff2-variations");
  font-weight: 200 800;
  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-display: swap;
}
@font-face {
  font-family: "Bricolage";
  src: url("/fuentes/bricolage.woff2") format("woff2-variations");
  font-weight: 200 800;
  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-display: swap;
}

:root {
  --base: #241565;
  --velo: rgba(255, 255, 255, .09);
  --velo2: rgba(255, 255, 255, .15);
  --borde: rgba(255, 255, 255, .14);
  --texto: #ffffff;
  --suave: rgba(255, 255, 255, .72);
  --sol: #ffd23f;
  --rosa: #ff5d9e;
  --menta: #3ee6b0;
  --cielo: #4cc9f0;
  --violeta: #8b5cf6;
  --naranja: #ff9a3c;
  --lima: #c5f24a;
  --error: #ff7a7a;
  --fuente: "Bricolage", "Segoe UI Variable", system-ui, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; }
body {
  background:
    radial-gradient(900px 520px at 8% -6%, rgba(255, 93, 158, .38), transparent 62%),
    radial-gradient(800px 520px at 100% 10%, rgba(139, 92, 246, .5), transparent 60%),
    linear-gradient(180deg, #34208f 0%, #241565 55%, #1b0f4c 100%);
  background-attachment: fixed;
  background-color: var(--base);
  color: var(--texto);
  font-family: var(--fuente);
  font-weight: 500;
  font-size: 16px;
  line-height: 1.4;
  overscroll-behavior-y: contain;
}
h1, h2, h3 { margin: 0; font-weight: 800; letter-spacing: -.02em; line-height: 1.12; }
h1 { font-size: 32px; }
h2 { font-size: 22px; }
h3 { font-size: 17px; letter-spacing: -.01em; }
p { margin: 0; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--sol); outline-offset: 2px; }
.oculto { display: none !important; }

/* logo de fondo */
.marca-lateral {
  position: fixed; right: -120px; top: 14vh; width: 360px; aspect-ratio: 640 / 575; z-index: 0; pointer-events: none;
  background: url("/logo-marca.png") center / contain no-repeat; opacity: .07; transform: rotate(-8deg);
}

#app { position: relative; z-index: 1; max-width: 520px; margin: 0 auto; padding: 0 20px 128px; }
.vista { animation: entrar .25s ease-out; }
@keyframes entrar { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* barra superior */
.barra-estado {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 8px; height: 52px;
  margin: 0 -20px 10px; padding: 0 20px; background: rgba(36, 21, 101, .82); backdrop-filter: blur(10px);
  font-size: 13px; color: var(--suave);
}
.barra-estado .puntos { margin-left: auto; color: var(--sol); font-weight: 800; font-size: 18px; }
.barra-estado .puntos small { font-size: 12px; font-weight: 600; color: var(--suave); }
.punto { width: 9px; height: 9px; border-radius: 50%; background: var(--menta); flex: none; }
.punto.mal { background: var(--sol); animation: latido 1.2s infinite; }
@keyframes latido { 50% { opacity: .35; } }
.cola { background: var(--sol); color: #3a2a00; border-radius: 99px; padding: 2px 10px; font-weight: 800; font-size: 12px; }

/* tarjetas y filas */
.card { background: var(--velo); border-radius: 24px; padding: 18px; margin: 14px 0; }
.card.hecha { background: rgba(62, 230, 176, .16); }
.card.bloqueada { opacity: .55; }
.fila { display: flex; align-items: center; gap: 12px; }
.fila.sep { justify-content: space-between; }
.suave { color: var(--suave); font-size: 14px; font-weight: 500; }
.chico { font-size: 13px; }
.lista { margin: 4px 0; }
.item {
  display: flex; align-items: center; gap: 14px; padding: 13px 0; border-bottom: 1px solid rgba(255, 255, 255, .09);
  text-decoration: none; color: inherit; width: 100%; text-align: left; background: none;
}
.item:last-child { border-bottom: 0; }
.item .cuerpo { flex: 1; min-width: 0; }
.item .cuerpo b { display: block; font-weight: 700; font-size: 17px; line-height: 1.2; }
.item .cuerpo span { display: block; color: var(--suave); font-size: 14px; margin-top: 2px; }
.item.bloqueada { opacity: .5; }
.item.hecha .cuerpo b { color: var(--menta); }
.mas { font-weight: 800; color: var(--sol); font-size: 18px; flex: none; }
.item.hecha .mas { color: var(--menta); }

.etiqueta { display: inline-block; border-radius: 99px; padding: 3px 10px; font-size: 12px; font-weight: 700; background: var(--velo2); color: var(--texto); }
.etiqueta.pts { background: var(--sol); color: #3a2a00; }
.etiqueta.ok { background: var(--menta); color: #05382a; }
.etiqueta.cola { background: var(--rosa); color: #fff; }

/* avatares redondos */
.avatar {
  --t: 48px; width: var(--t); height: var(--t); flex: none; border-radius: 50%; display: grid; place-items: center;
  font-size: calc(var(--t) * .52); line-height: 1; overflow: hidden;
}
.avatar.g { --t: 72px; }
.avatar.xl { --t: 104px; }
.avatar.xxl { --t: 180px; }
.avatar img, .retrato img { width: 100%; height: 100%; object-fit: cover; display: block; }
.c0 { background: #ff8fc0; } .c1 { background: #ffd23f; } .c2 { background: #5eeac0; } .c3 { background: #6fd6f5; }
.c4 { background: #b79cff; } .c5 { background: #ffae5e; } .c6 { background: #d3f56e; } .c7 { background: #ff9d9d; }
.avatar.vacio { background: rgba(255, 255, 255, .1); color: rgba(255, 255, 255, .4); font-weight: 800; }

/* botones */
.boton {
  display: block; width: 100%; padding: 15px 18px; border-radius: 18px; font-weight: 800; font-size: 17px; text-align: center; text-decoration: none;
  background: var(--sol); color: #3a2a00; box-shadow: 0 4px 0 #c79a12; transition: transform .08s, box-shadow .08s;
}
.boton:active { transform: translateY(3px); box-shadow: 0 1px 0 #c79a12; }
.boton.rosa { background: var(--rosa); color: #fff; box-shadow: 0 4px 0 #bd3377; }
.boton.menta { background: var(--menta); color: #04382a; box-shadow: 0 4px 0 #1fa77d; }
.boton.suave { background: var(--velo); color: var(--texto); box-shadow: none; }
.boton.peligro { background: var(--error); color: #fff; box-shadow: 0 4px 0 #c24545; }
.boton:disabled { opacity: .4; transform: none; }
.boton.chico { padding: 10px 16px; font-size: 14px; display: inline-block; width: auto; border-radius: 14px; }

/* inicio */
.hola .suave { font-size: 15px; }
.puntaje-fila { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 6px 0 2px; }
.puntaje { font-size: 88px; font-weight: 800; letter-spacing: -.045em; line-height: .9; color: var(--sol); }
.puntaje small { font-size: 18px; font-weight: 600; letter-spacing: 0; color: var(--suave); margin-left: 6px; }
.bloque-colmena .num { font-size: 32px; font-weight: 800; letter-spacing: -.03em; line-height: 1; }
.bloque-colmena .num small { font-size: 15px; font-weight: 600; color: var(--suave); letter-spacing: 0; }
.vivo {
  display: block; margin: 14px 0; padding: 14px 18px; border-radius: 22px; text-decoration: none;
  background: var(--rosa); color: #fff; animation: pulso 1.8s ease-in-out infinite;
}
.vivo b { font-size: 19px; display: block; line-height: 1.15; }
@keyframes pulso { 50% { transform: scale(1.012); } }
.progreso { height: 10px; border-radius: 99px; background: rgba(255, 255, 255, .14); overflow: hidden; margin: 12px 0 8px; }
.progreso > i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--rosa), var(--sol)); transition: width .5s; }

/* tu gente */
.gente { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px 10px; margin-top: 14px; }
.gente .tile { background: none; padding: 0; line-height: 0; }
.gente .avatar { --t: 100%; width: 100%; height: auto; aspect-ratio: 1; font-size: 7vw; transition: transform .15s; }
.gente .tile:active .avatar { transform: scale(.92); }
@media (min-width: 521px) { .gente .avatar { font-size: 34px; } }
.gente .avatar.nuevo { animation: encender .6s ease-out; }
@keyframes encender { 0% { transform: scale(.4); } 60% { transform: scale(1.12); } 100% { transform: none; } }

/* formularios */
input[type=text], input[type=search], input[type=password], input[type=tel], textarea {
  width: 100%; padding: 15px 18px; border-radius: 18px; border: 2px solid transparent; background: rgba(255, 255, 255, .12); outline: none; font-size: 17px;
}
input::placeholder, textarea::placeholder { color: rgba(255, 255, 255, .5); }
input:focus, textarea:focus { border-color: var(--rosa); background: rgba(255, 255, 255, .16); }
.lista-personas { display: grid; gap: 0; margin-top: 8px; max-height: 52vh; overflow: auto; }
.persona {
  display: flex; align-items: center; gap: 14px; padding: 10px 8px; width: 100%; text-align: left; background: none;
  border-bottom: 1px solid rgba(255, 255, 255, .08); font-weight: 700; font-size: 17px; border-radius: 14px;
}
.persona small { display: block; font-weight: 500; font-size: 13px; color: var(--suave); }
.persona.sel { background: rgba(255, 93, 158, .25); }
.persona .avatar { --t: 42px; }

/* respuestas */
.opcion {
  display: flex; gap: 14px; align-items: center; width: 100%; padding: 13px 16px; margin: 9px 0; border-radius: 20px; text-align: left;
  background: var(--velo); font-weight: 700; font-size: 17px;
}
.opcion:active { background: var(--velo2); }
.opcion .letra { width: 32px; height: 32px; border-radius: 50%; background: var(--violeta); display: grid; place-items: center; flex: none; font-weight: 800; font-size: 14px; color: #fff; }
.opcion.elegida { background: var(--cielo); color: #06283a; }
.opcion.elegida .letra { background: #06283a; color: var(--cielo); }
.opcion.correcta { background: var(--menta); color: #04382a; }
.opcion.correcta .letra { background: #04382a; color: var(--menta); }
.opcion.mal { background: var(--error); color: #fff; }
.opcion:disabled { opacity: 1; }

.qr-caja { background: #fff; padding: 16px; border-radius: 26px; width: fit-content; margin: 16px auto; }
.qr-caja svg, .qr-caja img { display: block; width: 220px; height: 220px; }
.codigo-grande { font-size: 30px; letter-spacing: .3em; font-weight: 800; text-align: center; color: var(--sol); padding-left: .3em; }
.visor { position: relative; border-radius: 22px; overflow: hidden; background: #000; aspect-ratio: 1; }
.visor video { width: 100%; height: 100%; object-fit: cover; }
.visor::after { content: ""; position: absolute; inset: 16%; border: 3px solid var(--sol); border-radius: 22px; box-shadow: 0 0 0 999px rgba(0, 0, 0, .35); }

.toast {
  position: fixed; left: 50%; bottom: 100px; transform: translateX(-50%) translateY(24px); z-index: 60; opacity: 0; pointer-events: none;
  background: #fff; color: #2a1a6e; padding: 12px 20px; border-radius: 99px; font-weight: 700; max-width: 90vw; text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .35); transition: opacity .25s, transform .25s;
}
.toast.ver { opacity: 1; transform: translateX(-50%); }
#confeti { position: fixed; inset: 0; pointer-events: none; z-index: 80; }

/* ranking */
.ranking-fila { display: flex; align-items: center; gap: 12px; padding: 10px 8px; border-bottom: 1px solid rgba(255, 255, 255, .08); border-radius: 14px; }
.ranking-fila.yo { background: rgba(255, 93, 158, .25); border-bottom-color: transparent; }
.ranking-fila .pos { width: 30px; text-align: center; font-weight: 800; font-size: 19px; color: var(--suave); }
.ranking-fila:nth-child(-n+3) .pos { color: var(--sol); }
.ranking-fila .avatar { --t: 40px; }
.ranking-fila .pts { margin-left: auto; font-weight: 800; color: var(--sol); font-size: 18px; }

.ficha-foto { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 18px; background: var(--velo); }
.pista { background: var(--velo); border-radius: 14px; padding: 10px 14px; margin: 6px 0; font-size: 15px; font-weight: 600; }
.error { color: #ffb0b0; font-weight: 700; margin-top: 8px; }
.tabs { display: flex; gap: 8px; margin: 4px 0 10px; overflow-x: auto; }
.tabs button { padding: 9px 16px; border-radius: 99px; background: var(--velo); color: var(--suave); font-weight: 700; white-space: nowrap; }
.tabs button.activo { background: #fff; color: #2a1a6e; }
.atras { margin-top: 4px; display: inline-flex; align-items: center; gap: 6px; color: var(--suave); text-decoration: none; font-weight: 600; padding: 6px 0 2px; }

/* ingreso */
.login { padding-top: 44px; }
.login .saludo { font-size: 15px; color: var(--suave); margin-bottom: 6px; }
.login h1 { font-size: 42px; line-height: 1; max-width: 8.5em; }
.login .sub { margin: 14px 0 22px; color: var(--suave); max-width: 22em; font-size: 17px; }
.login label { display: block; font-weight: 700; margin-bottom: 8px; }
.login .ayuda { margin-top: 16px; }
.sugerencias { margin-top: 8px; }

/* aparición de una nueva conexión */
.revela {
  position: fixed; inset: 0; z-index: 70; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  padding: 24px; text-align: center; background: rgba(27, 15, 76, .94);
}
.revela .avatar { animation: sale .7s cubic-bezier(.2, 1.3, .4, 1); }
@keyframes sale { 0% { transform: scale(.2); opacity: 0; } 100% { transform: none; opacity: 1; } }
.revela h1 { font-size: 34px; margin-top: 8px; }
.revela .mas-grande { color: var(--sol); font-size: 24px; font-weight: 800; }
.revela .boton { max-width: 320px; margin-top: 14px; }

/* navegación inferior */
.nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: rgba(30, 17, 84, .94); backdrop-filter: blur(12px); border-radius: 24px 24px 0 0; padding-bottom: env(safe-area-inset-bottom); }
.nav > div { display: flex; align-items: flex-end; max-width: 520px; margin: 0 auto; padding: 0 8px; }
.nav a { flex: 1; text-align: center; padding: 10px 2px 9px; color: var(--suave); text-decoration: none; font-size: 11.5px; font-weight: 600; }
.nav a svg { display: block; width: 24px; height: 24px; margin: 0 auto 3px; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.nav a.activo { color: var(--sol); font-weight: 700; }
.nav a.escanear { position: relative; margin-top: -24px; font-weight: 700; color: #ffc2dc; }
.nav a.escanear .hexo { display: grid; place-items: center; width: 62px; height: 62px; margin: 0 auto 4px; border-radius: 50%; background: var(--rosa); box-shadow: 0 6px 18px rgba(255, 93, 158, .5); }
.nav a.escanear svg { margin: 0; stroke: #fff; width: 28px; height: 28px; }
.nav a.escanear.activo { color: var(--sol); }
.nav a.escanear.activo .hexo { background: var(--sol); box-shadow: 0 6px 18px rgba(255, 210, 63, .45); }
.nav a.escanear.activo svg { stroke: #3a2a00; }

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