
:root {
  /* Nova/Galaxy Color Palette */
  --bg-space: #0a0a0f;
  --bg-nebula: #1a0d2e;
  --bg-star: #2d1b3d;
  --panel-dark: #1e1034;
  --panel-glow: #2a1852;
  --text-cosmic: #e8e3ff;
  --text-star: #b794f6;
  --text-nebula: #9f7aea;
  --text-muted: #6b46c1;
  --accent-nova: #ff6b9d;
  --accent-galaxy: #a855f7;
  --accent-cosmic: #06ffa5;
  --accent-supernova: #ffd23f;
  --success: #00ff88;
  --warning: #ffa500;
  --danger: #ff4757;
  --live-pulse: #ff0080;
  --border-cosmic: rgba(168, 85, 247, 0.3);
  --border-glow: rgba(255, 107, 157, 0.4);

  /* Galaxy Glassmorphism */
  --glass-space: rgba(42, 24, 82, 0.15);
  --glass-nebula: rgba(159, 122, 234, 0.1);
  --glass-border: rgba(232, 227, 255, 0.2);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: radial-gradient(circle at 20% 80%,
      rgba(168, 85, 247, 0.3) 0%,
      transparent 50%),
    radial-gradient(circle at 80% 20%,
      rgba(255, 107, 157, 0.3) 0%,
      transparent 50%),
    radial-gradient(circle at 40% 40%,
      rgba(6, 255, 165, 0.2) 0%,
      transparent 50%),
    linear-gradient(135deg,
      var(--bg-space) 0%,
      var(--bg-nebula) 50%,
      var(--bg-star) 100%);
  color: var(--text-cosmic);
  font-family: "SF Pro Display", ui-sans-serif, system-ui, -apple-system,
    "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* Animated Starfield Background */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: radial-gradient(2px 2px at 20px 30px,
      var(--accent-cosmic),
      transparent),
    radial-gradient(2px 2px at 40px 70px, var(--accent-supernova), transparent),
    radial-gradient(1px 1px at 90px 40px, var(--accent-galaxy), transparent),
    radial-gradient(1px 1px at 130px 80px, var(--text-star), transparent),
    radial-gradient(2px 2px at 160px 30px, var(--accent-nova), transparent);
  background-repeat: repeat;
  background-size: 200px 100px;
  animation: sparkle 20s linear infinite;
  pointer-events: none;
  opacity: 0.6;
  z-index: -1;
}

/* Auth & Settings Layouts */
.auth-body,
.settings-body {
  min-height: 100vh;
  margin: 0;
  background: radial-gradient(circle at 20% 80%, rgba(168, 85, 247, 0.25) 0%, transparent 45%),
    radial-gradient(circle at 80% 20%, rgba(255, 107, 157, 0.25) 0%, transparent 45%),
    radial-gradient(circle at 40% 40%, rgba(6, 255, 165, 0.18) 0%, transparent 45%),
    linear-gradient(135deg, var(--bg-space) 0%, var(--bg-nebula) 45%, var(--bg-star) 100%);
  color: var(--text-cosmic);
  font-family: "SF Pro Display", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  position: relative;
  overflow: hidden;
}

.auth-orbs,
.settings-noise,
.auth-noise {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.auth-orbs::before,
.auth-orbs::after {
  content: "";
  position: absolute;
  width: 520px;
  height: 520px;
  border-radius: 50%;
  filter: blur(110px);
  opacity: 0.8;
}

.auth-orbs::before {
  background: rgba(168, 85, 247, 0.25);
  top: -120px;
  left: -180px;
}

.auth-orbs::after {
  background: rgba(255, 107, 157, 0.2);
  bottom: -180px;
  right: -160px;
}

.auth-noise,
.settings-noise {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 160 160'%3E%3Cpath fill='%23ffffff0f' d='M0 0h20v20H0z'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
  opacity: 0.2;
}

.auth-layout {
  width: min(1120px, 100% - 32px);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 32px;
  padding: 48px 0;
  position: relative;
  z-index: 1;
  align-items: stretch;
}

.auth-hero {
  padding: 32px;
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(14, 11, 25, 0.8);
  box-shadow: 0 25px 60px rgba(3, 4, 17, 0.6);
}

.auth-hero h1 {
  font-size: clamp(2rem, 4vw, 2.8rem);
  margin: 8px 0 12px;
}

.eyebrow {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--text-muted);
  margin: 0;
}

.hero-text {
  margin: 0 0 24px;
  color: rgba(255, 255, 255, 0.85);
}

.auth-highlights {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.auth-highlights li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.auth-highlights i {
  font-size: 1.25rem;
  color: var(--accent-galaxy);
}

.auth-panel {
  padding: 36px;
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(12, 9, 21, 0.9);
  box-shadow: 0 25px 60px rgba(3, 4, 17, 0.65);
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.auth-panel-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.version-chip,
.settings-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.05);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.input-field label,
.form-group label {
  display: block;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.input-wrapper,
.form-group input[type="text"],
.form-group input[type="password"] {
  width: 100%;
}

.input-wrapper {
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.04);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
}

.input-wrapper i {
  color: var(--text-muted);
}

.input-wrapper input,
.form-group input {
  background: transparent;
  border: none;
  color: var(--text-cosmic);
  font-size: 1rem;
  flex: 1;
}

.input-wrapper input:focus,
.form-group input:focus {
  outline: none;
}

.input-action {
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
}

.auth-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: space-between;
  align-items: center;
}

.auth-tip,
.tip {
  display: inline-flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.8);
  max-width: 360px;
}

.inline-error {
  min-height: 24px;
  border-radius: 10px;
  padding: 10px 14px;
  background: rgba(248, 113, 113, 0.15);
  border: 1px solid rgba(248, 113, 113, 0.4);
  color: #fecaca;
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.inline-error.show {
  opacity: 1;
  transform: translateY(0);
}

.auth-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 12px;
  display: grid;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 999px;
  border: none;
  font-weight: 600;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
  padding: 12px 22px;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-galaxy), var(--accent-nova));
  color: #fff;
  box-shadow: 0 12px 30px rgba(168, 85, 247, 0.45);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
}

.btn.is-loading {
  position: relative;
  pointer-events: none;
}

.btn.is-loading::after {
  content: "";
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: cosmicSpin 0.8s linear infinite;
}

.btn.ghost-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: var(--text-cosmic);
}

.btn.danger-btn {
  background: rgba(248, 113, 113, 0.2);
  border: 1px solid rgba(248, 113, 113, 0.4);
  color: #fecaca;
}

.icon-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-cosmic);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.settings-shell {
  width: min(1200px, 100% - 32px);
  margin: 0 auto;
  padding: 48px 0 64px;
  position: relative;
  z-index: 1;
}

.settings-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 32px;
}

.settings-header h1 {
  margin: 0;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

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

.settings-card {
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(11, 10, 25, 0.85);
  padding: 24px;
  box-shadow: 0 20px 55px rgba(3, 4, 17, 0.55);
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.settings-card.highlight {
  background: radial-gradient(circle at top left, rgba(255, 107, 157, 0.18), transparent 60%),
    rgba(11, 10, 25, 0.92);
}

.settings-card.full-width {
  grid-column: 1 / -1;
}

.settings-card-header h2 {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.settings-card-header h2 i {
  color: var(--accent-galaxy);
}

.meta-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
}

.meta-list li {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 12px 16px;
}

.meta-list span {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.meta-list strong {
  font-size: 1rem;
}

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

.form-group {
  display: flex;
  flex-direction: column;
}

.form-group input {
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  padding: 11px 14px;
  color: var(--text-cosmic);
}

.checkbox-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--text-cosmic);
}

.table-container {
  overflow-x: auto;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.users-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 520px;
}

.users-table th,
.users-table td {
  padding: 14px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.users-table th {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
}

.role-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
}

.role-badge.original-admin {
  background: rgba(255, 107, 157, 0.18);
  color: #fecdd3;
}

.role-badge.admin {
  background: rgba(59, 130, 246, 0.18);
  color: #bfdbfe;
}

.role-badge.user {
  background: rgba(148, 163, 184, 0.2);
  color: #cbd5f5;
}

.message-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 3000;
}

