:root {
  color-scheme: dark;
  --bg: #08051a;
  --panel: #120e2c;
  --panel-alt: #1b1540;
  --text: #f8f8ff;
  --muted: #c2c8f5;
  --accent: #8750ff;
  --accent-soft: rgba(135, 80, 255, 0.24);
  --aqua: #3eeef8;
  --border: rgba(179, 190, 255, 0.22);
  --danger: #ff5468;
  --dock-width: 360px;
  --dock-offset: 1rem;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background:
    radial-gradient(circle at 10% 0%, rgba(136, 76, 255, 0.28), transparent 42%),
    radial-gradient(circle at 96% 84%, rgba(62, 238, 248, 0.2), transparent 40%),
    linear-gradient(160deg, #050315 0%, #0b0822 44%, var(--bg) 100%);
  color: var(--text);
}

body.overlay {
  min-height: 100vh;
  background: linear-gradient(180deg, rgba(10, 12, 27, 0.98), rgba(15, 20, 43, 0.94));
}

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

.site-header,
.site-footer {
  border-bottom: 1px solid var(--border);
  background: rgba(8, 6, 25, 0.74);
  backdrop-filter: blur(10px);
}

.site-footer {
  border-top: 1px solid var(--border);
  border-bottom: 0;
  margin-top: 4rem;
}

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

.nav a,
.actions a,
.card a,
.hero a,
.overlay-card a,
.twitch-direct-link a,
.timeline-bar {
  color: inherit;
  text-decoration: none;
}

.nav-links {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text);
}

.brand-logo {
  width: 2.5rem;
  height: 2.5rem;
  flex: 0 0 auto;
}

.hero,
.section,
.badge-detail,
.overlay-shell {
  padding: 2.5rem 0;
}

.hero-grid,
.badge-detail-grid,
.info-grid {
  display: grid;
  gap: 2rem;
  align-items: center;
}

.home-layout {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
}

.hero-grid,
.info-grid {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.hero-grid {
  min-height: 56vh;
}

.section-compact {
  padding: 1.5rem 0 0;
}

.hero-banner {
  display: block;
  width: min(100%, 52rem);
  height: auto;
  margin-bottom: 1.5rem;
  border-radius: 24px;
  border: 1px solid var(--border);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.28);
}

.badge-detail-grid {
  grid-template-columns: minmax(180px, 280px) 1fr;
}

.actions,
.filters,
.compact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
}

