:root {
  color-scheme: dark;
  --bg: #0e0e10;
  --panel: #18181b;
  --panel-2: #1f1f23;
  --panel-3: #26262c;
  --border: rgba(255, 255, 255, 0.08);
  --text: #efeff1;
  --muted: #adadb8;
  --accent: #9146ff;
  --accent-soft: rgba(145, 70, 255, 0.16);
  --success: #2dd4bf;
  --shadow: 0 12px 28px rgba(0, 0, 0, 0.32);
  --desktop-columns: 5;
  --effective-columns: 1;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top, rgba(145, 70, 255, 0.22), transparent 22%),
    linear-gradient(180deg, #18181b 0%, #0e0e10 24%, #0b0b0d 100%);
  color: var(--text);
  font-family: Inter, Arial, Helvetica, sans-serif;
}

body {
  min-width: 320px;
}

a {
  color: inherit;
}

.page-shell {
  max-width: 1820px;
  margin: 0 auto;
  padding: 24px;
}

.hero {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
  margin-bottom: 26px;
}

.brand-block {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 18px;
}

.brand-logo {
  width: 72px;
  height: 72px;
  object-fit: contain;
  filter: drop-shadow(0 8px 18px rgba(145, 70, 255, 0.3));
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.78rem;
}

.hero h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.2rem);
  letter-spacing: -0.03em;
}

.hero-copy {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.hero-meta {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 220px;
}

.status-pill,
.stats,
.toolbar-item {
  border: 1px solid var(--border);
  background: rgba(31, 31, 35, 0.96);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
}

.status-pill,
.stats,
.toolbar-item {
  border-radius: 8px;
  padding: 14px 16px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--success);
  box-shadow: 0 0 0 6px rgba(45, 212, 191, 0.14);
}

.stats strong {
  display: block;
  font-size: 1.6rem;
}

.stats span,
.label {
  color: var(--muted);
  font-size: 0.92rem;
}

.toolbar {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.toolbar-item {
  min-height: 74px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
}

.toolbar-actions {
  align-items: stretch;
}

.action-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.toolbar-button {
  min-height: 38px;
  padding: 0 14px;
  border: 0;
  border-radius: 8px;
  background: linear-gradient(180deg, #a970ff 0%, #9146ff 100%);
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
  transition:
    transform 160ms ease,
    filter 160ms ease;
}

.toolbar-button:hover {
  transform: translateY(-1px);
  filter: brightness(1.04);
}

.toolbar-button-secondary {
  background: #2a2a31;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.error-box {
  color: #ffb4b4;
  border-color: rgba(255, 110, 110, 0.24);
  background: rgba(89, 22, 33, 0.42);
}

.is-hidden {
  display: none;
}

.stream-grid {
  display: grid;
  grid-template-columns: repeat(var(--effective-columns), minmax(min(100%, 400px), 1fr));
  gap: 16px;
}

.stream-card {
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: linear-gradient(180deg, rgba(24, 24, 27, 0.96) 0%, rgba(18, 18, 23, 0.98) 100%);
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.34);
  overflow: hidden;
  border-radius: 22px;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease;
}

.stream-card:hover {
  transform: translateY(-4px);
  border-color: rgba(145, 70, 255, 0.42);
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.36);
}

.player-shell {
  background: #0b0b0d;
  padding: 12px 12px 0;
}

.player-frame {
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: 300px;
  border-radius: 16px;
  overflow: hidden;
  background: #000;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.stream-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 14px 14px 16px;
}

.stream-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.avatar {
  width: 46px;
  height: 46px;
  border-radius: 999px;
  object-fit: cover;
  background: var(--panel-2);
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.stream-titles {
  min-width: 0;
}

.channel-name,
.stream-title {
  margin: 0;
}

.channel-name {
  font-size: 1rem;
  font-weight: 700;
}

.stream-title {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.stream-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.category-pill {
  max-width: 65%;
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(145, 70, 255, 0.14);
  color: #e2d0ff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.86rem;
}

.twitch-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  background: linear-gradient(180deg, #a970ff 0%, #9146ff 100%);
  text-decoration: none;
  font-weight: 600;
  transition:
    filter 180ms ease,
    transform 180ms ease;
}

.twitch-link:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
}

.empty-state {
  padding: 56px 24px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  text-align: center;
  color: var(--muted);
  background: rgba(31, 31, 35, 0.9);
}

.empty-state h2 {
  margin: 0 0 10px;
  color: var(--text);
}

@media (max-width: 860px) {
  .page-shell {
    padding: 18px;
  }

  .hero {
    flex-direction: column;
  }

  .hero-meta,
  .toolbar {
    grid-template-columns: 1fr;
    width: 100%;
  }
}

@media (max-width: 640px) {
  .action-row {
    flex-direction: column;
  }

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

  .category-pill {
    max-width: none;
  }
}
