/* Sofihero :: estilos. El canvas dibuja fondo y juego; los menus son HTML encima. */

:root {
  --fondo: #0a0822;
  --blanco: rgb(245 248 255);
  --tenue: rgb(150 158 180);
  --oro: rgb(255 214 92);
  --rojo: rgb(255 80 90);
  --acento: 130 110 255;           /* lo cambia main.js segun el mood de la cancion */
  --fuente: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: dark;
  touch-action: manipulation;       /* sin zoom por doble toque */
  -webkit-text-size-adjust: 100%;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  background: var(--fondo);
}

body {
  position: fixed;
  inset: 0;
  color: var(--blanco);
  font: 500 16px/1.35 var(--fuente);
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

#lienzo {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;               /* la superficie de juego: nada de gestos del navegador */
}

#sonda {                            /* mide los safe-area insets para el canvas */
  position: fixed;
  inset: 0;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  visibility: hidden;
  pointer-events: none;
}

#ui {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.pantalla {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  justify-content: safe center;    /* si no cabe, se desplaza en vez de cortarse arriba */
  gap: clamp(.45rem, 2.2vmin, 1.1rem);
  padding: max(14px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right))
           max(14px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  overflow-y: auto;
  pointer-events: auto;
  text-align: center;
}

.pantalla.juego { pointer-events: none; touch-action: none; }
.pantalla.velo { background: rgb(0 0 0 / .64); }

h1, h2, p { margin: 0; }

.titulo {
  font: 900 clamp(2.6rem, 13vmin, 7.5rem)/1 var(--fuente);
  letter-spacing: .04em;
  text-shadow: 0 0 .35em rgb(var(--acento) / .6);
}

h2 {
  font: 900 clamp(1.6rem, 7vmin, 3.4rem)/1.05 var(--fuente);
  letter-spacing: .04em;
}

.sub { font-weight: 700; font-size: clamp(.85rem, 2.8vmin, 1.25rem); }
.acento { color: rgb(var(--acento)); font-weight: 700; }
.oro { color: var(--oro); font-weight: 700; }
.tenue { color: var(--tenue); }
.rojo { color: var(--rojo); }
.grande { font: 900 clamp(1.8rem, 8vmin, 3.2rem)/1 var(--fuente); }
.nota { max-width: 40rem; font-size: clamp(.8rem, 2.5vmin, 1rem); }
.estado { min-height: 1.35em; color: var(--oro); font-size: clamp(.8rem, 2.5vmin, 1rem); }
.cargado { font-size: clamp(.8rem, 2.6vmin, 1.1rem); }
.cargado .tenue { font-size: .8em; letter-spacing: .08em; }

.ayuda { color: var(--tenue); font-size: clamp(.7rem, 2.1vmin, .9rem); }
.ayuda::after { content: attr(data-teclado); }
body[data-disp="mando"] .ayuda::after { content: attr(data-mando); }
body[data-disp="tactil"] .ayuda { display: none; }

/* -- botones estilo consola sci-fi (tech button de Python) ------------------ */

.botones { display: flex; flex-direction: column; align-items: center; gap: clamp(.5rem, 2vmin, 1rem); }
.botones.fila { flex-direction: row; flex-wrap: wrap; justify-content: center; }

button { font-family: inherit; }

.tec {
  --c: var(--acento);
  --k: .8em;
  appearance: none;
  padding: 0;
  border: 0;
  background: none;
  color: var(--tenue);
  font: 800 clamp(1rem, 3.4vmin, 1.55rem)/1 var(--fuente);
  letter-spacing: .06em;
  min-width: min(21rem, 78vw);
  cursor: pointer;
  transition: color .15s, filter .15s;
}

.tec > span {
  position: relative;
  display: block;
  padding: .95em 1.5em;
  background: rgb(var(--c) / .42);
  clip-path: polygon(var(--k) 0, calc(100% - var(--k)) 0, 100% var(--k), 100% calc(100% - var(--k)),
                     calc(100% - var(--k)) 100%, var(--k) 100%, 0 calc(100% - var(--k)), 0 var(--k));
}

