/*
 * Asistente de Compañía - Estilos (tablet-first, accesible para personas mayores)
 *
 * Principios: texto MUY grande, alto contraste, objetivos táctiles >= 64px,
 * paleta cálida y serena, orientación horizontal, nada de menús complejos.
 */

:root {
  --fondo: #f5e9da;        /* crema cálido */
  --fondo-2: #efe0cd;
  --texto: #3a2a20;        /* marrón oscuro, alto contraste sobre crema */
  --acento: #c2613f;       /* terracota */
  --acento-claro: #e08a63;
  --verde: #4e8a5b;
  --sombra: rgba(90, 60, 40, 0.25);
  --radio: 28px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--fondo);
  color: var(--texto);
  font-family: "Atkinson Hyperlegible", "Verdana", "Segoe UI", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
  user-select: none;
}

#pantalla {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 2vh 3vw;
  max-width: 1100px;
  margin: 0 auto;
}

/* --- Cara --- */
#zona-cara {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 0;
}
#cara {
  width: auto;
  height: 100%;
  max-height: 42vh;
  filter: drop-shadow(0 10px 20px var(--sombra));
}

/* --- Texto / estado --- */
#zona-texto {
  text-align: center;
  width: 100%;
  padding: 0 2vw;
}
.estado {
  font-size: clamp(22px, 3.5vw, 34px);
  color: var(--acento);
  margin: 0 0 8px;
  font-weight: 700;
}
.transcripcion {
  font-size: clamp(26px, 4.6vw, 46px);
  line-height: 1.35;
  margin: 0;
  min-height: 1.4em;
  font-weight: 600;
}

/* --- Botones --- */
#zona-botones {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4vw;
  width: 100%;
  padding: 2vh 0;
}
.boton-grande {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 220px;
  min-height: 220px;
  border: none;
  border-radius: 50%;
  background: var(--acento);
  color: #fff;
  box-shadow: 0 8px 0 #9c4730, 0 12px 24px var(--sombra);
  cursor: pointer;
  transition: transform .12s ease, background .2s ease;
  touch-action: manipulation;
}
.boton-grande .icono { font-size: 72px; line-height: 1; }
.boton-grande .etiqueta { font-size: 30px; font-weight: 800; }
.boton-grande:active { transform: translateY(4px); box-shadow: 0 4px 0 #9c4730, 0 8px 16px var(--sombra); }
.boton-grande.escuchando { background: var(--verde); box-shadow: 0 8px 0 #356a40, 0 12px 24px var(--sombra); animation: latido 1.4s ease-in-out infinite; }
.boton-grande.pensando { background: var(--acento-claro); }

.boton-secundario {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 110px;
  min-height: 110px;
  border: 4px solid var(--acento);
  border-radius: var(--radio);
  background: #fff8ef;
  color: var(--texto);
  cursor: pointer;
  touch-action: manipulation;
}
.boton-secundario .icono { font-size: 40px; }
.boton-secundario .etiqueta { font-size: 20px; font-weight: 700; }
.boton-secundario:active { background: var(--fondo-2); }
.boton-secundario.apagado { opacity: .5; }

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

/* --- Fallback de texto --- */
#zona-fallback {
  display: flex;
  gap: 12px;
  width: 100%;
  max-width: 800px;
  padding: 1vh 0 2vh;
}
#entrada-texto {
  flex: 1;
  font-size: 28px;
  padding: 16px 20px;
  border-radius: var(--radio);
  border: 3px solid var(--acento);
  background: #fff;
}
#btn-enviar-texto { min-height: 64px; min-width: 120px; }

/* --- Aviso de instalación --- */
.aviso-instalar {
  position: fixed;
  bottom: 16px;
  right: 16px;
  font-size: 20px;
  padding: 16px 22px;
  border-radius: var(--radio);
  border: none;
  background: var(--verde);
  color: #fff;
  box-shadow: 0 6px 16px var(--sombra);
  cursor: pointer;
}

/* Indicador de cámara activa */
.camara-activa #btn-camara { box-shadow: 0 0 0 4px var(--verde); }

video { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

/* En orientación vertical, sugerir girar */
@media (orientation: portrait) {
  #pantalla::before {
    content: "Gira la tablet 🖐️";
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--fondo);
    font-size: 34px;
    font-weight: 800;
    color: var(--acento);
    z-index: 50;
  }
}
