/* =============================================
   LIAM — ESTILOS PRINCIPALES
   Paleta: Negro profundo + Azul eléctrico
   Estilo: Glassmorphism / Sci-Fi / Premium
   Fuentes: Outfit (UI) + Orbitron (marca)
============================================= */

/* ── Variables globales ── */
:root {
  /* Colores base */
  --bg-deep:        #06080f;
  --bg-dark:        #090c17;
  --bg-surface:     rgba(13, 18, 35, 0.85);
  --bg-surface-2:   rgba(16, 22, 44, 0.75);
  --bg-card:        rgba(15, 21, 42, 0.80);
  --bg-card-hover:  rgba(22, 30, 60, 0.90);

  /* Azules */
  --blue-primary:   #3b82f6;
  --blue-bright:    #60c8ff;
  --blue-electric:  #00b4ff;
  --blue-glow:      rgba(59, 130, 246, 0.35);
  --blue-glow-soft: rgba(59, 130, 246, 0.12);

  /* Texto */
  --text-primary:   #e2e8f0;
  --text-secondary: #94a3b8;
  --text-muted:     #475569;
  --text-accent:    #60c8ff;

  /* Bordes */
  --border-subtle:  rgba(59, 130, 246, 0.15);
  --border-medium:  rgba(59, 130, 246, 0.25);
  --border-bright:  rgba(96, 200, 255, 0.40);

  /* Glassmorphism */
  --glass-bg:       rgba(10, 15, 30, 0.80);
  --glass-blur:     20px;
  --glass-border:   rgba(255, 255, 255, 0.06);

  /* Sombras */
  --shadow-panel:   0 24px 80px rgba(0, 0, 0, 0.60), 0 0 0 1px var(--border-subtle);
  --shadow-card:    0 8px 32px rgba(0, 0, 0, 0.40);
  --shadow-blue:    0 0 40px rgba(59, 130, 246, 0.25);
  --shadow-dock:    0 -4px 40px rgba(0, 0, 0, 0.50), 0 0 0 1px var(--border-subtle);

  /* Espaciado */
  --radius-sm:      8px;
  --radius-md:      14px;
  --radius-lg:      20px;
  --radius-xl:      28px;
  --radius-full:    999px;

  /* Transiciones */
  --transition-fast:   0.15s ease;
  --transition-base:   0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-spring: 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);

  /* Layout */
  --header-h: 58px;
  --dock-h:   68px;
}


/* ── Reset y base ── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  height: 100%;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  height: 100%;
  min-height: 100dvh;
  background-color: var(--bg-deep);
  color: var(--text-primary);
  font-family: 'Outfit', 'Segoe UI', system-ui, sans-serif;
  font-weight: 400;
  line-height: 1.5;
  overflow: hidden;
  position: relative;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
  color: inherit;
  outline: none;
}

button:focus-visible {
  outline: 2px solid var(--blue-primary);
  outline-offset: 2px;
}

a {
  text-decoration: none;
  color: inherit;
}

img {
  max-width: 100%;
  display: block;
  user-select: none;
}


/* =============================================
   OVERLAY / BACKDROP
============================================= */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 5, 15, 0.60);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-base);
}

.overlay.is-active {
  opacity: 1;
  pointer-events: all;
}


/* =============================================
   HEADER
============================================= */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-h);
  z-index: 200;

  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;

  background: rgba(6, 8, 15, 0.70);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border-bottom: 1px solid var(--glass-border);
  box-shadow: 0 1px 0 var(--border-subtle);
}

/* Marca: ícono + logo */
.header__brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 0 6px var(--blue-primary));
}

.header__logo {
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.08em;
  color: var(--text-primary);
  text-shadow: 0 0 20px var(--blue-glow);
}

/* Navegación derecha */
.header__nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header__link {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  transition: color var(--transition-fast), background var(--transition-fast);
}

.header__link:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
}

.header__link--logout {
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}

.header__link--logout:hover {
  color: var(--blue-bright);
  border-color: var(--border-medium);
  background: rgba(59, 130, 246, 0.06);
}

.header__menu-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.03);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  margin-left: 4px;
}

.header__menu-btn:hover {
  background: rgba(59, 130, 246, 0.1);
  border-color: var(--border-medium);
}

.header__menu-lines {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-end;
}

.header__menu-lines span {
  display: block;
  height: 1.5px;
  background: var(--text-secondary);
  border-radius: 2px;
  transition: all var(--transition-fast);
}