.message {
  min-width: 280px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(11, 10, 25, 0.9);
  box-shadow: 0 20px 40px rgba(3, 4, 17, 0.55);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  color: var(--text-cosmic);
}

.message.success {
  border-color: rgba(16, 185, 129, 0.4);
  background: rgba(16, 185, 129, 0.12);
}

.message.error {
  border-color: rgba(248, 113, 113, 0.4);
  background: rgba(248, 113, 113, 0.12);
}

.message-close {
  border: none;
  background: transparent;
  color: inherit;
  font-size: 1.2rem;
  cursor: pointer;
}

@media (max-width: 768px) {
  .auth-panel,
  .auth-hero {
    padding: 24px;
  }

  .auth-panel-header {
    flex-direction: column;
  }

  .settings-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .header-actions {
    width: 100%;
    justify-content: flex-start;
  }
}

a {
    color: var(--text-cosmic);
    text-transform: uppercase;
}

@keyframes sparkle {
  from {
    transform: translateX(0);
  }

  to {
    transform: translateX(200px);
  }
}

#app {
  min-height: 100vh;
  height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  background: var(--glass-space);
  /* backdrop-filter: blur(20px); */
  border-bottom: 1px solid var(--glass-border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  transition: transform 0.35s ease, opacity 0.2s ease; /* hinzugefügt */
}

/* hinzugefügt: Header im Stream-Tab automatisch ausblenden */
body.stream-mode header {
  transform: translateY(-100%);
  opacity: 0;
  pointer-events: none;
}

/* eingeblendet, wenn Maus oben ist (via .show-header) oder direkte Hover (wenn sichtbar) */
body.stream-mode.show-header header,
body.stream-mode header:hover {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
  background: linear-gradient(135deg,
      var(--accent-nova) 0%,
      var(--accent-galaxy) 50%,
      var(--accent-cosmic) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 0 20px rgba(255, 107, 157, 0.5);
  animation: textGlow 3s ease-in-out infinite alternate;
}

@keyframes textGlow {
  from {
    filter: drop-shadow(0 0 5px rgba(255, 107, 157, 0.3));
  }

  to {
    filter: drop-shadow(0 0 15px rgba(168, 85, 247, 0.6));
  }
}

nav {
  display: flex;
  gap: 12px;
}

nav button {
  background: var(--glass-nebula);
  /* backdrop-filter: blur(15px); */
  border: 1px solid var(--border-cosmic);
  color: var(--text-cosmic);
  padding: 12px 20px;
  border-radius: 16px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

nav button::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg,
      transparent,
      rgba(255, 255, 255, 0.2),
      transparent);
  transition: left 0.6s;
}

nav button:hover::before {
  left: 100%;
}

nav button:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 35px rgba(168, 85, 247, 0.4);
  border-color: var(--accent-galaxy);
  background: var(--glass-space);
}

nav button.active {
  background: linear-gradient(135deg,
      var(--accent-nova) 0%,
      var(--accent-galaxy) 100%);
  border-color: var(--accent-nova);
  color: white;
  box-shadow: 0 8px 25px rgba(255, 107, 157, 0.5);
  animation: activeGlow 2s ease-in-out infinite alternate;
}

@keyframes activeGlow {
  from {
    box-shadow: 0 8px 25px rgba(255, 107, 157, 0.5);
  }

  to {
    box-shadow: 0 8px 25px rgba(168, 85, 247, 0.7);
  }
}

main {
  flex: 1;
  overflow-y: auto;
  display: flex;
  /* hinzugefügt: damit Tab-Content den verfügbaren Platz füllen kann */
  flex-direction: column;
  /* hinzugefügt */
}

main section.tab {
  padding: 28px 24px;
}

.tab {
  display: none;
  animation: cosmicFadeIn 0.5s ease-out;
}

.tab.active {
  display: block;
}

html.preload {
  overflow: hidden;
}

#stream.tab {
  overflow: hidden;
  height: 100%;
  padding: unset;
  margin: unset;
}

/* hinzugefügt: Stream-Tab füllt den verfügbaren Platz und das Iframe ist abgerundet */
#stream.tab.active {
  flex-direction: column;
  min-height: 0;
  /* wichtig für Flex-Layout in Kombination mit overflow */
}

#stream.tab.active iframe {
  width: 100%;
  height: 100%;
  border-radius: 0px;
  border: none;
  overflow: hidden;
}


.friend-invite-button {
      background: var(--glass-nebula);
    /* backdrop-filter: blur(15px); */
    border: 1px solid var(--border-cosmic);
    color: var(--text-cosmic);
    padding: 12px 20px;
    border-radius: 16px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.friend-invite-button span {
  margin-top: 0.4rem;
    margin-left: 0.5rem;
}

@keyframes cosmicFadeIn {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
    /* filter: blur(10px); */
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
    /* filter: blur(0); */
  }
}

.cards {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 12px;
  width: 100%;
}

.card {
  background: var(--glass-space);
  border: 1px solid var(--border-cosmic);
  border-radius: 20px;
  padding: 28px 32px;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.3);
}

.card > *:not(.card-background) {
  width: 100%;
}

.card .icon-heading {
  justify-content: center;
  align-items: center;
  flex-direction: row;
  text-align: center;
  width: 100%;
  gap: 12px;
}

.card .icon-heading span {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.search-section {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.site-selection {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top:16px;
  justify-content: center;
}

.site-option {
  position: relative;
}

.site-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.radio-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--border-cosmic);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-cosmic);
  font-weight: 600;
  letter-spacing: 0.04em;
  transition: all 0.25s ease;
}

.site-option input:checked + .radio-label,
.radio-label.active {
  border-color: var(--accent-galaxy);
  background: rgba(168, 85, 247, 0.2);
  color: var(--text-cosmic);
  box-shadow: 0 0 20px rgba(168, 85, 247, 0.3);
}

.search-container {
  display: flex;
  gap: 12px;
  width: 100%;
  align-items: center;
  max-width: 760px;
  margin: 0 auto;
}

.icon-heading {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

.referral-notice {
  background: linear-gradient(135deg, rgba(162, 155, 254, 0.15), rgba(108, 92, 231, 0.25));
  border: 1px solid rgba(162, 155, 254, 0.35);
  border-radius: 16px;
  padding: 20px;
  margin: 16px;
  box-shadow: 0 0 25px rgba(108, 92, 231, 0.25);
  color: var(--text-primary);
  backdrop-filter: blur(12px);
}

.referral-notice .referral-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.referral-notice .referral-text {
  margin: 0;
  font-size: 15px;
  line-height: 1.5;
}

.referral-notice .referral-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}


.referral-modal .modal-content {
  max-width: 520px;
}

.icon-heading i {
  font-size: 2rem;
  color: var(--accent-galaxy);
}

