/* Página del celular para conversar con Modasito (celular.html). Pensada para una mano:
   todo en una columna, botones grandes y el de hablar al alcance del pulgar. */
:root {
  --fondo-1: #06122b;
  --fondo-2: #10306a;
  --superficie: rgba(255, 255, 255, 0.07);
  --superficie-fuerte: rgba(255, 255, 255, 0.12);
  --borde: rgba(255, 255, 255, 0.16);
  --texto: #f4f7ff;
  --texto-suave: #b9c6e4;
  --dorado: #f6c453;
  --naranja: #f47b20;
  --naranja-oscuro: #c85a0c;
  --verde: #4ade80;
  --amarillo: #fbbf24;
  --celeste: #5ee7ff;
  --peligro: #ff8a8a;
  --radio: 16px;
  --fuente: "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, "Roboto", sans-serif;
  --nivel: 0;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: radial-gradient(120% 70% at 50% 0%, var(--fondo-2), var(--fondo-1) 70%) fixed, var(--fondo-1);
  color: var(--texto);
  font-family: var(--fuente);
  font-size: 16px;
  line-height: 1.45;
}

button,
input {
  font: inherit;
  color: inherit;
}

[hidden] {
  display: none !important;
}

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.cel {
  width: 100%;
  max-width: 480px;
  min-height: 100dvh;
  margin: 0 auto;
  padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ---------- Encabezado ---------- */
.cabeza {
  display: flex;
  align-items: center;
  gap: 12px;
}

.cabeza-modasito {
  flex: none;
  width: 64px;
  height: 64px;
  object-fit: cover;
  object-position: 50% 6%;
  border-radius: 50%;
  background: var(--superficie-fuerte);
  border: 2px solid rgba(246, 196, 83, 0.6);
}

.cabeza-sobre {
  margin: 0;
  color: var(--dorado);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.cabeza-titulo {
  margin: 0;
  font-size: 24px;
  line-height: 1.15;
  font-weight: 800;
  text-wrap: balance;
}

/* ---------- Avisos ---------- */
.aviso,
.conexion {
  margin: 0;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--superficie-fuerte);
  border: 1px solid var(--borde);
  font-size: 15px;
}

.conexion {
  color: var(--amarillo);
  border-color: rgba(251, 191, 36, 0.35);
}

/* ---------- Paneles ---------- */
.panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
  animation: entrar 0.35s ease-out both;
}

