@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

/* ==========================================================================
   Design System & Tokens (Dark Mode Preference / HSL Tailored Theme)
   ========================================================================== */
:root {
  --bg-primary: #12141c;       /* Sleek dark background */
  --bg-secondary: #0a0b10;     /* Deeper dark background */
  --bg-card: rgba(22, 26, 40, 0.65); /* Glassmorphic card body */
  --bg-header: rgba(18, 20, 28, 0.75);
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-light: #64748b;
  
  --color-accent: #3b82f6;      /* Premium blue */
  --color-accent-hover: #2563eb;
  --color-accent-light: rgba(59, 130, 246, 0.12);
  --color-accent-glow: rgba(59, 130, 246, 0.35);
  
  --color-gold: #fbbf24;
  --color-silver: #94a3b8;
  --color-bronze: #ea580c;
  --color-live: #ef4444;
  
  --border-color: rgba(255, 255, 255, 0.08);
  --border-color-hover: rgba(255, 255, 255, 0.15);
  
  --border-radius-sm: 8px;
  --border-radius-md: 16px;
  --border-radius-lg: 24px;
  
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 12px 32px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 20px 48px rgba(0, 0, 0, 0.5);
  
  --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --transition-smooth: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  --max-width: 1200px;
}

/* ==========================================================================
   1. Base Reset & Structure (Strictly avoid horizontal scrolls)
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-family: var(--font-sans);
  color: var(--text-primary);
  background-color: var(--bg-secondary);
  scroll-behavior: smooth;
  scrollbar-gutter: stable;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  max-width: 100%;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.6;
  overflow-x: hidden;
  width: 100%;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 5px;
  border: 2px solid var(--bg-secondary);
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}

a {
  color: inherit;
  text-decoration: none;
  transition: var(--transition-smooth);
}

/* ==========================================================================
   2. Layout Elements
   ========================================================================== */
.header-wrapper {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: var(--bg-header);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1.25rem 1.5rem;
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-accent);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo span {
  background: linear-gradient(135deg, var(--color-accent), #a855f7);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  list-style: none;
}

.nav-link {
  font-weight: 500;
  font-size: 0.95rem;
  padding: 0.25rem 0;
  border-bottom: 2px solid transparent;
  color: var(--text-secondary);
}

.nav-link:hover, .nav-link.active {
  color: var(--text-primary);
  border-bottom-color: var(--color-accent);
}

/* LIVE dot pulsing */
.nav-link-live {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--color-live) !important;
  font-weight: 700;
}
.nav-live-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: var(--color-live);
  border-radius: 50%;
  animation: navLivePulse 1.4s ease-in-out infinite;
  flex-shrink: 0;
}
@keyframes navLivePulse {
  0%, 100% { opacity: 1; transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.5); }
  50%       { opacity: 0.7; transform: scale(0.8); box-shadow: 0 0 0 4px rgba(239, 68, 68, 0); }
}

.main-content {
  flex: 1 0 auto;
  max-width: var(--max-width);
  width: 100%;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  overflow-x: hidden;
}

.footer-wrapper {
  background-color: var(--bg-primary);
  border-top: 1px solid var(--border-color);
  padding: 2.5rem 0;
  margin-top: auto;
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.footer-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.footer-links-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem 1.5rem;
  padding: 0;
  margin: 0 0 1.25rem 0;
}

.footer-link {
  color: var(--text-secondary);
  font-size: 0.85rem;
  transition: var(--transition-smooth);
}
.footer-link:hover {
  color: var(--text-primary);
}

.footer-attribution {
  font-size: 0.78rem;
  color: var(--text-light);
  margin-bottom: 0.5rem;
}

.footer-copyright {
  font-size: 0.85rem;
  color: var(--text-light);
}

/* ==========================================================================
   3. Hero Section & Capsule Search
   ========================================================================== */
.hero-banner {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.08) 0%, rgba(168, 85, 247, 0.08) 100%);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  padding: 4.5rem 2rem;
  margin-bottom: 2.5rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero-banner::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.12) 0%, transparent 60%);
  pointer-events: none;
  animation: pulse 12s infinite alternate;
}

@keyframes pulse {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(5%, 5%) scale(1.1); }
}

.hero-title {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800;
  margin-bottom: 1rem;
  line-height: 1.2;
}