.icon-heading span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

nav button i,
nav button span,
.stats-tab-btn i,
.stats-tab-btn span {
  pointer-events: none;
}

nav button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.stats-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.streamer-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
  align-items: flex-end;
}

.streamer-controls .control-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 200px;
}

.streamer-controls label {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.62);
}

.streamer-controls input[type="search"],
.streamer-controls select {
  background: var(--glass-space);
  border: 1px solid var(--border-cosmic);
  border-radius: 12px;
  padding: 10px 14px;
  color: var(--text-cosmic);
  font-size: 0.95rem;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.streamer-controls input[type="search"]:focus,
.streamer-controls select:focus {
  outline: none;
  border-color: var(--accent-galaxy);
  box-shadow: 0 8px 24px rgba(168, 85, 247, 0.35);
}

.streamer-controls .filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.streamer-controls .filter-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--border-cosmic);
  background: rgba(255, 255, 255, 0.05);
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.streamer-controls .filter-toggle input[type="checkbox"] {
  accent-color: var(--accent-galaxy);
}

.streamer-controls .filter-toggle span {
  pointer-events: none;
}

.streamer-controls .filter-toggle.active {
  background: rgba(168, 85, 247, 0.18);
  border-color: var(--accent-galaxy);
  color: var(--text-cosmic);
}

h3 i {
    color: var(--accent-galaxy);
    font-size: 22px;
}

.streamer-actions .fa-solid,
.modal .fa-solid {
  pointer-events: none;
}

.points-explanation .points {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.monthly-rewards .reward,
.special-events .special {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.special-events .special i,
.monthly-rewards .reward i {
  color: var(--text-cosmic);
}
.streamers-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(430px, 1fr));
  gap: 24px;
}

.streamer-card {
  position: relative;
  border-radius: 18px;
  background: var(--glass-space);
  border: 1px solid var(--border-cosmic);
  padding: 20px;
  display: flex;
  flex-direction: column;
  /*justify-content: space-between;*/
  gap: 16px;
  min-height: 280px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
  transition: all 0.35s ease;
}

.streamer-card:hover {
  transform: translateY(-6px);
  border-color: var(--accent-galaxy);
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.35);
}

.streamer-header {
  display: flex;
  align-items: center;
  gap: 16px;
}

.streamer-avatar {
  width: 72px;
  height: 72px;
  border-radius: 16px;
  object-fit: cover;
  border: 2px solid var(--accent-galaxy);
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  color: var(--text-cosmic);
}

.streamer-avatar img {
  width: 72px;
  height: 72px;
  border-radius: 16px;
  border: 2px solid var(--accent-galaxy);
}

.streamer-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.streamer-meta .name {
  font-size: 1.2rem;
  font-weight: 600;
}

.streamer-meta .status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: rgba(168, 85, 247, 0.15);
  color: var(--text-cosmic);
}

.streamer-meta .status-badge.offline {
  background: rgba(148, 163, 184, 0.15);
  color: #94a3b8;
}

.streamer-description {
  color: var(--text-cosmic);
  font-size: 0.95rem;
  min-height: 40px;
  display: block;
  padding: 16px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  text-align: center;
  max-height: 155px;
  overflow: hidden;
  position: relative;
}

.streamer-description.full {
  max-height: none;
  overflow: visible;
}

.streamer-description::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 32px;
  background: linear-gradient(180deg, rgba(42, 24, 82, 0) 0%, rgba(42, 24, 82, 0.9) 100%);
  pointer-events: none;
}

.streamer-actions {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.streamer-actions button {
  flex: 1;
  min-width: 140px;
}

.modal.streamer-modal .modal-content {
  max-width: 640px;
  padding: 32px;
  text-align: left;
}

.streamer-modal-header {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 16px;
}

.streamer-modal-header img {
  width: 90px;
  height: 90px;
  border-radius: 20px;
  object-fit: cover;
  border: 2px solid var(--accent-galaxy);
}

.streamer-modal-body {
  display: grid;
  gap: 18px;
}


.streamer-stats {
  margin-top: auto;
  display: grid;
  gap: 12px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  text-align: left;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.streamer-stats .streamer-stat {
  font-weight: 600;
  color: var(--text-cosmic);
}

.streamer-stats.empty {
  font-style: italic;
  opacity: 0.7;
}

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

.streamer-stat {
  padding: 12px;
  border-radius: 14px;
  background: rgba(148, 163, 184, 0.12);
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  align-items: center;
  gap: 4px 8px;
}

.streamer-stat .stat-icon {
  grid-row: span 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(168, 85, 247, 0.18);
  color: var(--text-cosmic);
}

.streamer-stat .label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-cosmic);
}

.streamer-stat .value {
  font-size: 1.1rem;
  font-weight: 600;
}

.streamer-stat .detail {
  font-size: 0.75rem;
  color: var(--text-cosmic);
  float:right;
}

.stats-pagination {
  margin-top: auto;
  padding-top: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.stats-page-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-cosmic);
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.stats-page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.stats-page-btn:not(:disabled):hover {
  background: rgba(168, 85, 247, 0.2);
  border-color: var(--accent-galaxy);
}

.stats-page-indicator {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.queue-heading {
  justify-content: space-between;
  gap: 16px;
}

.queue-toggle {
  margin-left: auto;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-cosmic);
  border-radius: 999px;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.queue-toggle:hover {
  border-color: var(--accent-galaxy);
}

.queue-card.collapsed .queue-toggle i {
  transform: rotate(180deg);
}

.queue-card.collapsed #queue-section,
.queue-card.collapsed #active-downloads,
.queue-card.collapsed #completed-downloads {
  display: none !important;
}

.queue-card.collapsed #queue-empty {
  display: none;
}

.queue-section {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-top: 18px;
}

.queue-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.queue-item {
  padding: 18px;
  border-radius: 20px;
  background: rgba(11, 10, 25, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 12px 30px rgba(3, 4, 17, 0.45);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.queue-item-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.queue-item-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-cosmic);
}

.queue-item-subtitle {
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.queue-item-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  text-transform: uppercase;
}

.queue-item-chip i {
  font-size: 0.9rem;
}

.queue-item-chip.status-downloading {
  background: rgba(99, 102, 241, 0.18);
  border-color: rgba(129, 140, 248, 0.4);
  color: #c7d2fe;
}

.queue-item-chip.status-queued {
  background: rgba(252, 211, 77, 0.15);
  border-color: rgba(251, 191, 36, 0.35);
  color: #fde68a;
}

.queue-item-chip.status-completed {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(110, 231, 183, 0.4);
  color: #6ee7b7;
}

.queue-item-chip.status-failed {
  background: rgba(248, 113, 113, 0.15);
  border-color: rgba(248, 113, 113, 0.35);
  color: #fecaca;
}

.queue-item-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: space-between;
  flex-wrap: wrap;
}

.queue-item-order {
  display: inline-flex;
  gap: 6px;
}

.queue-btn {
  border: none;
  border-radius: 10px;
  padding: 6px 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: opacity 0.2s ease, transform 0.2s ease;
  color: var(--text-cosmic);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.queue-btn--ghost {
  background: rgba(255, 255, 255, 0.04);
}

.queue-btn:hover {
  opacity: 0.8;
  transform: translateY(-1px);
}

.queue-item-handle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px dashed rgba(255, 255, 255, 0.12);
  cursor: grab;
}

.queue-item[draggable="true"] {
  cursor: grab;
}

.queue-item.is-dragging {
  opacity: 0.85;
  transform: scale(0.99);
  cursor: grabbing;
}

