/**
 * ToniEye v0.1.0 — Viewer-Layout (Refs #183).
 *
 * Nur Modul-Layout: Bühne für den MJPEG-Stream + Fallback-Panel.
 * Buttons, Bar und Typo kommen aus den Shared Bausteinen (idf-btn,
 * idf-list-bar, idf-headline) — hier nichts davon nachbauen.
 */

.te-main {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding: var(--space-6);
}

/* Toolbar — nutzt .idf-list-bar als Basis, hier nur der Status-Text */
.te-status {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--font-md);
  color: var(--mid);
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* [hidden] muss gegen die display-Regeln von .te-loading/.te-fallback
   gewinnen — Author-display überschreibt sonst das UA-display:none
   (gleiche Falle wie .idf-form-subgrid[hidden], Werkzeuge v0.2.13). */
.te-stage [hidden] {
  display: none !important;
}

/* Bühne: dunkle Fläche, Stream mittig, hält auch im Vollbild */
.te-stage {
  position: relative;
  display: grid;
  place-items: center;
  background: var(--ink);
  border-radius: var(--radius-lg);
  overflow: hidden;
  min-height: 320px;
  /* 16:9-Bühne, aber nie höher als der Viewport minus Kopfbereich */
  aspect-ratio: 16 / 9;
  max-height: calc(100vh - 260px);
}

.te-stage img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.te-loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--white);
  font-size: var(--font-xl);
}

/* Ton-Toggle als Overlay unten rechts — Brand-Rot an, Grau stumm.
   Liegt IN der Bühne und bleibt damit auch im Vollbild sichtbar. */
.te-sound-overlay {
  position: absolute;
  right: var(--space-4);
  bottom: var(--space-4);
  z-index: var(--z-overlay);
  background: var(--primary);
  border-color: var(--primary);
  color: var(--white);
  opacity: 0.92;
}

.te-sound-overlay:hover {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--white);
}

/* Fallback-Panel — Empty-State in der Bühne */
.te-fallback {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-8);
  text-align: center;
  color: var(--white);
  max-width: 520px;
}

.te-fallback > i {
  font-size: 40px;
  opacity: 0.5;
}

.te-fallback-title {
  margin: 0;
  font-size: var(--font-lg);
}

.te-fallback-text {
  margin: 0;
  font-size: var(--font-md);
  line-height: var(--leading-relax);
  opacity: 0.8;
}

.te-fallback .idf-btn {
  margin-top: var(--space-2);
}

.te-hint {
  margin: 0;
  font-size: var(--font-sm);
  color: var(--mid);
}

.te-hint code {
  font-size: inherit;
}
