/* Página de los teléfonos. Pensada para hermanos mayores: letra Atkinson Hyperlegible (hecha para baja visión), grande
   y respetando el tamaño de letra del teléfono (rem), botones de al menos 64 px, contraste alto (≥ 4,5:1 en todo texto;
   la mayoría ≥ 7:1), fondo claro y cálido, y nada que se distinga solo por el color. */

@font-face {
  font-family: "Atkinson Hyperlegible";
  font-style: normal; font-weight: 400; font-display: swap;
  src: url("fuentes/atkinson-hyperlegible-latin-400-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  font-style: normal; font-weight: 700; font-display: swap;
  src: url("fuentes/atkinson-hyperlegible-latin-700-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  font-style: normal; font-weight: 400; font-display: swap;
  src: url("fuentes/atkinson-hyperlegible-latin-ext-400-normal.woff2") format("woff2");
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  font-style: normal; font-weight: 700; font-display: swap;
  src: url("fuentes/atkinson-hyperlegible-latin-ext-700-normal.woff2") format("woff2");
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --fondo: #fbf7f0;
  --texto: #1e1b16;          /* sobre el fondo: 16:1 */
  --suave: #4a443b;          /* 8,9:1 */
  --principal: #1f4e79;      /* texto blanco encima: 8,6:1 */
  --principal-hover: #173b5c;
  --peligro: #8b1e1e;        /* texto blanco encima: 8,9:1 */
  --banda: #fff1c2;
  --banda-texto: #3d2c00;    /* sobre la banda: 11:1 */
  --error: #8b1e1e;
  --foco: #b34700;
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { font-size: 112.5%; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh;
  font-family: "Atkinson Hyperlegible", system-ui, sans-serif; font-size: 1.15rem; line-height: 1.5;
  background: var(--fondo); color: var(--texto);
}
main { max-width: 40rem; margin: 0 auto; padding: max(1.25rem, env(safe-area-inset-top)) 1.25rem max(1.5rem, env(safe-area-inset-bottom)); }

.pantalla { display: flex; flex-direction: column; gap: 1.1rem; padding-top: 1.5rem; }
h1 { font-size: 2.1rem; line-height: 1.2; margin: 0; }
h1:focus { outline: none; }
h2 { font-size: 1.6rem; margin: 0 0 .5rem; }
.grande { font-size: 1.3rem; margin: 0; }
.nota, .ayuda { color: var(--suave); margin: 0; }
.ayuda { margin-top: -.6rem; font-size: 1rem; }
.error { color: var(--error); font-weight: 700; margin: 0; }
.error::before { content: "⚠ "; }   /* no solo por el color */
ul.grande { padding-left: 1.3rem; display: flex; flex-direction: column; gap: .6rem; }

form { display: flex; flex-direction: column; gap: 1rem; }
label { font-weight: 700; font-size: 1.25rem; }
input {
  font: inherit; font-size: 1.4rem; min-height: 4rem; padding: .6rem .9rem;
  border: 3px solid var(--texto); border-radius: .75rem; background: #fff; color: var(--texto); width: 100%;
}
#campo-pin { display: flex; flex-direction: column; gap: 1rem; }
#pin { letter-spacing: .25em; font-variant-numeric: tabular-nums; }

button {
  font: inherit; font-weight: 700; font-size: 1.3rem; min-height: 4rem; padding: .7rem 1.2rem;
  border-radius: .9rem; cursor: pointer; border: 3px solid transparent; width: 100%;
  touch-action: manipulation;
}
button.principal { background: var(--principal); color: #fff; }
button.principal:hover { background: var(--principal-hover); }
button.secundario { background: #fff; color: var(--texto); border-color: var(--texto); }
button.peligro { background: var(--peligro); color: #fff; }
:focus-visible { outline: 4px solid var(--foco); outline-offset: 3px; }
#boton-escuchar { min-height: 6rem; font-size: 1.7rem; }

.banda { background: var(--banda); color: var(--banda-texto); border: 2px solid var(--banda-texto); border-radius: .75rem; padding: .8rem 1rem; margin: 0; font-weight: 700; }
.banda::before { content: "ⓘ "; }

.girando { width: 4rem; height: 4rem; border-radius: 50%; border: .5rem solid #d8d0c3; border-top-color: var(--principal); animation: girar 1.2s linear infinite; }
@keyframes girar { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .girando { animation-duration: 4s; } }

.mirando { padding-top: .5rem; }
.escenario { position: relative; background: #000; border-radius: .75rem; overflow: hidden; aspect-ratio: 16 / 9; }
.escenario video { width: 100%; height: 100%; display: block; background: #000; }
.escenario:fullscreen { border-radius: 0; aspect-ratio: auto; }
.solo-sonido { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; gap: .5rem; padding: 1.2rem; background: #1e1b16; color: #fbf7f0; text-align: center; }
.solo-sonido p { margin: 0; }
.sobre-video { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: auto; padding-inline: 2rem; min-height: 5rem; font-size: 1.5rem; }
.estado { margin: 0; color: var(--suave); font-weight: 700; }
.controles { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
.controles .peligro { grid-column: 1 / -1; }
.controles:has(#boton-pantalla[hidden]) #boton-modo { grid-column: 1 / -1; }   /* solo sonido: un botón, a lo ancho */

dialog { border: 3px solid var(--texto); border-radius: 1rem; padding: 1.5rem; max-width: 34rem; width: calc(100% - 2rem); background: var(--fondo); color: var(--texto); }
dialog::backdrop { background: rgb(0 0 0 / .55); }
dialog .controles { margin-top: 1rem; grid-template-columns: 1fr; }

.solo-lector { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

@media (min-width: 48rem) {
  main { max-width: 64rem; }
  .pantalla:not(.mirando) { max-width: 40rem; margin: 0 auto; }
  .controles { grid-template-columns: 1fr 1fr 1fr; }
  .controles .peligro { grid-column: auto; }
}
