:root {
  --lurk-bg: #09080d;
  --lurk-surface: #121018;
  --lurk-surface-2: #191620;
  --lurk-border: rgba(255, 255, 255, 0.08);
  --lurk-text: #f5f1fb;
  --lurk-muted: #a7a0b2;
  --lurk-purple: #9147ff;
  --lurk-purple-bright: #a970ff;
  --lurk-green: #42d392;
  --lurk-red: #ff647c;
  --lurk-yellow: #f6c85f;
}

html,
body {
  min-height: 100%;
  background: var(--lurk-bg);
  color: var(--lurk-text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
  background-image:
    radial-gradient(circle at 10% -10%, rgba(145, 71, 255, 0.17), transparent 34rem),
    radial-gradient(circle at 100% 20%, rgba(89, 41, 153, 0.1), transparent 28rem);
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem 1rem;
}

.auth-card {
  width: min(100%, 31rem);
  padding: clamp(1.75rem, 5vw, 3rem);
  border: 1px solid var(--lurk-border);
  border-radius: 1.5rem;
  background: linear-gradient(145deg, rgba(25, 22, 32, 0.98), rgba(14, 12, 19, 0.98));
  box-shadow: 0 2rem 6rem rgba(0, 0, 0, 0.45);
  text-align: center;
}

.auth-card-minimal {
  width: min(100%, 24rem);
  padding: 1.25rem;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 4rem;
  height: 4rem;
  border-radius: 1.15rem;
  background: linear-gradient(145deg, var(--lurk-purple-bright), #6c2bd9);
  color: white;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.05em;
  box-shadow: 0 0.75rem 2.5rem rgba(145, 71, 255, 0.28);
}

.brand-mark-sm {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.75rem;
  font-size: 0.78rem;
  flex: 0 0 auto;
}

.eyebrow {
  margin: 1.5rem 0 0.4rem;
  color: var(--lurk-purple-bright);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.auth-card h1,
.hero-row h1 {
  color: var(--lurk-text);
  letter-spacing: -0.04em;
}

.auth-card h1 {
  margin: 0;
  font-size: clamp(2rem, 8vw, 2.65rem);
}

.auth-lead {
  margin: 1rem auto 1.5rem;
  color: var(--lurk-muted);
  font-size: 1rem;
  line-height: 1.65;
}

.truth-card {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  margin: 1.5rem 0;
  padding: 1rem;
  border: 1px solid rgba(145, 71, 255, 0.24);
  border-radius: 1rem;
  background: rgba(145, 71, 255, 0.07);
  text-align: left;
}

.truth-card p {
  margin: 0;
  color: #cfc8d9;
  line-height: 1.5;
}

.truth-icon {
  display: inline-grid;
  place-items: center;
  width: 1.5rem;
  height: 1.5rem;
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--lurk-purple);
  color: white;
  font-size: 0.78rem;
  font-weight: 800;
}

.btn-twitch {
  border-color: var(--lurk-purple);
  background: var(--lurk-purple);
  color: white;
  font-weight: 700;
}

.btn-twitch:hover,
.btn-twitch:focus-visible {
  border-color: var(--lurk-purple-bright);
  background: var(--lurk-purple-bright);
  color: white;
}

.allowlist-note {
  margin: 1rem 0 0;
  color: #827b8d;
  font-size: 0.78rem;
}

.dashboard-nav {
  min-height: 4.75rem;
  border-bottom: 1px solid var(--lurk-border);
  background: rgba(9, 8, 13, 0.82);
  backdrop-filter: blur(18px);
}

.nav-inner,
.nav-user,
.brand,
.channel-title-row,
.channel-actions {
  display: flex;
  align-items: center;
}

.nav-inner {
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  gap: 0.75rem;
  color: var(--lurk-text);
  text-decoration: none;
}

.brand strong,
.brand small,
.nav-user-copy strong,
.nav-user-copy small {
  display: block;
}

.brand small,
.nav-user-copy small {
  color: var(--lurk-muted);
  font-size: 0.72rem;
}

.nav-user {
  gap: 0.75rem;
}

.dashboard-content {
  padding-top: 2.5rem;
  padding-bottom: 4rem;
}

.hero-row {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 2rem;
  margin-bottom: 1.5rem;
}

.hero-row .eyebrow {
  margin-top: 0;
}

.hero-row h1 {
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
}

.hero-row p,
.channel-toolbar p,
.account-danger-zone p,
.reconnect-banner p {
  margin: 0.4rem 0 0;
  color: var(--lurk-muted);
}

.global-toggle-card {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  min-width: 20rem;
  padding: 1rem 1.15rem;
  border: 1px solid var(--lurk-border);
  border-radius: 1rem;
  background: var(--lurk-surface);
}

.global-toggle-card > span {
  flex: 1;
}

.global-toggle-card strong,
.global-toggle-card small {
  display: block;
}

.global-toggle-card small {
  margin-top: 0.2rem;
  color: var(--lurk-muted);
}

.switch-control {
  width: 3.25rem;
  height: 1.8rem;
  padding: 0.2rem;
  border: 0;
  border-radius: 999px;
  background: #403a49;
  transition: background 0.2s ease;
}

.switch-control span {
  display: block;
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 50%;
  background: white;
  transition: transform 0.2s ease;
}

.switch-control.is-on {
  background: var(--lurk-purple);
}

.switch-control.is-on span {
  transform: translateX(1.45rem);
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.85rem;
  margin: 1.5rem 0 2.5rem;
}

.status-card {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  min-height: 5.25rem;
  padding: 1rem;
  border: 1px solid var(--lurk-border);
  border-radius: 1rem;
  background: rgba(18, 16, 24, 0.92);
}

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

.status-card small {
  color: var(--lurk-muted);
}

.status-card strong {
  margin-top: 0.18rem;
  text-transform: capitalize;
}

.status-dot {
  width: 0.7rem;
  height: 0.7rem;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--lurk-muted);
  box-shadow: 0 0 0 0.3rem rgba(167, 160, 178, 0.08);
}

.status-dot.state-connected,
.status-dot.state-ready {
  background: var(--lurk-green);
  box-shadow: 0 0 0 0.3rem rgba(66, 211, 146, 0.1);
}

.status-dot.state-connecting,
.status-dot.state-initializing,
.status-dot.state-reconnecting {
  background: var(--lurk-yellow);
}

.status-dot.state-error,
.status-dot.state-disconnected {
  background: var(--lurk-red);
}

.information-card {
  border-color: rgba(145, 71, 255, 0.18);
  background: rgba(145, 71, 255, 0.06);
}

.channel-toolbar,
.account-danger-zone,
.reconnect-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
}

