/* ══ TU NIVEL (2026-10-28, docs/NIVELES.md) ══════════════════════════
   Rediseño (Edgar: «dice 9 nivel y abajo nivel 10 marco nuevo… hacerlo
   claro»): cada cosa UNA vez. El número vive dentro de su insignia (la
   forma y el color de su marco, que js/nivel-marco.js dibuja desde
   assets/niveles/niveles.json); al lado, «Nivel» en chiquito y una barra
   limpia; al final, el premio que sigue como un icono que se toca. */

/* ── La insignia: la misma pieza en todas partes ── */
.nv-insignia { display: inline-grid; place-items: center; flex: 0 0 auto; line-height: 0; }
.nv-ins { display: block; overflow: visible; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .35)); }

/* ── Junto a un nombre (party, Amigos, Social): la insignia chica ── */
.nv-chip { display: inline-grid; place-items: center; flex: 0 0 auto; vertical-align: middle; margin-left: 5px; line-height: 0; }
.nv-chip .nv-ins { filter: drop-shadow(0 1px 1.5px rgba(0, 0, 0, .3)); }

/* ── La tecla del lobby: abajo a la izquierda ── */
.lb-nivel {
  position: absolute; left: 18px; bottom: 14px; z-index: 4; display: flex; align-items: center; gap: 6px;
  width: 236px; padding: 4px 6px 4px 4px; border-radius: 999px; color: #FFFFFF;
  background: var(--lb-hud-fondo, #1A1130); border: 1.5px solid rgba(255, 255, 255, .14);
  box-shadow: 0 2px 0 rgba(0, 0, 0, .35), 0 6px 14px rgba(0, 0, 0, .32), inset 0 1px 0 rgba(255, 255, 255, .08);
  animation: lb-entra .5s cubic-bezier(0.22, 1, 0.36, 1) .15s both;
}
.lb-nivel[hidden] { display: none; }
.lb-nivel-b {
  display: flex; align-items: center; gap: 9px; flex: 1; min-width: 0; min-height: 44px; padding: 0 4px 0 0; border: 0; border-radius: 999px;
  background: none; color: inherit; font-family: inherit; text-align: left; cursor: pointer; transition: transform .2s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.lb-nivel-b:hover { transform: translateY(-1px); }
.lb-nivel-b:active { transform: scale(.97); }
.lb-nivel-b:focus-visible, .lb-nivel-premio:focus-visible { outline: 2px solid #FFB35C; outline-offset: 3px; }
.lb-nivel-tx { display: grid; gap: 4px; flex: 1; min-width: 0; }
.lb-nivel-tx small { font-size: 9.5px; font-weight: 900; letter-spacing: 1.4px; text-transform: uppercase; line-height: 1; color: rgba(255, 255, 255, .78); }
.lb-nivel-linea { display: block; height: 6px; border-radius: 999px; background: rgba(255, 255, 255, .16); overflow: hidden; }
.lb-nivel-linea i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--nv1, #C4A6FF), #FFFFFF); transition: width .6s cubic-bezier(0.22, 1, 0.36, 1); }
.lb-nivel-premio {
  flex: 0 0 auto; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; cursor: pointer; font-size: 18px;
  color: #FFC27A; background: rgba(255, 255, 255, .08); border: 1.5px solid rgba(255, 255, 255, .18); transition: transform .2s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.lb-nivel-premio:hover { transform: scale(1.06); }
.lb-nivel-premio:active { transform: scale(.94); }

/* En el teléfono: compacta, arriba a la izquierda (sin la palabra). */
/* Con el menú abierto en una pantalla de 1280, la escena mide ~1060: la barra se acorta para no tocar la bocina de «Escuchar» (tools/bancos/lobby-arte.mjs). */
@media (min-width: 900px) and (max-width: 1300px) { .lb-nivel { width: 200px; } }
@media (max-width: 899px) {
  /* Arriba a la izquierda, en la fila de lo tuyo (2026-10-29): la insignia
     y su barra fina; el premio que sigue está en su hoja. */
  .lb-nivel { top: calc(8px + env(safe-area-inset-top)); left: 8px; bottom: auto; width: auto; gap: 4px; padding: 2px 8px 2px 3px; }
  .lb-nivel-premio { display: none; }
  .lb-nivel-b { min-height: 36px; gap: 7px; }
  .lb-nivel .nv-insignia .nv-ins { width: 28px; height: 31px; }
  .lb-nivel-tx small { display: none; }
  .lb-nivel-linea { width: 64px; height: 5px; }
  @media (max-width: 389px) { .lb-nivel-linea { width: 50px; } }
  /* La caja de un amigo mide 100 px: su insignia va de sello en la esquina, sin apretar su nombre. */
  .lb-socio-tag { position: relative; }
  .lb-socio-tag .nv-chip { position: absolute; top: -12px; left: -9px; margin: 0; }
}

/* ── La hoja ── */
.nv-hoja { max-height: min(88vh, 760px); overflow-y: auto; }
.nv-baja { font-size: 13px; }
.nv-yo { display: flex; align-items: center; gap: 16px; padding: 14px; border-radius: 18px; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .1); animation: dr-sube .45s cubic-bezier(0.22, 1, 0.36, 1) both; }
.nv-yo-tx { display: grid; gap: 6px; flex: 1; min-width: 0; }
.nv-yo-tx b { font-size: 20px; font-weight: 900; }
.nv-yo-tx small { font-size: 12.5px; color: rgba(246, 238, 255, .78); }
.nv-barra { display: block; height: 8px; border-radius: 999px; background: rgba(255, 255, 255, .14); overflow: hidden; }
.nv-barra i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #FFB35C, #FF8A00); }
.nv-xp { font-size: 14px; font-weight: 900; font-variant-numeric: tabular-nums; }
.nv-h { margin: 18px 0 8px; font-size: 11px; font-weight: 900; letter-spacing: 1.4px; text-transform: uppercase; color: rgba(246, 238, 255, .72); }
.nv-hito.is-foco { box-shadow: 0 0 0 2px #FFB35C; }
.nv-hito { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 16px; background: rgba(255, 255, 255, .05); animation: dr-sube .45s cubic-bezier(0.22, 1, 0.36, 1) .08s both; }
.nv-hito > div { display: grid; gap: 2px; }
.nv-hito b { font-size: 15px; font-weight: 900; }
.nv-hito span { font-size: 12.5px; color: rgba(246, 238, 255, .78); }
.nv-fuentes { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.nv-fuentes li { display: grid; grid-template-columns: 1fr auto; align-items: center; column-gap: 10px; padding: 8px 12px; border-radius: 12px; background: rgba(255, 255, 255, .04); animation: dr-sube .4s cubic-bezier(0.22, 1, 0.36, 1) both; }
.nv-fuentes li:nth-child(n+4) { animation-delay: .08s; } .nv-fuentes li:nth-child(n+8) { animation-delay: .16s; }
.nv-fuentes span { font-size: 13.5px; font-weight: 800; }
.nv-fuentes b { font-size: 13.5px; font-weight: 900; color: #FFC27A; font-variant-numeric: tabular-nums; }
.nv-fuentes small { grid-column: 1 / -1; font-size: 11.5px; color: rgba(246, 238, 255, .7); }
.nv-nota { margin: 10px 2px 0; font-size: 12.5px; line-height: 1.4; color: rgba(246, 238, 255, .78); }
.nv-marcos { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.nv-marcos li { opacity: .42; filter: saturate(.5); }
.nv-marcos li.is-tuyo { opacity: 1; filter: none; }

/* ── El festejo ── */
.nv-fiesta-hoja { width: min(380px, 100%); display: grid; justify-items: center; gap: 10px; text-align: center; padding: 30px 22px 22px; }
.nv-fiesta-hoja h2 { margin: 6px 0 0; font-size: 24px; font-weight: 900; animation: dr-sube .45s cubic-bezier(0.22, 1, 0.36, 1) .25s both; }
.nv-halo { position: absolute; top: -40px; left: 50%; width: 320px; height: 320px; margin-left: -160px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(255, 179, 92, .45), transparent 62%); animation: nv-halo 1.4s cubic-bezier(0.22, 1, 0.36, 1) both; }
@keyframes nv-halo { from { opacity: 0; transform: scale(.5); } }
.nv-insignia--fiesta { animation: nv-pop 1.2s cubic-bezier(0.34, 1.56, 0.64, 1) .1s both; }
@keyframes nv-pop { 0% { opacity: 0; transform: scale(.3) rotate(-20deg); } 55% { opacity: 1; transform: scale(1.12) rotate(4deg); } 100% { transform: none; } }
.nv-f-n { margin: 0; font-size: 13px; color: rgba(246, 238, 255, .78); }
.nv-f-premios { list-style: none; margin: 6px 0 4px; padding: 0; display: grid; gap: 8px; width: 100%; }
.nv-f-premios li { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 12px; border-radius: 14px; font-size: 15px; font-weight: 900; background: rgba(255, 255, 255, .07);
  animation: dr-sube .45s cubic-bezier(0.22, 1, 0.36, 1) both; }
.nv-f-premios li:nth-child(1) { animation-delay: .35s; } .nv-f-premios li:nth-child(2) { animation-delay: .43s; } .nv-f-premios li:nth-child(3) { animation-delay: .51s; }
.nv-f-premios i { font-size: 20px; color: #FFC27A; }
.nv-seguir { margin-top: 6px; min-height: 48px; padding: 0 30px; border: 0; border-radius: 999px; cursor: pointer; font-family: inherit; font-size: 16px; font-weight: 900;
  color: var(--pri-tinta, #2A1300); background: var(--pri-fondo, #FF8A00); box-shadow: 0 4px 0 #B45F00; }
.nv-seguir:active { transform: translateY(2px); box-shadow: 0 2px 0 #B45F00; }

@media (prefers-reduced-motion: reduce) {
  .lb-nivel, .lb-nivel-linea i, .nv-yo, .nv-hito, .nv-fuentes li, .nv-fiesta-hoja h2, .nv-halo, .nv-insignia--fiesta, .nv-f-premios li { animation: none !important; transition: none !important; opacity: 1 !important; transform: none !important; }
}
