:root {
  color-scheme: dark;
  --bg: #080b10;
  --surface: #101720;
  --surface-2: #141d29;
  --surface-3: #1b2634;
  --text: #edf3fb;
  --muted: #9aa9bb;
  --line: rgba(255, 255, 255, 0.1);
  --twitch: #9146ff;
  --kick: #53fc18;
  --cyan: #38d5d8;
  --red: #ff4d5d;
  --amber: #f7b84b;
  --radius: 8px;
  --shadow: 0 18px 70px rgba(0, 0, 0, 0.36);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  color: var(--text);
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(140deg, rgba(145, 70, 255, 0.16), transparent 34rem),
    linear-gradient(30deg, rgba(56, 213, 216, 0.09), transparent 42rem),
    var(--bg);
}

body,
button,
input,
select,
textarea {
  font: inherit;
}

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

img {
  max-width: 100%;
}

.site-main,
.site-footer,
.topbar {
  width: min(100% - 32px, 1520px);
  margin-inline: auto;
}

.site-main {
  padding: 32px 0 64px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: auto 1fr minmax(220px, 320px);
  align-items: center;
  gap: 22px;
  min-height: 72px;
  padding: 12px 0;
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--twitch), var(--cyan) 52%, var(--kick));
  color: #071008;
  font-weight: 900;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.site-nav a,
.tabs a {
  min-height: 38px;
  padding: 9px 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--muted);
}

.site-nav a.is-active,
.site-nav a:hover,
.tabs a.is-active,
.tabs a:hover {
  color: var(--text);
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.06);
}

.nav-toggle {
  display: none;
}

.search-widget {
  position: relative;
}

.search-widget input,
.filter-bar input,
.filter-bar select,
.compare-picker select,
.contact-form input,
.contact-form textarea,
.login-panel input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.055);
  color: var(--text);
  padding: 10px 12px;
  outline: none;
}

.search-widget input:focus,
.filter-bar input:focus,
.filter-bar select:focus,
.contact-form input:focus,
.contact-form textarea:focus,
.login-panel input:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(56, 213, 216, 0.16);
}

.search-results {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: min(420px, 92vw);
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0d141d;
  box-shadow: var(--shadow);
}

.search-results a,
.search-state {
  display: grid;
  grid-template-columns: 10px 1fr;
  gap: 9px;
  padding: 10px;
  border-radius: 8px;
}

.search-results a:hover {
  background: rgba(255, 255, 255, 0.06);
}

.search-results small {
  grid-column: 2;
  color: var(--muted);
}

.platform-dot {
  width: 9px;
  height: 9px;
  margin-top: 7px;
  border-radius: 99px;
}

.platform-dot.twitch {
  background: var(--twitch);
}

.platform-dot.kick {
  background: var(--kick);
}

.dashboard-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 560px);
  gap: 24px;
  align-items: stretch;
  min-height: 420px;
}

.hero-copy,
.hero-panel,
.section-block,
.login-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(16, 23, 32, 0.82);
  box-shadow: var(--shadow);
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(28px, 5vw, 72px);
}

.hero-panel {
  display: grid;
  align-content: center;
  padding: 22px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--cyan);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 780px;
  margin-bottom: 18px;
  font-size: clamp(2.4rem, 5vw, 5.4rem);
  line-height: 0.95;
}

h2 {
  font-size: 1.35rem;
}

.hero-copy p:not(.eyebrow),
.page-heading p,
.text-content p {
  max-width: 720px;
  color: var(--muted);
  line-height: 1.7;
}

.hero-actions,
.filter-bar,
.compare-picker,
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  cursor: pointer;
}

.button-primary {
  border-color: rgba(83, 252, 24, 0.34);
  background: linear-gradient(135deg, rgba(83, 252, 24, 0.92), rgba(56, 213, 216, 0.88));
  color: #071008;
  font-weight: 800;
}

.button-secondary,
.button-ghost {
  background: rgba(255, 255, 255, 0.06);
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
}

.metric-card {
  min-height: 118px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.045);
}

.metric-card span {
  display: block;
  color: var(--muted);
  font-size: 0.88rem;
}

.metric-card strong {
  display: block;
  margin-top: 16px;
  font-size: 1.75rem;
}

.platform-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0 24px;
}

.platform-pill {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 72px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.045);
}

.platform-pill img {
  width: 26px;
  height: 26px;
}

.platform-pill strong {
  margin-left: auto;
}

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

.section-wide {
  grid-column: span 2;
}

.section-block {
  min-width: 0;
  padding: 20px;
}

.section-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}

.section-heading a {
  color: var(--cyan);
  font-weight: 700;
}

.data-table-wrap {
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.data-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.data-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #121a24;
  color: var(--muted);
  font-size: 0.82rem;
}

.table-profile,
.streamer-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.table-profile small,
.streamer-row small {
  display: block;
  color: var(--muted);
}

