/* Vista fullscreen del kiosko: solo el avatar y elementos mínimos. */

:root { color-scheme: dark; }

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: radial-gradient(circle at 50% 30%, #2a3550 0%, #0d1117 70%);
  font-family: system-ui, -apple-system, sans-serif;
  color: #e6e9f0;
  cursor: default;
  user-select: none;
  -webkit-user-select: none;
}

#avatar {
  position: fixed;
  inset: 0;
}

#avatar[data-loading]::after {
  content: 'Cargando avatar ' attr(data-loading);
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 1rem;
  opacity: .6;
}

#avatar[data-error]::after {
  content: '⚠ ' attr(data-error);
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #ff8a8a;
  font-size: .95rem;
  max-width: 80vw;
  text-align: center;
}

/* Indicador de estado: discreto, arriba al centro */
#status-bar {
  position: fixed;
  top: max(18px, env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: .55rem;
  padding: .45rem 1rem;
  border-radius: 999px;
  background: rgba(10, 14, 24, .45);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, .08);
  font-size: .88rem;
  letter-spacing: .01em;
  transition: opacity .4s;
  z-index: 5;
}

#status-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #6b7280;
  transition: background .3s, box-shadow .3s;
}

#status-dot[data-state="dormida"]    { background: #6b7280; }
#status-dot[data-state="conectando"] { background: #f0b35e; animation: pulse 1s infinite; }
#status-dot[data-state="escuchando"] { background: #5e9bf0; animation: pulse 1.6s infinite; }
#status-dot[data-state="pensando"]   { background: #f0b35e; animation: pulse 1s infinite; }
#status-dot[data-state="hablando"]   { background: #5ef08c; animation: pulse 1.2s infinite; }

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, .25); }
  50%      { box-shadow: 0 0 0 7px rgba(255, 255, 255, 0); }
}

#status-label { opacity: .85; }
#status-label:empty { display: none; }

/* Subtítulos */
#subtitles {
  position: fixed;
  left: 50%;
  bottom: max(7vh, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  max-width: min(860px, 86vw);
  padding: .8rem 1.4rem;
  border-radius: 14px;
  background: rgba(8, 11, 19, .55);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, .07);
  font-size: clamp(1rem, 2.4vw, 1.35rem);
  line-height: 1.45;
  text-align: center;
  opacity: 0;
  transition: opacity .35s;
  pointer-events: none;
  z-index: 5;
}

#subtitles.visible { opacity: 1; }

/* Engranaje de configuración: discreto, esquina inferior derecha */
#gear {
  position: fixed;
  right: max(14px, env(safe-area-inset-right));
  bottom: max(14px, env(safe-area-inset-bottom));
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: rgba(230, 233, 240, .35);
  background: rgba(10, 14, 24, .3);
  border: 1px solid rgba(255, 255, 255, .06);
  text-decoration: none;
  transition: color .25s, background .25s, transform .25s;
  z-index: 6;
}

#gear:hover {
  color: rgba(230, 233, 240, .95);
  background: rgba(10, 14, 24, .65);
  transform: rotate(40deg);
}

/* Overlay de arranque (gesto de usuario para desbloquear micrófono y audio) */
#boot-overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(7, 10, 17, .88);
  backdrop-filter: blur(14px);
  z-index: 20;
  transition: opacity .5s;
}

#boot-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

#offline-overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(7, 10, 17, .92);
  backdrop-filter: blur(14px);
  z-index: 30; /* por encima del boot: sin red no hay nada que activar */
  transition: opacity .5s;
}

#offline-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.boot-card {
  text-align: center;
  padding: 2.5rem 3rem;
  max-width: min(480px, 90vw);
}

.boot-card h1 {
  font-size: clamp(1.5rem, 4vw, 2.2rem);
  margin: 0 0 .6rem;
  font-weight: 650;
}

.boot-card p {
  opacity: .75;
  margin: 0 0 1.8rem;
  font-size: 1.05rem;
}

#boot-button {
  font-size: 1.15rem;
  font-weight: 650;
  padding: .95rem 2.6rem;
  border: none;
  border-radius: 999px;
  color: white;
  background: linear-gradient(135deg, #4f7cff, #6a5cff);
  cursor: pointer;
  box-shadow: 0 12px 40px rgba(79, 124, 255, .35);
  transition: transform .2s, filter .2s;
}

#boot-button:hover:not(:disabled) {
  transform: translateY(-2px);
  filter: brightness(1.12);
}

#boot-button:disabled {
  opacity: .55;
  cursor: wait;
}

.boot-error {
  color: #ff8a8a;
  min-height: 1.2em;
  font-size: .9rem !important;
}
