/* show.sonoeai.com: the room of a Sonoe Show talk, on the audience's phones. Flat: solid colors only, no glows,
   gradients or shadows. Sonoe's tokens by default; show.js writes the talk's own brand over them (#marca). Light or
   dark as the phone is (?tema= forces one, for previews). Every screen fills the phone; its icon moves. */
:root {
  --surface: #f8f8f8; --on-surface: #2e2d3a; --on-surface-variant: #444654;
  --container: #e3e2f2;
  --primary: #445ed9; --on-primary: #f8f8f8; --casco-primary: #203dc4;
  --tonal: #ffffff; --casco-tonal: #a8a8b4;
  --outline-variant: #c5c5d6;
  --error: #ba1a1a; --error-container: #ffdad6; --on-error-container: #410002;
  --texto: "Lexend", system-ui, sans-serif;
  --datos: "Lexend Zetta", "Lexend", system-ui, sans-serif;
  color-scheme: light dark;
}
:root[data-tema="claro"] { color-scheme: light; }
:root[data-tema="oscuro"] { color-scheme: dark; }
/* Dark: the phone's, or forced with ?tema=oscuro (?tema=claro forces light). */
@media (prefers-color-scheme: dark) {
  :root:not([data-tema="claro"]) {
    --surface: #2e2d3a; --on-surface: #f8f8f8; --on-surface-variant: #c5c5d6;
    --container: #383746;
    --primary: #b9c3ff; --on-primary: #00218c; --casco-primary: #7d8ee6;
    --tonal: #3a394a; --casco-tonal: #1f1e29;
    --outline-variant: #555666;
    --error: #ffb4ab; --error-container: #93000a; --on-error-container: #ffdad6;
  }
}
:root[data-tema="oscuro"] {
  --surface: #2e2d3a; --on-surface: #f8f8f8; --on-surface-variant: #c5c5d6;
  --container: #383746;
  --primary: #b9c3ff; --on-primary: #00218c; --casco-primary: #7d8ee6;
  --tonal: #3a394a; --casco-tonal: #1f1e29;
  --outline-variant: #555666;
  --error: #ffb4ab; --error-container: #93000a; --on-error-container: #ffdad6;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { min-height: 100dvh; background: var(--surface); color: var(--on-surface); font: 400 17px/1.55 var(--texto);
  -webkit-text-size-adjust: 100%; display: flex; flex-direction: column; }
[hidden] { display: none !important; }

/* Top: the brand's mark in the middle; «Atrás» on the left and «Siguiente» (or «En vivo») on the right. */
.arriba { width: min(640px, 100%); margin: 0 auto; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px;
  min-height: 56px; padding: calc(10px + env(safe-area-inset-top)) 20px 6px; }
.arriba-izq { grid-column: 1; justify-self: start; display: flex; }
/* Each in its own column, so hiding the mark never moves «Siguiente» to the middle. */
.arriba-der { grid-column: 3; justify-self: end; display: flex; }
.logo { grid-column: 2; justify-self: center; display: flex; align-items: center; }
.logo img { height: 26px; width: auto; display: block; }
.logo-mascara { display: block; height: 28px; width: calc(28px * var(--proporcion, 1)); background: var(--on-surface);
  -webkit-mask: var(--imagen) center / contain no-repeat; mask: var(--imagen) center / contain no-repeat; }
.logo-mascara.acento { background: var(--primary); }
.logotipo { font: 800 16px/1 var(--datos); letter-spacing: -0.08em; white-space: nowrap; }
.vivo { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: var(--on-surface-variant); }
.vivo::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--primary); animation: latido 1.6s ease-in-out infinite; }
@keyframes latido { 50% { transform: scale(.55); } }

main { flex: 1; width: min(640px, 100%); margin: 0 auto; padding: 8px 20px 24px; display: flex; flex-direction: column; }
main.con-barra { padding-bottom: calc(150px + env(safe-area-inset-bottom)); }

/* A screen that fills the phone, its content in the middle. */
.pantalla { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 14px; padding: 12px 0 8vh; animation: entra 420ms cubic-bezier(.22, 1, .36, 1); }
.pantalla.arriba-del-todo { justify-content: flex-start; padding-top: 18px; }
.centro { text-align: center; align-items: center; }
/* On a phone the sign-up starts at the top: the keyboard takes the bottom half. */
@media (max-width: 700px) {
  .pantalla.pregunta { justify-content: flex-start; padding-top: 22px; }
}
@keyframes entra { from { opacity: 0; transform: translateY(16px); } }