.queue-item-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

.queue-stat {
  padding: 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.queue-stat-label {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  color: var(--text-cosmic);
  text-transform: uppercase;
}

.queue-progress-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.queue-progress-bar {
  position: relative;
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.queue-progress-bar.is-sub {
  height: 6px;
}

.queue-progress-fill {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent-nova), var(--accent-galaxy));
  transition: width 0.35s ease;
}

.queue-progress-bar.is-sub .queue-progress-fill {
  background: linear-gradient(90deg, #f97316, #fb7185);
}

.queue-progress-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.queue-progress-sub {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.queue-item-detail-text {
  margin: 0;
  font-size: 0.92rem;
  color: rgba(255, 255, 255, 0.85);
}

.queue-empty {
  margin-top: 16px;
  padding: 20px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px dashed rgba(255, 255, 255, 0.12);
  font-size: 0.95rem;
  color: var(--text-muted);
  text-align: center;
}


.module-card-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 6px;
}

.module-card-body {
  font-size: 0.85rem;
  color: var(--text-muted);
  display: grid;
  gap: 2px;
}

.module-card-error {
  margin-top: 8px;
  font-size: 0.8rem;
  color: #f87171;
}


.bot-log-entry {
  display: flex;
  gap: 8px;
  font-size: 0.85rem;
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
}

.bot-log-entry .time {
  color: var(--text-muted);
  font-family: "JetBrains Mono", "Fira Code", monospace;
}

.bot-log-entry.type-success {
  background: rgba(16, 185, 129, 0.12);
}

.bot-log-entry.type-error {
  background: rgba(248, 113, 113, 0.15);
}

.manual-copy-input {
  width: 100%;
  padding: 10px;
  border-radius: 8px;
  border: 1px dashed var(--border-cosmic);
  background: rgba(0, 0, 0, 0.4);
  color: var(--text-cosmic);
  font-family: "JetBrains Mono", "Fira Code", monospace;
  font-size: 0.85rem;
  margin-bottom: 12px;
}

.stats-tab-content .card {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.stats-tab-content .card ul {
  margin: 0;
  padding: 0;
  list-style-position: inside;
}

.search-input {
  flex: 1 1 280px;
  min-width: 240px;
  padding: 14px 18px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(9, 6, 20, 0.65);
  color: var(--text-cosmic);
  font-size: 1rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.35);
}

.search-input::placeholder {
  color: rgba(232, 227, 255, 0.6);
}

.search-input:focus {
  outline: none;
  border-color: var(--accent-galaxy);
  box-shadow: 0 0 0 2px rgba(168, 85, 247, 0.25);
}

.search-btn {
  padding: 12px 28px;
  border-radius: 999px;
  border: none;
  background: linear-gradient(135deg, var(--accent-galaxy), var(--accent-nova));
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 12px 24px rgba(168, 85, 247, 0.35);
}

.search-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
}

.search-btn:not(:disabled):hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 32px rgba(255, 107, 157, 0.4);
}

.results-section {
  margin-top: 32px;
}

.results-section h3 {
    font-size: 22px;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-cosmic);
    margin-bottom: 18px;
}

.results-section h3::before {
  content: "\f002";
    font-size: 22px;
  font-family: "Font Awesome 5 Free";
  font-weight: 900;
    margin-right: 1rem;
  color: var(--accent-galaxy);
}

.results-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 280px));
  gap: 24px;
  justify-content: center;
}

.results-container .anime-card {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.35);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.35);
  cursor: pointer;
}

.results-container .anime-card .anime-card-background {
  filter: brightness(0.65);
}

.results-container .anime-card .anime-card-content {
  padding: 18px;
  gap: 10px;
}

.results-container .anime-card .anime-actions {
  justify-content: flex-end;
}

.anime-actions {
  display: flex;
  gap: 10px;
}

.anime-actions button {
  border-radius: 999px;
  padding: 8px 18px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.anime-actions .info-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.4);
  color: var(--text-cosmic);
}

.anime-actions .info-btn:hover {
  border-color: var(--accent-galaxy);
  transform: translateY(-1px);
}

.anime-actions .download-btn {
  background: linear-gradient(135deg, var(--accent-galaxy), var(--accent-nova));
  color: #fff;
  box-shadow: 0 12px 24px rgba(168, 85, 247, 0.35);
}

.anime-actions .download-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 32px rgba(168, 85, 247, 0.4);
}

.loading-section {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top:3rem;
  justify-items: center;
  width:100%;
  gap: 12px;
  color: var(--text-nebula);
}

.loading-spinner,
.loading-spinner-small {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(255, 255, 255, 0.15);
  border-top-color: var(--accent-galaxy);
  border-radius: 50%;
  animation: cosmicSpin 1s linear infinite;
}

.loading-spinner-small {
  width: 20px;
  height: 20px;
}

.popular-new-sections {
  display: grid;
  overflow: hidden;
  gap: 28px;
  margin-top: 32px;
}

.anime-section h3 {
  display: flex;
  max-width: 93.9vw;
  align-items: center;
  gap: 10px;
    font-size: 22px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-cosmic);
  margin-bottom: 16px;
  justify-content: center;
}

.anime-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
}

.anime-carousel {
  position: relative;
  width: 100%;
}

.anime-carousel-viewport {
  overflow: hidden;
  width: 100%;
  scrollbar-width: none;
  cursor: grab;
  touch-action: pan-y;
}

.anime-carousel-viewport::-webkit-scrollbar {
  display: none;
}

.anime-carousel-viewport.dragging {
  cursor: grabbing;
}

.anime-carousel .anime-grid {
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  gap: 24px;
  padding: 8px 4px 12px;
}

.anime-carousel .home-anime-card {
  flex: 0 0 220px;
}

.anime-card {
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.35);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.35);
  min-height: 0;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  aspect-ratio: 2 / 3;
}

.anime-card img,
.anime-card-background {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
}

.anime-card-background {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: brightness(0.65);
  transition: transform 0.35s ease;
  transform-origin: center;
}

.anime-card-background::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(10, 10, 15, 0) 0%, rgba(10, 10, 15, 0.9) 80%);
}

.anime-card::before {
  content: "";
  display: block;
  padding-top: 150%;
}

.anime-card img,
.anime-card-background {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
}

.anime-card:hover .anime-card-background {
  transform: scale(1.05);
}

.anime-card-content {
  position: absolute;
  inset: auto 0 0 0;
  z-index: 1;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.home-content {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.empty-state {
  margin-top: 28px;
  padding: 40px 32px;
  border-radius: 28px;
  background: linear-gradient(135deg, rgba(17, 17, 32, 0.75), rgba(25, 8, 46, 0.85));
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 25px 60px rgba(5, 5, 14, 0.45);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 16px;
  position: relative;
  overflow: hidden;
}

.empty-state::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top, rgba(168, 85, 247, 0.2), transparent 55%);
  pointer-events: none;
}

.empty-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  color: var(--accent-galaxy);
  box-shadow: inset 0 0 25px rgba(169, 85, 247, 0.25);
}

.empty-state h3 {
  margin: 0;
  font-size: 1.5rem;
  color: var(--text-cosmic);
}

.empty-state p {
  margin: 0;
  color: var(--text-nebula);
  max-width: 420px;
}

.empty-state .hint-chip {
  margin-top: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.03);
  font-size: 0.82rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.anime-title {
  font-weight: 700;
  font-size: 1rem;
  color: #fff;
}