.channel-toolbar {
  margin-bottom: 1rem;
}

.channel-toolbar h2,
.account-danger-zone h2 {
  margin: 0;
  font-size: 1.2rem;
}

.add-channel-form {
  display: flex;
  gap: 0.6rem;
  width: min(100%, 34rem);
}

.form-control {
  border-color: var(--lurk-border);
  background: var(--lurk-surface);
  color: var(--lurk-text);
}

.form-control:focus {
  border-color: var(--lurk-purple);
  background: var(--lurk-surface-2);
  box-shadow: 0 0 0 0.2rem rgba(145, 71, 255, 0.16);
}

.channel-grid {
  display: grid;
  gap: 0.85rem;
}

.channel-card {
  display: grid;
  grid-template-columns: minmax(17rem, 1fr) minmax(13rem, 0.65fr) auto;
  gap: 1.25rem;
  align-items: center;
  padding: 1.1rem;
  border: 1px solid var(--lurk-border);
  border-radius: 1.15rem;
  background: linear-gradient(110deg, rgba(25, 22, 32, 0.96), rgba(16, 14, 21, 0.96));
  transition: border-color 0.2s ease, transform 0.2s ease, opacity 0.2s ease;
}

.channel-card:hover {
  border-color: rgba(145, 71, 255, 0.28);
  transform: translateY(-1px);
}

.channel-card.is-disabled {
  opacity: 0.62;
}

.channel-main {
  display: flex;
  min-width: 0;
  gap: 1rem;
  align-items: center;
}

.channel-avatar {
  width: 3.3rem;
  height: 3.3rem;
  flex: 0 0 auto;
  border-radius: 1rem;
  object-fit: cover;
  background: var(--lurk-surface-2);
}

