:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #0e0e10;
  color: #efeff1;
  --page: #0e0e10;
  --surface: #18181b;
  --surface-raised: #1f1f23;
  --border: #303038;
  --muted: #adadb8;
  --accent: #9147ff;
  --accent-hover: #a970ff;
  --live: #eb0400;
  --success: #36b37e;
  --warning: #f5a524;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--page);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--page);
  color: #efeff1;
}

a {
  color: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.skip-link {
  position: fixed;
  inset-inline-start: 16px;
  top: -60px;
  z-index: 100;
  padding: 10px 14px;
  border-radius: 8px;
  background: #ffffff;
  color: #111111;
  transition: top 160ms ease;
}

.skip-link:focus {
  top: 16px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--border);
  background: rgba(14, 14, 16, 0.96);
  backdrop-filter: blur(14px);
}

.header-inner,
.page-shell,
.site-footer {
  width: min(1180px, 100%);
  margin: 0 auto;
}

.header-inner {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: max(12px, env(safe-area-inset-top)) 22px 12px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 9px;
  background: var(--accent);
  color: #ffffff;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 16px;
  line-height: 1.1;
}

.brand small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.18em;
}

.header-status {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 36px;
  padding: 7px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--warning);
}

body[data-stream-state="online"] .status-dot {
  background: var(--live);
}

body[data-stream-state="offline"] .status-dot {
  background: var(--muted);
}

body[data-stream-state="error"] .status-dot {
  background: #ff6464;
}

.page-shell {
  padding: 34px 22px 42px;
}

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

.eyebrow {
  margin: 0 0 7px;
  color: var(--accent-hover);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

h1 {
  margin: 0;
  font-size: clamp(27px, 5vw, 44px);
  line-height: 1.15;
  letter-spacing: -0.025em;
}

.hero-copy {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.secondary-button,
.fallback-panel a {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  padding: 9px 16px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface-raised);
  color: #efeff1;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.secondary-button:hover,
.fallback-panel a:hover {
  border-color: var(--accent-hover);
  background: #29292e;
}

.secondary-button:focus-visible,
.fallback-panel a:focus-visible,
.brand:focus-visible {
  outline: 3px solid rgba(169, 112, 255, 0.45);
  outline-offset: 3px;
}

.player-section {
  width: 100%;
}

.player-frame {
  position: relative;
  width: 100%;
  min-height: 300px;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #000000;
}

#twitch-player,
#twitch-player iframe {
  width: 100% !important;
  height: 100% !important;
  min-height: 300px;
  border: 0;
}

.noscript-message {
  display: grid;
  min-height: 300px;
  place-items: center;
  margin: 0;
  padding: 24px;
  text-align: center;
}

.player-notice {
  min-height: 22px;
  margin: 10px 2px 0;
  color: var(--muted);
  font-size: 13px;
}

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

.status-card {
  min-width: 0;
  padding: 15px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
}

.status-card span,
.status-card strong,
.status-card small {
  display: block;
}

.card-label {
  color: var(--muted);
  font-size: 12px;
}

.status-card strong {
  margin-top: 6px;
  overflow: hidden;
  font-size: 17px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-card small {
  margin-top: 5px;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fallback-panel {
  margin-top: 18px;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.fallback-panel:not([hidden]) {
  display: flex;
}

.fallback-panel strong {
  display: block;
}

.fallback-panel p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 20px 22px max(22px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 12px;
}

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

@media (max-width: 600px) {
  .header-inner,
  .page-shell,
  .site-footer {
    padding-inline: 14px;
  }

  .header-status {
    max-width: 48vw;
    overflow: hidden;
    text-overflow: ellipsis;
  }

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

  .secondary-button {
    align-self: flex-start;
  }

  .player-frame,
  #twitch-player,
  #twitch-player iframe {
    min-height: 300px;
  }

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

  .fallback-panel,
  .site-footer {
    align-items: stretch;
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