.anime-info {
  font-size: 0.85rem;
  color: rgba(232, 227, 255, 0.8);
  line-height: 1.4;
}

.anime-actions {
  margin-top: 12px;
  display: flex;
  justify-content: flex-end;
}

.download-btn {
  border: none;
  border-radius: 999px;
  padding: 8px 18px;
  font-weight: 600;
  background: linear-gradient(135deg, var(--accent-galaxy), var(--accent-nova));
  color: #fff;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.download-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(255, 107, 157, 0.35);
}

.card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg,
      var(--accent-nova),
      var(--accent-galaxy),
      var(--accent-cosmic));
  opacity: 0;
  transition: opacity 0.4s;
}

.card::after {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle,
      rgba(255, 107, 157, 0.1) 0%,
      transparent 70%);
  opacity: 0;
  transition: opacity 0.4s;
  animation: rotate 20s linear infinite;
  z-index: -1;
  pointer-events: none;
}

@keyframes rotate {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

.card:hover {
  /* transform: translateY(-8px) scale(1.02); */
  border-color: var(--accent-galaxy);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.4), 0 0 0 1px var(--border-glow),
    0 0 50px rgba(168, 85, 247, 0.3);
}

.card:hover::before,
.card:hover::after {
  opacity: 1;
}

.row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin-bottom: 1rem;
}

.live-card .title {
  font-weight: 700;
  font-size: 18px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-cosmic);
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 12px 0;
}

.badge {
  font-size: 11px;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 12px;
  background: var(--glass-nebula);
  border: 1px solid var(--border-cosmic);
  color: var(--text-cosmic);
  /* backdrop-filter: blur(10px); */
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 10px rgba(168, 85, 247, 0.2);
}

.live-chip {
  font-size: 10px;
  font-weight: 800;
  color: white;
  background: linear-gradient(135deg,
      var(--live-pulse) 0%,
      var(--accent-nova) 100%);
  padding: 6px 12px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  box-shadow: 0 0 20px rgba(255, 0, 128, 0.6),
    0 4px 15px rgba(255, 107, 157, 0.4);
  animation: livePulse 1.5s ease-in-out infinite alternate;
  position: relative;
}

.live-chip::before {
  content: "●";
  position: absolute;
  left: -5px;
  top: 50%;
  transform: translateY(-50%);
  color: white;
  font-size: 8px;
  animation: blink 1s ease-in-out infinite;
}

@keyframes livePulse {
  from {
    box-shadow: 0 0 20px rgba(255, 0, 128, 0.6),
      0 4px 15px rgba(255, 107, 157, 0.4);
  }

  to {
    box-shadow: 0 0 30px rgba(255, 0, 128, 0.9),
      0 6px 25px rgba(255, 107, 157, 0.7);
  }
}

@keyframes blink {

  0%,
  50% {
    opacity: 1;
  }

  51%,
  100% {
    opacity: 0.3;
  }
}

.muted {
  color: var(--text-nebula);
  font-size: 14px;
  margin: 8px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Modal overlay */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(3, 4, 17, 0.8);
  backdrop-filter: blur(12px);
  display: none;
  justify-content: center;
  align-items: flex-start;
  overflow-y: auto;
  padding: 40px 16px;
  z-index: 2000;
}

.modal-overlay.show {
  display: flex;
}

.modal-content {
  background: var(--glass-space);
  border: 1px solid var(--border-glow);
  border-radius: 24px;
  width: min(900px, 100%);
  color: var(--text-cosmic);
  display: flex;
  flex-direction: column;
  gap: 24px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55);
  animation: modalSlideIn 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.close-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--text-cosmic);
  font-size: 1.2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.close-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.05);
}

.info-modal-content {
  width: min(780px, 100%);
  padding: 32px;
}

.info-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.info-badge {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 0.85rem;
  display: inline-flex;
  gap: 6px;
}

.info-modal-body {
  display: grid;
  grid-template-columns: minmax(220px, 260px) 1fr;
  gap: 24px;
}

.info-cover-wrapper {
  width: 100%;
  aspect-ratio: 2 / 3;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.35);
}

.info-cover {
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
}

.info-details {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

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

.stat-card {
  padding: 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}

.info-season-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}

.info-season-item {
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.info-season-item span {
  font-weight: 600;
}

.info-placeholder {
  color: var(--text-muted);
  font-size: 0.9rem;
  text-align: center;
  padding: 16px 0;
}

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

.info-meta .label {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: block;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.info-description {
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.85);
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes modalSlideIn {
  from {
    transform: scale(0.8) translateY(50px);
    opacity: 0;
  }

  to {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
}

.modal h3 {
  margin: 0 0 15px 0;
    font-size: 22px;
  color: var(--text-cosmic);
  background: linear-gradient(135deg,
      var(--accent-nova) 0%,
      var(--accent-galaxy) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.modal p {
  color: var(--text-nebula);
  line-height: 1.6;
}

.modal-close {
  background: linear-gradient(135deg,
      var(--accent-galaxy) 0%,
      var(--accent-nova) 100%);
  border: none;
  color: white;
  padding: 12px 24px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s;
}

.modal-close:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(168, 85, 247, 0.4);
}

.download-modal-content {
  width: min(960px, 100%);
  padding: 32px;
  gap: 32px;
  position: relative;
  padding-top: 56px;
}

.download-body {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.download-modal-content .modal-header {
  margin-bottom: 8px;
  padding-right: 60px;
}

.download-modal-content .close-btn {
  position: absolute;
  top: 24px;
  right: 24px;
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.25);
}

.download-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
  grid-auto-rows: minmax(170px, auto);
}

.modal-kicker {
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 6px 0;
}

.meta-block {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.meta-block .label {
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  display: block;
  margin-bottom: 6px;
}

.meta-value {
  margin: 0;
  font-size: 1rem;
  color: var(--text-cosmic);
}

.meta-block--language {
  min-height: 100%;
}

.meta-block--title {
  grid-column: span 2;
  flex-direction: row;
  gap: 16px;
  align-items: stretch;
  min-height: 220px;
}

.download-cover {
  width: 140px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  background-size: cover;
  background-position: center;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
  flex-shrink: 0;
  position: relative;
}

.download-cover::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 40%, rgba(3, 3, 15, 0.6));
  opacity: 0;
  transition: opacity 0.2s ease;
}

.download-cover.has-cover::after {
  opacity: 1;
}

.title-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
  justify-content: center;
}

.download-title {
  font-size: 1.7rem;
  margin: 0;
  line-height: 1.3;
  color: #fff;
}

.download-source {
  margin: 0;
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.download-source[data-site="s.to"] {
  color: #a0f3ff;
}

.download-source[data-site="filme"] {
  color: #ffbddb;
}

.download-source[data-site="aniworld.to"] {
  color: #cdbaff;
}

@media (max-width: 900px) {
  .meta-block--title {
    grid-column: span 1;
    flex-direction: column;
    min-height: 0;
  }

  .download-cover {
    width: 100%;
    height: 200px;
  }
}

.meta-hint {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-nebula);
}

.download-columns {
  display: grid;
  grid-template-columns: 1fr;
}

.panel-heading h4 {
  margin: 0;
  font-size: 1.1rem;
}

.panel-heading p {
  margin: 4px 0 16px;
  font-size: 0.95rem;
  color: var(--text-nebula);
}

.episode-selection-panel {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  padding: 20px;
  min-height: 360px;
}

.language-dropdown {
  width: 100%;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(7, 10, 30, 0.8);
  color: var(--text-cosmic);
}

.selection-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.selection-header h4 {
  margin: 0;
}

.selection-header p {
  margin: 4px 0 0;
  font-size: 0.9rem;
  color: var(--text-nebula);
}

.selection-controls {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.control-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-cosmic);
  border-radius: 999px;
  padding: 6px 16px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.control-btn:hover {
  background: rgba(255, 255, 255, 0.12);
}

 .episode-tree {
  margin-top: 16px;
  max-height: 460px;
  overflow: auto;
  padding-right: 8px;
}

.episode-tree::-webkit-scrollbar {
  width: 8px;
}

.episode-tree::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: linear-gradient(180deg, var(--accent-galaxy), var(--accent-nova));
}