.tec > span::before {              /* relleno oscuro: deja 2px de borde de color */
  --j: calc(var(--k) - .9px);
  content: "";
  position: absolute;
  inset: 2px;
  z-index: -1;
  background: rgb(16 20 32 / .94);
  clip-path: polygon(var(--j) 0, calc(100% - var(--j)) 0, 100% var(--j), 100% calc(100% - var(--j)),
                     calc(100% - var(--j)) 100%, var(--j) 100%, 0 calc(100% - var(--j)), 0 var(--j));
}

.tec small { font-size: .62em; font-weight: 700; }

.tec:focus, .tec:focus-visible { outline: none; }
.tec:focus { color: var(--blanco); filter: drop-shadow(0 0 .55em rgb(var(--c) / .6)); }
.tec:focus > span { background: rgb(var(--c)); animation: brillo 1s ease-in-out infinite alternate; }
.tec:focus > span::after {          /* linea de escaneo */
  content: "";
  position: absolute;
  left: var(--k);
  right: var(--k);
  height: 1.5px;
  background: rgb(var(--c));
  animation: escaneo 1.2s linear infinite;
}

@media (hover: hover) {
  .tec:hover { color: var(--blanco); filter: drop-shadow(0 0 .55em rgb(var(--c) / .6)); }
  .tec:hover > span { background: rgb(var(--c)); }
}

.tec:active > span { transform: translateY(1px); }

@keyframes brillo { from { background: rgb(var(--c) / .6); } to { background: rgb(var(--c)); } }
@keyframes escaneo { from { top: 10%; } to { top: 88%; } }

.chico {
  appearance: none;
  min-height: 42px;
  padding: .5em 1.15em;
  border: 1.5px solid rgb(150 158 180 / .5);
  border-radius: 999px;
  background: rgb(16 20 32 / .72);
  color: var(--tenue);
  font: 700 clamp(.8rem, 2.5vmin, 1rem)/1 var(--fuente);
  cursor: pointer;
}
.chico:focus { outline: none; border-color: var(--oro); color: var(--blanco); box-shadow: 0 0 0 2px var(--oro); }
@media (hover: hover) { .chico:hover { border-color: var(--oro); color: var(--blanco); } }
.chico:disabled { opacity: .55; cursor: default; }
@media (hover: hover) { .chico:disabled:hover { border-color: rgb(150 158 180 / .5); color: var(--tenue); } }

:focus-visible { outline: 3px solid var(--oro); outline-offset: 3px; }

.app {
  position: fixed;
  z-index: 2;
  top: max(10px, env(safe-area-inset-top));
  right: max(10px, env(safe-area-inset-right));
  display: inline-flex;
  align-items: center;
  gap: .4em;
  pointer-events: auto;
  color: var(--oro);
  border-color: rgb(255 214 92 / .5);
}
.app svg { width: 1.1em; height: 1.1em; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }

/* -- biblioteca --------------------------------------------------------------- */

.lista {
  list-style: none;
  margin: 0;
  padding: .25rem;
  width: min(42rem, 100%);
  min-height: 0;
  flex: 0 1 auto;
  overflow-y: auto;
  display: grid;
  gap: .4rem;
  touch-action: pan-y;
}

.lista li { display: flex; gap: .4rem; }

