:root {
  color-scheme: dark;
  --bg: #0b1020;
  --panel: rgba(17, 24, 39, 0.88);
  --panel-border: rgba(148, 163, 184, 0.18);
  --text: #e5e7eb;
  --muted: #94a3b8;
  --primary: #8b5cf6;
  --primary-strong: #7c3aed;
  --secondary: #22c55e;
  --warning: #f59e0b;
  --surface: #111827;
  --surface-soft: #1f2937;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
  --radius: 24px;
  --radius-sm: 18px;
  --container: 1240px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background:
    radial-gradient(circle at top left, rgba(139, 92, 246, 0.32), transparent 28%),
    radial-gradient(circle at top right, rgba(34, 197, 94, 0.18), transparent 20%),
    linear-gradient(180deg, #050816 0%, #0b1020 45%, #090d18 100%);
  color: var(--text);
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
}

code {
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.9);
  color: #c4b5fd;
}

.container {
  width: min(calc(100% - 2rem), var(--container));
  margin: 0 auto;
}

.site-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(16px);
  background: rgba(5, 8, 22, 0.7);
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

.site-header__inner,
.site-footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0;
}

.site-logo {
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.site-nav {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.site-nav__link {
  padding: 0.7rem 1rem;
  border-radius: 999px;
  color: var(--muted);
  transition: 0.2s ease;
}

.site-nav__link:hover,
.site-nav__link.is-active {
  color: var(--text);
  background: rgba(139, 92, 246, 0.18);
}

.site-main {
  flex: 1;
  padding: 2rem 0 4rem;
}

.site-footer {
  border-top: 1px solid rgba(148, 163, 184, 0.12);
  background: rgba(5, 8, 22, 0.85);
}

.site-footer p {
  margin: 0.35rem 0 0;
  color: var(--muted);
}

.site-footer__meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.35rem;
  color: var(--muted);
}

.hero-section {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(320px, 0.9fr);
  gap: 1.5rem;
}

.hero-card,
.panel-card,
.stat-card {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hero-card {
  padding: 2rem;
}

.hero-card--primary {
  position: relative;
  overflow: hidden;
}

.hero-card--primary::after {
  content: '';
  position: absolute;
  inset: auto -80px -120px auto;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.45), transparent 72%);
}

.hero-card h1,
.stats-page-intro h1 {
  margin: 0.25rem 0 1rem;
  font-size: clamp(2.2rem, 4vw, 4.2rem);
  line-height: 0.98;
}

.hero-description,
.section-description {
  margin: 0;
  max-width: 70ch;
  line-height: 1.65;
  color: #dbe4f3;
}

.hero-description--muted,
.section-description,
.panel-card__meta,
.empty-state,
.message-item__head span,
.link-card span,
.leaderboard-item__content span,
.history-item__meta span,
.stat-card__description,
.detail-list dt {
  color: var(--muted);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(139, 92, 246, 0.14);
  color: #c4b5fd;
}

.hero-actions,
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.hero-actions {
  margin-top: 1.5rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 46px;
  padding: 0.8rem 1.1rem;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button--primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
  color: white;
}

.button--ghost {
  background: rgba(15, 23, 42, 0.9);
  color: var(--text);
  border: 1px solid rgba(148, 163, 184, 0.18);
}

.button--small {
  min-height: 40px;
  padding: 0.65rem 0.95rem;
}

.link-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0.85rem;
  margin-top: 2rem;
}

.link-grid--compact {
  margin-top: 0;
}

.link-card {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1rem;
  border-radius: var(--radius-sm);
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.14);
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.link-card:hover {
  transform: translateY(-2px);
  border-color: rgba(139, 92, 246, 0.45);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  font-weight: 700;
  margin-bottom: 1rem;
}

.status-pill--online {
  background: rgba(34, 197, 94, 0.18);
  color: #86efac;
}

.status-pill--offline {
  background: rgba(148, 163, 184, 0.18);
  color: #cbd5e1;
}

.status-pill--unknown {
  background: rgba(245, 158, 11, 0.18);
  color: #fbbf24;
}

.sidebar-title {
  margin: 0 0 1rem;
  font-size: 1.5rem;
}

