* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family:
    system-ui,
    -apple-system,
    sans-serif;
  background: #1a1a2e;
  color: #e0e0e0;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

main {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

h1 {
  font-size: 1.8rem;
  color: #fff;
}

#video-container {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
}

.video-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
}

.video-panel label {
  font-size: 0.8rem;
  color: #aaa;
}

video,
canvas {
  width: 480px;
  max-width: 44vw;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 8px;
}

#controls {
  display: flex;
  gap: 0.75rem;
}

button {
  padding: 0.5rem 1.25rem;
  border: none;
  border-radius: 6px;
  font-size: 0.95rem;
  cursor: pointer;
  background: #0f3460;
  color: #e0e0e0;
  transition: background 0.2s;
}

button:hover:not(:disabled) {
  background: #16213e;
}

button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

#status {
  font-size: 0.85rem;
  color: #888;
}

#codec-badge {
  display: inline-block;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  font-family: monospace;
  background: #1b5e20;
  color: #a5d6a7;
  letter-spacing: 0.03em;
}

/* ── Codec results table ───────────────────────────────────── */

#codec-results {
  width: 100%;
  max-width: 960px;
  margin-top: 0.5rem;
  overflow-x: auto;
}

.codec-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
  text-align: left;
}

.codec-table th,
.codec-table td {
  padding: 0.4rem 0.6rem;
  border-bottom: 1px solid #2a2a4a;
  white-space: nowrap;
}

.codec-table thead th {
  color: #aaa;
  font-weight: 600;
  border-bottom: 2px solid #3a3a5a;
}

.codec-table tbody tr:hover {
  background: #22223a;
}

.codec-table .rank {
  font-weight: 700;
  color: #8ab4f8;
  white-space: nowrap;
}

.codec-table code {
  font-size: 0.75rem;
  color: #8ab4f8;
}

.badge {
  display: inline-block;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
}

.badge.yes {
  background: #1b5e20;
  color: #a5d6a7;
}

.badge.no {
  background: #4a1c1c;
  color: #ef9a9a;
}