.season-container {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 14px;
  margin-bottom: 12px;
  background: rgba(255, 255, 255, 0.02);
}

.season-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.season-checkbox,
.episode-checkbox {
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: transparent;
  position: relative;
  cursor: pointer;
  transition: border 0.2s ease, background 0.2s ease;
}

.season-checkbox:checked,
.episode-checkbox:checked {
  background: linear-gradient(135deg, var(--accent-galaxy), var(--accent-nova));
  border-color: transparent;
}

.season-checkbox:checked::after,
.episode-checkbox:checked::after {
  content: '\2713';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  color: #fff;
}

.season-label {
  font-weight: 600;
  color: var(--text-cosmic);
}

.episodes-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 8px 16px;
}

.episode-item-tree {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 4px;
  border-radius: 10px;
  transition: background 0.2s ease;
  flex-wrap: wrap;
}

.episode-item-tree:hover {
  background: rgba(255, 255, 255, 0.05);
}

.episode-label {
  color: var(--text-nebula);
}

.language-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.language-chips--loading {
  opacity: 0.6;
}

.language-chip {
  font-size: 1rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-cosmic);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
}

.language-chip--loading {
  font-size: 0.8rem;
  letter-spacing: 0.2em;
}

.language-chip-mount {
  min-height: 32px;
}

.language-flag {
  width: 26px;
  height: 18px;
  border-radius: 4px;
  object-fit: cover;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.35);
}

.language-chip[data-lang="DE"] {
  border-color: rgba(168, 85, 247, 0.6);
  color: #f2c0ff;
}

.language-chip[data-lang="EN"] {
  border-color: rgba(79, 209, 197, 0.6);
  color: #b8fff5;
}

.language-chip[data-lang="JP"] {
  border-color: rgba(255, 99, 132, 0.6);
  color: #ffbacf;
}

.episode-tree-loading {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-nebula);
}

.modal-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 20px;
}

.selected-count {
  font-size: 0.95rem;
  color: var(--text-nebula);
}

.modal-actions {
  display: flex;
  gap: 12px;
}

.primary-btn,
.secondary-btn {
  border-radius: 999px;
  padding: 10px 24px;
  border: none;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.primary-btn {
  background: linear-gradient(135deg, var(--accent-galaxy), var(--accent-nova));
  color: #fff;
  box-shadow: 0 12px 24px rgba(168, 85, 247, 0.35);
}

.primary-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
}

.secondary-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-cosmic);
}

.primary-btn:hover:not(:disabled),
.secondary-btn:hover {
  transform: translateY(-1px);
}

/* Twitch modal embed layout */
.twitch-embed-container {
  width: 100%;
  height: 100%;
  margin: 0;
  flex: 1 1 auto;
  display: flex;
  align-items: stretch;
}

.twitch-embed-iframe {
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 8px;
  background: #000;
}

.actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.actions button {
  border: 1px solid var(--border-cosmic);
  background: var(--glass-nebula);
  /* backdrop-filter: blur(15px); */
  color: var(--text-cosmic);
  padding: 10px 16px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  flex: 1;
  text-align: center;
  min-width: 140px;
  position: relative;
  overflow: hidden;
}

.actions button::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg,
      transparent,
      rgba(255, 255, 255, 0.1),
      transparent);
  transition: left 0.6s;
}

.actions button:hover::before {
  left: 100%;
}

.actions button:hover {
  background: var(--glass-space);
  border-color: var(--accent-galaxy);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(168, 85, 247, 0.3);
}

.actions button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.actions button:disabled:hover {
  background: var(--glass-nebula);
  border-color: var(--border-cosmic);
  box-shadow: none;
}

.range {
  margin-top: 24px;
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.range button {
  padding: 10px 20px;
  border-radius: 16px;
  border: 1px solid var(--border-cosmic);
  background: var(--glass-nebula);
  /* backdrop-filter: blur(15px); */
  color: var(--text-cosmic);
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  min-width: 80px;
  position: relative;
  overflow: hidden;
}

.range button::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: radial-gradient(circle, var(--accent-galaxy) 0%, transparent 70%);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  transform: translate(-50%, -50%);
  opacity: 0;
}

.range button:hover::after {
  width: 200%;
  height: 200%;
  opacity: 0.3;
}

.range button:hover {
  background: var(--glass-space);
  border-color: var(--accent-galaxy);
  transform: translateY(-2px);
  color: var(--text-cosmic);
}

.range button.active {
  background: linear-gradient(135deg,
      var(--accent-galaxy) 0%,
      var(--accent-nova) 100%);
  border-color: var(--accent-nova);
  color: white;
  box-shadow: 0 8px 25px rgba(168, 85, 247, 0.4);
  animation: rangeGlow 2s ease-in-out infinite alternate;
}

@keyframes rangeGlow {
  from {
    box-shadow: 0 8px 25px rgba(168, 85, 247, 0.4);
  }

  to {
    box-shadow: 0 8px 25px rgba(255, 107, 157, 0.6);
  }
}

ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

li {
  padding: 16px 0;
  border-bottom: 1px solid var(--border-cosmic);
  transition: all 0.3s;
  border-radius: 12px;
  margin-bottom: 6px;
  position: relative;
}

li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 3px;
  height: 0;
  background: linear-gradient(135deg,
      var(--accent-nova) 0%,
      var(--accent-galaxy) 100%);
  transition: height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  transform: translateY(-50%);
  border-radius: 0 2px 2px 0;
}

li:hover {
  background: var(--glass-nebula);
  padding-left: 16px;
  color: var(--text-cosmic);
}

li:hover::before {
  height: 60%;
}

li:last-child {
  border-bottom: none;
}

li a {
  color: var(--accent-cosmic);
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s;
  position: relative;
}

li a::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg,
      var(--accent-cosmic) 0%,
      var(--accent-galaxy) 100%);
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

li a:hover {
  color: var(--accent-supernova);
  text-shadow: 0 0 10px rgba(255, 210, 63, 0.5);
}

li a:hover::after {
  width: 100%;
}

/* Cosmic Loading Animation */
.loading {
  display: inline-block;
  width: 40px;
  height: 40px;
  border: 3px solid var(--glass-border);
  border-top: 3px solid var(--accent-galaxy);
  border-radius: 50%;
  animation: cosmicSpin 1s linear infinite;
}

@keyframes cosmicSpin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

/* Responsive Design for Galaxy */
@media (max-width: 768px) {
  header {
    padding: 16px 20px;
  }

  h1 {
    font-size: 20px;
  }

  nav {
    gap: 8px;
  }

  nav button {
    padding: 10px 16px;
    font-size: 13px;
  }

  main {
    padding: 20px 16px;
  }

  .cards {
    grid-template-columns: 1fr;
    gap: 16px;
  }

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

  .card {
    padding: 20px;
  }

  .actions {
    flex-direction: column;
  }

  .actions button {
    min-width: auto;
  }

  .modal-content {
    margin: 20px;
    padding: 24px;
  }
}

