:root {
  color-scheme: light;
  --bg: #f4f6f8;
  --surface: #ffffff;
  --text: #1b2430;
  --muted: #5c6b7a;
  --border: #d5dde5;
  --accent: #1f4f73;
  --accent-hover: #163a55;
  --error: #9b1c1c;
  --player-bg: #0f1419;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif;
}

.demo {
  max-width: 960px;
  margin: 0 auto;
  padding: 20px 16px 32px;
}

.demo-header h1 {
  margin: 0 0 4px;
  font-size: 1.35rem;
  font-weight: 650;
}

.demo-header p,
.embed p {
  margin: 0;
  color: var(--muted);
}

.filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 20px 0 12px;
}

.filters label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
}

.filters select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

.filters select:disabled {
  background: #eef1f4;
  color: var(--muted);
}

.filters noscript {
  grid-column: 1 / -1;
}

.status {
  min-height: 1.4em;
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.9rem;
}

.status.error {
  color: var(--error);
}

.player {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  background: var(--player-bg);
  aspect-ratio: 16 / 9;
}

.player video {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--player-bg);
}

.player-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  margin: 0;
  color: #9aa7b5;
  font-size: 0.95rem;
}

.player.has-video .player-placeholder {
  display: none;
}

.embed {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.embed h2 {
  margin: 0 0 6px;
  font-size: 1rem;
}

.embed pre {
  overflow-x: auto;
  margin: 12px 0;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  font-size: 0.8rem;
  white-space: pre-wrap;
}

@media (max-width: 720px) {
  .filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

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