/* Las llamadas de voz: la tarjeta de la llamada en curso y la sala (la pantalla completa de la llamada grupal). */

/* MARK: La tarjeta */

.ll-tarjeta {
  --ll-ancho: min(calc(372 * var(--u)), calc(100vw - 16px));
  position: fixed; z-index: 60; top: calc(54 * var(--u)); right: 14px; width: var(--ll-ancho);
  display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; border-radius: 14px; cursor: grab;
  background: color-mix(in srgb, var(--flota) 90%, transparent); backdrop-filter: blur(22px); -webkit-backdrop-filter: blur(22px);
  box-shadow: 0 0 0 1px rgba(var(--p), .1), 0 12px 34px rgba(0, 0, 0, .45); animation: aparecer .14s ease-out;
}
.ll-tarjeta:active { cursor: grabbing; }
.ll-fila { display: flex; align-items: center; gap: 10px; min-width: 0; }
.ll-gris { color: var(--texto2); }
.ll-azul { color: var(--azul); }
.ll-quien { position: relative; flex: none; display: grid; place-items: center; }
.ll-quien .cara { width: calc(30 * var(--u)); height: calc(30 * var(--u)); }
.ll-quien .ll-aro { inset: -4px; }

.ll-titulo { display: flex; flex-direction: column; gap: 1px; min-width: 0; cursor: pointer; }
.ll-titulo b { font-size: var(--f13); font-weight: 600; }
.ll-titulo small { font-size: var(--f11); color: var(--texto2); }

.ll-onda { flex: none; display: flex; align-items: center; justify-content: center; gap: 3px; width: calc(26 * var(--u)); height: calc(26 * var(--u)); }
.ll-onda i { width: 3.5px; height: calc(5 * var(--u)); border-radius: 3px; background: var(--azul); transition: height .1s ease-out; }
.ll-onda.suena i { background: var(--verde); transition: none; }
.ll-onda.conectando i { background: var(--texto2); transition: none; }