/* Stream Preview Gallery */
.stream-preview {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  background: var(--glass-space);
  /* backdrop-filter: blur(20px); */
  border: 1px solid var(--border-cosmic);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}

.stream-preview:hover {
  transform: scale(1.025) translateY(-8px);
  border-color: var(--accent-galaxy);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.4), 0 0 40px rgba(168, 85, 247, 0.4);
}

.stream-thumbnail {
  width: 100%;
  height: 180px;
  object-fit: cover;
  transition: all 0.4s;
  border-radius: 12px 12px 0 0;
}

.stream-preview:hover .stream-thumbnail {
  transform: scale(1.1);
  filter: brightness(1.2) saturate(1.3);
}

.stream-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg,
      rgba(168, 85, 247, 0) 0%,
      rgba(255, 107, 157, 0.1) 50%,
      rgba(6, 255, 165, 0.2) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: all 0.3s;
}

.stream-preview:hover .stream-overlay {
  opacity: 1;
  background: linear-gradient(135deg,
      rgba(168, 85, 247, 0.3) 0%,
      rgba(255, 107, 157, 0.3) 50%,
      rgba(6, 255, 165, 0.3) 100%);
}

.stream-play-button {
  background: linear-gradient(135deg,
      var(--accent-galaxy) 0%,
      var(--accent-nova) 100%);
  border: none;
  color: white;
  padding: 10px 20px;
  top: -25px;
  border-radius: 50px;
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.3s;
  text-transform: uppercase;
  letter-spacing: 1px;
  box-shadow: 0 8px 25px rgba(168, 85, 247, 0.4);
  position: relative;
  overflow: hidden;
}

.stream-play-button::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg,
      transparent,
      rgba(255, 255, 255, 0.3),
      transparent);
  transition: left 0.6s;
}

.stream-play-button:hover::before {
  left: 100%;
}

.stream-play-button:hover {
  transform: scale(1.15);
  box-shadow: 0 12px 35px rgba(255, 107, 157, 0.6);
  position: relative;
  z-index: 100;
}

/* Card Blur Effect when Play Button is Hovered - CSS fallback */
.stream-preview:hover:has(.stream-play-button:hover) .stream-thumbnail {
  /* filter: blur(6px); */
  transition: filter 0.3s ease;
}

.stream-preview:hover:has(.stream-play-button:hover) .stream-info {
  /* filter: blur(4px); */
  transition: filter 0.3s ease;
}

.stream-preview:hover:has(.stream-play-button:hover) .stream-play-button {
  filter: none;
}

.stream-preview:hover:has(.stream-play-button:hover) .stream-play-button {
  filter: none;
}

/* Stream Info Overlay */
.stream-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
  padding: 20px 16px 16px;
  color: white;
}

.stream-status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.live-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--live-pulse);
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  animation: livePulse 1.5s ease-in-out infinite alternate;
}

.live-indicator::before {
  content: "●";
  font-size: 8px;
  animation: blink 1s ease-in-out infinite;
}

.viewer-count {
  background: rgba(255, 255, 255, 0.2);
  padding: 4px 8px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}

.stream-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stream-category {
  font-size: 12px;
  color: var(--text-nebula);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* QR Code Modal */
.qr-code,
.qr-code-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 20px;
}

.qr-code canvas,
.qr-code-container canvas,
.qr-code-container img {
  border: 4px solid var(--accent-galaxy);
  border-radius: 16px;
  background: white;
  padding: 10px;
  box-shadow: 0 8px 25px rgba(168, 85, 247, 0.3);
  transition: transform 0.3s ease;
}

.qr-code canvas:hover,
.qr-code-container canvas:hover,
.qr-code-container img:hover {
  transform: scale(1.05);
}

.qr-instructions {
  text-align: center;
  color: var(--text-nebula);
  font-size: 14px;
  line-height: 1.5;
  margin: 10px 0;
}

/* Stream Actions */
.stream-actions {
  display: flex;
  gap: 12px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.stream-action-btn {
  flex: 1;
  min-width: 120px;
  padding: 10px 16px;
  border: 1px solid var(--border-cosmic);
  background: var(--glass-nebula);
  /* backdrop-filter: blur(15px); */
  color: var(--text-cosmic);
  border-radius: 12px;
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.stream-action-btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg,
      transparent,
      rgba(255, 255, 255, 0.1),
      transparent);
  transition: left 0.6s;
}

.stream-action-btn:hover::before {
  left: 100%;
}

.stream-action-btn:hover {
  background: var(--glass-space);
  border-color: var(--accent-galaxy);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(168, 85, 247, 0.3);
}

.stream-action-btn.primary {
  background: linear-gradient(135deg,
      var(--accent-galaxy) 0%,
      var(--accent-nova) 100%);
  border-color: var(--accent-nova);
  color: white;
}

.stream-action-btn.primary:hover {
  box-shadow: 0 8px 25px rgba(255, 107, 157, 0.5);
}

/* Offline Stream Styling */
.stream-preview.offline {
  opacity: 0.7;
}

.stream-preview.offline .stream-thumbnail {
  filter: grayscale(0.5);
}

.stream-preview.offline .stream-info {
  background: linear-gradient(transparent, rgba(30, 16, 52, 0.9));
}

.offline-indicator {
  background: var(--text-muted);
  color: white;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
}

/* Custom Scrollbar for Galaxy Theme */
::-webkit-scrollbar {
  width: 12px;
}

::-webkit-scrollbar-track {
  background: var(--bg-space);
  border-radius: 6px;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg,
      var(--accent-galaxy) 0%,
      var(--accent-nova) 100%);
  border-radius: 6px;
  box-shadow: 0 0 10px rgba(168, 85, 247, 0.3);
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg,
      var(--accent-nova) 0%,
      var(--accent-cosmic) 100%);
  box-shadow: 0 0 15px rgba(255, 107, 157, 0.5);
}

/* Nova Events Specific Styles */
.nova-explanation {
  max-width: 1200px;
  margin: 0 auto;
}

