:root {
  color-scheme: dark;
  --bg: #0d0f12;
  --panel: #15191f;
  --panel-2: #1b2028;
  --line: #303845;
  --text: #eef2f7;
  --muted: #9aa6b2;
  --accent: #53b3cb;
  --accent-2: #e2b854;
  --danger: #e35d6a;
}

* {
  box-sizing: border-box;
}

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

.app {
  min-height: 100vh;
  padding: 16px;
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 12px;
}

.topbar,
.transport {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.topbar {
  min-height: 72px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  min-width: 220px;
}

h1 {
  margin: 0;
  font-size: 20px;
  line-height: 1.15;
  letter-spacing: 0;
}

.meta,
.status {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.selectors {
  display: flex;
  align-items: end;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
}

select,
button,
input[type="number"],
input[type="search"],
input[type="range"] {
  font: inherit;
}

select,
input[type="number"],
input[type="search"] {
  height: 36px;
  min-width: 128px;
  max-width: 360px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 10px;
  background: var(--panel-2);
  color: var(--text);
}

#roundSelect {
  width: min(46vw, 520px);
}

#queryFilter {
  min-width: 180px;
}

#minDuration {
  min-width: 86px;
  width: 86px;
}

.transport {
  min-height: 56px;
  padding: 10px 12px;
  display: grid;
  grid-template-columns: 86px 64px minmax(120px, 1fr) 64px minmax(120px, 220px);
  align-items: center;
  gap: 10px;
}

button {
  height: 36px;
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: #081014;
  font-weight: 700;
  cursor: pointer;
}

button:disabled,
select:disabled,
input[type="number"]:disabled,
input[type="search"]:disabled,
input:disabled {
  cursor: not-allowed;
  opacity: 0.56;
}

.timeNow,
.timeTotal {
  color: var(--text);
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  text-align: center;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--accent-2);
}

.videoGrid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  align-content: start;
}

.povCard {
  min-width: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.povHeader {
  height: 34px;
  padding: 0 9px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.povHeader strong {
  color: var(--text);
  font-size: 13px;
}

.povHeader .sideT {
  color: var(--accent-2);
}

.povHeader .sideCT {
  color: #75b8ff;
}

.videoShell {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #050607;
}

video {
  display: block;
  width: 100%;
  height: 100%;
  background: #050607;
}

.povCard.activeAudio {
  border-color: var(--accent-2);
}

.povCard.error {
  border-color: var(--danger);
}

@media (max-width: 1180px) {
  .videoGrid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .app {
    padding: 10px;
  }

  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .selectors {
    justify-content: stretch;
  }

  .selectors label,
  #roundSelect,
  #queryFilter,
  #minDuration,
  select {
    width: 100%;
    max-width: none;
  }

  .transport {
    grid-template-columns: 78px 58px minmax(120px, 1fr) 58px;
  }

  .status {
    grid-column: 1 / -1;
  }

  .videoGrid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 460px) {
  .videoGrid {
    grid-template-columns: 1fr;
  }
}