.avatar-fallback {
  display: grid;
  place-items: center;
  background: rgba(145, 71, 255, 0.2);
  color: var(--lurk-purple-bright);
  font-weight: 800;
}

.channel-identity {
  min-width: 0;
}

.channel-title-row {
  gap: 0.6rem;
}

.channel-title-row h3 {
  overflow: hidden;
  margin: 0;
  color: var(--lurk-text);
  font-size: 1rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.channel-identity p,
.channel-state small {
  margin: 0.15rem 0 0;
  color: var(--lurk-muted);
  font-size: 0.78rem;
}

.stream-time {
  opacity: 0.7;
}

.live-badge,
.join-state {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1;
  text-transform: uppercase;
}

.live-badge {
  padding: 0.3rem 0.48rem;
  background: rgba(167, 160, 178, 0.12);
  color: var(--lurk-muted);
}

.live-badge.is-live {
  background: rgba(255, 100, 124, 0.14);
  color: #ff8da0;
}

.live-badge.is-live::before {
  width: 0.35rem;
  height: 0.35rem;
  margin-right: 0.32rem;
  border-radius: 50%;
  background: var(--lurk-red);
  content: "";
}

.channel-state {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.join-state {
  padding: 0.38rem 0.55rem;
  background: rgba(167, 160, 178, 0.1);
  color: var(--lurk-muted);
}

.join-state.state-joined {
  background: rgba(66, 211, 146, 0.12);
  color: #75e6b0;
}

.join-state.state-joining,
.join-state.state-leaving {
  background: rgba(246, 200, 95, 0.12);
  color: #f7d787;
}

.join-state.state-error {
  background: rgba(255, 100, 124, 0.12);
  color: #ff8da0;
}

.channel-error {
  margin: 0;
  color: #ff8da0;
  font-size: 0.75rem;
}

.channel-actions {
  justify-content: flex-end;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.empty-state {
  padding: 4rem 1rem;
  border: 1px dashed rgba(145, 71, 255, 0.3);
  border-radius: 1.25rem;
  background: rgba(145, 71, 255, 0.035);
  text-align: center;
}

.empty-orbit {
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  margin: 0 auto 1rem;
  border: 1px solid rgba(145, 71, 255, 0.4);
  border-radius: 50%;
  color: var(--lurk-purple-bright);
  font-size: 1.5rem;
}

.empty-state h3 {
  margin: 0;
}

.empty-state p {
  max-width: 31rem;
  margin: 0.55rem auto 0;
  color: var(--lurk-muted);
}

.reconnect-banner {
  margin: -1rem 0 2rem;
  padding: 1.15rem;
  border: 1px solid rgba(246, 200, 95, 0.25);
  border-radius: 1rem;
  background: rgba(246, 200, 95, 0.06);
}

.account-danger-zone {
  margin-top: 3rem;
  padding: 1.25rem;
  border: 1px solid rgba(255, 100, 124, 0.2);
  border-radius: 1rem;
  background: rgba(255, 100, 124, 0.035);
}

.error-code {
  color: var(--lurk-purple-bright);
  font-size: 4rem;
  font-weight: 900;
  letter-spacing: -0.08em;
}

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

  .channel-card {
    grid-template-columns: minmax(15rem, 1fr) auto;
  }

  .channel-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
    border-top: 1px solid var(--lurk-border);
    padding-top: 0.85rem;
  }
}

@media (max-width: 720px) {
  .dashboard-content {
    padding-top: 1.5rem;
  }

  .nav-user-copy {
    display: none;
  }

  .hero-row,
  .channel-toolbar,
  .account-danger-zone,
  .reconnect-banner {
    align-items: stretch;
    flex-direction: column;
  }

  .global-toggle-card,
  .add-channel-form {
    min-width: 0;
    width: 100%;
  }

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

  .channel-card {
    grid-template-columns: 1fr;
  }

  .channel-state,
  .channel-actions {
    grid-column: auto;
  }
}

@media (max-width: 460px) {
  .brand small,
  .nav-user .avatar {
    display: none;
  }

  .add-channel-form {
    flex-direction: column;
  }

  .channel-actions form,
  .channel-actions .btn {
    flex: 1 1 auto;
  }
}

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