/* css/live.css — Live mode styles + HUD */

.view--live {
  background: var(--bg-base);
}

/* ── Live Canvas ────────────────────────────────────────── */
.live-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: calc(100% - var(--hud-height));
  will-change: transform;
  cursor: default;
}

/* ── Permission Overlay ─────────────────────────────────── */
.permission-overlay {
  position: absolute;
  inset: 0;
  bottom: var(--hud-height);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  z-index: 10;
  cursor: pointer;
  transition: opacity var(--dur-slow) var(--ease-out);
}

.permission-pulse {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  border: 1px solid rgba(235, 228, 215, 0.22);
  animation: permission-breathe 2.8s ease-in-out infinite;
  position: relative;
}

.permission-pulse::before {
  content: '';
  position: absolute;
  inset: 12px;
  border-radius: 50%;
  background: rgba(235, 228, 215, 0.05);
  animation: permission-breathe 2.8s ease-in-out infinite;
  animation-delay: 0.15s;
}

/* outer halo ring */
.permission-pulse::after {
  content: '';
  position: absolute;
  inset: -18px;
  border-radius: 50%;
  border: 1px solid rgba(235, 228, 215, 0.07);
  animation: permission-breathe 2.8s ease-in-out infinite;
  animation-delay: 0.3s;
}

.permission-label {
  font-family: var(--font-ui);
  font-size: 16px;
  color: var(--ink-secondary);
  text-align: center;
  margin-top: var(--space-2);
}

.permission-sub {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-tertiary);
  letter-spacing: 0.07em;
  text-align: center;
}

/* ── Denied Overlay ─────────────────────────────────────── */
.denied-overlay {
  position: absolute;
  inset: 0;
  bottom: var(--hud-height);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  z-index: 10;
}

.denied-label {
  font-family: var(--font-ui);
  font-size: 15px;
  color: var(--ink-secondary);
}

.denied-sub {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-tertiary);
  letter-spacing: 0.04em;
  text-align: center;
}

/* ── Silence State ──────────────────────────────────────── */
.silence-state {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 5;
  animation: fade-in 1.5s var(--ease-out) forwards;
}

.silence-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(235, 228, 215, 0.28);
}

/* ── Bottom HUD ─────────────────────────────────────────── */
.live-hud {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--hud-height);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 var(--space-6);
  /* Safe area for notched/home-indicator phones */
  padding-bottom: env(safe-area-inset-bottom, 0);
  padding-left: max(var(--space-6), env(safe-area-inset-left));
  padding-right: max(var(--space-6), env(safe-area-inset-right));
  background: rgba(8, 8, 8, 0.82);
  backdrop-filter: var(--blur-ui);
  -webkit-backdrop-filter: var(--blur-ui);
  border-top: 1px solid rgba(235, 228, 215, 0.06);
  z-index: 20;
}

/* ── REC Indicator ──────────────────────────────────────── */
.hud-left {
  display: flex;
  align-items: center;
}

.rec-indicator {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  opacity: 0;
  transition: opacity var(--dur-slow) var(--ease-out);
}

.rec-indicator.visible {
  opacity: 1;
}

.rec-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #e05050;
  animation: rec-pulse 1.5s ease-in-out infinite;
  flex-shrink: 0;
}

.rec-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(235, 228, 215, 0.50);
}

/* ── HUD Center Readouts ────────────────────────────────── */
.hud-center {
  display: flex;
  gap: var(--space-8);
  align-items: center;
}

.readout {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.readout-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(235, 228, 215, 0.45);
}

.readout-value {
  font-family: var(--font-mono);
  font-size: 22px;
  color: var(--ink-secondary);
  letter-spacing: 0.02em;
  transition: color var(--dur-fast) var(--ease-precise);
  min-width: 3.5ch;
  text-align: center;
  line-height: 1;
}

/* ── HUD Right ──────────────────────────────────────────── */
.hud-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-3);
}

.save-timer {
  font-family: var(--font-mono);
  font-size: 11px;
  color: rgba(235, 228, 215, 0.40);
  letter-spacing: 0.05em;
}

/* ── Save Button ────────────────────────────────────────── */
.save-btn {
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-primary);
  background: rgba(235, 228, 215, 0.05);
  border: 1px solid rgba(235, 228, 215, 0.18);
  border-radius: var(--radius-sm);
  padding: 9px 22px;
  cursor: pointer;
  transition:
    background var(--dur-fast) var(--ease-out),
    border-color var(--dur-fast) var(--ease-out),
    transform var(--dur-fast) var(--ease-spring);
  letter-spacing: 0.02em;
}

.save-btn:hover {
  background: var(--surface-hover);
  border-color: var(--border-hover);
}

.save-btn:active {
  transform: scale(0.96);
}

/* ── Mobile: HUD reflow ─────────────────────────────────── */
@media (max-width: 640px) {
  .live-hud {
    grid-template-columns: auto 1fr auto;
    padding: 0 var(--space-3);
    gap: var(--space-2);
  }

  .hud-center {
    gap: var(--space-6);
    justify-content: center;
  }

  .readout-value {
    font-size: 17px;
  }

  .readout-label {
    font-size: 9px;
    letter-spacing: 0.10em;
  }

  /* Hide "LISTENING" text — keep pulsing dot only */
  .rec-label {
    display: none;
  }

  .save-btn {
    padding: 8px 14px;
    font-size: 12px;
  }

  .save-timer {
    display: none;
  }
}

@media (max-width: 380px) {
  .hud-center {
    gap: var(--space-4);
  }
  .readout-value {
    font-size: 15px;
  }
}

/* ── Mobile: permission overlay ─────────────────────────── */
@media (max-width: 640px) {
  .permission-pulse {
    width: 72px;
    height: 72px;
  }
  .permission-label {
    font-size: 15px;
  }
  .permission-sub {
    font-size: 11px;
  }
}

/* ── Touch devices: ensure tap targets are comfortable ──── */
@media (hover: none) {
  .mode-btn {
    padding: 8px 4px;
    min-width: 44px;
    text-align: center;
  }
  .save-btn {
    min-height: 44px;
  }
}
