.sala {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  background: var(--sala-fondo);
  color: var(--sala-tinta);
}

/* ---------------------------------------------------------------- */
/* Encabezado                                                       */
/* ---------------------------------------------------------------- */

/* Banda con el verde exacto de la marca. La tinta es verde profundo y no
   blanco: blanco sobre #41AC3F da 2,9:1 y no pasa contraste. */
.encabezado {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2vw;
  height: 13vh;
  padding: 0 2.5vw;
  background: var(--verde);
  color: var(--verde-profundo);
}

.logoHueco {
  min-width: 10vw;
}

.titulos {
  text-align: center;
  min-width: 0;
}

.organismo {
  font-size: 3.6vh;
  font-weight: 700;
  letter-spacing: 0.03em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.subtitulo {
  font-size: 1.8vh;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(20, 51, 26, 0.74);
  margin-top: 0.5vh;
}

.bloqueDerecha {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1.4vw;
  min-width: 10vw;
}

.reloj {
  font-size: 3.8vh;
  font-weight: 600;
  text-align: right;
}

/* ---------------------------------------------------------------- */
/* Escenario: turno llamado + estado de cada box                    */
/* ---------------------------------------------------------------- */

.escenario {
  flex: 1;
  display: grid;
  /* El heroe se lleva casi dos tercios: es lo unico que se lee de lejos. */
  grid-template-columns: minmax(0, 1.9fr) minmax(0, 1fr);
  gap: 1.6vh 1.6vw;
  padding: 1.8vh 2.5vw;
  min-height: 0;
}

.heroe {
  display: flex;
  flex-direction: column;
  gap: 1.2vh;
  min-width: 0;
  min-height: 0;
}

.heroeEtiquetas {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 1.2vw;
  font-size: 2.2vh;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--sala-tinta-suave);
}

.heroeEtiquetas span {
  text-align: center;
}

.heroePaneles {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 1.2vw;
  min-height: 0;
}

.panelTurno,
.panelBox {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 0;
  border: 1px solid var(--sala-borde);
  background: var(--sala-tarjeta);
}

.panelTurno {
  border-left: 0.9vh solid var(--verde);
}

.panelBox {
  background: var(--verde-profundo);
  border-color: var(--verde-profundo);
  color: #ffffff;
}

.numeroHeroe {
  font-size: 34vh;
  font-weight: 800;
  line-height: 0.9;
  color: var(--verde-profundo);
}

.nombreHeroe {
  font-size: 9vh;
  font-weight: 800;
  line-height: 1;
  text-align: center;
  padding: 0 1vw;
  overflow-wrap: anywhere;
}

/* Mientras dura el aviso, el panel del turno se pinta con el amarillo
   institucional. Es la misma senial que antes, movida al heroe. */
.heroe[data-destacando='true'] .panelTurno {
  background: var(--amarillo);
  border-color: var(--amarillo-borde);
  border-left-color: var(--amarillo-borde);
  animation: latir 1.1s ease-in-out 5;
}

@keyframes latir {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(245, 196, 0, 0);
  }
  50% {
    box-shadow: 0 0 0 1.1vh rgba(245, 196, 0, 0.5);
  }
}

@media (prefers-reduced-motion: reduce) {
  .heroe[data-destacando='true'] .panelTurno {
    animation: none;
  }
}

/* Arranque de jornada: todavia no se llamo a nadie. */
.heroeEnEspera {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.4vh;
  border: 1px solid var(--sala-borde);
  background: var(--sala-tarjeta);
  text-align: center;
  padding: 0 3vw;
}

.heroeEnEsperaTitulo {
  font-size: 6vh;
  font-weight: 800;
  color: var(--verde-profundo);
}

.heroeEnEsperaTexto {
  font-size: 2.8vh;
  color: var(--sala-tinta-suave);
}

/* ---------------------------------------------------------------- */
/* Columna: ultimo turno de cada box                                */
/* ---------------------------------------------------------------- */

.columna {
  display: grid;
  grid-auto-rows: 1fr;
  gap: 1.2vh;
  min-height: 0;
}