.tema {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: .15rem;
  padding: .6rem .9rem;
  border: 1.5px solid transparent;
  border-radius: 10px;
  background: rgb(16 20 32 / .6);
  color: var(--tenue);
  text-align: left;
  cursor: pointer;
}
.tema b { color: var(--blanco); font-size: clamp(.9rem, 2.8vmin, 1.1rem); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tema small { font-size: clamp(.72rem, 2.2vmin, .85rem); }
.tema .etq { color: var(--oro); font-weight: 800; letter-spacing: .06em; }
.tema:focus { outline: none; }
.tema:focus, .tema.actual { background: rgb(var(--acento) / .24); border-color: rgb(var(--acento)); color: var(--blanco); }
@media (hover: hover) { .tema:hover { border-color: rgb(var(--acento) / .7); } }

.borrar {
  flex: 0 0 auto;
  min-width: 3rem;
  padding: 0 .8rem;
  border: 1.5px solid rgb(255 80 90 / .35);
  border-radius: 10px;
  background: rgb(16 20 32 / .6);
  color: rgb(255 80 90 / .85);
  font: 800 .85rem/1 var(--fuente);
  cursor: pointer;
}
.borrar svg { width: 1.2rem; height: 1.2rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
.borrar:focus { outline: none; border-color: var(--rojo); box-shadow: 0 0 0 2px var(--rojo); color: var(--blanco); }
.borrar[data-confirmar] { background: var(--rojo); color: #fff; }

/* Con la nube la biblioteca no cabe en un celular: se desplaza entera (centrada si
   cabe; los espaciadores reemplazan a "safe center", que Safari < 17.6 no tiene). */
#p-biblioteca { justify-content: flex-start; }
#p-biblioteca::before, #p-biblioteca::after { content: ""; flex: 1 0 0; }
#p-biblioteca .lista { flex: none; max-height: max(15rem, 55vh); }
.lista .vacio { padding: .6rem .9rem; color: var(--tenue); font-size: clamp(.8rem, 2.4vmin, .95rem); }
.tema small.rojo { color: rgb(255 150 156); }

/* -- nube: links de YouTube, pedidos y canciones compartidas ------------------- */

.panel, .seccion { width: min(42rem, 100%); text-align: left; }
.panel { display: grid; gap: .45rem; }
.panel p { font-size: clamp(.78rem, 2.4vmin, .95rem); }
.panel h3, .seccion { margin: .35rem 0 0; font: 800 clamp(.78rem, 2.4vmin, .95rem)/1.2 var(--fuente); letter-spacing: .1em; color: var(--tenue); }
.caja { padding: .8rem .9rem; border: 1.5px dashed rgb(var(--acento) / .6); border-radius: 12px; background: rgb(16 20 32 / .55); }
.caja h3 { margin: 0; color: var(--blanco); }

.campo { display: flex; gap: .45rem; }
.campo input, .campo-l input, .campo select, .campo-l select {
  appearance: none;                   /* sin la sombra interior de iOS */
  min-width: 0;
  min-height: 44px;
  padding: .5em .85em;
  border: 1.5px solid rgb(150 158 180 / .5);
  border-radius: 10px;
  background: rgb(16 20 32 / .85);
  color: var(--blanco);
  font: 600 16px/1.2 var(--fuente);   /* 16px: iOS no hace zoom al enfocar */
  -webkit-user-select: text;          /* el body no deja seleccionar: aqui hay que poder pegar */
  user-select: text;
  -webkit-touch-callout: default;
}
.campo input, .campo select { flex: 1; }
.campo input::placeholder, .campo-l input::placeholder { color: rgb(150 158 180 / .75); }
.campo input:focus, .campo-l input:focus, .campo select:focus, .campo-l select:focus { outline: none; border-color: var(--oro); box-shadow: 0 0 0 2px var(--oro); }
.campo .chico { flex: 0 0 auto; }
#banda-codigo-in { text-transform: uppercase; letter-spacing: .12em; }

/* -- cuenta: entrar/crear cuenta y avatar -------------------------------------- */

.form-cuenta { display: grid; gap: .6rem; width: min(24rem, 100%); text-align: left; }
.campo-l { display: grid; gap: .3rem; font-size: clamp(.78rem, 2.4vmin, .95rem); }
.form-cuenta .tec { justify-self: center; margin-top: .2rem; }

.avatares { display: flex; flex-wrap: wrap; justify-content: center; gap: .4rem; }
.avatar {
  appearance: none;
  width: 2.6rem;
  height: 2.6rem;
  padding: 0;
  border: 1.5px solid rgb(150 158 180 / .5);
  border-radius: 50%;
  background: rgb(16 20 32 / .72);
  font-size: 1.3rem;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.avatar:focus { outline: none; border-color: var(--oro); box-shadow: 0 0 0 2px var(--oro); }
.avatar.sel { border-color: rgb(var(--acento)); background: rgb(var(--acento) / .35); }
@media (hover: hover) { .avatar:hover { border-color: var(--oro); } }

/* -- ONLINE: pestañas (hub, alcance banda/todos y dificultad de una tabla) ------ */

.tabs { display: flex; flex-wrap: wrap; justify-content: center; gap: .4rem; }
.tab {
  appearance: none;
  padding: .45em 1.1em;
  border: 1.5px solid rgb(150 158 180 / .5);
  border-radius: 999px;
  background: rgb(16 20 32 / .72);
  color: var(--tenue);
  font: 800 clamp(.78rem, 2.4vmin, .95rem)/1 var(--fuente);
  letter-spacing: .04em;
  cursor: pointer;
}
.tab[aria-selected="true"] { border-color: rgb(var(--acento)); background: rgb(var(--acento) / .35); color: var(--blanco); }
.tab:focus { outline: none; border-color: var(--oro); color: var(--blanco); box-shadow: 0 0 0 2px var(--oro); }
@media (hover: hover) { .tab:hover { border-color: var(--oro); color: var(--blanco); } }

.online-cuerpo { display: grid; gap: .6rem; width: min(42rem, 100%); text-align: left; }

/* -- ONLINE: tablas (reyes por dificultad y la tabla de puntajes) -------------- */

.reyes { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: .5rem; }
.rey { padding: .5rem .7rem; border-radius: 10px; background: rgb(16 20 32 / .6); text-align: center; }
.rey b { display: block; font-size: .68rem; letter-spacing: .08em; color: var(--tenue); }
.rey span { display: block; color: var(--blanco); font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rey i { display: block; font-style: normal; color: var(--oro); font-weight: 800; }

.tabla-online { width: 100%; border-collapse: collapse; font-size: clamp(.78rem, 2.3vmin, .92rem); }
.tabla-online th, .tabla-online td { text-align: left; padding: .4rem .35rem; border-bottom: 1px solid rgb(255 255 255 / .08); }
.tabla-online th { font-size: .65rem; letter-spacing: .1em; color: var(--tenue); font-weight: 800; }
.tabla-online tr.yo { background: rgb(var(--acento) / .18); }

/* -- banda: miembros ------------------------------------------------------------ */

.miembros { gap: .35rem; }
.miembro {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .5rem .8rem;
  border-radius: 10px;
  background: rgb(16 20 32 / .6);
  text-align: left;
}
.miembro .av { font-size: 1.2rem; }
.miembro b { flex: 1; min-width: 0; color: var(--blanco); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.pedidos { list-style: none; margin: 0; padding: 0; display: grid; gap: .35rem; }
.pedidos:empty { display: none; }
.pedido {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .4rem;
  padding: .35rem .4rem .35rem .75rem;
  border-left: 3px solid var(--tenue);
  border-radius: 10px;
  background: rgb(16 20 32 / .6);
}
.pedido .txt { flex: 1 1 10rem; min-width: 0; display: grid; gap: .1rem; }
.pedido b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: clamp(.85rem, 2.6vmin, 1rem); }
.pedido small { color: var(--tenue); font-size: clamp(.72rem, 2.2vmin, .85rem); }
.pedido.bajando { border-left-color: var(--oro); }
.pedido.listo { border-left-color: rgb(110 240 140); }
.pedido.error { border-left-color: var(--rojo); }
.pedido.error small { color: rgb(255 150 156); }
.pedido .chico { flex: 0 0 auto; padding: .5em .85em; }

.cabeza { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .2rem .8rem; }
.panel .uso { color: var(--tenue); font-size: clamp(.72rem, 2.2vmin, .85rem); font-variant-numeric: tabular-nums; }

/* -- analisis ------------------------------------------------------------------ */

.barra {
  width: min(32rem, 82vw);
  height: .95rem;
  border: 2px solid rgb(70 76 100);
  border-radius: 999px;
  background: rgb(24 26 38);
  overflow: hidden;
}
#an-barra { width: 0; height: 100%; background: rgb(var(--acento)); transition: width .25s; }

.eq { display: flex; align-items: center; gap: clamp(3px, 1vmin, 7px); height: clamp(3rem, 14vmin, 5.5rem); }
.eq i {
  width: clamp(5px, 1.4vmin, 10px);
  height: 100%;
  border-radius: 3px;
  background: rgb(var(--acento));
  transform: scaleY(.2);
  animation: eq .52s ease-in-out infinite alternate;
}
@keyframes eq { to { transform: scaleY(1); } }

/* -- dificultad: los tres portales ------------------------------------------ */

.portales {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(.6rem, 4vw, 3.5rem);
  padding: clamp(.4rem, 2vmin, 1.2rem);
}

.portal {
  --t: clamp(6.2rem, min(25vw, 36vh), 14rem);
  position: relative;
  isolation: isolate;
  width: var(--t);
  height: var(--t);
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--blanco);
  display: grid;
  place-content: center;
  gap: .2em;
  font: 900 clamp(.95rem, 3.2vmin, 1.5rem)/1.05 var(--fuente);
  letter-spacing: .05em;
  cursor: pointer;
  transition: transform .18s ease, filter .18s ease;
}
.portal svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; z-index: -1; }
.portal span, .portal small { text-shadow: 0 1px 4px #000, 0 0 2px #000; }
.portal small { font: 700 clamp(.62rem, 2vmin, .85rem)/1.1 var(--fuente); color: rgb(245 248 255 / .85); letter-spacing: 0; }
.p-halo { fill: rgb(var(--c30)); }
.p-aro { fill: rgb(var(--c)); }
.p-centro { fill: rgb(var(--c22)); }
.p-remolino {
  fill: none;
  stroke: rgb(var(--c155));
  stroke-width: .1;
  stroke-dasharray: 1.4 .6944;      /* remolino de 3 brazos de 1.4 rad */
  transform-origin: 0 0;
  animation: girar 2.86s linear infinite;
}
.p-sel { fill: none; stroke: #fff; stroke-width: .035; opacity: 0; }
.portal:focus { outline: none; transform: scale(1.15); filter: drop-shadow(0 0 1.1rem rgb(var(--c) / .55)); }
.portal:focus .p-sel { opacity: 1; }
.portal:focus .p-remolino { animation-duration: 1.57s; }
@media (hover: hover) { .portal:hover { transform: scale(1.15); } }
@keyframes girar { to { transform: rotate(-360deg); } }

.giro { display: none; font-size: .85rem; }
@media (orientation: portrait) and (pointer: coarse) { .giro { display: block; } }

/* -- juego: botones en pantalla ------------------------------------------------ */

.hud-b {
  position: absolute;
  display: grid;
  place-items: center;
  width: 3.1rem;
  height: 3.1rem;
  padding: 0;
  border: 2px solid rgb(150 158 180 / .55);
  border-radius: 50%;
  background: rgb(12 14 26 / .55);
  color: var(--blanco);
  pointer-events: auto;
  touch-action: none;
  cursor: pointer;
}
.hud-b svg { width: 52%; height: 52%; fill: currentColor; }
#b-pausa { top: max(10px, env(safe-area-inset-top)); right: max(10px, env(safe-area-inset-right)); }
#b-sp {
  top: 30%;
  right: max(10px, env(safe-area-inset-right));
  width: 3.9rem;
  height: 3.9rem;
  color: rgb(255 214 92 / .5);
  border-color: rgb(255 214 92 / .3);
}
#b-sp.listo {
  color: var(--oro);
  border-color: var(--oro);
  background: rgb(255 214 92 / .18);
  box-shadow: 0 0 1rem rgb(255 214 92 / .55);
  animation: latido .9s ease-in-out infinite alternate;
}
#b-sp.activo { color: #2a1f00; background: var(--oro); border-color: var(--oro); box-shadow: 0 0 1.4rem rgb(255 214 92 / .8); }
@keyframes latido { to { transform: scale(1.1); } }

/* -- pausa ------------------------------------------------------------------------ */

.volumen { display: flex; align-items: center; gap: .8rem; font-weight: 700; }
.volumen input { width: min(18rem, 50vw); accent-color: rgb(var(--acento)); }
.volumen output { min-width: 3.2em; text-align: left; font-weight: 800; }

/* -- resultados ------------------------------------------------------------------ */

.rango { font: 900 clamp(3rem, 20vmin, 10rem)/.95 var(--fuente); color: rgb(var(--acento)); }
.rango.oro { color: var(--oro); text-shadow: 0 0 .3em rgb(255 214 92 / .45); }
.puntaje { font: 900 clamp(1.7rem, 8vmin, 3.8rem)/1 var(--fuente); }
.juicios {
  display: grid;
  grid-template-columns: auto auto;
  gap: .1rem 1.4rem;
  margin: 0;
  font: 800 clamp(.85rem, 2.9vmin, 1.2rem)/1.25 var(--fuente);
}
.juicios dt { text-align: right; }
.juicios dd { margin: 0; text-align: left; font-variant-numeric: tabular-nums; }
.j-perfect { color: rgb(120 240 255); }
.j-great { color: rgb(110 240 140); }
.j-good { color: rgb(250 210 90); }
.j-miss { color: rgb(255 80 90); }
#res-extra { color: var(--tenue); font-weight: 700; font-size: clamp(.8rem, 2.6vmin, 1.05rem); }
#res-extra.fc { color: var(--oro); }
#p-resultados .tec { min-width: min(12rem, 28vw); }
#res-record { width: min(28rem, 100%); }
#res-record-cuerpo { margin: 0; font-size: clamp(.82rem, 2.6vmin, 1rem); line-height: 1.7; }
#res-online .chico { min-width: min(11rem, 30vw); }

/* -- avisos (toast) y confeti de records (docs/estilo-make-me-crazy.md) -------- */

#toasts {
  position: fixed;
  z-index: 60;
  top: max(10px, env(safe-area-inset-top));
  right: max(10px, env(safe-area-inset-right));
  display: flex;
  flex-direction: column;
  gap: .5rem;
  max-width: 80vw;
  pointer-events: none;
}
.toast {
  pointer-events: auto;    /* #toasts es "none": deja pasar los clics salvo sobre un aviso */
  background: var(--oro);
  color: #0d0b12;
  border-radius: 14px;
  padding: .6rem .9rem;
  font-weight: 800;
  box-shadow: 4px 4px 0 rgb(0 0 0 / .5);
  animation: t-in .35s cubic-bezier(.2, 1.6, .4, 1) both;
}
.toast b { display: block; font: 900 .9rem/1.2 var(--fuente); letter-spacing: .05em; }
.toast span { font-size: .82rem; }
.toast.out { animation: t-out .35s ease forwards; }
@keyframes t-in { from { opacity: 0; transform: translateX(60px); } }
@keyframes t-out { to { opacity: 0; transform: translateX(60px); } }

.toast-botones { display: flex; gap: .4rem; margin-top: .4rem; }
.toast-botones button {
  appearance: none;
  border: 1.5px solid #0d0b12;
  border-radius: 8px;
  padding: .3em .7em;
  background: rgb(0 0 0 / .12);
  color: #0d0b12;
  font: 800 .78rem/1 var(--fuente);
  cursor: pointer;
}
.toast-botones button:focus { outline: 2px solid #0d0b12; outline-offset: 1px; }

#conf { position: fixed; inset: 0; z-index: 59; overflow: hidden; pointer-events: none; }
.cf { position: absolute; top: -12px; width: 8px; height: 14px; animation: cf-caer linear forwards; }
@keyframes cf-caer { to { transform: translateY(105vh) rotate(360deg); opacity: .2; } }

/* -- calibracion ------------------------------------------------------------- */

.pulso {
  --k: 1;
  position: relative;
  width: clamp(6rem, 22vmin, 11rem);
  aspect-ratio: 1;
  margin: clamp(.6rem, 5vmin, 2.6rem);
  cursor: pointer;
  touch-action: none;
}
.pulso::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgb(var(--acento));
  transform: scale(var(--k));
}
.pulso > div { position: absolute; inset: 0; border: 3px solid var(--blanco); border-radius: 50%; }
.ajuste .chico { min-width: 3.2rem; }

/* -- DESCARGAR APP ------------------------------------------------------------- */

dialog {
  width: min(48rem, calc(100vw - 20px));
  max-width: none;
  max-height: calc(100vh - 20px);
  max-height: calc(100dvh - 20px);
  padding: 0;
  border: 2px solid rgb(var(--acento) / .8);
  border-radius: 16px;
  background: rgb(12 14 26 / .97);
  color: var(--blanco);
  overflow: hidden;
}
dialog::backdrop { background: rgb(0 0 0 / .62); }

.app-caja {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(.5rem, 2vmin, .9rem);
  max-height: calc(100vh - 24px);
  max-height: calc(100dvh - 24px);
  padding: clamp(.9rem, 3vmin, 1.8rem);
  overflow-y: auto;
  text-align: center;
}
.app-opciones { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .6rem; width: 100%; }
.app-opciones .tec { min-width: 0; font-size: clamp(.9rem, 2.8vmin, 1.2rem); }
.app-opciones .tec > span { padding: 1.05em .6em; }
.app-opciones .tec.elegido > span { background: rgb(var(--c)); }
.app-opciones .tec.elegido { color: var(--blanco); }

.app-panel {
  display: flex;
  align-items: center;
  gap: clamp(.8rem, 3vmin, 1.6rem);
  width: 100%;
  padding: clamp(.8rem, 2.6vmin, 1.3rem);
  border: 2px solid rgb(var(--c, var(--acento)));
  border-radius: 14px;
  background: rgb(16 20 32);
  text-align: left;
}
.app-panel .qr { flex: 0 0 auto; width: clamp(8.5rem, 30vmin, 13rem); height: auto; border-radius: 8px; background: #fff; }
.app-panel .texto { display: grid; gap: .5rem; min-width: 0; }
.app-panel .url { color: var(--oro); font: 900 clamp(1.05rem, 3.4vmin, 1.5rem)/1.1 var(--fuente); overflow-wrap: anywhere; }
.app-panel ol { margin: 0; padding-left: 1.3em; display: grid; gap: .35rem; font-size: clamp(.85rem, 2.6vmin, 1.02rem); }
.app-panel .ok { color: rgb(110 240 140); font-weight: 900; font-size: clamp(1.1rem, 3.6vmin, 1.5rem); }
.app-panel .icono { display: inline-block; width: 1.15em; height: 1.15em; vertical-align: -.2em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.app-panel .chico { justify-self: start; }

@media (max-width: 600px) {
  .app-opciones { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .app-panel { flex-direction: column; text-align: left; }
}

/* -- pantallas bajitas (celular en horizontal) ------------------------------ */

@media (max-height: 480px) {
  .botones { flex-direction: row; flex-wrap: wrap; justify-content: center; }
  .botones .tec { min-width: 0; }
  .tec > span { padding: .8em 1.2em; }
  .titulo { font-size: clamp(2.2rem, 12vmin, 4rem); }
  .portal { --t: clamp(5.5rem, 34vh, 10rem); }
  .pulso { width: clamp(4.5rem, 18vmin, 8rem); margin: .4rem; }
}

@media (orientation: portrait) {
  .portales { flex-direction: column; gap: clamp(.6rem, 3vh, 2rem); }
  .portal { --t: clamp(6rem, min(40vw, 19vh), 12rem); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition: none !important;
  }
}

.sin-js { position: fixed; inset: 0; display: grid; place-content: center; margin: 0; padding: 2rem; text-align: center; }
