:root {
  color-scheme: dark;
  --bg: #101114;
  --panel: #181a1f;
  --panel-strong: #20242a;
  --text: #f2f4f8;
  --muted: #a7adb8;
  --line: #303640;
  --accent: #36d399;
  --warning: #f59e0b;
  --danger: #ef4444;
  --focus: #7dd3fc;
}

* {
  box-sizing: border-box;
}

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

.topbar {
  min-height: 92px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 28px;
  border-bottom: 1px solid var(--line);
  background: #15171b;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 28px;
  line-height: 1.1;
  font-weight: 760;
}

h2 {
  font-size: 20px;
  line-height: 1.2;
  font-weight: 700;
}

.eyebrow,
.section-title {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.layout {
  display: grid;
  grid-template-columns: minmax(220px, 320px) minmax(0, 1fr);
  min-height: calc(100vh - 93px);
}

.stream-list {
  padding: 18px;
  border-right: 1px solid var(--line);
  background: #131519;
}

.section-title {
  margin-bottom: 12px;
}

.stream-button {
  width: 100%;
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.stream-button:hover,
.stream-button.active {
  background: var(--panel);
  border-color: var(--line);
}

.stream-button:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.stream-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 15px;
  font-weight: 700;
}

.stream-slug {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.dot {
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--danger);
}

.dot.online {
  background: var(--accent);
}

.player-area {
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 22px;
  gap: 16px;
}

.player-header {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.status {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
}

.status-online {
  border-color: rgba(54, 211, 153, 0.45);
  color: var(--accent);
}

.status-offline {
  border-color: rgba(239, 68, 68, 0.45);
  color: #fca5a5;
}

.status-neutral {
  color: var(--muted);
}

.video-shell {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: 280px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #050608;
}

iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: none;
  background: #050608;
}

iframe.active {
  display: block;
}

.empty-state {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 8px;
  color: var(--muted);
  text-align: center;
  padding: 24px;
}

.empty-state strong {
  color: var(--text);
  font-size: 18px;
}

.links {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.links a {
  color: var(--focus);
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
}

.links a:hover {
  text-decoration: underline;
}

@media (max-width: 760px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
    padding: 18px;
  }

  .layout {
    grid-template-columns: 1fr;
  }

  .stream-list {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  #streams {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 8px;
  }

  .player-area {
    padding: 16px;
  }

  .player-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .video-shell {
    min-height: 210px;
  }
}