.fila {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1vw;
  padding: 0 1.6vw;
  min-height: 0;
  border: 1px solid var(--sala-borde);
  border-left: 0.7vh solid var(--verde);
  background: var(--sala-tarjeta);
  transition:
    border-color 0.3s ease,
    background-color 0.3s ease;
}

.filaNombre {
  font-size: 2.6vh;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--sala-tinta-suave);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.filaNumero {
  /* Se achica al crecer la cantidad de puestos, con 7,5vh como techo: con
     cuatro boxes queda igual que antes y con seis deja de tocar los bordes.
     --filas lo pone el componente. */
  font-size: min(7.5vh, 42vh / var(--filas, 4));
  font-weight: 800;
  line-height: 1;
  color: var(--sala-tinta);
}

.filaVacia {
  background: var(--sala-libre);
  border-left-color: var(--sala-libre-borde);
}

.filaVacia .filaNombre,
.filaVacia .filaNumero {
  color: var(--sala-tinta-tenue);
}

.filaPausa {
  border-left-color: var(--amarillo-borde);
}

.filaLeyenda {
  font-size: 2.2vh;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--amarillo-tinta);
}

.filaDestacada {
  background: var(--amarillo);
  border-color: var(--amarillo-borde);
  border-left-color: var(--amarillo-borde);
}

.filaDestacada .filaNombre {
  color: var(--amarillo-tinta);
}

.filaDestacada .filaNumero {
  color: var(--verde-profundo);
}

/* ---------------------------------------------------------------- */
/* Pie                                                              */
/* ---------------------------------------------------------------- */

.pie {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 2vw;
  height: 13vh;
  padding: 0 2.5vw;
  border-top: 1px solid var(--sala-borde);
  background: var(--sala-tarjeta);
  font-size: 2.4vh;
  color: var(--sala-tinta-suave);
}

.bloquePie {
  display: flex;
  align-items: baseline;
  gap: 1.2vw;
  min-width: 0;
}

/* El bloque de datos se pega a la derecha; la leyenda queda a la izquierda por
   ser la primera celda de la grilla. */
.pie > .bloquePie:last-child {
  justify-self: end;
}

.marcas {
  display: flex;
  align-items: center;
  gap: 2vw;
}

.marca {
  display: block;
  max-height: 9vh;
  max-width: 22vw;
  width: auto;
  object-fit: contain;
}

.etiquetaPie {
  font-size: 1.8vh;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--sala-tinta-tenue);
  white-space: nowrap;
}

.leyendaPie {
  font-size: 2.2vh;
  color: var(--sala-tinta-suave);
  text-wrap: pretty;
}

.dato {
  font-size: 3.2vh;
  font-weight: 700;
  color: var(--sala-tinta);
}

/* ---------------------------------------------------------------- */
/* Avisos                                                           */
/* ---------------------------------------------------------------- */

.sinConexion {
  position: fixed;
  right: 1.2vw;
  bottom: 12.4vh;
  display: flex;
  align-items: center;
  gap: 0.6vw;
  padding: 0.8vh 1.2vw;
  border-radius: 999px;
  background: #fdeef0;
  border: 1px solid rgba(194, 26, 39, 0.45);
  color: var(--rojo-oscuro);
  font-size: 1.9vh;
  font-weight: 700;
}

.puntoRojo {
  width: 1.1vh;
  height: 1.1vh;
  border-radius: 50%;
  background: var(--rojo);
  animation: pulsar 1.6s ease-in-out infinite;
}

@keyframes pulsar {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.25;
  }
}

.velo {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3vh;
  background: rgba(241, 245, 240, 0.96);
  backdrop-filter: blur(4px);
}

.veloTexto {
  font-size: 3vh;
  color: var(--sala-tinta-suave);
  text-align: center;
  max-width: 44ch;
  line-height: 1.5;
}

.botonVelo {
  padding: 2.4vh 5vw;
  border-radius: 1.2vh;
  background: var(--verde-fuerte);
  color: #ffffff;
  font-size: 3.4vh;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.botonVelo:hover {
  background: var(--verde-hover);
}
