:root {
  --bg: #000000;
  --text: #ffffff;
  --muted: #777777;
  --yellow: #ffd60a;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* ---- Vista principal a pantalla completa ---- */
.stage {
  height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Traduccion: arriba, ~2/3, DE CABEZA (para la persona de enfrente) */
.translation-area {
  flex: 2 1 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  overflow: hidden;
  transform: rotate(180deg);
}
#dst-text {
  margin: 0;
  width: 100%;
  text-align: center;
  color: var(--yellow);
  font-weight: 800;
  line-height: 1.08;
  word-break: break-word;
  font-size: 64px; /* punto de partida; JS lo ajusta al espacio disponible */
}
/* cursor parpadeante del efecto maquina de escribir */
#dst-text .caret {
  display: inline-block;
  width: 0.06em;
  background: var(--yellow);
  margin-left: 0.04em;
  animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* Heard: abajo, ~1/3, chiquito, orientacion normal */
.heard-area {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 14px 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
}
.heard-area .tag {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
  margin-bottom: 6px;
}
#src-text {
  margin: 0;
  text-align: center;
  color: var(--text);
  font-size: 1rem;
  line-height: 1.35;
  opacity: 0.85;
}

/* ---- Controles, mas abajo del todo (se llega bajando) ---- */
.controls {
  max-width: 520px;
  margin: 0 auto;
  padding: 32px 18px 60px;
}
.controls h1 { text-align: center; font-size: 1.4rem; margin: 0 0 20px; }

.picker { display: block; text-align: center; color: var(--muted); margin-bottom: 22px; font-size: 0.95rem; }
.picker span { display: block; margin-bottom: 8px; }
.picker select {
  width: 100%; padding: 14px; font-size: 1.05rem; border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12); background: #0d0d0d; color: var(--text); text-align: center;
}

.buttons { display: grid; gap: 16px; }
.lang-btn {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 26px 16px; border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 20px;
  background: #0d0d0d; color: var(--text); cursor: pointer;
  transition: transform 0.08s ease, border-color 0.2s ease;
}
.lang-btn:active { transform: scale(0.97); }
.lang-btn.active { border-color: #fff; outline: 2px solid #fff; }
.lang-btn .label { color: var(--muted); font-size: 0.9rem; }
.lang-btn .big { font-size: 1.4rem; font-weight: 700; }

.stop-btn {
  width: 100%; margin-top: 16px; padding: 16px; border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 16px; background: transparent; color: #c25; font-size: 1.05rem; font-weight: 600; cursor: pointer;
}

.status { margin-top: 18px; text-align: center; font-size: 0.95rem; }
.status.idle { color: var(--muted); }
.status.connecting { color: #ffd166; }
.status.listening { color: var(--yellow); font-weight: 700; }
.status.error { color: #ff453a; }

/* ---- Historial ---- */
.history-bar { display: flex; gap: 12px; justify-content: center; margin-top: 28px; }
.ghost-btn {
  background: transparent; border: 1px solid rgba(255, 255, 255, 0.18);
  color: var(--muted); padding: 10px 18px; border-radius: 12px; font-size: 0.9rem; cursor: pointer;
}
.ghost-btn.danger { color: #c25; }

.history-panel { margin-top: 18px; display: grid; gap: 10px; }
.history-item {
  border: 1px solid rgba(255, 255, 255, 0.08); border-radius: 12px; padding: 10px 12px;
}
.history-item .when { font-size: 0.7rem; color: var(--muted); margin-bottom: 4px; }
.history-item .h-src { font-size: 0.85rem; color: var(--muted); }
.history-item .h-dst { font-size: 1rem; color: var(--yellow); }
.history-empty { text-align: center; color: var(--muted); font-size: 0.9rem; padding: 10px; }