h1 { font-size: 34px; line-height: 1.15; font-weight: 600; margin: 0; letter-spacing: -0.01em; }
.grande { font-size: 40px; }
.bajada { color: var(--on-surface-variant); margin: 0; font-size: 18px; }
.detalle { color: var(--on-surface-variant); font-size: 15px; margin: 0; }

/* Sonoe's icon component, alive: the face on its shell, the icon moving as the screen asks. */
.icono-vivo { --t: 76px; --cara: var(--primary); --casco: var(--casco-primary); position: relative; isolation: isolate; width: var(--t); height: var(--t);
  border-radius: 50%; background: var(--casco); color: var(--on-primary); display: grid; place-items: center; flex: none; }
.icono-vivo::before { content: ""; position: absolute; z-index: -1; inset: 3px 3px 6px; border-radius: 50%; background: var(--cara); }
.icono-vivo svg { width: 46%; height: 46%; fill: currentColor; margin-top: -3px; }
.icono-vivo.tonal { --cara: var(--tonal); --casco: var(--casco-tonal); color: var(--on-surface); }
.icono-vivo.error { --cara: var(--error); --casco: var(--on-error-container); color: var(--surface); }
.flota { animation: flota 2.6s ease-in-out infinite; }
@keyframes flota { 50% { transform: translateY(-8px); } }
.flota svg { animation: inclina 2.6s ease-in-out infinite; }
@keyframes inclina { 25% { transform: rotate(-8deg); } 75% { transform: rotate(8deg); } }
.reloj-arena { animation: flota 2.4s ease-in-out infinite; }
.reloj-arena svg { animation: arena 2.4s cubic-bezier(.65, 0, .35, 1) infinite; }
@keyframes arena { 0%, 40% { transform: rotate(0); } 60%, 100% { transform: rotate(180deg); } }
.sacude { animation: aparece 380ms cubic-bezier(.34, 1.56, .64, 1), sacude 520ms 380ms ease-in-out; }
@keyframes sacude { 20%, 60% { transform: translateX(-9px); } 40%, 80% { transform: translateX(9px); } }
@keyframes aparece { from { transform: scale(.4); opacity: 0; } }
.vuela svg { animation: vuela 2.2s cubic-bezier(.5, 0, .3, 1) infinite; }
@keyframes vuela { 0% { transform: translate(-30%, 30%) scale(.8); opacity: 0; } 25%, 60% { transform: none; opacity: 1; }
  100% { transform: translate(60%, -60%) scale(.8); opacity: 0; } }
.salta { animation: aparece 480ms cubic-bezier(.34, 1.56, .64, 1); }

/* The number pad */
.casillas { display: flex; gap: 8px; justify-content: center; margin: 22px 0 6px; }
.casilla { width: 46px; height: 58px; border-radius: 14px; background: var(--container); display: grid; place-items: center;
  font: 700 28px/1 var(--datos); letter-spacing: -0.08em; color: var(--on-surface); border: 2px solid transparent; }
.casilla.actual { border-color: var(--primary); }
.casilla.llena { animation: aparece 220ms cubic-bezier(.34, 1.56, .64, 1); }
.casillas.mal { animation: sacude 480ms ease-in-out; }
.casillas.mal .casilla { background: var(--error-container); color: var(--on-error-container); }
.mensaje-error { min-height: 26px; color: var(--error); font-weight: 600; margin: 0; }
.mensaje-error:not(:empty) { animation: aparece 320ms cubic-bezier(.34, 1.56, .64, 1); }
.teclado { display: grid; grid-template-columns: repeat(3, 84px); gap: 14px 22px; justify-content: center; margin-top: 12px; }
/* More specific than .boton (declared later): the keys are big, their numbers in the brand's numbers font. */
.boton.tecla { width: 84px; height: 84px; min-height: 84px; --hondo: 4px; --radio: 999px; font: 600 32px/1 var(--datos);
  letter-spacing: -0.08em; padding: 0 0 var(--hondo); }