.hero-title span {
  background: linear-gradient(135deg, var(--color-accent) 0%, #a855f7 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: clamp(0.95rem, 2vw, 1.1rem);
  color: var(--text-secondary);
  letter-spacing: 0.03em;
  margin-bottom: 2.5rem;
  font-weight: 400;
}

.hero-search-form {
  display: flex;
  justify-content: center;
  width: 100%;
  margin-bottom: 1.5rem;
  position: relative;
  z-index: 1;
}

.hero-search-wrap {
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 500px;
  background: #1e293b;
  border: 1.5px solid var(--border-color);
  border-radius: 50px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: var(--transition-smooth);
}

.hero-search-wrap:focus-within {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px var(--color-accent-glow), var(--shadow-md);
}

.hero-search-icon {
  padding-left: 1.2rem;
  padding-right: 0.2rem;
  color: var(--text-light);
  font-size: 1rem;
  flex-shrink: 0;
}

.hero-search-wrap:focus-within .hero-search-icon {
  color: var(--color-accent);
}

.hero-search-input {
  flex: 1 1 0;
  border: none;
  background: transparent;
  padding: 0.9rem 0.75rem;
  font-family: inherit;
  font-size: 0.98rem;
  color: var(--text-primary);
  outline: none;
  min-width: 0;
  -webkit-appearance: none;
}

.hero-search-input::placeholder {
  color: var(--text-light);
}

.hero-search-btn {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  margin: 5px;
  border: none;
  border-radius: 50%;
  background: var(--color-accent);
  color: #fff;
  font-size: 0.95rem;
  cursor: pointer;
  transition: var(--transition-smooth);
}
.hero-search-btn:hover {
  background: var(--color-accent-hover);
  transform: scale(1.05);
}

.hero-cta {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 0.5rem;
}

/* ==========================================================================
   4. Buttons, Cards, Glassmorphism, and Badges
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--border-radius-md);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  border: 1px solid transparent;
  transition: var(--transition-smooth);
}

.btn-primary {
  background-color: var(--color-accent);
  color: white;
}
.btn-primary:hover {
  background-color: var(--color-accent-hover);
  box-shadow: 0 4px 12px var(--color-accent-glow);
  transform: translateY(-2px);
}

.btn-secondary {
  background-color: #1e293b;
  border-color: var(--border-color);
  color: var(--text-primary);
}
.btn-secondary:hover {
  background-color: #334155;
  border-color: var(--border-color-hover);
  transform: translateY(-2px);
}

.btn-danger {
  background-color: #ef4444;
  color: white;
}
.btn-danger:hover {
  background-color: #dc2626;
  transform: translateY(-2px);
}

.btn-sm {
  padding: 0.4rem 0.8rem;
  font-size: 0.85rem;
  border-radius: var(--border-radius-sm);
}

.glass-card {
  background-color: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition-smooth);
}
.glass-card:hover {
  border-color: var(--border-color-hover);
  box-shadow: var(--shadow-md);
}

/* Tag Badges HSL theme */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 600;
  transition: var(--transition-smooth);
}
.badge-main_genre {
  background-color: rgba(59, 130, 246, 0.12);
  color: #60a5fa;
}
.badge-style {
  background-color: rgba(168, 85, 247, 0.12);
  color: #c084fc;
}
.badge-network {
  background-color: rgba(34, 197, 94, 0.12);
  color: #4ade80;
}
.badge-content_tag {
  background-color: rgba(249, 115, 22, 0.12);
  color: #fb923c;
}

/* Rank badges */
.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 50%;
  font-weight: 700;
  font-size: 1.1rem;
}
.rank-1 {
  background-color: rgba(251, 191, 36, 0.15);
  color: var(--color-gold);
}
.rank-2 {
  background-color: rgba(148, 163, 184, 0.15);
  color: var(--color-silver);
}
.rank-3 {
  background-color: rgba(234, 88, 12, 0.15);
  color: var(--color-bronze);
}
.rank-other {
  background-color: #1e293b;
  color: var(--text-secondary);
}

.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  position: relative;
  padding-bottom: 0.5rem;
}
.section-title::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 40px;
  height: 3px;
  background-color: var(--color-accent);
  border-radius: 2px;
}

/* ==========================================================================
   5. Interactive 2-Stage Filter Accordion & Search
   ========================================================================== */
.filter-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 2rem;
  min-width: 0;
  width: 100%;
}

.filter-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Responsive folding toggle buttons (Hidden on PC) */
.filter-toggle-btn {
  display: none;
}

/* 2-stage accordion css classes */
.accordion-group {
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 1.25rem;
}
.accordion-group:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.accordion-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  font-size: 1rem;
  color: var(--text-primary);
  cursor: pointer;
  user-select: none;
  padding: 0.5rem 0;
}
.accordion-header i {
  transition: transform 0.25s ease;
  color: var(--text-secondary);
}
.accordion-header.active i {
  transform: rotate(180deg);
  color: var(--color-accent);
}

.accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease-out;
}
.accordion-content.show {
  max-height: 500px; /* high enough for tags list */
}

.filter-options {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.5rem 0.25rem 0;
}

.filter-btn-option {
  text-align: left;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 0.9rem;
  padding: 0.4rem 0.75rem;
  border-radius: var(--border-radius-sm);
  cursor: pointer;
  transition: var(--transition-smooth);
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.filter-btn-option:hover {
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}
.filter-btn-option.active {
  background-color: var(--color-accent-light);
  color: var(--color-accent);
  font-weight: 600;
}

.filter-btn-option .count-badge {
  font-size: 0.75rem;
  color: var(--text-light);
  background: #1e293b;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
}

/* ==========================================================================
   6. Leaderboard rows, Ellipsis, Bookmarks and Cards
   ========================================================================== */
.controls-panel {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  padding: 1rem 1.5rem;
}

.sort-buttons {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.sort-btn {
  padding: 0.4rem 1rem;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 600;
  border: 1px solid var(--border-color);
  background: #1e293b;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition-smooth);
}
.sort-btn:hover {
  border-color: var(--border-color-hover);
  color: var(--text-primary);
}
.sort-btn.active {
  background-color: var(--color-accent-light);
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.leaderboard-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.leaderboard-row {
  display: grid;
  grid-template-columns: 3rem 60px 1fr auto auto;
  align-items: center;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  padding: 1rem 1.5rem;
  transition: var(--transition-smooth);
  gap: 1.25rem;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}
.leaderboard-row:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
  border-color: var(--border-color-hover);
}

.col-rank {
  text-align: center;
}

.row-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}

.row-details {
  min-width: 0;
  overflow: hidden;
}

/* Name clamp for PC */
.row-name {
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 0.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-primary);
}

.row-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  overflow: hidden;
  max-height: 24px;
}

.col-stats {
  display: flex;
  gap: 2rem;
  text-align: right;
  font-size: 0.95rem;
  flex-shrink: 0;
}
.stat-item {
  display: flex;
  flex-direction: column;
  min-width: 90px;
}
.stat-val {
  font-weight: 700;
  color: var(--text-primary);
}
.stat-label {
  font-size: 0.72rem;
  color: var(--text-light);
  margin-top: 0.15rem;
}

/* Bookmark (★) styling */
.col-favorite {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  z-index: 5;
}
.fav-toggle-btn {
  background: none;
  border: none;
  color: var(--text-light);
  font-size: 1.3rem;
  cursor: pointer;
  transition: var(--transition-smooth);
  padding: 0.25rem;
}
.fav-toggle-btn:hover {
  color: var(--color-gold);
  transform: scale(1.15);
}
.fav-toggle-btn.active {
  color: var(--color-gold);
  text-shadow: 0 0 8px rgba(251, 191, 36, 0.4);
}

/* ==========================================================================
   7. Cookie Consent Banner CSS
   ========================================================================== */
