/* Bresh · cáscara: barra superior, barra con el pompón «Jugá», glowstick del premio, hojas, avisos y transiciones */

/* ───────── barra superior ───────── */
.barra-sup {
  position: fixed; z-index: 50; top: 0; left: 0; right: 0; height: calc(var(--top-h) + var(--seg-t)); padding: var(--seg-t) var(--lado) 0;
  display: flex; align-items: center; gap: 14px; view-transition-name: barra-sup;
  transition: background .35s var(--suave), box-shadow .35s var(--suave);
}
.barra-sup::before { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(11,6,9,.55), transparent); opacity: 1; transition: opacity .35s; pointer-events: none; }
.barra-sup.con-fondo { background: linear-gradient(180deg, rgba(11,6,9,.72), rgba(11,6,9,.5)); box-shadow: inset 0 -1px 0 rgba(255,255,255,.08), 0 10px 30px -14px rgba(0,0,0,.6); -webkit-backdrop-filter: blur(20px) saturate(1.8); backdrop-filter: blur(20px) saturate(1.8); }
.barra-sup.con-fondo::before { opacity: 0; }
.marca { display: block; width: 92px; flex: none; transition: transform .5s var(--rebote); }
.marca:active { transform: scale(.92) rotate(-3deg); }
.marca { transition: transform .5s var(--rebote), opacity .35s var(--suave), translate .45s var(--suave); }
html.logo-centro .marca { opacity: 0; translate: 0 -10px; pointer-events: none; }
.marca svg { width: 100%; height: auto; filter: drop-shadow(0 2px 6px rgba(0,0,0,.35)); }
.acciones { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.acciones .btn-ico { width: 42px; height: 42px; border-radius: 999px; background: linear-gradient(180deg, rgba(42,18,32,.6), rgba(14,6,11,.7)); -webkit-backdrop-filter: blur(18px) saturate(1.8); backdrop-filter: blur(18px) saturate(1.8); box-shadow: inset 0 1px 1px rgba(255,255,255,.5), inset 0 -1px 1px rgba(255,255,255,.12), 0 8px 18px -8px rgba(0,0,0,.5); }
.acciones .btn-ico .ni, .acciones .btn-ico .ni svg { width: 21px; height: 21px; display: grid; place-items: center; }
.b-sonido { display: none !important; }

/* la pulsera de nivel arriba */
.chip-nivel { display: inline-flex; transition: transform .5s var(--rebote); }
.chip-nivel:empty { display: none; }
.chip-nivel .pulsera { height: 32px; padding: 0 10px 0 13px; font-size: .64rem; gap: 6px; rotate: -3deg; }
.chip-nivel .pulsera .precinto { width: 15px; height: 20px; margin-left: 2px; }
.chip-nivel .pulsera .precinto::after { inset: 5px; }
.chip-nivel:active { transform: scale(.94); }

/* Mis QR arriba */
.chip-qr { position: relative; display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 14px; border-radius: 999px; background: linear-gradient(180deg, rgba(255,255,255,.95), rgba(255,255,255,.82)); color: var(--tinta); box-shadow: inset 0 1px 1px #fff, 0 8px 18px -8px rgba(0,0,0,.5); font-family: var(--display); font-stretch: 115%; font-weight: 900; font-size: .74rem; letter-spacing: .04em; text-transform: uppercase; transition: transform .5s var(--rebote); }
.chip-qr .ni, .chip-qr .ni svg { width: 20px; height: 20px; display: grid; place-items: center; }
.chip-qr:active { transform: scale(.94); }
.chip-qr[aria-current="page"] { background: var(--fucsia); color: #fff; box-shadow: inset 0 1px 1px rgba(255,255,255,.5), 0 8px 18px -8px rgba(216,0,122,.6); }
.chip-qr .punto { position: absolute; top: -4px; right: -4px; width: 14px; height: 14px; border-radius: 50%; background: var(--vivo); border: 2.5px solid var(--noche); animation: latido-punto 1.6s var(--suave) infinite; }
@keyframes latido-punto { 50% { transform: scale(1.25); } }
@media (max-width: 400px) { .chip-qr .nt { display: none; } .chip-qr { padding: 0 11px; } }
@media (max-width: 352px) { .chip-nivel { display: none; } }

/* navegación arriba (compu) */
.nav-compu { display: none; }
.nav-compu a, .nav-in a { position: relative; }
.nav-onda { position: absolute; left: 50%; bottom: 4px; width: 46px; height: 9px; translate: -50% 0; opacity: 0; scale: .4 1; transition: opacity .25s, scale .6s var(--rebote); }
.nav-onda svg { width: 100%; height: 100%; }
[aria-current="page"] > .nav-onda { opacity: 1; scale: 1; }

/* ───────── barra inferior flotante de vidrio (tipo Liquid Glass de Apple) ───────── */
.nav-tel {
  position: fixed; z-index: 50; left: 50%; bottom: calc(12px + var(--seg-b)); width: min(calc(100vw - 28px), 380px);
  translate: -50% 0; view-transition-name: nav-tel; transition: transform .7s var(--rebote), width .7s var(--rebote);
  transform-origin: 50% 100%;
}
.nav-in {
  position: relative; height: 66px; display: grid; grid-template-columns: 1fr 104px 1fr; align-items: stretch; border-radius: 999px; isolation: isolate;
  background: linear-gradient(180deg, rgba(240,40,140,.93) 0%, rgba(216,0,122,.94) 55%, rgba(178,0,100,.96) 100%);
  -webkit-backdrop-filter: blur(24px) saturate(1.8); backdrop-filter: blur(24px) saturate(1.8);
  box-shadow:
    inset 0 1.5px 1px rgba(255,255,255,.42), inset 0 -1px 1px rgba(255,255,255,.10),
    inset 1px 0 1px rgba(255,255,255,.16), inset -1px 0 1px rgba(255,255,255,.16),
    inset 0 0 22px rgba(255,255,255,.05),
    0 18px 40px -14px rgba(122,0,69,.7), 0 3px 10px rgba(0,0,0,.25);
}
/* brillo especular que corre por el borde del vidrio */
.nav-in::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 2; padding: 1px;
  background: linear-gradient(115deg, rgba(255,255,255,.75), rgba(255,255,255,0) 28%, rgba(255,255,255,0) 64%, rgba(255,255,255,.4) 86%, rgba(255,255,255,.08));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
}
/* la gota: el vidrio más claro bajo la pestaña activa, que se desliza con resorte */
.nav-gota {
  position: absolute; z-index: 0; top: 7px; bottom: 7px; left: 0; width: var(--g-w, 0px); border-radius: 999px; translate: var(--g-x, 0px) 0; opacity: 0;
  background: radial-gradient(120% 140% at 50% 0%, rgba(255,255,255,.5), rgba(255,255,255,.22) 60%, rgba(255,255,255,.14));
  box-shadow: inset 0 1px 1px rgba(255,255,255,.7), inset 0 -1px 1px rgba(255,255,255,.18), 0 6px 14px -6px rgba(0,0,0,.35);
  transition: translate .65s var(--rebote), width .65s var(--rebote), opacity .3s;
}
.nav-gota.ver { opacity: 1; }
.nav-in > a { position: relative; z-index: 1; display: grid; justify-items: center; align-content: center; gap: 2px; color: rgba(255,255,255,.88); text-shadow: 0 1px 4px rgba(122,0,69,.45); transition: color .25s; }
.nav-in > a .ni, .nav-in > a .ni svg { width: 24px; height: 24px; display: grid; place-items: center; transition: transform .5s var(--rebote); }
.nav-in > a .nt { font-family: var(--display); font-stretch: 112%; font-weight: 800; font-size: .66rem; letter-spacing: .06em; text-transform: uppercase; transition: opacity .3s, max-height .4s var(--suave); max-height: 14px; }
.nav-in > a[aria-current="page"] { color: #fff; }
.nav-in > a[aria-current="page"] .ni { color: #fff; transform: translateY(-1px) scale(1.1); filter: drop-shadow(0 1px 4px rgba(122,0,69,.5)); }
.nav-in > a:active .ni { transform: scale(.86); }
.nav-in > a .nav-onda { display: none; }

/* el botón Jugá: el vinilo del juego, girando despacio, asomando del vidrio */
.nav-in > a.pompon { position: relative; align-content: end; padding-bottom: 9px; color: #fff; }
.pompon .nt { font-family: var(--display); font-stretch: 112%; font-weight: 900; font-size: .66rem; letter-spacing: .08em; text-transform: uppercase; text-shadow: 0 1px 6px rgba(0,0,0,.5); }
.pompon-bola {
  position: absolute; left: 50%; top: -30px; width: 62px; height: 62px; margin-left: -31px; border-radius: 50%;
  background: url('../assets/juego/vinilo.webp') center / contain no-repeat;
  filter: drop-shadow(0 10px 14px rgba(0,0,0,.6)) drop-shadow(0 0 14px rgba(255,31,154,.35));
  animation: girar 5s linear infinite; transition: transform .5s var(--rebote);
}
.pompon-bola::after { content: ''; position: absolute; inset: 0; border-radius: 50%; background: linear-gradient(135deg, rgba(255,255,255,.35), transparent 38%, transparent 62%, rgba(255,255,255,.12)); animation: girar 5s linear infinite reverse; }
.pompon:active .pompon-bola { transform: scale(.9); transition-duration: .08s; }
.pompon[aria-current="page"] .pompon-bola { filter: drop-shadow(0 10px 14px rgba(0,0,0,.6)) drop-shadow(0 0 22px rgba(255,31,154,.8)); }
.pompon-n { position: absolute; top: -34px; right: 18px; min-width: 24px; height: 24px; padding: 0 6px; border-radius: 99px; display: grid; place-items: center; background: #fff; color: var(--fucsia); font-family: var(--display); font-stretch: 112%; font-weight: 900; font-style: normal; font-size: .8rem; box-shadow: 0 3px 0 var(--fucsia-oo); animation: latido-punto 1.4s var(--suave) infinite; z-index: 3; }

/* al bajar, la barra se achica (como en iOS) y vuelve al subir */
html.nav-min .nav-tel { transform: scale(.84) translateY(6px); }
html.nav-min .nav-in > a .nt { opacity: 0; max-height: 0; }
html.nav-min .nav-in > a.pompon .nt { opacity: 0; }

/* contenido: deja lugar a las barras */
#principal { padding-bottom: calc(66px + 12px + var(--seg-b) + 36px); }
.app:not(.sin-tope) { padding-top: calc(54px + 18px + var(--seg-t)); }

/* ───────── el glowstick del premio (aviso fijo) ───────── */
.premio-aviso { position: fixed; z-index: 49; left: 0; right: 0; top: calc(var(--seg-t) + 54px + 18px); padding-inline: 12px; display: flex; justify-content: center; pointer-events: none; view-transition-name: premio-aviso; }
.pa-in {
  position: relative; pointer-events: auto; width: min(100%, 540px); min-height: 58px; display: flex; align-items: center; gap: 12px; padding: 8px 8px 8px 12px;
  border-radius: 16px; background: #0B0609; box-shadow: 0 0 0 1.5px rgba(255,31,154,.35), 0 18px 40px -12px rgba(0,0,0,.9), 0 0 34px -6px rgba(255,31,154,.55);
  animation: pa-entra .8s var(--rebote) both;
}
.pa-chispa { position: relative; flex: none; width: 16px; height: 42px; border-radius: 8px; overflow: hidden; background: rgba(255,31,154,.12); box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.18); }
.pa-chispa::before { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: calc(var(--resta, 1) * 100%); background: linear-gradient(180deg, #FFB3DA, var(--vivo) 40%, var(--fucsia)); box-shadow: 0 0 16px var(--vivo), 0 0 4px #fff inset; transition: height 1s linear; }
.pa-chispa::after { content: ''; position: absolute; left: 3px; top: 4px; width: 3px; height: 60%; border-radius: 3px; background: rgba(255,255,255,.55); }
.pa-chispa svg { display: none; }
.pa-txt { flex: 1; min-width: 0; font-size: .84rem; font-weight: 600; line-height: 1.25; color: #fff; }
.pa-txt b { font-family: var(--display); font-stretch: 112%; font-weight: 900; font-variant-numeric: tabular-nums; color: var(--peluche); }
.pa-btn { flex: none; min-height: 42px; padding: 0 14px; border-radius: 12px; display: inline-flex; align-items: center; background: var(--fucsia); color: #fff; box-shadow: 0 3px 0 var(--fucsia-oo); font-family: var(--display); font-stretch: 115%; font-weight: 900; font-size: .74rem; letter-spacing: .04em; text-transform: uppercase; transition: transform .4s var(--rebote); }
.pa-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--fucsia-oo); }
.pa-barra { display: none; }
.pa-in.urgente { animation: pa-entra .8s var(--rebote) both, pa-urgente 1s var(--suave) .8s infinite; }
.pa-in.venciendo { animation: pa-vence 1s var(--suave) both; }
@keyframes pa-entra { from { opacity: 0; transform: translateY(-26px) rotate(-2deg) scale(.92); } to { opacity: 1; transform: none; } }
@keyframes pa-urgente { 50% { box-shadow: 0 0 0 2px var(--vivo), 0 18px 40px -12px rgba(0,0,0,.9), 0 0 44px rgba(255,31,154,.9); } }
@keyframes pa-vence { 0% { transform: none; } 20% { transform: translateX(-6px) rotate(-1.5deg); } 40% { transform: translateX(6px) rotate(1.5deg); filter: saturate(.3) brightness(.7); } 100% { opacity: 0; transform: translateY(-12px) scale(.9); filter: grayscale(1) brightness(.4); } }

/* ───────── hojas (ventanas) ───────── */
dialog.hoja {
  position: fixed; inset: auto 0 0 0; margin: 0 auto; padding: 0; width: min(100%, 600px); max-width: 100%; max-height: min(92svh, 860px);
  border: 0; border-radius: 26px 26px 0 0; background: var(--noche-2); color: var(--t1); overflow: hidden;
  box-shadow: 0 -2px 0 rgba(255,31,154,.35), 0 -30px 80px -20px rgba(0,0,0,.9);
}
dialog.hoja[open] { display: flex; flex-direction: column; animation: hoja-in .8s var(--rebote) both; }
dialog.hoja[open].saliendo { animation: hoja-out .26s var(--suave) both; }
dialog.hoja::backdrop { background: rgba(6,2,4,.72); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); animation: fondo-in .4s var(--suave) both; }
dialog.hoja.saliendo::backdrop { animation: fondo-in .26s var(--suave) reverse both; }
@keyframes hoja-in { from { transform: translateY(100%); } to { transform: none; } }
@keyframes hoja-out { to { transform: translateY(100%); } }
@keyframes fondo-in { from { opacity: 0; } }
.hoja-asa { width: 60px; height: 12px; margin: 12px auto 0; flex: none; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 12'%3E%3Cpath d='M2 10 C6 10 8 2 13 2 S18 10 22 10 S28 2 33 2 S38 10 42 10 S48 2 53 2 S58 10 62 10' fill='none' stroke='%23FF1F9A' stroke-width='3.2' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat; }
.hoja-cab { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 12px 4px 22px; flex: none; }
.hoja-tit { font-family: var(--display); font-stretch: 125%; font-weight: 900; font-size: 1.5rem; letter-spacing: -.01em; line-height: .95; text-transform: uppercase; }
.hoja .cerrar { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: rgba(255,255,255,.08); color: #fff; transition: transform .4s var(--rebote); }
.hoja .cerrar:active { transform: rotate(90deg) scale(.9); }
.hoja .cerrar svg { width: 20px; height: 20px; }
.hoja-cuerpo { padding: 10px 22px calc(28px + var(--seg-b)); overflow-y: auto; overscroll-behavior: contain; display: grid; gap: 16px; align-content: start; }
.hoja.centrada, .hoja.ancha { width: min(100%, 760px); }

/* ───────── avisos: stickers que se pegan ───────── */
.avisos { position: fixed; left: 0; right: 0; bottom: calc(66px + 34px + var(--seg-b)); z-index: 70; display: grid; justify-items: center; gap: 8px; pointer-events: none; padding-inline: 16px; }
.aviso-chico { pointer-events: auto; max-width: 440px; padding: 13px 20px; border-radius: 14px; background: #fff; color: var(--tinta); font-weight: 700; font-size: .9rem; box-shadow: 0 4px 0 #E3A8C4, 0 18px 36px -12px rgba(0,0,0,.7); rotate: -1.5deg; }
.aviso-chico.rosa { background: var(--peluche); box-shadow: 0 4px 0 #D98BB0, 0 18px 36px -12px rgba(0,0,0,.7); }
.aviso-chico.mal { background: #FFD7E4; }

/* ───────── pie ───────── */
.pie { width: min(100%, var(--ancho)); margin: 0 auto; padding: 24px var(--lado) calc(var(--nav-h) + var(--seg-b) + 40px); display: grid; gap: 14px; justify-items: start; color: var(--t3); font-size: .8rem; line-height: 1.5; }
.pie-marca { width: 120px; opacity: .9; }
.pie-marca svg { width: 100%; height: auto; }
.pie strong { color: var(--t2); }

/* ───────── transiciones entre pantallas ───────── */
.app.sale { animation: pant-sale .2s var(--suave) both; }
.app.entra { animation: pant-entra .7s var(--rebote) both; }
@keyframes pant-sale { to { opacity: 0; transform: translateY(-10px) scale(.99); } }
@keyframes pant-entra { from { opacity: 0; transform: translateY(18px); } }
::view-transition-old(root) { animation: vt-sale .26s var(--suave) both; }
::view-transition-new(root) { animation: vt-entra .7s var(--rebote) both; }
html[data-dir="atras"]::view-transition-old(root) { animation-name: vt-sale-atras; }
html[data-dir="atras"]::view-transition-new(root) { animation-name: vt-entra-atras; }
@keyframes vt-sale { to { opacity: 0; transform: translateX(-4%) rotate(-.6deg); } }
@keyframes vt-entra { from { opacity: 0; transform: translateX(6%) rotate(.8deg); } }
@keyframes vt-sale-atras { to { opacity: 0; transform: translateX(4%) rotate(.6deg); } }
@keyframes vt-entra-atras { from { opacity: 0; transform: translateX(-6%) rotate(-.8deg); } }
::view-transition-group(compartido) { animation-duration: .8s; animation-timing-function: var(--resorte); z-index: 5; }
::view-transition-old(compartido), ::view-transition-new(compartido) { height: 100%; width: 100%; object-fit: cover; animation-duration: .6s; }
::view-transition-group(barra-sup), ::view-transition-group(nav-tel), ::view-transition-group(premio-aviso) { animation: none; }
::view-transition-old(barra-sup), ::view-transition-new(barra-sup), ::view-transition-old(nav-tel), ::view-transition-new(nav-tel), ::view-transition-old(premio-aviso), ::view-transition-new(premio-aviso) { animation: none; }

/* ───────── hoja «Ver como» ───────── */
.personas { display: grid; gap: 10px; }
.persona { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 66px; padding: 12px 16px; border-radius: 16px; text-align: left; background: rgba(255,255,255,.06); box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.1); transition: background .2s, box-shadow .2s, transform .5s var(--rebote); }
.persona:active { transform: scale(.98); }
.persona.act { background: rgba(216,0,122,.18); box-shadow: inset 0 0 0 2px var(--vivo); }
.persona-t { display: grid; gap: 2px; }
.persona-t b { font-family: var(--display); font-stretch: 118%; font-weight: 900; text-transform: uppercase; font-size: 1.05rem; }
.persona-t small { color: var(--t3); font-size: .82rem; }
.persona-ok { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--vivo); color: #fff; transform: scale(0); transition: transform .5s var(--rebote); }
.persona.act .persona-ok { transform: scale(1); }
.persona-ok svg { width: 16px; height: 16px; stroke-width: 3; }
.fila-nombre { display: flex; gap: 10px; }
.reinicio { display: grid; gap: 10px; padding-top: 6px; border-top: 1.5px dashed rgba(255,255,255,.14); }

/* ───────── compu ───────── */
@media (min-width: 900px) {
  .marca { width: 116px; }
  .nav-compu { display: flex; gap: 6px; margin-left: 28px; }
  .nav-compu a { display: inline-flex; align-items: center; height: 46px; padding: 0 14px 6px; font-family: var(--display); font-stretch: 118%; font-weight: 900; font-size: .9rem; letter-spacing: .04em; text-transform: uppercase; color: rgba(255,255,255,.72); transition: color .2s; }
  .nav-compu a:hover, .nav-compu a[aria-current="page"] { color: #fff; }
  .nav-compu .nav-onda { bottom: 2px; }
  .nav-tel { width: 400px; bottom: 22px; }
  .pie { padding-bottom: 48px; }
  .avisos { bottom: 110px; }
  .b-sonido { display: inline-grid !important; }
  dialog.hoja { inset: 0; margin: auto; border-radius: 26px; max-height: min(88svh, 820px); height: fit-content; }
  dialog.hoja[open] { animation: hoja-centro-in .75s var(--rebote) both; }
  dialog.hoja[open].saliendo { animation: hoja-centro-out .26s var(--suave) both; }
  @keyframes hoja-centro-in { from { opacity: 0; transform: translateY(40px) rotate(-1deg) scale(.94); } to { opacity: 1; transform: none; } }
  @keyframes hoja-centro-out { to { opacity: 0; transform: translateY(20px) scale(.96); } }
}
@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
  .pompon-bola { animation: none; }
}