.header__menu-lines span:first-child { width: 16px; }
.header__menu-lines span:last-child  { width: 11px; }

.header__menu-btn:hover .header__menu-lines span {
  background: var(--blue-bright);
}


/* =============================================
   ESCENA PRINCIPAL
============================================= */
.scene {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  padding-bottom: calc(var(--dock-h) + 40px);
  padding-left: 6%;
  padding-top: var(--header-h);
}

/* Luces de ambiente en el fondo */
.scene__ambient {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(120px);
  animation: ambientPulse 8s ease-in-out infinite;
}

.scene__ambient:first-child {
  width: 600px;
  height: 400px;
  background: radial-gradient(ellipse, rgba(59, 130, 246, 0.08) 0%, transparent 70%);
  bottom: 10%;
  left: -5%;
  animation-delay: 0s;
}

.scene__ambient--2 {
  width: 400px;
  height: 400px;
  background: radial-gradient(ellipse, rgba(96, 200, 255, 0.05) 0%, transparent 70%);
  top: 20%;
  left: 20%;
  animation-delay: -4s;
}

@keyframes ambientPulse {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50%       { opacity: 1;   transform: scale(1.08); }
}


/* ── Contenedor de Liam ── */
.liam-container {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  /* Tamaño base del personaje */
  width: clamp(280px, 38vw, 540px);
  height: clamp(320px, 55vh, 700px);
  animation: liamFloat 5s ease-in-out infinite;
  will-change: transform;
}

/* Animación de levitación suave */
@keyframes liamFloat {
  0%, 100% { transform: translateY(0px); }
  50%       { transform: translateY(-14px); }
}

/* Glow azul detrás de Liam */
.liam-glow {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(
    ellipse 60% 50% at 50% 60%,
    rgba(59, 130, 246, 0.22) 0%,
    rgba(96, 200, 255, 0.08) 50%,
    transparent 80%
  );
  filter: blur(20px);
  animation: glowPulse 4s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}

@keyframes glowPulse {
  0%, 100% { opacity: 0.7; transform: scale(1); }
  50%       { opacity: 1;   transform: scale(1.05); }
}

/* Sombra en el suelo bajo Liam */
.liam-shadow {
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 55%;
  height: 30px;
  background: radial-gradient(ellipse, rgba(59, 130, 246, 0.25) 0%, transparent 70%);
  filter: blur(12px);
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  animation: shadowPulse 5s ease-in-out infinite;
}

@keyframes shadowPulse {
  0%, 100% { opacity: 0.6; transform: translateX(-50%) scaleX(1); }
  50%       { opacity: 0.9; transform: translateX(-50%) scaleX(1.08); }
}

/* Imagen / video de Liam */
.liam-character {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: bottom center;
  filter:
    drop-shadow(0 0 30px rgba(59, 130, 246, 0.35))
    drop-shadow(0 0 80px rgba(59, 130, 246, 0.15));
  transition: filter var(--transition-base);
}

.liam-character:hover {
  filter:
    drop-shadow(0 0 40px rgba(59, 130, 246, 0.55))
    drop-shadow(0 0 100px rgba(96, 200, 255, 0.20));
}

/* Cuando Liam está en modo "Hablar" activo */
.liam-container.is-speaking .liam-character {
  filter:
    drop-shadow(0 0 50px rgba(96, 200, 255, 0.70))
    drop-shadow(0 0 100px rgba(59, 130, 246, 0.40));
}

.liam-container.is-speaking .liam-glow {
  background: radial-gradient(
    ellipse 70% 60% at 50% 55%,
    rgba(96, 200, 255, 0.35) 0%,
    rgba(59, 130, 246, 0.15) 50%,
    transparent 80%
  );
  animation: glowPulse 1.5s ease-in-out infinite;
}

/* Indicador de estado */
.liam-status {
  position: absolute;
  bottom: calc(var(--dock-h) + 28px);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  color: var(--text-secondary);
  white-space: nowrap;
}

.liam-status__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--blue-primary);
  box-shadow: 0 0 8px var(--blue-primary);
  animation: dotPulse 2s ease-in-out infinite;
  flex-shrink: 0;
}

@keyframes dotPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.5; transform: scale(0.85); }
}

/* Estado: escuchando */
.liam-status.is-listening .liam-status__dot {
  background: #22c55e;
  box-shadow: 0 0 10px #22c55e;
  animation: dotPulse 0.8s ease-in-out infinite;
}