@keyframes entrar {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.nota {
  margin: 0;
  color: var(--texto-suave);
  font-size: 14px;
}

.tarjeta {
  padding: 20px;
  border-radius: var(--radio);
  background: var(--superficie);
  border: 1px solid var(--borde);
  text-align: center;
}

.tarjeta-titulo {
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 800;
  color: var(--dorado);
}

.tarjeta-texto {
  margin: 0;
  color: var(--texto-suave);
}

/* ---------- Formulario ---------- */
.formulario {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.campo {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.campo-etiqueta {
  font-weight: 700;
  font-size: 15px;
  padding: 0;
}

.opcional {
  font-weight: 400;
  color: var(--texto-suave);
}

.campo input {
  width: 100%;
  min-height: 52px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1.5px solid var(--borde);
  background: rgba(0, 0, 0, 0.25);
  font-size: 18px;
  outline: none;
}

.campo input:focus-visible {
  border-color: var(--dorado);
  box-shadow: 0 0 0 3px rgba(246, 196, 83, 0.25);
}

.campo-codigo {
  font-size: 32px !important;
  font-weight: 800;
  letter-spacing: 0.4em;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.campo-ayuda {
  color: var(--texto-suave);
  font-size: 13px;
}

.equipos {
  margin: 0;
  padding: 0;
  border: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.equipos-lista {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.equipo {
  position: relative;
}

.equipo input {
  position: absolute;
  opacity: 0;
  inset: 0;
  margin: 0;
}

.equipo span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1.5px solid var(--borde);
  background: var(--superficie);
  font-size: 15px;
  font-weight: 600;
}

.equipo span::before {
  content: "";
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--color, var(--dorado));
}

.equipo input:checked + span {
  border-color: var(--color, var(--dorado));
  background: color-mix(in srgb, var(--color, var(--dorado)) 22%, transparent);
}

.equipo input:focus-visible + span {
  box-shadow: 0 0 0 3px rgba(246, 196, 83, 0.35);
}

/* ---------- Botones ---------- */
.boton {
  min-height: 52px;
  padding: 12px 18px;
  border-radius: 14px;
  border: 1.5px solid transparent;
  font-weight: 700;
  font-size: 17px;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.boton:disabled {
  opacity: 0.55;
  cursor: default;
}

.boton:focus-visible,
.hablar:focus-visible {
  outline: 3px solid var(--dorado);
  outline-offset: 3px;
}

.boton-principal {
  background: linear-gradient(180deg, var(--naranja), var(--naranja-oscuro));
  color: #fff;
  box-shadow: 0 6px 18px rgba(244, 123, 32, 0.35);
}

.boton-principal:active {
  transform: translateY(1px);
}

.boton-secundario {
  background: transparent;
  border-color: var(--borde);
  color: var(--texto);
  font-weight: 600;
}

.boton-chip {
  min-height: 44px;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--superficie-fuerte);
  border-color: var(--borde);
  font-size: 15px;
  font-weight: 600;
}

.boton-chip[aria-expanded="true"] {
  border-color: var(--dorado);
}

/* ---------- Fila ---------- */
.tarjeta-fila {
  padding: 24px 20px;
}

.fila-etiqueta {
  margin: 0;
  color: var(--texto-suave);
  font-weight: 600;
}

.fila-numero {
  margin: 4px 0;
  font-size: 72px;
  line-height: 1;
  font-weight: 800;
  color: var(--dorado);
  font-variant-numeric: tabular-nums;
}

.fila-conversando {
  margin: 8px 0 0;
  color: var(--celeste);
  font-weight: 600;
}

/* ---------- Turno ---------- */
.turno-estado {
  margin: 0;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--superficie);
  font-weight: 700;
  text-align: center;
  color: var(--color-estado, var(--texto));
  transition: color 0.3s ease;
}

.turno-estado[data-estado="escuchando"] {
  --color-estado: var(--verde);
}

.turno-estado[data-estado="pensando"] {
  --color-estado: var(--amarillo);
}

.turno-estado[data-estado="hablando"] {
  --color-estado: var(--celeste);
}

.dialogo {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 3em;
}

.dicho {
  margin: 0;
  padding: 10px 14px;
  border-radius: 14px;
  max-width: 92%;
  font-size: 15px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.dicho-tu {
  align-self: flex-end;
  background: rgba(244, 123, 32, 0.2);
  border-bottom-right-radius: 4px;
}

.dicho-modasito {
  align-self: flex-start;
  background: var(--superficie-fuerte);
  border-bottom-left-radius: 4px;
}

/* El botón para hablar: grande, al centro, y no deja seleccionar texto ni abrir menús */
.hablar {
  position: relative;
  align-self: center;
  width: min(62vw, 220px);
  aspect-ratio: 1;
  margin: 8px 0 0;
  border: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 35%, #ff9a4a, var(--naranja) 55%, var(--naranja-oscuro));
  box-shadow:
    0 10px 30px rgba(244, 123, 32, 0.4),
    inset 0 -6px 14px rgba(0, 0, 0, 0.18);
  color: #fff;
  cursor: pointer;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  transition:
    transform 0.15s ease,
    background 0.2s ease;
}

.hablar-icono {
  width: 38%;
  height: 38%;
  fill: currentColor;
  stroke: currentColor;
  pointer-events: none;
}

.hablar-anillo {
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  border: 4px solid var(--verde);
  opacity: 0;
  transform: scale(calc(1 + var(--nivel) * 0.16));
  transition:
    opacity 0.2s ease,
    transform 0.08s linear;
  pointer-events: none;
}

body[data-grabando="si"] .hablar {
  transform: scale(0.96);
  background: radial-gradient(circle at 50% 35%, #6ef0a0, #22c55e 55%, #15803d);
  box-shadow: 0 10px 30px rgba(34, 197, 94, 0.45);
}

body[data-grabando="si"] .hablar-anillo {
  opacity: 0.9;
}

.hablar:disabled {
  background: radial-gradient(circle at 50% 35%, #8a96b4, #5b6688 60%, #3d4664);
  box-shadow: none;
  cursor: default;
}

.hablar-texto {
  margin: -4px 0 0;
  text-align: center;
  font-weight: 700;
  font-size: 17px;
}

.acciones {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.preguntas {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.preguntas .boton {
  min-height: 48px;
  text-align: left;
  font-weight: 600;
  font-size: 15px;
  background: var(--superficie);
  border-color: var(--borde);
}

.credito {
  margin: auto 0 0;
  padding-top: 8px;
  text-align: center;
  color: var(--texto-suave);
  font-size: 12px;
  opacity: 0.6;
}

@media (prefers-reduced-motion: reduce) {
  .panel {
    animation: none;
  }
  .hablar,
  .hablar-anillo {
    transition: none;
  }
}