.ll-boton {
  flex: none; display: grid; place-items: center; width: calc(36 * var(--u)); height: calc(34 * var(--u)); border-radius: 99px;
  background: rgba(var(--p), .1); color: var(--texto); transition: background .12s;
}
.ll-boton:hover { background: rgba(var(--p), .17); }
.ll-boton.apagado { color: var(--ambar); }
.ll-boton.cortar { width: calc(44 * var(--u)); background: var(--rojo); color: #fff; }
.ll-boton.cortar:hover { background: color-mix(in srgb, var(--rojo) 88%, #000); }

/* El aro azul que gira alrededor de la cara de un bot que está trabajando. */
.ll-aro {
  position: absolute; inset: -3px; border-radius: 50%; border: 2.5px solid transparent; border-top-color: var(--azul);
  animation: girar 1.1s linear infinite; pointer-events: none;
}

.ll-caras { display: flex; align-items: flex-start; gap: 14px; overflow-x: auto; padding: 6px 2px 2px; scrollbar-width: none; }
.ll-caras::-webkit-scrollbar { display: none; }
.ll-carita { flex: none; display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: calc(56 * var(--u)); max-width: calc(84 * var(--u)); cursor: pointer; }
.ll-carita-cara { position: relative; display: grid; place-items: center; padding: 4px; border-radius: 50%; box-shadow: inset 0 0 0 2.5px transparent; transition: transform .2s, box-shadow .2s; }
.ll-carita-cara .cara { width: calc(44 * var(--u)); height: calc(44 * var(--u)); }
.ll-carita.habla .ll-carita-cara { box-shadow: inset 0 0 0 2.5px var(--verde); transform: scale(1.08); }
.ll-carita.le-toca .ll-carita-cara { box-shadow: inset 0 0 0 2.5px rgba(var(--p), .34); }
.ll-carita-cara .ll-aro { inset: 0; }
.ll-carita-nombre { max-width: 100%; font-size: var(--f11); color: var(--texto2); }
.ll-carita.habla .ll-carita-nombre { color: var(--texto); font-weight: 600; }
.ll-carita-trabaja { font-size: calc(9.5 * var(--u)); font-weight: 500; color: var(--azul); margin-top: -3px; }
.ll-marca { position: absolute; display: grid; place-items: center; width: 19px; height: 19px; border-radius: 50%; color: #fff; animation: aparecer .15s; }
.ll-marca.abajo { right: -3px; bottom: -3px; background: var(--primario); }
.ll-marca.arriba { right: -4px; top: -4px; background: #d99a00; }

.ll-texto { display: flex; flex-direction: column; gap: 4px; cursor: pointer; }
.ll-texto.abierta { gap: 6px; max-height: calc(230 * var(--u)); overflow-y: auto; cursor: auto; }
.ll-linea { font-size: var(--f125); line-height: 1.4; color: var(--texto); overflow-wrap: anywhere; }
.ll-linea b { font-size: var(--f115); font-weight: 600; margin-right: .6em; }
.ll-linea.apagada { color: var(--texto2); }
/* Cerrada se ve el final de cada línea (lo último que se dijo), no el principio. */
.ll-texto.cerrada .ll-linea { display: flex; align-items: flex-end; max-height: 4.2em; overflow: hidden; }
.ll-texto.cerrada .ll-linea b { flex: none; align-self: flex-start; line-height: 1.5; }

.ll-fin { flex-direction: row; align-items: flex-start; gap: 9px; cursor: pointer; text-align: left; color: var(--texto2); font-size: var(--f125); line-height: 1.4; user-select: text; }
.ll-fin .ico { margin-top: 1px; color: var(--rojo); }
.ll-fin span { flex: 1; min-width: 0; overflow-wrap: anywhere; }

/* MARK: La sala */

/* Siempre oscura, como una videollamada, con cualquier estilo de la página. */
.ll-sala {
  --p: 255, 255, 255; --texto: #fff; --texto2: rgba(255, 255, 255, .6); --azul: #51a2ff; --rojo: #ff6467; --ambar: #ffb900; --verde: #00d492;
  position: fixed; inset: 0; z-index: 70; display: flex; flex-direction: column; color: #fff; background: #121317; color-scheme: dark;
  padding: max(8px, env(safe-area-inset-top)) max(0px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(0px, env(safe-area-inset-left));
  animation: aparecer .14s ease-out;
}
.ll-sala-arriba { flex: none; display: flex; align-items: center; gap: 12px; padding: 6px 16px 10px; }
.ll-sala-titulo { display: flex; flex-direction: column; gap: 2px; }
.ll-sala-titulo b { font-size: calc(15 * var(--u)); font-weight: 600; }
.ll-sala-titulo small { font-size: var(--f12); color: var(--texto2); }

.ll-redondo {
  flex: none; display: grid; place-items: center; width: 52px; height: 52px; border-radius: 99px; color: #fff;
  background: rgba(255, 255, 255, .08); transition: background .12s;
}
.ll-redondo.activo { background: rgba(255, 255, 255, .16); }
.ll-redondo:hover { background: rgba(255, 255, 255, .24); }
.ll-redondo.chico { width: 40px; height: 40px; background: rgba(255, 255, 255, .1); }
.ll-redondo.alerta { background: var(--rojo); }
.ll-redondo.cortar { width: 72px; background: var(--rojo); }
.ll-redondo.alerta:hover, .ll-redondo.cortar:hover { background: color-mix(in srgb, var(--rojo) 86%, #000); }

.ll-mosaico { flex: 1 1 0; min-height: 0; display: flex; flex-direction: column; gap: 8px; padding: 0 16px; width: 100%; max-width: 1500px; margin: 0 auto; }
.ll-mosaico-fila { flex: 1 1 0; min-height: 80px; display: flex; justify-content: center; gap: 8px; }
.ll-recuadro {
  position: relative; flex: none; width: calc((100% - 8px * (var(--columnas) - 1)) / var(--columnas)); border-radius: 16px; overflow: hidden; display: block;
  background: linear-gradient(rgba(0, 0, 0, .25), rgba(0, 0, 0, .25)),
    linear-gradient(to bottom, color-mix(in srgb, var(--tinta) 32%, transparent), color-mix(in srgb, var(--tinta) 14%, transparent));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06); transition: box-shadow .2s;
}
button.ll-recuadro { cursor: pointer; }
.ll-recuadro.vos { background: rgba(255, 255, 255, .07); }
.ll-recuadro.habla { box-shadow: inset 0 0 0 3px var(--azul); }
.ll-lienzo { position: absolute; inset: 0; display: grid; place-items: center; container-type: size; }
.ll-centro { position: relative; display: grid; place-items: center; width: min(42cqw, 42cqh); aspect-ratio: 1; transition: transform .2s; }
.ll-recuadro.vos .ll-centro { width: min(36cqw, 36cqh); }
.ll-recuadro.habla .ll-centro { transform: scale(1.05); }
.ll-centro > .cara { position: relative; width: 100%; height: 100%; }
.ll-centro > .ll-aro { inset: -15%; border-width: 3px; }
.ll-halo { position: absolute; inset: -35%; border-radius: 50%; pointer-events: none; }
.ll-halo::before, .ll-halo::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--tinta, var(--azul)); }
.ll-halo::before { opacity: .18; animation: ll-latir .63s ease-in-out infinite alternate; }
.ll-halo::after { opacity: .12; animation: ll-latir-chico .63s ease-in-out infinite alternate; }
.ll-halo.con-nivel { inset: -30%; --tinta: var(--azul); }
.ll-halo.con-nivel::before { animation: none; transform: scale(calc(.8 + .2 * var(--latido, 0))); transition: transform .1s; }
.ll-halo.con-nivel::after { animation: none; transform: scale(calc(.9 + .1 * var(--latido, 0))); transition: transform .1s; }
@keyframes ll-latir { from { transform: scale(.8); } to { transform: scale(1); } }
@keyframes ll-latir-chico { from { transform: scale(.9); } to { transform: scale(1); } }

.ll-vos { position: relative; display: grid; place-items: center; width: 100%; height: 100%; border-radius: 50%; background: #5c6bbf; color: rgba(255, 255, 255, .9); }
.ll-vos .ico { width: 45%; height: 45%; }
.ll-vos-chico { position: relative; flex: none; width: 40px; height: 40px; padding: 3px; border-radius: 50%; box-shadow: inset 0 0 0 2.5px transparent; transition: box-shadow .2s; }
.ll-vos-chico.habla { box-shadow: inset 0 0 0 2.5px var(--azul); }
.ll-vos-chico > i { position: absolute; right: 0; bottom: 0; display: grid; place-items: center; width: 17px; height: 17px; border-radius: 50%; background: var(--rojo); color: #fff; }

.ll-chips { position: absolute; left: 9px; top: 9px; display: flex; flex-direction: column; align-items: flex-start; gap: 5px; }
.ll-chip {
  display: inline-flex; align-items: center; gap: 4px; padding: 4px 7px; border-radius: 99px; white-space: nowrap;
  font-size: calc(10.5 * var(--u)); font-weight: 600; color: #fff; background: rgba(255, 255, 255, .25); animation: aparecer .15s;
}
.ll-chip.ambar { background: #c98a00; }
.ll-chip.azul { background: #2f7fe0; }
.ll-nombre {
  position: absolute; left: 9px; bottom: 9px; max-width: calc(100% - 18px); display: flex; align-items: baseline; gap: 4px; padding: 4px 8px; border-radius: 99px;
  background: rgba(0, 0, 0, .45); color: #fff; font-size: var(--f12);
}
.ll-nombre b { font-weight: 600; }
.ll-nombre small { font-size: var(--f11); color: rgba(255, 255, 255, .6); }
.ll-sin-mic { position: absolute; right: 9px; top: 9px; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--rojo); color: #fff; }

.ll-indicador { position: absolute; right: 9px; top: 9px; display: flex; align-items: center; justify-content: center; gap: 2.5px; width: 28px; height: 28px; border-radius: 50%; background: #2f7fe0; }
.ll-indicador i { width: 3px; height: 13px; border-radius: 3px; background: #fff; transform: scaleY(.3); animation: ll-barrita .4s ease-in-out infinite alternate; }
.ll-indicador i:nth-child(2) { animation-delay: -.27s; }
.ll-indicador i:nth-child(3) { animation-delay: -.13s; }
@keyframes ll-barrita { from { transform: scaleY(.3); } to { transform: scaleY(1); } }

.ll-leyenda {
  flex: none; display: flex; flex-direction: column; justify-content: flex-end; gap: 4px; min-height: 60px; width: calc(100% - 28px); max-width: 860px; margin: 8px auto 0;
  padding: 8px 12px; border-radius: 12px;
}
.ll-leyenda.con-texto { background: rgba(0, 0, 0, .55); }
.ll-leyenda .ll-linea { font-size: calc(15 * var(--u)); color: #fff; display: flex; align-items: flex-end; max-height: 2.8em; overflow: hidden; }
.ll-leyenda .ll-linea b { flex: none; align-self: flex-start; font-size: var(--f13); font-weight: 700; line-height: 1.6; }
.ll-controles { flex: none; display: flex; justify-content: center; gap: 14px; padding: 10px 0 6px; }

@media (prefers-reduced-motion: reduce) {
  .ll-halo::before, .ll-halo::after, .ll-indicador i { animation: none; }
  .ll-aro { animation-duration: 2.4s; }
}

/* MARK: Celular */

@media (max-width: 760px) {
  /* La tarjeta es una barra arriba de todo, y la página (con sus paneles) empieza debajo. */
  .ll-tarjeta {
    top: 0 !important; left: 0 !important; right: 0 !important; width: auto; border-radius: 0; cursor: auto; gap: 8px;
    padding: calc(10px + env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) 10px max(14px, env(safe-area-inset-left));
    box-shadow: 0 1px 0 var(--borde); background: var(--flota); backdrop-filter: none; -webkit-backdrop-filter: none;
  }
  body.ll-corrida #app { height: calc(100dvh - var(--ll-alto, 0px)); margin-top: var(--ll-alto, 0px); }
  body.ll-corrida .panel { top: var(--ll-alto, 0px); padding-top: 0; }
  body.ll-corrida .encabezado { padding-top: 0; height: 50px; }
  .ll-boton { min-width: 42px; min-height: 40px; }
  .ll-boton.cortar { min-width: 52px; }
  .ll-linea { font-size: var(--f13); }
  .ll-sala-arriba { padding: 6px 14px 10px; }
  .ll-mosaico { padding: 0 10px; }
  .ll-leyenda { min-height: 44px; }
}
