:root {
  --bg-primary: #15202b;
  --bg-secondary: #1e2433;
  --bg-card: #252d3d;
  --bg-hover: rgba(255, 255, 255, 0.15);
  --orange-accent: #ff8c42;
  --pink-accent: #ff4081;
  --text-primary: #1a1a2e;
  --text-dim: #5a5a7a;
  --border-color: rgba(255, 255, 255, 0.2);
  --success-color: #10b981;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  margin: 0;
  padding: 0;
  color: var(--text-primary);
  font-family: "Nunito", sans-serif;
  background: linear-gradient(135deg, #a8d8ea 0%, #d4e8f0 50%, #c9e4f5 100%);
  background-image: url("https://i.pinimg.com/originals/f1/a7/07/f1a707c5bad8b99796c8c4591d8fc6a2.gif");
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  background-repeat: no-repeat;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(
    135deg,
    rgba(168, 216, 234, 0.7) 0%,
    rgba(212, 232, 240, 0.75) 50%,
    rgba(201, 228, 245, 0.7) 100%
  );
  opacity: 0;
  transition: opacity 0.3s ease;
}

body[data-has-bg-image="true"]::before {
  opacity: 1;
}

button,
a {
  font: inherit;
}

[hidden] {
  display: none !important;
}

.active-page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

.active-header {
  padding: 20px;
  margin-bottom: 20px;
  border-radius: 12px;
  background: var(--bg-card);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: center;
}

.active-title {
  flex: 1;
  margin: 0;
  color: var(--orange-accent);
  font-size: 28px;
  font-weight: 800;
  text-align: center;
}

.filter-bar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 20px;
  margin-bottom: 15px;
  border-radius: 12px;
  background: var(--bg-card);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.filter-row-main {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.filter-button {
  padding: 8px 16px;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  color: white;
  background: var(--bg-secondary);
  cursor: pointer;
  font-family: "Nunito", sans-serif;
  font-size: 14px;
  font-weight: 700;
  transition: all 0.3s ease;
}

.filter-button:hover {
  border-color: var(--orange-accent);
  background: var(--bg-hover);
}

.filter-button[aria-pressed="true"] {
  border-color: var(--orange-accent);
  color: white;
  background: var(--orange-accent);
}

.filter-info {
  padding: 12px 20px;
  margin-bottom: 20px;
  border-radius: 8px;
  color: #000;
  background: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(10px);
  font-size: 14px;
  font-weight: 700;
  text-align: center;
}

.divider {
  padding: 0 10px;
  color: rgba(0, 0, 0, 0.5);
}

.hosts-container {
  width: 80%;
  min-height: 400px;
  padding: 20px;
  margin: 0 auto 20px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.5);
  box-shadow: none;
  backdrop-filter: blur(10px);
}

.hosts-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.host-card {
  display: flex;
  align-items: center;
  gap: 15px;
  min-width: 0;
  padding: 8px 10px;
  border: none;
  border-radius: 10px;
  color: inherit;
  background: transparent;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.3s ease;
}

.host-card:hover,
.host-card:focus-visible {
  background: rgba(255, 255, 255, 0.3);
  outline: none;
  transform: translateX(5px);
}

.game-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 205px;
  color: #000;
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
}

.game-image {
  width: 50px;
  height: 50px;
  flex-shrink: 0;
  border-radius: 0;
  background: transparent;
  object-fit: cover;
}

.game-image-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--bg-secondary);
  font-size: 26px;
}

.game-name {
  overflow: hidden;
  text-overflow: ellipsis;
}

.host-details {
  display: flex;
  flex: 1;
  min-width: 0;
  flex-direction: column;
  gap: 5px;
}

.host-username {
  overflow: hidden;
  margin: 0;
  color: #000;
  font-size: 18px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.host-time {
  margin: 0;
  color: #333;
  font-size: 12px;
  font-weight: 600;
}

.activity-badge {
  flex-shrink: 0;
  padding: 4px 8px;
  border-radius: 4px;
  color: white;
  background: #ef4444;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.5px;
  animation: livePulse 2s ease-in-out infinite;
}

.host-cta {
  flex-shrink: 0;
  min-width: 120px;
  color: #000;
  font-size: 14px;
  font-weight: 800;
  text-align: right;
}

.loading-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 60px 20px;
  font-weight: 700;
}

.loading-spinner {
  width: 50px;
  height: 50px;
  border: 4px solid var(--border-color);
  border-top-color: var(--orange-accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.empty-state {
  padding: 60px 20px;
  color: #000;
  text-align: center;
}

.empty-state h2 {
  margin-bottom: 10px;
  font-size: 18px;
  font-weight: 700;
}

.empty-state p {
  color: rgba(0, 0, 0, 0.7);
  font-size: 14px;
  font-weight: 600;
}

.error-message {
  padding: 15px 20px;
  margin-bottom: 20px;
  border: 2px solid #ef4444;
  border-radius: 8px;
  color: #dc2626;
  background: rgba(239, 68, 68, 0.2);
  font-weight: 600;
  text-align: center;
}

.page-footer {
  padding: 20px;
  text-align: center;
}

.page-footer a {
  display: inline-block;
  padding: 12px 24px;
  border-radius: 8px;
  color: var(--orange-accent);
  background: var(--bg-card);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  font-size: 16px;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.3s ease;
}

.page-footer a:hover {
  color: white;
  background: var(--orange-accent);
  transform: translateY(-2px);
}

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

@keyframes livePulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

@media (max-width: 768px) {
  .active-page {
    padding: 10px;
  }

  .active-title {
    font-size: 20px;
  }

  .filter-bar {
    padding: 15px;
    gap: 8px;
  }

  .filter-row-main {
    gap: 8px;
  }

  .filter-button {
    padding: 7px 12px;
    font-size: 13px;
  }

  .hosts-container {
    width: 90%;
    padding: 15px;
  }

  .game-badge {
    min-width: 180px;
  }

  .host-cta {
    min-width: 105px;
    font-size: 13px;
  }
}

@media (max-width: 500px) {
  .active-title {
    font-size: 18px;
  }

  .filter-bar {
    padding: 10px;
  }

  .filter-row-main {
    justify-content: flex-start;
  }

  .filter-button {
    padding: 6px 10px;
    font-size: 12px;
  }

  .hosts-container {
    width: 95%;
    padding: 10px 5px;
  }

  .host-card {
    gap: 8px;
    padding: 7px 5px;
  }

  .game-badge {
    min-width: 118px;
    max-width: 118px;
    gap: 6px;
    font-size: 11px;
  }

  .game-image {
    width: 34px;
    height: 34px;
  }

  .host-username {
    font-size: 14px;
  }

  .host-time {
    font-size: 10px;
  }

  .activity-badge {
    padding: 3px 6px;
    font-size: 10px;
  }

  .host-cta {
    display: none;
  }
}

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

  .activity-badge,
  .loading-spinner {
    animation: none;
  }
}