.cookie-banner-wrap {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  background: rgba(18, 20, 28, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--border-color);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(100%);
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.cookie-banner-wrap.show {
  display: block;
  opacity: 1;
  transform: translateY(0);
}
.cookie-banner-container {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.25rem;
  justify-content: space-between;
}
.cookie-banner-text {
  margin: 0;
  font-size: 0.88rem;
  color: var(--text-secondary);
  flex: 1 1 300px;
  line-height: 1.6;
}
.cookie-icon {
  color: var(--color-gold);
  margin-right: 0.4rem;
}
.highlight-text {
  color: var(--text-primary);
}
.cookie-link {
  color: var(--color-accent);
  text-decoration: underline;
}
.cookie-banner-actions {
  display: flex;
  gap: 0.75rem;
  flex-shrink: 0;
  flex-wrap: wrap;
}
.btn-cookie-reject {
  padding: 0.5rem 1.1rem;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.85rem;
  transition: var(--transition-smooth);
}
.btn-cookie-reject:hover {
  background: rgba(255,255,255,0.05);
  color: var(--text-primary);
  border-color: var(--border-color-hover);
}
.btn-cookie-accept {
  padding: 0.5rem 1.25rem;
  border-radius: 8px;
  border: none;
  background: var(--color-accent);
  color: #fff;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.85rem;
  transition: var(--transition-smooth);
}
.btn-cookie-accept:hover {
  background: var(--color-accent-hover);
  box-shadow: 0 0 12px var(--color-accent-glow);
}

/* ==========================================================================
   8. Detail Page Charts, Lists and Forms
   ========================================================================== */
.detail-container {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 2rem;
}
.detail-sidebar {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.detail-avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid rgba(255,255,255,0.1);
  margin-bottom: 1rem;
}
.detail-name {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
  word-break: break-word;
}
.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  justify-content: center;
  margin-bottom: 1.5rem;
}
.detail-main {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.analytics-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  padding: 1.5rem;
}
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}
.video-card {
  background-color: #1e293b;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: var(--transition-smooth);
}
.video-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-color-hover);
}
.video-thumbnail-container {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 ratio */
  background: #0f172a;
}
.video-thumbnail {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.video-info {
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  flex-grow: 1;
}
.video-card-title {
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  height: 2.8em;
}
.video-card-date {
  font-size: 0.72rem;
  color: var(--text-light);
}

/* ==========================================================================
   9. Responsive Adaptive Styles (Strictly 768px threshold)
   ========================================================================== */
@media (max-width: 992px) {
  .filter-layout {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  .detail-container {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .main-content {
    padding: 1rem 0.75rem;
  }

  .header-container {
    padding: 0.5rem 0.75rem !important;
    flex-wrap: nowrap !important;
    gap: 0.5rem !important;
  }
  .logo {
    font-size: 1.1rem !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    gap: 0.3rem !important;
  }
  .logo span {
    white-space: nowrap !important;
  }
  .nav-links {
    gap: 0.4rem !important;
    flex-wrap: nowrap !important;
  }
  .nav-link {
    font-size: 0.78rem !important;
    white-space: nowrap !important;
    padding: 0.15rem 0.2rem !important;
  }
  .nav-link i {
    display: none !important;
  }
  .hero-banner {
    padding: 1.2rem 0.75rem !important;
    margin-bottom: 0.75rem !important;
  }
  .hero-title {
    font-size: 1.35rem !important;
    margin-bottom: 0.35rem !important;
  }
  .hero-subtitle {
    font-size: 0.75rem !important;
    margin-bottom: 0.75rem !important;
  }
  .hero-search-wrap {
    height: 38px !important;
  }
  .hero-search-input {
    padding: 0.5rem 0.6rem !important;
    font-size: 0.88rem !important;
  }
  .hero-search-btn {
    width: 28px !important;
    height: 28px !important;
    margin: 5px 5px 5px 0 !important;
  }
  
  /* Sidebar toggle implementation */
  .filter-sidebar {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 0;
    overflow: hidden;
  }
  .filter-toggle-btn {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 1rem 1.25rem;
    background: none;
    border: none;
    color: var(--text-primary);
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
  }
  .filter-toggle-btn i {
    transition: transform 0.3s ease;
  }
  .filter-toggle-btn.active i {
    transform: rotate(180deg);
  }
  .filter-collapse {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
  }
  .filter-collapse.show {
    max-height: 2000px; /* high limit to fit all categories */
  }

  /* Title Overflow & Responsive Vertical 2-Row configuration */
  .leaderboard-row {
    grid-template-columns: 2.2rem 48px 1fr auto; /* fav goes to the right, stats go down */
    grid-template-rows: auto auto;
    padding: 1rem;
    gap: 0.75rem 0.5rem;
  }
  
  .col-rank {
    grid-column: 1;
    grid-row: 1;
  }
  .row-avatar {
    grid-column: 2;
    grid-row: 1;
    width: 44px;
    height: 44px;
  }
  .row-details {
    grid-column: 3;
    grid-row: 1;
  }
  .col-favorite {
    grid-column: 4;
    grid-row: 1;
  }
  .col-stats {
    grid-column: 2 / 5;
    grid-row: 2;
    justify-content: flex-start;
    gap: 1.5rem;
    text-align: left;
    border-top: 1px solid rgba(255,255,255,0.04);
    padding-top: 0.5rem;
  }
  
  .row-name {
    font-size: 0.98rem;
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }
  .stat-item {
    min-width: auto;
    flex-direction: row;
    align-items: center;
    gap: 0.4rem;
  }
  .stat-val {
    font-size: 0.88rem;
  }
  .stat-label {
    margin-top: 0;
    font-size: 0.72rem;
  }
  
  .controls-panel {
    padding: 0.75rem 1rem;
  }
  .sort-buttons {
    width: 100%;
    justify-content: space-between;
  }
  .sort-btn {
    flex-grow: 1;
    text-align: center;
    padding: 0.4rem 0.5rem;
    font-size: 0.8rem;
  }
}