.avatar-fallback,
.avatar-large {
  position: relative;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(145, 70, 255, 0.9), rgba(83, 252, 24, 0.82));
  color: #071008;
  font-weight: 900;
  object-fit: cover;
}

.avatar-image {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
}

.avatar-initials {
  position: relative;
  z-index: 0;
}

.avatar-fallback {
  width: 38px;
  height: 38px;
}

.avatar-large {
  width: 92px;
  height: 92px;
  font-size: 1.65rem;
}

.platform-tag,
.quality-badge,
.live-dot {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 0.78rem;
  font-weight: 800;
}

.platform-twitch {
  color: #d8c6ff;
}

.platform-kick {
  color: #baff9e;
}

.quality-exact,
.quality-computed {
  color: #baff9e;
}

.quality-estimated,
.quality-partial,
.quality-last_known {
  color: #ffe0a3;
}

.quality-unavailable,
.quality-source_error {
  color: #ffb3ba;
}

.live-dot {
  color: #ffb3ba;
}

.stack-list {
  display: grid;
  gap: 10px;
}

.streamer-row,
.log-row,
.metric-line {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.035);
}

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.tag-cloud a {
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.045);
}

.tag-cloud span {
  color: var(--muted);
}

.clip-grid,
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.clip-grid.compact {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.clip-card,
.category-card {
  display: grid;
  gap: 10px;
  min-width: 0;
  min-height: 180px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.045);
}

.clip-card > *,
.category-card > * {
  min-width: 0;
}

.clip-thumb {
  display: block;
  width: 100%;
  max-width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(145, 70, 255, 0.24), rgba(83, 252, 24, 0.16));
  background-position: center;
  background-size: cover;
}

.clip-card small,
.category-card small,
.category-card span {
  color: var(--muted);
}

.page-heading,
.profile-header,
.text-content {
  width: min(100%, 1100px);
  margin-bottom: 22px;
}

.page-heading h1,
.profile-header h1 {
  font-size: clamp(2.2rem, 4vw, 4rem);
}

.filter-bar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(160px, 220px) minmax(160px, 220px) auto;
  align-items: end;
  width: min(100%, 980px);
}

.profile-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.045);
}

.profile-identity {
  display: flex;
  align-items: center;
  gap: 18px;
}

.profile-metrics {
  margin-bottom: 18px;
}

.notice,
.empty-state,
.skeleton {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.045);
  color: var(--muted);
}

.notice.error {
  border-color: rgba(255, 77, 93, 0.42);
  color: #ffb3ba;
}

.chart-shell {
  min-height: 320px;
}

.metric-chart svg {
  width: 100%;
  height: auto;
  min-height: 260px;
}

.chart-summary,
.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  color: var(--muted);
}

.contact-form {
  display: grid;
  gap: 12px;
  width: min(100%, 720px);
  margin-top: 22px;
}

.admin-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  min-width: 0;
}

.admin-shell > * {
  min-width: 0;
}

.admin-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 18px;
  border-right: 1px solid var(--line);
  background: rgba(10, 15, 22, 0.94);
}

.admin-sidebar nav {
  display: grid;
  gap: 4px;
  margin: 26px 0;
}

.admin-sidebar a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 9px 10px;
  border-radius: 8px;
  color: var(--muted);
}

.admin-sidebar a.is-active,
.admin-sidebar a:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.07);
}

.admin-nav-dot {
  width: 7px;
  height: 7px;
  border-radius: 99px;
  background: var(--cyan);
}

.admin-main {
  width: min(100% - 36px, 1920px);
  margin: 0 auto;
  padding: 28px 0 64px;
}

.admin-header h1 {
  font-size: clamp(2rem, 3vw, 3.2rem);
}

.admin-login-main {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
}

.login-panel {
  width: min(100%, 420px);
  padding: 24px;
}

.login-panel form {
  display: grid;
  gap: 14px;
}

.login-panel label {
  display: grid;
  gap: 6px;
  color: var(--muted);
}

.compare-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.compare-card {
  position: relative;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.045);
}

.compare-card button {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.compare-card dl {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.compare-card dt {
  color: var(--muted);
}

.site-footer {
  align-items: center;
  padding: 28px 0 48px;
  border-top: 1px solid var(--line);
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

@media (max-width: 980px) {
  .topbar {
    grid-template-columns: auto auto;
  }

  .nav-toggle {
    display: inline-grid;
    place-items: center;
    width: 40px;
    height: 40px;
    margin-left: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
  }

  .site-nav,
  .nav-search {
    grid-column: 1 / -1;
  }

  .site-nav {
    display: none;
    flex-direction: column;
    align-items: stretch;
  }

  .site-nav.is-open {
    display: flex;
  }

  .dashboard-hero,
  .content-grid,
  .platform-strip,
  .admin-shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .section-wide {
    grid-column: auto;
  }

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

  .filter-bar {
    grid-template-columns: 1fr;
  }

  .admin-sidebar {
    position: relative;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .profile-header,
  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }
}