.liam-status.is-listening .liam-status__text::after {
  content: '...';
  animation: ellipsis 1.5s steps(3, end) infinite;
}

@keyframes ellipsis {
  0%        { clip-path: inset(0 75% 0 0); }
  33%       { clip-path: inset(0 50% 0 0); }
  66%       { clip-path: inset(0 25% 0 0); }
  100%      { clip-path: inset(0 0 0 0); }
}


/* =============================================
   DOCK FLOTANTE
============================================= */
.dock {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 150;

  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 12px;

  background: rgba(10, 13, 24, 0.88);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-dock);

  /* Entrada con animación */
  animation: dockEntrance 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0.3s both;
}

@keyframes dockEntrance {
  from { opacity: 0; transform: translateX(-50%) translateY(20px) scale(0.95); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
}

/* Botón del dock */
.dock__btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 10px 18px;
  border-radius: var(--radius-xl);
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  min-width: 72px;
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

.dock__btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--blue-glow-soft);
  opacity: 0;
  transition: opacity var(--transition-fast);
  border-radius: inherit;
}

.dock__btn:hover {
  color: var(--text-primary);
  background: rgba(59, 130, 246, 0.1);
}

.dock__btn:hover::before {
  opacity: 1;
}

.dock__btn:active {
  transform: scale(0.95);
}

/* Estado activo del botón */
.dock__btn.is-active {
  color: #fff;
  background: rgba(59, 130, 246, 0.18);
  border: 1px solid var(--border-medium);
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.20);
}

.dock__btn.is-active .dock__icon {
  color: var(--blue-bright);
  filter: drop-shadow(0 0 6px var(--blue-primary));
}

/* Estado de Hablar activo (especial) */
.dock__btn#btnHablar.is-speaking {
  background: rgba(59, 130, 246, 0.25);
  border: 1px solid var(--blue-primary);
  color: var(--blue-bright);
  box-shadow: 0 0 24px rgba(59, 130, 246, 0.35), inset 0 0 12px rgba(59, 130, 246, 0.1);
  animation: speakingPulse 1.2s ease-in-out infinite;
}

@keyframes speakingPulse {
  0%, 100% { box-shadow: 0 0 24px rgba(59, 130, 246, 0.35), inset 0 0 12px rgba(59, 130, 246, 0.1); }
  50%       { box-shadow: 0 0 36px rgba(59, 130, 246, 0.55), inset 0 0 18px rgba(59, 130, 246, 0.2); }
}

.dock__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--transition-fast), filter var(--transition-fast);
}

.dock__label {
  line-height: 1;
}

/* Separador vertical */
.dock__separator {
  width: 1px;
  height: 28px;
  background: var(--border-subtle);
  margin: 0 4px;
  flex-shrink: 0;
}


/* =============================================
   PANELES FLOTANTES — BASE
============================================= */
.panel {
  position: fixed;
  z-index: 200;

  background: rgba(10, 14, 28, 0.92);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-panel);

  /* Estado inicial: oculto */
  opacity: 0;
  pointer-events: none;
  transform: translateY(16px) scale(0.97);
  transition:
    opacity 0.30s ease,
    transform 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.panel.is-open {
  opacity: 1;
  pointer-events: all;
  transform: translateY(0) scale(1);
}

/* Header común de paneles */
.panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--border-subtle);
}

.panel__title {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--text-primary);
  text-shadow: 0 0 16px var(--blue-glow);
}

/* Botón "···" de menú */
.panel__dots-btn {
  display: flex;
  gap: 3px;
  align-items: center;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  transition: background var(--transition-fast);
  color: var(--text-muted);
}

.panel__dots-btn span {
  font-size: 1.1rem;
  line-height: 0;
  margin-top: -2px;
}

.panel__dots-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
}

/* Footer común */
.panel__footer {
  padding: 16px 22px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: center;
}

.panel__close-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 28px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-medium);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  transition: all var(--transition-base);
}

.panel__close-btn:hover {
  background: rgba(59, 130, 246, 0.1);
  border-color: var(--blue-primary);
  color: var(--text-primary);
  box-shadow: 0 0 16px rgba(59, 130, 246, 0.15);
}


/* =============================================
   PANEL: MODOS
============================================= */
.panel--modos {
  /* Posición: derecha-centro */
  right: 5%;
  top: 50%;
  transform: translateY(-46%) scale(0.97);
  width: clamp(340px, 38vw, 500px);
}