.detail-list {
  display: grid;
  gap: 0.9rem;
  margin: 0;
}

.detail-list div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.08);
}

.detail-list dt,
.detail-list dd {
  margin: 0;
}

.detail-list dd {
  text-align: right;
  font-weight: 600;
}

.stream-preview {
  margin-top: 1.25rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(148, 163, 184, 0.16);
}

.section-spacing {
  margin-top: 1.5rem;
}

.section-heading h2,
.panel-card h2,
.panel-card h3 {
  margin: 0.35rem 0 0;
  font-size: clamp(1.35rem, 2vw, 2rem);
}

.section-heading h1 {
  margin-top: 0.35rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.stats-grid--dense {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.stat-card {
  padding: 1.4rem;
}

.stat-card__label {
  display: block;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.stat-card__value {
  display: block;
  margin-top: 0.8rem;
  font-size: clamp(2rem, 3vw, 3rem);
  line-height: 1;
}

.stat-card__description {
  margin: 0.9rem 0 0;
  line-height: 1.55;
}

.stat-card--primary {
  border-color: rgba(139, 92, 246, 0.35);
}

.stat-card--secondary {
  border-color: rgba(34, 197, 94, 0.35);
}

.stat-card--success {
  border-color: rgba(34, 197, 94, 0.4);
}

.embed-grid,
.community-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.9fr);
  gap: 1rem;
}

.panel-card {
  padding: 1.35rem;
}

.panel-card__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
}

.embed-frame {
  overflow: hidden;
  border-radius: var(--radius-sm);
  background: #020617;
  border: 1px solid rgba(148, 163, 184, 0.14);
}

.embed-frame--video {
  aspect-ratio: 16 / 9;
}

.embed-frame--chat {
  min-height: 680px;
}

.embed-frame iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.notice {
  padding: 0.95rem 1rem;
  border-radius: var(--radius-sm);
  margin: 1rem 0 0;
}

.notice--warning {
  background: rgba(245, 158, 11, 0.12);
  color: #fde68a;
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.message-list,
.leaderboard-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.85rem;
}

.message-item,
.leaderboard-item {
  padding: 1rem;
  border-radius: var(--radius-sm);
  background: rgba(15, 23, 42, 0.88);
  border: 1px solid rgba(148, 163, 184, 0.12);
}

.message-item__head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.55rem;
}

.message-item p {
  margin: 0;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.leaderboard-item {
  display: flex;
  align-items: center;
  gap: 0.95rem;
}

.leaderboard-item__position {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 54px;
  min-height: 54px;
  border-radius: 16px;
  background: rgba(139, 92, 246, 0.14);
  color: #c4b5fd;
  font-weight: 800;
}

.leaderboard-item__content {
  display: grid;
  gap: 0.2rem;
}

.history-list {
  display: grid;
  gap: 0.85rem;
}

.history-list--large {
  gap: 1rem;
}

.history-item__meta {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.45rem;
}

.history-item__bar {
  width: 100%;
  height: 14px;
  border-radius: 999px;
  background: rgba(30, 41, 59, 0.9);
  overflow: hidden;
}

.history-item__bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), #38bdf8);
}

.empty-state {
  margin: 0;
  line-height: 1.6;
}

@media (max-width: 1100px) {
  .hero-section,
  .embed-grid,
  .community-grid,
  .stats-grid,
  .stats-grid--dense {
    grid-template-columns: 1fr;
  }

  .embed-frame--chat {
    min-height: 560px;
  }
}

@media (max-width: 720px) {
  .site-header__inner,
  .site-footer__inner,
  .hero-actions,
  .section-heading,
  .panel-card__header,
  .message-item__head {
    align-items: stretch;
    flex-direction: column;
  }

  .site-footer__meta {
    align-items: flex-start;
  }

  .hero-card,
  .panel-card,
  .stat-card {
    padding: 1.15rem;
  }

  .hero-card h1,
  .stats-page-intro h1 {
    font-size: 2.2rem;
  }

  .detail-list div,
  .history-item__meta {
    flex-direction: column;
  }

  .detail-list dd {
    text-align: left;
  }

  .embed-frame--chat {
    min-height: 460px;
  }
}