.button,
button {
  border: 0;
  border-radius: 999px;
  background: linear-gradient(120deg, #8c63ff, #6842ff);
  color: #fff;
  padding: 0.8rem 1.2rem;
  font: inherit;
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(108, 73, 255, 0.36);
}

.button.secondary,
button.secondary {
  background: var(--accent-soft);
  color: var(--text);
}

input,
label.checkbox {
  font: inherit;
}

input[type='search'] {
  width: min(420px, 100%);
  padding: 0.85rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(19, 15, 47, 0.9);
  color: var(--text);
}

label.checkbox {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(19, 15, 47, 0.8);
}

.grid {
  display: grid;
  gap: 1rem;
}

.badge-grid {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.live-grid {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.card,
.overlay-card,
.detail-panel,
.schedule-shell {
  background:
    linear-gradient(180deg, rgba(31, 24, 68, 0.9), rgba(17, 13, 39, 0.88));
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 1.25rem;
  box-shadow: 0 18px 34px rgba(3, 2, 14, 0.36);
}

.card img,
.badge-detail img,
.badge-thumb img {
  width: 88px;
  height: 88px;
  object-fit: cover;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.08);
}

.badge-thumb {
  width: 88px;
  height: 88px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.08);
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
  flex: 0 0 auto;
}

.badge-thumb span {
  font-size: 1.65rem;
  line-height: 1;
}

.badge-thumb.has-image .badge-thumb-fallback {
  display: none;
}

.badge-thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.card-header,
.overlay-card-header,
.timeline-label {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.card-header,
.overlay-card-header {
  margin-bottom: 1rem;
}

.eyebrow,
.meta,
.muted,
small {
  color: var(--muted);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.84rem;
}

.feature-list {
  margin: 1rem 0 0;
  padding-left: 1.25rem;
  display: grid;
  gap: 0.6rem;
}

.stat-row,
.opportunity-list {
  display: grid;
  gap: 1rem;
}

.overlay-shell .heading-row,
.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.overlay-shell h1,
.section-heading h1 {
  font-size: clamp(2rem, 3vw, 3.4rem);
  margin: 0;
}

.empty-state {
  padding: 2rem;
  text-align: center;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px dashed var(--border);
}

.schedule-shell {
  overflow-x: auto;
}

.timeline-board {
  min-width: 1080px;
}

.timeline-header-row,
.timeline-row {
  display: grid;
  grid-template-columns: 280px 1fr;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.timeline-label {
  padding: 1rem;
}

.timeline-label.heading {
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--muted);
}

.badge-thumb-small {
  width: 56px;
  height: 56px;
  border-radius: 16px;
}

.timeline-label h3,
.timeline-label p {
  margin: 0;
}

.timeline-label p {
  margin-top: 0.3rem;
}

.timeline-axis,
.timeline-track {
  position: relative;
  display: grid;
  grid-template-columns: repeat(30, minmax(0, 1fr));
}

.timeline-axis {
  padding: 0.75rem 0;
}

.timeline-day {
  padding: 0 0.5rem;
  color: var(--muted);
  border-left: 1px solid rgba(255, 255, 255, 0.06);
}

.timeline-day strong,
.timeline-day span {
  display: block;
}

.timeline-track {
  min-height: 86px;
  background-image: repeating-linear-gradient(
    to right,
    rgba(255, 255, 255, 0.06) 0,
    rgba(255, 255, 255, 0.06) 1px,
    transparent 1px,
    transparent calc(100% / 30)
  );
}

.timeline-now {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--danger);
  opacity: 0.9;
}

.timeline-bar {
  position: absolute;
  top: 18px;
  height: 50px;
  border-radius: 999px;
  padding: 0.8rem 1rem;
  display: flex;
  align-items: center;
  overflow: hidden;
  background: linear-gradient(90deg, hsl(var(--timeline-accent) 75% 58% / 0.65), hsl(var(--timeline-accent) 75% 35% / 0.2));
  border: 1px solid hsl(var(--timeline-accent) 75% 72% / 0.6);
  box-shadow: inset 0 0 30px rgba(255, 255, 255, 0.08);
}

.timeline-bar span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.92rem;
}

.twitch-sidebar {
  display: grid;
  gap: 1rem;
}

.docked-twitch-sidebar {
  display: none;
}

.twitch-embed-stack {
  display: grid;
  gap: 0.85rem;
}

.twitch-embed,
.twitch-chat-embed {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #111;
}

.twitch-embed {
  min-height: 220px;
}

.twitch-chat-embed {
  min-height: 280px;
}

.twitch-direct-link {
  display: none;
  margin: 1rem 0 0;
}

.overlay-shell-compact {
  min-height: 100vh;
  display: grid;
  gap: 1rem;
  grid-template-rows: auto auto 1fr auto;
}

.overlay-center-space {
  min-height: 38vh;
}

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

.live-grid-compact .overlay-card {
  padding: 0.9rem;
}

.live-grid-compact .overlay-card-header {
  margin-bottom: 0.6rem;
}

@media (max-width: 720px) {
  .nav,
  .section-heading,
  .overlay-shell .heading-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .badge-detail-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 960px) {
  .home-layout {
    grid-template-columns: 1fr;
  }

  .twitch-sidebar,
  .docked-twitch-sidebar {
    display: none;
  }

  .twitch-direct-link {
    display: block;
  }
}

@media (min-width: 961px) {
  body.with-docked-twitch .container {
    width: min(1160px, calc(100% - 2rem - var(--dock-width) - var(--dock-offset)));
  }

  .docked-twitch-sidebar {
    position: fixed;
    top: 5.75rem;
    right: 0;
    width: var(--dock-width);
    display: block;
    z-index: 10;
  }

  .docked-twitch-sidebar .twitch-embed-stack {
    gap: 0;
  }

  .docked-twitch-sidebar .twitch-embed,
  .docked-twitch-sidebar .twitch-chat-embed {
    display: block;
    width: 100%;
    border: 0;
    border-radius: 0;
    background: #111;
  }

  .docked-twitch-sidebar .twitch-embed {
    min-height: 203px;
    height: 203px;
  }

  .docked-twitch-sidebar .twitch-chat-embed {
    min-height: calc(100vh - 5.75rem - 203px);
    height: calc(100vh - 5.75rem - 203px);
  }
}