.panel--modos.is-open {
  transform: translateY(-50%) scale(1);
}

/* Grilla de modos */
.modes-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  padding: 18px 18px 16px;
}

/* Tarjeta de modo */
.mode-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 20px 12px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  background: rgba(15, 20, 40, 0.70);
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  transition: all var(--transition-base);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.mode-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.05) 0%, transparent 60%);
  opacity: 0;
  transition: opacity var(--transition-base);
}

.mode-card:hover {
  background: rgba(22, 30, 60, 0.90);
  border-color: var(--border-medium);
  color: var(--text-primary);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35), 0 0 0 1px var(--border-subtle);
}

.mode-card:hover::before {
  opacity: 1;
}

.mode-card:active {
  transform: translateY(0) scale(0.97);
}

/* Modo activo */
.mode-card--active {
  background: rgba(59, 130, 246, 0.12);
  border-color: var(--blue-primary);
  color: var(--blue-bright);
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.18), inset 0 0 12px rgba(59, 130, 246, 0.06);
}

.mode-card--active::before {
  opacity: 1;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.12) 0%, transparent 60%);
}

.mode-card--active .mode-card__icon {
  filter: drop-shadow(0 0 8px rgba(96, 200, 255, 0.60));
  color: var(--blue-bright);
}

.mode-card__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  transition: filter var(--transition-base), color var(--transition-base);
}

.mode-card__name {
  line-height: 1;
  font-weight: 500;
}


/* =============================================
   PANEL: CHAT
============================================= */
.panel--chat {
  /* Posición: derecha-centro */
  right: 5%;
  top: 50%;
  transform: translateY(-46%) scale(0.97);
  width: clamp(300px, 36vw, 460px);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - var(--header-h) - var(--dock-h) - 80px);
}

.panel--chat.is-open {
  transform: translateY(-50%) scale(1);
}

/* Header del chat */
.chat__header {
  flex-shrink: 0;
}

.chat__brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.chat__avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1.5px solid var(--border-medium);
  background: rgba(59, 130, 246, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.20);
}

.chat__name {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-primary);
  text-shadow: 0 0 12px var(--blue-glow);
}

/* Área de mensajes */
.chat__messages {
  flex: 1;
  overflow-y: auto;
  padding: 18px 18px 12px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  /* Altura mínima y máxima */
  min-height: 200px;
  max-height: 380px;
  scroll-behavior: smooth;
}

/* Scrollbar minimalista */
.chat__messages::-webkit-scrollbar {
  width: 3px;
}
.chat__messages::-webkit-scrollbar-track {
  background: transparent;
}
.chat__messages::-webkit-scrollbar-thumb {
  background: var(--border-medium);
  border-radius: 3px;
}

/* Mensaje individual */
.chat__message {
  display: flex;
  flex-direction: column;
  gap: 4px;
  animation: messageIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
}

@keyframes messageIn {
  from { opacity: 0; transform: translateY(10px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Mensajes de Liam (izquierda) */
.chat__message--liam {
  align-items: flex-start;
}

/* Mensajes del usuario (derecha) */
.chat__message--user {
  align-items: flex-end;
}

/* Burbuja de mensaje */
.chat__bubble {
  max-width: 84%;
  padding: 11px 16px;
  border-radius: 18px;
  font-size: 0.9rem;
  line-height: 1.55;
  word-break: break-word;
}

.chat__message--liam .chat__bubble {
  background: rgba(22, 30, 58, 0.90);
  border: 1px solid var(--border-subtle);
  border-bottom-left-radius: 6px;
  color: var(--text-primary);
}

.chat__message--user .chat__bubble {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: #fff;
  border-bottom-right-radius: 6px;
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.30);
}

.chat__time {
  font-size: 0.72rem;
  color: var(--text-muted);
  padding: 0 4px;
}

/* Typing indicator */
.chat__typing .chat__bubble {
  padding: 14px 20px;
}

.typing-dots {
  display: flex;
  gap: 5px;
  align-items: center;
}

.typing-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-muted);
  animation: typingBounce 1.2s ease-in-out infinite;
}

.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); }
  30%            { transform: translateY(-6px); background: var(--blue-primary); }
}

/* Área de input del chat */
.chat__input-area {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px;
  border-top: 1px solid var(--border-subtle);
}

/* Botón Hablar en chat */
.chat__action-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 600;
  transition: all var(--transition-base);
  white-space: nowrap;
  flex-shrink: 0;
}