.nova-header {
  text-align: center;
  background: linear-gradient(135deg,
      var(--accent-galaxy) 0%,
      var(--accent-nova) 100%);
  color: var(--text-cosmic);
  margin-bottom: 2rem;
  box-shadow: 0 8px 32px rgba(168, 85, 247, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.nova-header h2 {
  margin: 0 0 0.5rem 0;
  font-size: 2rem;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.nova-header p {
  margin: 0;
  opacity: 0.9;
  font-size: 1.1rem;
}

.points-explanation {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.point-rule {
  display: flex;
  align-items: center;
  padding: 1rem;
  background: var(--glass-space);
  /* backdrop-filter: blur(10px); */
  border-radius: 12px;
  border: 1px solid var(--border-cosmic);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.point-rule .points {
  font-size: 1.5rem;
  font-weight: bold;
  margin-right: 1rem;
  min-width: 60px;
  color: var(--accent-supernova);
  text-shadow: 0 0 10px var(--accent-supernova);
}

.point-rule .description {
  font-size: 1.1rem;
  color: var(--text-cosmic);
}

.sunday-info p {
  margin-bottom: 1rem;
  font-size: 1.1rem;
  text-align: center;
  color: var(--text-cosmic);
}

.multipliers {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.multiplier {
  display: flex;
  align-items: center;
  padding: 0.8rem;
  background: var(--glass-nebula);
  /* backdrop-filter: blur(10px); */
  border-radius: 10px;
  border: 1px solid var(--border-glow);
  box-shadow: 0 4px 16px rgba(255, 107, 157, 0.1);
}

.multiplier .mult {
  font-weight: bold;
  font-size: 1.2rem;
  color: var(--accent-nova);
  margin-right: 1rem;
  min-width: 40px;
  text-shadow: 0 0 8px var(--accent-nova);
}

.multiplier .desc {
  color: var(--text-cosmic);
  font-size: 1rem;
}

.monthly-rewards {
  margin-top: 1rem;
}

.reward {
  padding: 0.8rem 1rem;
  margin: 0.5rem 0;
  background: var(--glass-space);
  /* backdrop-filter: blur(10px); */
  border-radius: 10px;
  border: 1px solid var(--border-cosmic);
  font-weight: 500;
  color: var(--text-cosmic);
  box-shadow: 0 4px 16px rgba(168, 85, 247, 0.1);
}

.special-events {
  margin-top: 1rem;
}

.special {
  padding: 0.6rem 1rem;
  margin: 0.4rem 0;
  background: var(--glass-nebula);
  /* backdrop-filter: blur(10px); */
  border-radius: 10px;
  border: 1px solid var(--border-glow);
  color: var(--text-cosmic);
  font-weight: 500;
  box-shadow: 0 4px 16px rgba(255, 107, 157, 0.1);
}

.current-standings {
  margin-top: 2rem;
  background: var(--glass-space);
  /* backdrop-filter: blur(15px); */
  border: 1px solid var(--border-cosmic);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.current-standings h3 {
    font-size: 22px;
  text-align: center;
  color: var(--text-cosmic);
  margin-bottom: 1.5rem;
  text-shadow: 0 0 10px rgba(168, 85, 247, 0.5);
}

#current-nova-leaderboard {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.nova-leaderboard-entry {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  background: var(--glass-nebula);
  /* backdrop-filter: blur(10px); */
  border-radius: 12px;
  border: 1px solid var(--border-glow);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
}

.nova-leaderboard-entry:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(255, 107, 157, 0.2);
}

.nova-leaderboard-entry .rank {
  font-weight: bold;
  font-size: 1.2rem;
  min-width: 40px;
  color: var(--accent-supernova);
  text-shadow: 0 0 8px var(--accent-supernova);
}

.nova-leaderboard-entry .name {
  flex: 1;
  margin: 0 1rem;
  font-weight: 500;
  color: var(--text-cosmic);
}

.nova-leaderboard-entry .points {
  font-weight: bold;
  color: var(--accent-cosmic);
  font-size: 1.1rem;
  text-shadow: 0 0 8px var(--accent-cosmic);
}

@media (max-width: 768px) {
  .nova-header h2 {
    font-size: 1.5rem;
  }

  .point-rule,
  .multiplier {
    flex-direction: column;
    text-align: center;
    gap: 0.5rem;
  }

  .point-rule .points,
  .multiplier .mult {
    margin-right: 0;
  }

  .nova-leaderboard-entry {
    flex-direction: column;
    text-align: center;
    gap: 0.5rem;
  }

  .nova-leaderboard-entry .name {
    margin: 0;
  }
}

/* Stats Header Styles */
.stats-header {
  text-align: center;
  margin-bottom: 1rem;
  padding: 1.5rem;
  background: var(--glass-nebula);
  border: 1px solid var(--border-cosmic);
  border-radius: 20px;
  backdrop-filter: blur(10px);
}

.stats-header h2 {
  margin: 0 0 0.5rem 0;
  font-size: 1.8rem;
  font-weight: 700;
  background: linear-gradient(45deg,
      var(--accent-galaxy),
      var(--accent-cosmic));
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 20px rgba(168, 85, 247, 0.3));
}

.period-display {
  margin: 0;
  color: var(--text-cosmic);
  font-size: 1rem;
  font-weight: 500;
}

/* Stats Tabs */
.stats-tabs {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 1rem 0;
}

.stats-tab-btn {
  background: var(--glass-space);
  border: 1px solid var(--border-cosmic);
  border-radius: 12px;
  padding: 8px 16px;
  color: var(--text-cosmic);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.stats-tab-btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg,
      transparent,
      rgba(168, 85, 247, 0.2),
      transparent);
  transition: left 0.5s;
}

.stats-tab-btn:hover::before {
  left: 100%;
}

.stats-tab-btn:hover {
  border-color: var(--accent-galaxy);
  color: var(--text-cosmic);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(168, 85, 247, 0.3);
}

.stats-tab-btn.active {
  background: linear-gradient(135deg, var(--accent-galaxy), var(--accent-nova));
  border-color: var(--accent-galaxy);
  color: white;
  font-weight: 600;
  box-shadow: 0 6px 20px rgba(168, 85, 247, 0.4);
}

.stats-tab-content {
  display: none;
  animation: cosmicFadeIn 0.4s ease-out;
}

.stats-tab-content.active {
  display: block;
}

/* Global Loading Overlay */
#global-loading-indicator {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  background: rgba(4, 4, 12, 0.72);
  backdrop-filter: blur(18px);
  z-index: 9999;
  color: #fff;
  text-align: center;
  padding: 2rem;
  transition: opacity 0.25s ease;
}

#global-loading-indicator[hidden] {
  display: none !important;
}

.loading-spinner {
  width: 64px;
  height: 64px;
  border: 4px solid rgba(255, 255, 255, 0.2);
  border-top-color: var(--accent-galaxy, #a855f7);
  border-radius: 50%;
  animation: loading-spin 1s linear infinite;
}

.loading-text {
  font-size: 1rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-cosmic, #f1f5f9);
}

@keyframes loading-spin {
  to {
    transform: rotate(360deg);
  }
}

.home-anime-card {
    background: var(--glass-space);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-cosmic);
    border-radius: 20px;
    padding: 6px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.home-anime-cover {
  position: relative;
  width: 100%;
  aspect-ratio: 2 / 3;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.home-anime-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 998;
  position: absolute;
  display: block;
  transition: transform 0.3s ease;
}

.home-anime-card:hover .home-anime-cover img {
  transform: scale(1.05);
  /* border-radius: 2rem; */
}

.home-anime-title {
  font-size: 0.93rem;
  font-weight: 600;
  color: #fff;
  text-align: center;
  line-height: 1.3;
  z-index: 999;
  padding: 10px 8px 12px;
  position: absolute;
  inset: auto 0 0 0;
  background: linear-gradient(180deg, rgba(6, 2, 18, 0.85)0%, rgba(6, 2, 18, 0.6) 100%);
  letter-spacing: 0.02em;
  text-shadow: 0 4px 12px rgba(0, 0, 0, 0.65);
}

.global-loader-overlay {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at top, rgba(32, 16, 64, 0.9), rgba(5, 5, 10, 0.95));
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.global-loader-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

.global-loader-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding: 32px 40px;
  border-radius: 24px;
  border: 1px solid var(--border-glow);
  background: rgba(8, 6, 18, 0.85);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
  text-align: center;
}

.global-loader-spinner {
  width: 72px;
  height: 72px;
  border: 4px solid rgba(255, 255, 255, 0.15);
  border-top-color: var(--accent-galaxy);
  border-radius: 50%;
  animation: loading-spin 1.2s linear infinite;
}

.global-loader-content p {
  margin: 0;
  font-size: 1.05rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-star);
}