:root {
  --fondo: #f4f6fa; --tarjeta: #ffffff; --borde: #d7dde8; --texto: #1c2433; --suave: #5b6578;
  --acento: #1f3a68; --acento-texto: #ffffff;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--fondo); color: var(--texto);
  font: 1rem/1.45 -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  min-height: 100dvh; overflow-wrap: anywhere;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
[hidden] { display: none !important; }
h1 { font-size: 1.6rem; margin: 0 0 .5rem; }
h2 { font-size: 1.1rem; margin: 0 0 .6rem; }

.pantalla { padding: 1.5rem 1.25rem; max-width: 30rem; margin: 0 auto; }
.centro { min-height: 100dvh; display: flex; flex-direction: column; justify-content: center; align-items: stretch; text-align: center; }
.centrado { text-align: center; }
.marca { width: 4.5rem; height: 4.5rem; border-radius: 1.2rem; background: var(--acento); color: #fff; font-size: 2.6rem; font-weight: 700;
         display: flex; align-items: center; justify-content: center; margin: 0 auto 1rem; }
.texto { color: var(--suave); margin: 0 0 1.25rem; }
.texto.chico { font-size: .9rem; margin: 1.25rem 0 .5rem; }
.aviso { min-height: 1.4rem; margin: .75rem 0 0; color: var(--texto); font-size: .95rem; }
.pasos { text-align: left; color: var(--suave); padding-left: 1.3rem; margin: 0 0 1.5rem; line-height: 1.6; }

.boton { font: inherit; font-weight: 600; padding: .8rem 1.1rem; min-height: 3rem; border-radius: .8rem; border: 1px solid var(--borde);
         background: var(--tarjeta); color: var(--acento); cursor: pointer; }
.boton.principal { background: var(--acento); color: var(--acento-texto); border-color: var(--acento); }
.boton.chico { min-height: 2.5rem; padding: .4rem .8rem; }
.boton:disabled { opacity: .55; cursor: default; }
.enlace { font: inherit; background: none; border: 0; color: var(--suave); text-decoration: underline; padding: .8rem; cursor: pointer; }

.fila { display: flex; gap: .6rem; }
.fila input { flex: 1 1 auto; min-width: 0; font: inherit; padding: .8rem 1rem; min-height: 3rem; border: 1px solid var(--borde); border-radius: .8rem; background: #fff; color: var(--texto); }
#i-codigo { text-transform: uppercase; letter-spacing: .12em; }

.puntos { display: flex; gap: 1rem; justify-content: center; margin: .5rem 0 1.5rem; }
.puntos i { width: 1rem; height: 1rem; border-radius: 50%; border: 2px solid var(--acento); }
.puntos i.lleno { background: var(--acento); }
.teclado { display: grid; grid-template-columns: repeat(3, 1fr); gap: .75rem; max-width: 18rem; width: 100%; margin: 0 auto; }
.teclado button { font: inherit; font-size: 1.5rem; font-weight: 600; min-height: 3.6rem; border-radius: 1rem; border: 1px solid var(--borde); background: #fff; color: var(--texto); cursor: pointer; }
.teclado .vacio { visibility: hidden; }

.girar { width: 3rem; height: 3rem; border: 4px solid var(--borde); border-top-color: var(--acento); border-radius: 50%; margin: 0 auto 1.25rem; animation: gira 1s linear infinite; }
@keyframes gira { to { transform: rotate(360deg); } }

.visor { position: relative; border-radius: 1rem; overflow: hidden; background: #000; aspect-ratio: 3 / 4; margin-bottom: 1rem; }
.visor video { width: 100%; height: 100%; object-fit: cover; display: block; }
.marco { position: absolute; inset: 18%; border: 3px solid #fff; border-radius: 1rem; opacity: .85; }

.principal { max-width: 46rem; margin: 0 auto; padding: 0 1rem 1.5rem; }
.cabecera { position: sticky; top: 0; z-index: 5; background: var(--fondo); display: flex; align-items: center; gap: .5rem; padding: .75rem 0; }
.cab-texto { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.cab-texto span { font-size: .85rem; color: var(--suave); }
.menu { display: flex; flex-direction: column; gap: .5rem; margin-bottom: .75rem; }

.cifras { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: .75rem; margin-bottom: 1.5rem; }
.cifra { background: var(--tarjeta); border: 1px solid var(--borde); border-radius: 1rem; padding: .9rem 1rem; min-width: 0; }
.cifra .t { font-size: .85rem; color: var(--suave); }
.cifra .v { font-size: 1.35rem; font-weight: 700; margin: .15rem 0; }
.cifra .d { font-size: .85rem; color: var(--suave); }

.chat { background: var(--tarjeta); border: 1px solid var(--borde); border-radius: 1rem; padding: 1rem; }
.mensajes { display: flex; flex-direction: column; gap: .6rem; margin-bottom: 1rem; }
.msg { max-width: 92%; padding: .65rem .85rem; border-radius: 1rem; }
.msg.yo { align-self: flex-end; background: var(--acento); color: #fff; }
.msg.solvo { align-self: flex-start; background: var(--fondo); border: 1px solid var(--borde); }
.msg .fuerte { font-weight: 700; }
.msg .linea + .linea { margin-top: .25rem; }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .6rem; }
.chip { font: inherit; font-size: .9rem; padding: .45rem .8rem; border-radius: 2rem; border: 1px solid var(--acento); background: #fff; color: var(--acento); cursor: pointer; text-align: left; }
.barra { position: sticky; bottom: 0; background: var(--tarjeta); padding-top: .25rem; }