.boton.tecla svg { width: 32px; height: 32px; }
.tecla.vacia { visibility: hidden; }

/* Fields and choices */
.campo input { width: 100%; min-height: 62px; border: 2px solid var(--outline-variant); border-radius: 20px; background: var(--surface);
  color: var(--on-surface); padding: 14px 20px; font: 400 20px var(--texto); outline: none; }
.campo input:focus { border-color: var(--primary); }
.opciones { display: flex; flex-direction: column; gap: 12px; margin-top: 6px; }
.opcion { width: 100%; justify-content: flex-start; text-align: left; min-height: 64px; font-size: 19px; padding-inline: 22px; }
.opcion .marca-opcion { margin-left: auto; width: 26px; height: 26px; border-radius: 50%; border: 2px solid currentColor; display: grid; place-items: center; opacity: .5; flex: none; }
.opcion[aria-pressed="true"] .marca-opcion { opacity: 1; background: var(--on-primary); color: var(--primary); border-color: var(--on-primary); }
.opcion .marca-opcion svg { width: 16px; height: 16px; }
.error { padding: 12px 16px; border-radius: 16px; background: var(--error-container); color: var(--on-error-container); font-weight: 600; margin: 0; }

/* Sonoe's tactile button: the face on a deeper shell, raised; pressing sinks it. */
.boton { --cara: var(--primary); --casco: var(--casco-primary); --tinta: var(--on-primary); --hondo: 3px; --radio: 24px;
  position: relative; isolation: isolate; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 56px; padding: 0 26px var(--hondo); border: 0; border-radius: var(--radio); background: var(--casco); color: var(--tinta);
  font: 600 17px/1.2 var(--texto); cursor: pointer; text-decoration: none; -webkit-tap-highlight-color: transparent; user-select: none;
  transition: padding 140ms cubic-bezier(.22, 1, .36, 1); }
.boton::before { content: ""; position: absolute; z-index: -1; inset: var(--hondo) var(--hondo) calc(var(--hondo) * 2);
  border-radius: calc(var(--radio) - var(--hondo)); background: var(--cara); transition: inset 140ms cubic-bezier(.22, 1, .36, 1); }
.boton:active:not(:disabled), .boton.pulsada { padding-top: var(--hondo); padding-bottom: 0; }
.boton:active:not(:disabled)::before, .boton.pulsada::before { inset: calc(var(--hondo) * 2) var(--hondo) var(--hondo); }
.boton:disabled { opacity: .45; cursor: default; }
.boton.tonal, .opcion { --cara: var(--tonal); --casco: var(--casco-tonal); --tinta: var(--on-surface); }
.opcion[aria-pressed="true"] { --cara: var(--primary); --casco: var(--casco-primary); --tinta: var(--on-primary); }
.boton.ancho { width: 100%; }
.boton.chico { min-height: 44px; font-size: 16px; padding-inline: 18px; --radio: 16px; }
.boton svg { width: 22px; height: 22px; fill: currentColor; flex: none; }
/* The icon button (.solo-ico): round, the icon alone («Atrás»). More specific than .boton.chico. */
.boton.solo-ico { width: 46px; min-height: 46px; height: 46px; padding: 0 0 var(--hondo); --radio: 999px; }
.boton.solo-ico:active:not(:disabled), .boton.solo-ico.pulsada { padding: var(--hondo) 0 0; }
.boton.solo-ico svg { width: 20px; height: 20px; }

/* The block of the slide */
.bloque h1 { font-size: 32px; }
.recomienda { display: inline-flex; align-self: flex-start; align-items: center; gap: 10px; padding: 7px 14px 7px 7px; border-radius: 999px;
  background: var(--container); font-size: 15px; font-weight: 600; animation: aparece 480ms cubic-bezier(.34, 1.56, .64, 1); }