.chat__action-btn--speak {
  background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
  color: #fff;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}

.chat__action-btn--speak:hover {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  box-shadow: 0 4px 20px rgba(59, 130, 246, 0.45);
  transform: translateY(-1px);
}

.chat__action-btn--speak.is-speaking {
  background: linear-gradient(135deg, #60c8ff 0%, #3b82f6 100%);
  animation: speakBtnPulse 1s ease-in-out infinite;
}

@keyframes speakBtnPulse {
  0%, 100% { box-shadow: 0 4px 14px rgba(59, 130, 246, 0.35); }
  50%       { box-shadow: 0 4px 28px rgba(96, 200, 255, 0.55); }
}

/* Cámara en chat */
.chat__action-btn--camera {
  border: 1px solid var(--border-medium);
  background: rgba(59, 130, 246, 0.10);
  color: var(--blue-bright);
  padding: 10px 12px;
}

.chat__action-btn--camera:hover {
  background: rgba(59, 130, 246, 0.20);
  border-color: var(--blue-primary);
}

.chat__dropdown-arrow {
  margin-left: 2px;
  opacity: 0.7;
}

/* Wrap del input de texto */
.chat__input-wrap {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
}

.chat__input {
  width: 100%;
  padding: 10px 42px 10px 16px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
  background: rgba(15, 20, 40, 0.80);
  color: var(--text-primary);
  font-family: 'Outfit', sans-serif;
  font-size: 0.88rem;
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.chat__input::placeholder {
  color: var(--text-muted);
}

.chat__input:focus {
  border-color: var(--blue-primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

/* Botón de envío */
.chat__send-btn {
  position: absolute;
  right: 6px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--blue-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.chat__send-btn:hover {
  background: var(--blue-bright);
  transform: scale(1.08);
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.40);
}

.chat__send-btn:active {
  transform: scale(0.95);
}


/* =============================================
   ANIMACIONES DE ENTRADA DE LA PÁGINA
============================================= */
.header {
  animation: slideDown 0.5s ease both;
}

@keyframes slideDown {
  from { transform: translateY(-20px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

.liam-container {
  animation: liamEntrance 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0.2s both,
             liamFloat 5s ease-in-out 1s infinite;
}

@keyframes liamEntrance {
  from { opacity: 0; transform: translateY(30px) scale(0.92); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.liam-status {
  animation: fadeInUp 0.6s ease 0.6s both;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateX(-50%) translateY(10px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}


/* =============================================
   RESPONSIVE — MÓVIL
============================================= */
@media (max-width: 768px) {

  :root {
    --header-h: 52px;
  }

  /* En móvil, Liam queda más centrado y pequeño */
  .scene {
    justify-content: center;
    padding-left: 0;
    align-items: flex-start;
    padding-top: calc(var(--header-h) + 20px);
  }

  .liam-container {
    width: clamp(200px, 70vw, 320px);
    height: clamp(220px, 45vh, 400px);
  }

  /* Dock más compacto */
  .dock {
    bottom: 16px;
    gap: 2px;
    padding: 6px 8px;
  }

  .dock__btn {
    padding: 8px 12px;
    min-width: 58px;
    font-size: 0.7rem;
  }

  .dock__label {
    display: none; /* En móvil solo íconos */
  }

  /* Paneles ocupan más pantalla en móvil */
  .panel--modos,
  .panel--chat {
    right: 50%;
    transform: translateY(-46%) translateX(50%) scale(0.97);
    width: calc(100vw - 32px);
    max-width: 400px;
  }

  .panel--modos.is-open,
  .panel--chat.is-open {
    transform: translateY(-50%) translateX(50%) scale(1);
  }

  .modes-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    padding: 14px 14px 12px;
  }

  .mode-card {
    padding: 14px 8px;
    font-size: 0.8rem;
    gap: 7px;
  }

  .header__link {
    font-size: 0.8rem;
    padding: 5px 10px;
  }

}

@media (max-width: 480px) {
  .dock__separator { display: none; }
  .modes-grid { grid-template-columns: repeat(2, 1fr); }
}


/* =============================================
   UTILIDADES
============================================= */

/* Scrollbar global */
::-webkit-scrollbar       { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-medium); border-radius: 4px; }

/* Selección de texto */
::selection {
  background: rgba(59, 130, 246, 0.30);
  color: var(--text-primary);
}