.recomienda .icono-vivo { --t: 34px; }
.recomienda .icono-vivo svg { animation: brilla 2.4s ease-in-out infinite; }
@keyframes brilla { 50% { transform: scale(1.18) rotate(12deg); } }
.markdown > :first-child { margin-top: 0; }
.markdown h2 { font-size: 22px; line-height: 1.3; font-weight: 600; margin: 24px 0 8px; }
.markdown h3 { font-size: 18px; font-weight: 600; margin: 22px 0 6px; }
.markdown p { margin: 0 0 14px; }
.markdown ul, .markdown ol { margin: 0 0 14px; padding-inline-start: 22px; }
.markdown li { margin: 4px 0; }
.markdown a { color: var(--primary); font-weight: 600; text-underline-offset: 3px; }
.markdown code { font: 500 15px ui-monospace, "SF Mono", Menlo, monospace; background: var(--container); padding: 2px 6px; border-radius: 6px; }
.markdown pre { background: var(--container); padding: 14px 16px; border-radius: 16px; overflow-x: auto; }
.markdown pre code { background: none; padding: 0; }
.markdown blockquote { margin: 0 0 14px; padding: 4px 0 4px 16px; border-inline-start: 4px solid var(--primary); color: var(--on-surface-variant); }
.enlace { background: none; border: 0; color: var(--primary); font: 600 15px var(--texto); padding: 10px 0; cursor: pointer; align-self: center; }

/* «Enviarme esto»: always at the bottom, a solid band clear of Safari's bar and the home indicator. */
.barra-abajo { position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; background: var(--surface); border-top: 1.5px solid var(--outline-variant);
  padding: 12px 20px calc(18px + env(safe-area-inset-bottom)); display: grid; gap: 8px; justify-items: center;
  animation: sube-barra 380ms cubic-bezier(.22, 1, .36, 1); }
.barra-abajo > * { width: min(600px, 100%); }
.barra-abajo .detalle { text-align: center; }
@keyframes sube-barra { from { transform: translateY(100%); } }

/* The talk's page (/event/<code>): each part on its own card, one after the other */
.evento { gap: 16px; }
.evento .parte { background: var(--container); border-radius: 24px; padding: 22px 20px 8px; animation: entra 420ms cubic-bezier(.22, 1, .36, 1) both; }
.evento .parte h2 { font-size: 24px; line-height: 1.25; font-weight: 600; margin: 0 0 12px; }
.evento .parte .markdown pre, .evento .parte .markdown code { background: var(--surface); }

/* The presenter's links: one tonal button per row, the network's icon, the link mark at the end */
.enlaces { display: grid; gap: 12px; width: 100%; margin-top: 18px; }
.enlaces .detalle { margin-bottom: 2px; }
.enlace-red { justify-content: flex-start; text-align: left; animation: entra 420ms cubic-bezier(.22, 1, .36, 1) both; }
.enlace-red span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.enlace-red svg:last-child { width: 16px; height: 16px; opacity: .55; }

/* Changing the email, in the bottom band of the last screen */
.barra-abajo .campo input { min-height: 54px; font-size: 18px; }
.listo { color: var(--primary); font-weight: 600; }

/* The notice: 3 seconds and the next part, with «Seguir» to go now. At the bottom, right above «Enviarme esto»
   (--alto-barra: the band's height, kept by show.js), or above Safari's bar when there's no band. */
.aviso-cambio { position: fixed; left: 50%; bottom: calc(var(--alto-barra, env(safe-area-inset-bottom)) + 12px);
  transform: translateX(-50%); z-index: 10;
  width: min(600px, calc(100% - 24px)); display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 4px 12px;
  padding: 14px 16px 12px; border-radius: 22px; background: var(--on-surface); color: var(--surface);
  animation: baja 380ms cubic-bezier(.22, 1, .36, 1); }
@keyframes baja { from { opacity: 0; transform: translate(-50%, 16px); } }
.aviso-icono svg { width: 24px; height: 24px; fill: currentColor; display: block; animation: gira 3s linear infinite; }
@keyframes gira { to { transform: rotate(360deg); } }
.aviso-texto { font-weight: 600; font-size: 15px; }
.aviso-barra { grid-column: 1 / -1; height: 4px; border-radius: 2px; background: var(--on-surface-variant); overflow: hidden; margin-top: 8px; }
.aviso-barra span { display: block; height: 100%; width: 100%; background: var(--surface); transform-origin: left; }
.seguir { --cara: var(--surface); --casco: var(--casco-tonal); --tinta: var(--on-surface); --radio: 16px; min-height: 42px; padding-inline: 16px; font-size: 15px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before { animation: none !important; transition: none !important; }
}
