
/* gamehub-main */
/* Main Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Accessibility: Focus-visible outline for keyboard navigation */
:focus-visible {
  outline: 2px solid var(--primary-color, #E53935);
  outline-offset: 2px;
}

:focus:not(:focus-visible) {
  outline: none;
}

/* Accessibility: Screen reader text (visually hidden) */
.screen-reader-text {
  border: 0;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
  word-wrap: normal !important;
}

.screen-reader-text:focus {
  background-color: #f1f1f1;
  border-radius: 3px;
  box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.6);
  clip: auto !important;
  clip-path: none;
  color: #21759b;
  display: block;
  font-size: 0.875rem;
  font-weight: 700;
  height: auto;
  left: 5px;
  line-height: normal;
  padding: 15px 23px 14px;
  text-decoration: none;
  top: 5px;
  width: auto;
  z-index: 100000;
}

/* Skip link */
.skip-link {
  z-index: 999999;
}

body {
  font-family: var(--body-font, 'Inter'), -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--background-color, #0F0D12);
  color: var(--text-color, #ffffff);
  line-height: 1.6;
  min-height: 100vh;
  padding-top: 64px;
}

/* Homepage Hero Section */
.homepage-hero {
  background: transparent;
  padding: 4rem 2rem;
  text-align: center;
  border-bottom: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
  margin-bottom: 2rem;
}

.hero-content {
  max-width: 800px;
  margin: 0 auto;
}

.hero-title {
  font-size: 3rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary-color, #E53935) 0%, var(--secondary-color, #FFC107) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 1rem;
  line-height: 1.2;
}

.hero-subtitle {
  font-size: 1.25rem;
  color: var(--text-secondary, rgba(255, 255, 255, 0.8));
  font-weight: 400;
  line-height: 1.6;
}

@media (max-width: 768px) {
  .homepage-hero {
    padding: 2rem 1rem;
  }

  .hero-title {
    font-size: 2rem;
  }

  .hero-subtitle {
    font-size: 1rem;
  }
}

/* Breadcrumbs */
.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 0;
  font-size: 0.875rem;
  color: var(--text-secondary);
  flex-wrap: wrap;
}

.breadcrumbs a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s ease;
}

.breadcrumbs a:hover {
  color: var(--primary-color);
}

.breadcrumbs .separator {
  margin: 0 0.25rem;
  opacity: 0.5;
}

.breadcrumbs .current {
  color: var(--text-color);
  font-weight: 500;
}

.homepage-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  max-width: 1600px;
  margin: 0 auto;
  padding: 1rem;
  gap: 1.5rem;
}

.layout-fullwidth .homepage-layout {
  max-width: 100%;
  padding: 1rem 3rem;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem;
}

.layout-fullwidth .container {
  max-width: 100%;
  padding: 0 3rem;
}

.main-content {
  min-width: 0;
}

.game-area {
  width: 100%;
}

.game-section {
  width: 100%;
}

/* Sidebar */
.sidebar {
  width: 320px;
}

/* Browse Container */
.browse-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.browse-header {
  text-align: center;
  margin-bottom: 3rem;
  padding: 2rem 0;
}

.browse-title {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--text-color);
  margin-bottom: 0.75rem;
}

.browse-subtitle {
  font-size: 1.125rem;
  color: var(--text-secondary);
}

/* No Results */
.no-results {
  text-align: center;
  padding: 4rem 2rem;
  background: var(--card-background-40);
  border-radius: 12px;
  border: 1px solid var(--border-color);
}

.no-results h2 {
  font-size: 2rem;
  color: var(--text-color);
  margin-bottom: 1rem;
}

.no-results p {
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

/* Buttons */
.btn {
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-block;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  color: var(--text-color);
  text-decoration: none;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px var(--primary-25);
}

/* Loading States */
.loading-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--border-color);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

.loading-text {
  color: var(--text-color);
  font-size: 1.125rem;
  margin-top: 1rem;
}

/* Responsive */
@media (max-width: 1024px) {
  .homepage-layout {
    grid-template-columns: 1fr;
  }

  .main-content {
    width: 100%;
    padding-right: 0;
  }

  .sidebar {
    width: 100%;
  }

}

@media (max-width: 768px) {
  body {
    padding-top: 56px;
  }

  .container {
    padding: 0 1rem;
  }

  .main-content {
    padding: 1rem;
  }

  .browse-container {
    padding: 1rem;
  }

  .browse-title {
    font-size: 1.75rem;
  }

  .browse-subtitle {
    font-size: 1rem;
  }

}

/* Utility Classes */
.text-center {
  text-align: center;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }

/* Floating Action Buttons */
.floating-action-buttons {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  z-index: 999;
}

.fab-button {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--primary-color);
  border: none;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
}

.fab-button.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: all;
}

.fab-button:hover {
  background: var(--secondary-color);
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.fab-button:active {
  transform: translateY(-2px);
}

.fab-button svg {
  transition: transform 0.3s ease;
}

.fab-button:hover svg {
  transform: scale(1.1);
}

/* Scroll to Top Button */
.scroll-to-top-btn {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--primary-color);
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all 0.3s ease;
  z-index: 9990;
}

.scroll-to-top-btn.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.scroll-to-top-btn:hover {
  background: var(--primary-color-dark, var(--accent-color));
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.scroll-to-top-btn:active {
  transform: translateY(-1px);
}

.scroll-to-top-btn svg {
  width: 24px;
  height: 24px;
  transition: transform 0.2s ease;
}

.scroll-to-top-btn:hover svg {
  transform: translateY(-2px);
}

@media (max-width: 768px) {
  .scroll-to-top-btn {
    bottom: 1.5rem;
    right: 1.5rem;
    width: 44px;
    height: 44px;
  }
  
  .scroll-to-top-btn svg {
    width: 20px;
    height: 20px;
  }
}

@media (max-width: 768px) {
  .floating-action-buttons {
    bottom: 1rem;
    right: 1rem;
    gap: 0.75rem;
  }
  
  .fab-button {
    width: 48px;
    height: 48px;
  }
  
  .fab-button svg {
    width: 20px;
    height: 20px;
  }
}

@media (max-width: 480px) {
  body {
    padding-top: 52px;
  }
}

/* Accessibility: Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ===== Light Mode Overrides ===== */
html.light-mode {
  --background-color: #f5f5f5;
  --card-background: #ffffff;
  --text-color: #1e293b;
  --text-secondary: #64748b;
  --border-color: rgba(0, 0, 0, 0.1);
  --card-background-40: #ffffff;
  --card-background-60: #ffffff;
  --card-background-80: #ffffff;
  --card-background-95: #ffffff;
  --card-background-10: rgba(255, 255, 255, 0.1);
  --card-background-15: rgba(255, 255, 255, 0.15);
  --card-background-20: rgba(255, 255, 255, 0.2);
  --text-60: rgba(30, 41, 59, 0.6);
  --text-80: rgba(30, 41, 59, 0.8);
  --text-color-muted: rgba(30, 41, 59, 0.55);
  --input-bg: rgba(0, 0, 0, 0.06);
  --glass-bg: rgba(0, 0, 0, 0.04);
  --hover-bg: rgba(0, 0, 0, 0.05);
  --placeholder-color: rgba(0, 0, 0, 0.30);
}

html.light-mode body {
  background: var(--background-color);
  color: var(--text-color);
}

html.light-mode .header {
  background: rgba(255, 255, 255, 0.95);
  border-bottom-color: rgba(0, 0, 0, 0.1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

html.light-mode .header.scrolled {
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

html.light-mode .left-sidebar {
  background: #ffffff;
  border-right-color: rgba(0, 0, 0, 0.1);
}

html.light-mode .game-card {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.08);
}

html.light-mode .header-random-btn img {
  filter: brightness(0) invert(1);
}


/* ── Article typography ────────────────────────────────────────────────
   The imported page bodies carry light-theme colours inline — headings at
   #1e293b, sub-headings at #1e3a8a, body at #334155 — which land at about
   1.2:1 against the dark page and are effectively unreadable. 361 published
   posts are affected, so the fix belongs here rather than in the content.

   One ink colour for the whole article: hierarchy comes from size and
   weight, not from a second hue. Only links and inline emphasis keep the
   brand accent, because they have to stay identifiable.

   The colours are written literally (LITERAL-ON-PURPOSE marker), not as
   var(--token): some of the imported markup sits under a wrapper
   that resets inherited custom properties, so a var() reference resolves to
   nothing there and the declaration falls back to the inline colour — which
   is the exact bug this block exists to fix. The inline styles are
   author-level, hence !important.
   ──────────────────────────────────────────────────────────────────── */
.game-description,
.game-description-content,
.description-content,
.description-preview,
.blog-article-body,
.post-content {
  color: rgba(255, 255, 255, 0.92);
}

.game-description :is(p, li, td, th, span, div, article, section, blockquote, figcaption, dd, dt, h1, h2, h3, h4, h5, h6),
.game-description-content :is(p, li, td, th, span, div, article, section, blockquote, figcaption, dd, dt, h1, h2, h3, h4, h5, h6),
.blog-article-body :is(p, li, td, th, span, div, article, section, blockquote, figcaption, dd, dt, h1, h2, h3, h4, h5, h6),
.post-content :is(p, li, td, th, span, div, article, section, blockquote, figcaption, dd, dt, h1, h2, h3, h4, h5, h6) {
  color: rgba(255, 255, 255, 0.92) !important;
}

/* Links and emphasis stay on the accent so they remain recognisable. */
.game-description :is(a, strong, b),
.game-description-content :is(a, strong, b),
.blog-article-body :is(a, strong, b),
.post-content :is(a, strong, b) {
  color: #22d3ee !important;
}

/* A bold link should read as one link, not as double emphasis. */
.game-description a :is(strong, b),
.game-description-content a :is(strong, b),
.blog-article-body a :is(strong, b),
.post-content a :is(strong, b) {
  color: inherit !important;
}

/* gamehub-header */
/* CrazyGames-inspired Header Design */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10000;
  background: var(--background-color);
  border-bottom: 1px solid var(--border-color);
  transition: all 0.25s ease;
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(12px);
}

.header-transparent {
  background: var(--card-background-80);
  backdrop-filter: blur(20px);
}

.header-solid {
  background: var(--background-color);
  backdrop-filter: none;
}

.header.scrolled {
  background: var(--card-background);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

/* Updated: 2025-11-20 - Grid layout with centered search */
.header-container {
  width: 100%;
  padding: 0 1.5rem;
  height: 64px;
  display: grid !important;
  grid-template-columns: auto auto 1fr auto !important;
  align-items: center;
  gap: 1rem;
}

.menu-toggle {
  grid-column: 1 !important;
}

/* Logo */
.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  transition: transform 0.2s ease;
  cursor: pointer;
  grid-column: 2 !important;
  justify-self: start !important;
}

.logo:hover {
  transform: scale(1.02);
}

.logo-icon {
  width: 32px;
  height: 32px;
  color: var(--primary-color);
}

.logo-text {
  font-size: 1.75rem;
  font-weight: 800;
  background: linear-gradient(45deg, var(--text-color), var(--text-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.02em;
}

/* Logo dark/light mode switching */
.logo-light {
  display: none;
}

html.light-mode .logo-light {
  display: block;
}

html.light-mode .logo-dark {
  display: none;
}

/* Navigation */
.nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  justify-content: flex-start;
  margin-left: 2rem;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 0.625rem 1.125rem;
  border-radius: 10px;
  font-weight: 500;
  font-size: 0.9375rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  white-space: nowrap;
  overflow: hidden;
}

.nav-link::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--primary-25) 0%, var(--secondary-25) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: -1;
}

.nav-link:hover {
  color: var(--text-color);
  transform: translateY(-1px);
}

.nav-link:hover::before {
  opacity: 1;
}

.nav-link.active {
  color: var(--text-color);
  font-weight: 600;
  background: linear-gradient(135deg, var(--primary-20) 0%, var(--secondary-20) 100%);
  box-shadow: inset 0 0 0 1px var(--primary-25);
}

.nav-link.active:hover {
  transform: translateY(-1px);
  box-shadow: inset 0 0 0 1px var(--primary-color), 0 4px 12px rgba(0, 0, 0, 0.1);
}

.nav-icon {
  font-size: 1rem;
}

.nav-icon-svg {
  width: 18px;
  height: 18px;
}

/* Dropdown Navigation */
.nav-dropdown {
  position: relative;
}

.dropdown-trigger {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
}

.dropdown-trigger.active .dropdown-arrow {
  transform: rotate(180deg);
}

.dropdown-arrow {
  width: 16px;
  height: 16px;
  transition: transform 0.2s ease;
}

.dropdown-arrow.open {
  transform: rotate(180deg);
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--card-background);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  padding: 0.5rem;
  min-width: 200px;
  z-index: 1001;
  display: none;
  animation: dropdownSlide 0.2s ease-out;
}

.dropdown-menu.active {
  display: block;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 0.625rem 1rem;
  border-radius: 8px;
  font-weight: 500;
  font-size: 0.875rem;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
  position: relative;
}

.dropdown-item:hover {
  background: var(--card-background-80);
  color: var(--text-color);
  padding-left: 1.125rem;
}

.dropdown-item:hover .dropdown-icon {
  transform: scale(1.1);
  color: var(--primary-color);
}

.dropdown-item.active {
  background: var(--primary-20);
  color: var(--text-color);
  font-weight: 600;
}

.dropdown-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.dropdown-divider {
  height: 1px;
  background: var(--border-color);
  margin: 0.5rem 0;
}

.dropdown-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 999;
  display: none;
}

/* Search */
.search-container {
  position: relative;
  width: 100%;
  max-width: 500px;
  z-index: 10;
  grid-column: 3 !important;
  justify-self: center !important;
}

.header .search-input {
  width: 100%;
  height: 40px;
  background: var(--card-background-80);
  border: 2px solid var(--border-color);
  border-radius: 20px;
  padding: 0 1rem 0 2.5rem;
  color: var(--text-color);
  font-size: 0.9rem;
  outline: none;
  transition: all 0.2s ease;
  backdrop-filter: blur(10px);
}

.header .search-input:focus {
  background: var(--card-background);
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px var(--primary-color-20);
}

.header .search-input::placeholder {
  color: var(--text-60);
}

.header .search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--text-60);
  z-index: 1;
}

/* Search Autocomplete */
.search-autocomplete {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 0;
  right: 0;
  background: var(--card-background);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  max-height: 400px;
  overflow-y: auto;
  display: none;
  z-index: 1003;
}

.search-autocomplete.active {
  display: block;
  animation: slideDown 0.2s ease-out;
}

.search-autocomplete-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  cursor: pointer;
  transition: background 0.2s ease;
  border-bottom: 1px solid var(--border-color);
  text-decoration: none;
  color: var(--text-color);
}

.search-autocomplete-item:last-child {
  border-bottom: none;
}

.search-autocomplete-item:hover {
  background: var(--card-background-60);
}

.search-autocomplete-item.selected {
  background: var(--card-background-80);
}

.search-autocomplete-thumb {
  width: 60px;
  height: 45px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--card-background-40);
}

.search-autocomplete-info {
  flex: 1;
  min-width: 0;
}

.search-autocomplete-title {
  font-weight: 600;
  font-size: 0.9rem;
  margin: 0 0 0.25rem 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-color);
}

.search-autocomplete-meta {
  font-size: 0.8rem;
  color: var(--text-secondary);
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.search-autocomplete-category {
  background: var(--primary-20);
  padding: 0.125rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 500;
}

.search-autocomplete-loading {
  padding: 1rem;
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.search-autocomplete-empty {
  padding: 1.5rem 1rem;
  text-align: center;
  color: var(--text-secondary);
}

.search-autocomplete-empty-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  opacity: 0.5;
}

/* Actions */
.actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.action-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--card-background-40);
  border: 1px solid var(--border-color);
  color: var(--text-color);
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 500;
  font-size: 0.9rem;
}

.action-btn:hover {
  background: rgba(255, 107, 53, 0.1);
  border-color: rgba(255, 107, 53, 0.3);
  color: var(--text-color);
  transform: translateY(-1px);
}

.action-icon {
  width: 18px;
  height: 18px;
}

.play-btn {
  background: linear-gradient(45deg, var(--accent-color), var(--secondary-color));
  color: var(--text-color);
  border: none;
  padding: 0.6rem 1.25rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 700;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 4px 15px rgba(255, 107, 53, 0.3);
}

.play-btn:hover {
  background: linear-gradient(45deg, var(--accent-color), var(--secondary-color));
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(255, 107, 53, 0.4);
}

.play-icon {
  width: 18px;
  height: 18px;
}

/* Header Actions Container */
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  grid-column: 4 !important;
  justify-self: end !important;
}

/* Header Random Button */
.header-random-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-color);
  border: none;
  border-radius: 6px;
  color: #fff;
  cursor: pointer;
  transition: all 0.3s ease;
}

.header-random-btn:hover {
  background: var(--secondary-color);
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
}

.header-random-btn img {
  filter: brightness(0) invert(1);
  transition: transform 0.3s ease;
  width: 18px;
  height: 18px;
}

.header-random-btn.spinning img {
  animation: spin 0.8s linear infinite;
}

/* Blog Icon Button */
.header-blog-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--card-background-40);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-color);
  text-decoration: none;
  transition: all 0.3s ease;
  padding: 0;
}

.header-blog-btn:hover,
.header-blog-btn:focus-visible {
  background: var(--primary-color-20);
  border-color: var(--primary-color);
  color: var(--primary-color);
  transform: translateY(-1px);
  outline: none;
}

.header-blog-btn svg {
  width: 18px;
  height: 18px;
}

/* Theme Toggle Button */
.theme-toggle-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--card-background-40);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-color);
  cursor: pointer;
  transition: all 0.3s ease;
  padding: 0;
}

.theme-toggle-btn:hover {
  background: var(--primary-color-20);
  border-color: var(--primary-color);
  transform: translateY(-1px);
}

.theme-toggle-btn svg {
  width: 18px;
  height: 18px;
  transition: transform 0.3s ease;
}

.theme-toggle-btn:hover svg {
  transform: rotate(30deg);
}

/* Sun icon hidden in dark, shown in light */
.theme-icon-sun { display: none; }
.theme-icon-moon { display: block; }
html.light-mode .theme-icon-sun { display: block; }
html.light-mode .theme-icon-moon { display: none; }

/* Mobile Menu Toggle */
.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: var(--card-background-40);
  border: 1px solid var(--primary-color);
  color: var(--primary-color);
  padding: 0.5rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 40px;
  height: 40px;
  justify-content: center;
  align-items: center;
}

.mobile-menu-toggle:hover {
  background: var(--primary-20);
  border-color: var(--primary-color);
}

.hamburger-line {
  width: 20px;
  height: 2px;
  background: var(--primary-color);
  transition: all 0.3s ease;
}

.mobile-menu-toggle.active .hamburger-line:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-toggle.active .hamburger-line:nth-child(2) {
  opacity: 0;
}

.mobile-menu-toggle.active .hamburger-line:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* Mobile Menu Button */
.mobile-menu-btn {
  display: none;
  background: var(--card-background-40);
  border: 1px solid var(--border-color);
  color: var(--text-color);
  padding: 0.5rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.mobile-menu-btn:hover {
  background: rgba(255, 107, 53, 0.1);
  border-color: rgba(255, 107, 53, 0.3);
  color: var(--text-color);
}

.mobile-menu-btn svg {
  width: 20px;
  height: 20px;
}

/* Mobile Menu */
.mobile-menu-overlay {
  position: fixed;
  top: 64px;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease-out, visibility 0s 0.2s;
}

.mobile-menu-overlay.active {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  transition: opacity 0.2s ease-out, visibility 0s 0s;
}

.mobile-menu {
  display: none;
  background: linear-gradient(135deg, var(--background-color) 0%, var(--background-color) 100%);
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  max-height: calc(100vh - 64px);
  overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.mobile-menu.active {
  display: block;
  animation: slideDown 0.2s ease-out;
}

.mobile-category-header {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent-color);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 1rem 0 0.5rem;
  padding: 0 1rem;
}

.mobile-search {
  position: relative;
  margin-bottom: 1.5rem;
}

.mobile-search-input {
  width: 100%;
  height: 48px;
  background: var(--card-background-40);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  padding: 0 1rem 0 3rem;
  color: var(--text-color);
  font-size: 1rem;
  outline: none;
  transition: all 0.2s ease;
}

.mobile-search-input:focus {
  background: var(--card-background-60);
  border-color: rgba(255, 107, 53, 0.5);
  box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}

.mobile-search-input::placeholder {
  color: var(--text-60);
}

.mobile-search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  color: #9ca3af;
}

.mobile-nav {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.mobile-nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-color);
  text-decoration: none;
  padding: 0.875rem 1rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 1rem;
  transition: all 0.2s ease;
}

.mobile-nav-link:hover {
  background: var(--card-background-60);
  color: var(--text-color);
}

.mobile-nav-link.active {
  background: linear-gradient(90deg, var(--primary-20), transparent);
  color: var(--text-color);
  font-weight: 600;
  border-left: 3px solid var(--primary-color);
  padding-left: calc(0.875rem - 3px);
}

.mobile-nav-section {
  margin: 1rem 0;
}

.mobile-section-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent-color);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
  padding: 0 1rem;
}

.mobile-nav-icon {
  font-size: 1.1rem;
  width: 20px;
  text-align: center;
}

.mobile-nav-icon-svg {
  width: 20px;
  height: 20px;
}

.mobile-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}

.mobile-action-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--card-background-40);
  border: 1px solid var(--border-color);
  color: var(--text-color);
  padding: 0.875rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 600;
  font-size: 1rem;
}

.mobile-action-btn:hover {
  background: var(--primary-color-10);
  color: var(--accent-color);
}

.mobile-action-icon {
  width: 20px;
  height: 20px;
}

.mobile-play-btn {
  background: linear-gradient(45deg, var(--accent-color), var(--secondary-color));
  color: var(--text-color);
  border: none;
  padding: 1rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 700;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  box-shadow: 0 4px 15px rgba(255, 107, 53, 0.3);
}

.mobile-play-btn:hover {
  background: linear-gradient(45deg, var(--accent-color), var(--secondary-color));
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(255, 107, 53, 0.4);
}

.mobile-play-icon {
  width: 20px;
  height: 20px;
}

/* Responsive Design */
@media (max-width: 1200px) {
  .header-container {
    gap: 1rem;
  }
  
  .search-container {
    width: 250px;
  }
  
  .action-text {
    display: none;
  }
  
  .action-btn {
    padding: 0.5rem;
  }
}

@media (max-width: 1024px) {
  .nav {
    display: none;
  }
  
  .search-container {
    display: none;
  }
  
  .header-random-btn {
    display: none;
  }

  .header-blog-btn {
    display: none;
  }

  .actions {
    display: none;
  }
  
  .mobile-menu-toggle {
    display: none !important;
  }

  .mobile-menu {
    display: none !important;
  }

  .menu-toggle {
    display: flex !important;
  }
  
  .mobile-menu-btn {
    display: block;
  }
}

@media (max-width: 768px) {
  .header-container {
    padding: 0 1rem;
    height: 56px;
    grid-template-columns: auto auto 1fr auto;
    gap: 0.5rem;
  }
  
  .search-container {
    max-width: 250px;
  }
  
  .logo-text {
    font-size: 1.5rem;
  }
  
  .logo-icon {
    width: 28px;
    height: 28px;
  }
  
  .mobile-menu {
    padding: 1rem;
  }
}

@media (max-width: 480px) {
  .header-container {
    padding: 0 0.75rem;
    height: 52px;
  }
  
  .logo-text {
    font-size: 1.3rem;
  }
  
  .mobile-nav-link,
  .mobile-action-btn {
    padding: 0.75rem;
    font-size: 0.95rem;
  }
  
  .mobile-play-btn {
    padding: 0.875rem;
    font-size: 1rem;
  }
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* ===== Category Navigation Bar ===== */
.category-bar {
  background: var(--background-color);
  border-bottom: 1px solid var(--border-color);
  position: relative;
  z-index: 99;
}

.category-bar-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  gap: 0.5rem;
  padding: 0.625rem 1.5rem;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;          /* Firefox */
  -ms-overflow-style: none;        /* IE/Edge */
}

.category-bar-inner::-webkit-scrollbar {
  display: none;                   /* Chrome/Safari */
}

.category-bar-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.4rem 0.875rem;
  background: var(--card-background);
  border: 1px solid var(--border-color);
  border-radius: 50px;
  color: var(--text-color);
  text-decoration: none;
  font-size: 0.8125rem;
  font-weight: 600;
  white-space: nowrap;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.category-bar-pill:hover {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.category-bar-pill.active {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: #fff;
}

.category-bar-icon {
  font-size: 0.9rem;
  line-height: 1;
}

.category-bar-label {
  line-height: 1;
}

@media (max-width: 768px) {
  .category-bar-inner {
    padding: 0.5rem 1rem;
    gap: 0.375rem;
  }

  .category-bar-pill {
    padding: 0.35rem 0.75rem;
    font-size: 0.75rem;
  }
}
/* ===== End Category Navigation Bar ===== */

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes dropdownSlide {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Focus States */
.nav-link:focus,
.action-btn:focus,
.play-btn:focus,
.search-input:focus,
.mobile-menu-btn:focus,
.dropdown-trigger:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  .header,
  .nav-link,
  .action-btn,
  .play-btn,
  .search-input,
  .mobile-menu,
  .logo,
  .dropdown-menu {
    transition: none;
  }
  
  .mobile-menu,
  .dropdown-menu {
    animation: none;
  }
}
/* WordPress Menu Support */
.nav-menu,
.mobile-nav-menu {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-menu li,
.mobile-nav-menu li {
  list-style: none;
  position: relative;
}

.nav-menu > li > a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  color: var(--text-color);
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 600;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.nav-menu > li > a {
  position: relative;
  overflow: hidden;
}

.nav-menu > li > a::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--primary-25) 0%, var(--secondary-25) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: -1;
}

.nav-menu > li > a:hover {
  color: var(--text-color);
  transform: translateY(-1px);
}

.nav-menu > li > a:hover::before {
  opacity: 1;
}

.nav-menu > li.current-menu-item > a,
.nav-menu > li.current_page_item > a,
.nav-menu > li.current-menu-ancestor > a {
  background: linear-gradient(135deg, var(--primary-20) 0%, var(--secondary-20) 100%);
  color: var(--text-color);
  font-weight: 600;
  box-shadow: inset 0 0 0 1px var(--primary-25);
}

.nav-menu > li.current-menu-item > a:hover,
.nav-menu > li.current_page_item > a:hover,
.nav-menu > li.current-menu-ancestor > a:hover {
  box-shadow: inset 0 0 0 1px var(--primary-color), 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Sub-menu dropdown */
.nav-menu .sub-menu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 200px;
  background: var(--card-background-60);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0.5rem;
  margin-top: 0.5rem;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s ease;
  z-index: 1000;
  list-style: none;
}

.nav-menu li:hover > .sub-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.nav-menu .sub-menu li a {
  display: block;
  padding: 0.625rem 1rem;
  color: var(--text-80);
  text-decoration: none;
  font-size: 0.875rem;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.nav-menu .sub-menu li a:hover {
  background: var(--card-background-80);
  color: var(--text-color);
  padding-left: 1.125rem;
}

.nav-menu .sub-menu li.current-menu-item > a,
.nav-menu .sub-menu li.current_page_item > a {
  background: var(--primary-20);
  color: var(--text-color);
  font-weight: 600;
}

/* Mobile menu styling */
.mobile-nav-menu {
  flex-direction: column;
  align-items: stretch;
  gap: 0;
}

.mobile-nav-menu li a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  color: var(--text-color);
  text-decoration: none;
  font-size: 1rem;
  font-weight: 600;
  border-bottom: 1px solid var(--border-color);
  transition: all 0.2s ease;
}

.mobile-nav-menu li a:hover {
  background: var(--card-background-60);
  color: var(--text-color);
}

.mobile-nav-menu li.current-menu-item > a,
.mobile-nav-menu li.current_page_item > a,
.mobile-nav-menu li.current-menu-ancestor > a {
  background: linear-gradient(90deg, var(--primary-20), transparent);
  color: var(--text-color);
  font-weight: 600;
  border-left: 3px solid var(--primary-color);
}

.mobile-nav-menu .sub-menu {
  list-style: none;
  padding-left: 0;
}

.mobile-nav-menu .sub-menu li a {
  padding-left: 3rem;
  font-size: 0.9375rem;
  background: rgba(0, 0, 0, 0.2);
}


/* Language Switcher
   Names the language you switch TO, so the pill is the action, not a label.
   Sized to sit in the same 32px action row as the random/blog buttons. */
.header-lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  height: 32px;
  padding: 0 0.5rem;
  background: var(--card-background-40);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-color);
  text-decoration: none;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1;
  transition: all 0.3s ease;
}

.header-lang-btn:hover,
.header-lang-btn:focus-visible {
  background: var(--primary-color-20);
  border-color: var(--primary-color);
  color: var(--primary-color);
  transform: translateY(-1px);
  outline: none;
}

.header-lang-btn__globe {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  opacity: 0.85;
}

.header-lang-btn__code {
  font-variant-numeric: tabular-nums;
}

/* Narrow screens: the action row is tight, so drop to the globe alone.
   The accessible name still carries the destination language. */
@media (max-width: 480px) {
  .header-lang-btn {
    width: 32px;
    padding: 0;
    justify-content: center;
  }
  .header-lang-btn__code {
    display: none;
  }
  .header-lang-btn__globe {
    width: 18px;
    height: 18px;
  }
}

/* gamehub-sidebar */
/* Sidebar Styles */
.sidebar {
  position: sticky;
  top: 90px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  background: var(--card-background-60);
  backdrop-filter: blur(10px);
  border-radius: 12px;
  padding: 1rem;
  border: 1px solid var(--border-color);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  /* Firefox scrollbar */
  scrollbar-width: thin;
  scrollbar-color: var(--primary-color) var(--card-background-40);
}

/* Webkit (Chrome, Safari, Edge) scrollbar - uses theme colors */
.sidebar::-webkit-scrollbar {
  width: 8px;
}

.sidebar::-webkit-scrollbar-track {
  background: var(--card-background-40);
  border-radius: 4px;
}

.sidebar::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--primary-color), var(--secondary-color));
  border-radius: 4px;
  border: 1px solid var(--card-background-40);
}

.sidebar::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, var(--secondary-color), var(--primary-color));
  box-shadow: 0 0 8px var(--primary-color-40);
}

/* Game sidebar scrollbar */
.game-sidebar,
.sidebar-games-list {
  scrollbar-width: thin;
  scrollbar-color: var(--primary-color) var(--card-background-40);
}

.game-sidebar::-webkit-scrollbar,
.sidebar-games-list::-webkit-scrollbar {
  width: 6px;
}

.game-sidebar::-webkit-scrollbar-track,
.sidebar-games-list::-webkit-scrollbar-track {
  background: var(--card-background-20);
  border-radius: 3px;
}

.game-sidebar::-webkit-scrollbar-thumb,
.sidebar-games-list::-webkit-scrollbar-thumb {
  background: var(--primary-gradient);
  border-radius: 3px;
}

.game-sidebar::-webkit-scrollbar-thumb:hover,
.sidebar-games-list::-webkit-scrollbar-thumb:hover {
  background: var(--accent-color);
}

.related-games h3 {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text-color);
  margin: 0;
  padding: 0.875rem 1rem;
  border-bottom: none;
  position: relative;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.related-games h3::before {
  content: '';
  width: 3px;
  height: 100%;
  background: var(--primary-color);
  position: absolute;
  left: 0;
  top: 0;
}

.action-games-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  padding: 0 1rem 1rem 1rem;
}

.action-game-item {
  display: block;
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  transition: all 0.3s ease;
}

.action-game-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.game-thumbnail {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: all 0.3s ease;
}

.action-game-item:hover .game-thumbnail {
  transform: scale(1.1);
  filter: brightness(0.7);
}

.game-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1rem;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 100%;
}

.action-game-item:hover .game-info {
  opacity: 1;
}

.game-title {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #ffffff;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-height: 1.4;
}

.sidebar .game-meta {
  display: none;
}

.sidebar .rating {
  display: none;
}

.sidebar .plays {
  display: none;
}

.no-games-message {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--text-60);
}

/* Responsive */
@media (max-width: 1024px) {
  .sidebar {
    position: static;
    width: 100%;
    max-height: none;
    margin: 2rem auto;
    max-width: 800px;
  }

  .action-games-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
  }

  .widget-games-list,
  .sidebar-games-list {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
  }
}

@media (max-width: 768px) {
  .sidebar {
    padding: 1rem;
  }

  .action-games-list {
    grid-template-columns: 1fr;
  }

  .action-game-item {
    flex-direction: column;
  }

  .game-thumbnail {
    width: 100%;
    height: 150px;
  }

  .widget-games-list,
  .sidebar-games-list {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
  }

  .widget-game-item,
  .sidebar-game-item {
    border-radius: 10px;
  }

  .widget-game-info,
  .sidebar-game-info {
    padding: 0.625rem;
  }

  .widget-game-title,
  .sidebar-game-info h4 {
    font-size: 0.8125rem;
  }

  .widget-game-meta,
  .sidebar-game-meta {
    font-size: 0.65rem;
  }
}

@media (max-width: 480px) {
  .widget-games-list,
  .sidebar-games-list {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
  }
}

/* Sidebar Widget Sections */
.sidebar-section {
  margin-bottom: 2rem;
}

.sidebar-section:last-child {
  margin-bottom: 0;
}

/* Sidebar Games List (for single-game.php default sidebar) */
.sidebar-games-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.625rem;
}

.sidebar-game-item {
  position: relative;
  display: block;
  text-decoration: none;
  border-radius: 16px;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background: var(--card-background-60);
  aspect-ratio: 1 / 1;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.sidebar-game-item:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.4);
}

.sidebar-game-thumb {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
}

.sidebar-game-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  filter: brightness(0.95);
}

.sidebar-game-item:hover .sidebar-game-thumb img {
  transform: scale(1.12);
  filter: brightness(1.05) saturate(1.1);
}

.sidebar-game-info {
  padding: 0.875rem;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.75) 60%, rgba(0, 0, 0, 0.3) 85%, transparent 100%);
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 2;
  transition: all 0.3s ease;
}

.sidebar-game-item:hover .sidebar-game-info {
  padding-bottom: 1.125rem;
}

.sidebar-game-info h4 {
  font-size: 0.875rem;
  font-weight: 700;
  color: #fff;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
  line-height: 1.3;
  letter-spacing: 0.01em;
}

.sidebar-game-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.85);
  margin-top: 0.375rem;
}

.sidebar-game-meta .rating {
  color: #fbbf24;
  font-size: 0.75rem;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.sidebar-game-meta .plays {
  color: rgba(255, 255, 255, 0.8);
  font-weight: 500;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

/* Play overlay removed */

/* gamehub-homepage-crazygames */
/**
 * CrazyGames-Style Layout
 * Applied site-wide: left sidebar navigation + content area.
 * On the homepage: hero banner + horizontal scroll rows.
 * On other pages: sidebar wraps category/tag/single content.
 *
 * @package GameHub
 */

/* =============================================
   USE THEME'S GLOBAL LEFT SIDEBAR ON ALL LAYOUTS
   Hide the CrazyGames-specific sidebar; the global
   .left-sidebar from sidebar-nav.css handles navigation.
   ============================================= */

/* Hide the CG-specific sidebar — theme sidebar is used instead */
.cg-sidebar {
  display: none !important;
}

/* Hide the header category bar — left sidebar handles categories */
body.homepage-crazygames .category-bar {
  display: none;
}

/* =============================================
   LAYOUT STRUCTURE
   ============================================= */
.cg-layout {
  display: flex;
  min-height: calc(100vh - 80px);
  background: var(--background-color);
}

/* =============================================
   LEFT SIDEBAR — Collapsed icons-only, expands on hover
   ============================================= */
.cg-sidebar {
  position: sticky;
  top: 64px;
  left: 0;
  width: 60px;
  min-width: 60px;
  height: calc(100vh - 64px);
  overflow-x: hidden;
  overflow-y: auto;
  background: var(--card-background);
  border-right: 1px solid var(--border-color);
  padding: 0.75rem 0;
  z-index: 20;
  scrollbar-width: thin;
  scrollbar-color: var(--border-color) transparent;
  transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1),
              min-width 0.25s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 0.25s ease;
}

.cg-sidebar:hover {
  width: 220px;
  min-width: 220px;
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15);
}

.cg-sidebar::-webkit-scrollbar {
  width: 0;
}

.cg-sidebar:hover::-webkit-scrollbar {
  width: 4px;
}

.cg-sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.cg-sidebar::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}

.cg-sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 0.375rem;
}

.cg-sidebar:hover .cg-sidebar-nav {
  padding: 0 0.5rem;
}

.cg-sidebar-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem;
  border-radius: 10px;
  text-decoration: none;
  color: var(--text-color);
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.15s ease;
  white-space: nowrap;
  overflow: hidden;
  justify-content: center;
}

.cg-sidebar:hover .cg-sidebar-item {
  padding: 0.625rem 0.875rem;
  justify-content: flex-start;
}

.cg-sidebar-item:hover {
  background: var(--primary-15, rgba(99, 102, 241, 0.1));
  color: var(--primary-color);
}

.cg-sidebar-item.active {
  background: var(--primary-15, rgba(99, 102, 241, 0.1));
  color: var(--primary-color);
  font-weight: 600;
}

.cg-sidebar-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.cg-sidebar-label {
  opacity: 0;
  width: 0;
  overflow: hidden;
  transition: opacity 0.2s ease 0s, width 0.25s ease;
}

.cg-sidebar:hover .cg-sidebar-label {
  opacity: 1;
  width: auto;
  transition: opacity 0.2s ease 0.1s, width 0.25s ease;
}

.cg-sidebar-divider {
  height: 1px;
  background: var(--border-color);
  margin: 0.5rem 0.625rem;
}

.cg-sidebar:hover .cg-sidebar-divider {
  margin: 0.5rem 0.875rem;
}

/* Tooltip on collapsed sidebar items */
.cg-sidebar-item {
  position: relative;
}

.cg-sidebar-item::after {
  content: attr(data-tooltip);
  position: absolute;
  left: calc(100% + 8px);
  top: 50%;
  transform: translateY(-50%);
  background: var(--card-background);
  color: var(--text-color);
  padding: 0.375rem 0.75rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-color);
  z-index: 100;
}

.cg-sidebar-item:hover::after {
  opacity: 1;
}

/* Hide tooltip when sidebar is expanded */
.cg-sidebar:hover .cg-sidebar-item::after {
  opacity: 0 !important;
  display: none;
}

/* =============================================
   MAIN CONTENT AREA
   ============================================= */
.cg-main {
  flex: 1;
  min-width: 0;
  padding: 1.25rem 1.75rem 3rem;
  overflow-x: clip; /* clip instead of hidden — preserves sticky positioning */
}

/* Full Width layout override — let cg-main span the full available area */
.layout-fullwidth .cg-main {
  max-width: 100%;
}

/* Browse pages (.browse-page) inside CrazyGames layout:
   Remove extra container padding since .cg-main handles it. */
.cg-main .browse-page .browse-hero {
  margin: -1.25rem -1.75rem 0;
  border-radius: 0;
}

.cg-main .browse-container {
  max-width: 100%;
  padding: 1.5rem 0 0;
}

/* Single game layout inside CrazyGames */
.cg-main .single-game-layout {
  max-width: 100%;
  padding: 0;
}

/* Fix game-sidebar sticky & height inside CrazyGames layout */
.cg-main .game-sidebar {
  position: sticky;
  top: 72px;
  max-height: calc(100vh - 80px);
  overflow-y: auto;
  align-self: start;
}

/* Page wrapper inside CrazyGames */
.cg-main .page-wrapper .page-hero {
  margin: -1.25rem -1.75rem 0;
}

.cg-main .page-wrapper .page-container-full {
  max-width: 100%;
  padding: 2rem 0;
}

/* =============================================
   HERO BANNER GRID
   ============================================= */
.cg-hero {
  margin-bottom: 1.75rem;
}

.cg-hero-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 0.75rem;
  min-height: 340px;
  max-height: 420px;
}

/* ── Desktop layouts for fewer-than-5 featured games ────────────────── */
.cg-hero[data-count="1"] .cg-hero-grid {
  grid-template-columns: 1fr;
  grid-template-rows: 1fr;
}
.cg-hero[data-count="2"] .cg-hero-grid {
  grid-template-columns: 1.2fr 1fr;
  grid-template-rows: 1fr;
}
.cg-hero[data-count="3"] .cg-hero-grid {
  grid-template-columns: 1.4fr 1fr;
  grid-template-rows: 1fr 1fr;
}
.cg-hero[data-count="4"] .cg-hero-grid {
  grid-template-columns: 1.4fr 1fr 1fr;
  grid-template-rows: 1fr 1fr;
}

/* 3 cards: primary spans both rows of column 1; two secondaries stack in column 2 */
.cg-hero[data-count="3"] .cg-hero-secondary:nth-child(2) { grid-column: 2; grid-row: 1; }
.cg-hero[data-count="3"] .cg-hero-secondary:nth-child(3) { grid-column: 2; grid-row: 2; }

/* 4 cards: primary spans both rows of column 1; three secondaries fill the rest (col 2 row 1, col 3 row 1, col 2-3 row 2) */
.cg-hero[data-count="4"] .cg-hero-secondary:nth-child(2) { grid-column: 2; grid-row: 1; }
.cg-hero[data-count="4"] .cg-hero-secondary:nth-child(3) { grid-column: 3; grid-row: 1; }
.cg-hero[data-count="4"] .cg-hero-secondary:nth-child(4) { grid-column: 2 / span 2; grid-row: 2; }

.cg-hero-card {
  position: relative;
  display: block;
  border-radius: 16px;
  overflow: hidden;
  text-decoration: none;
  color: #fff;
  background: #1a1a1a;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  isolation: isolate; /* contain z-index for play button + badge */
  transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1),
              box-shadow 0.35s ease;
  will-change: transform;
}

.cg-hero-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.22);
}

.cg-hero-card:focus-visible {
  outline: 3px solid var(--primary-color, #667eea);
  outline-offset: 2px;
}

.cg-hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.cg-hero-card:hover .cg-hero-img {
  transform: scale(1.06);
}

.cg-hero-primary {
  grid-column: 1;
  grid-row: 1 / 3;
  min-height: 340px;
}

.cg-hero-secondary {
  min-height: 160px;
}

.cg-hero-secondary:nth-child(2) { grid-column: 2; grid-row: 1; }
.cg-hero-secondary:nth-child(3) { grid-column: 3; grid-row: 1; }
.cg-hero-secondary:nth-child(4) { grid-column: 2; grid-row: 2; }
.cg-hero-secondary:nth-child(5) { grid-column: 3; grid-row: 2; }

/* "Featured" badge on primary card — gold gradient with subtle gloss */
.cg-hero-badge {
  position: absolute;
  top: 0.875rem;
  left: 0.875rem;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.3rem 0.65rem;
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  color: #422006;
  font-size: 0.6875rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  border-radius: 999px;
  box-shadow: 0 2px 8px rgba(251, 191, 36, 0.45),
              inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

/* Gradient overlay holding title + meta */
.cg-hero-gradient {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.92) 0%,
    rgba(0, 0, 0, 0.55) 35%,
    rgba(0, 0, 0, 0.15) 65%,
    transparent 100%
  );
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1rem;
  pointer-events: none; /* let clicks fall through to the <a> wrapper */
}

.cg-hero-primary .cg-hero-gradient {
  padding: 1.5rem;
}

.cg-hero-info {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  transform: translateY(0);
  transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.cg-hero-card:hover .cg-hero-info {
  transform: translateY(-2px);
}

/* Frosted-glass category tag */
.cg-tag {
  display: inline-flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.18);
  -webkit-backdrop-filter: blur(8px) saturate(140%);
  backdrop-filter: blur(8px) saturate(140%);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
  font-size: 0.6875rem;
  font-weight: 700;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  width: fit-content;
}

.cg-hero-name {
  font-size: 0.9375rem;
  font-weight: 700;
  color: #ffffff;
  margin: 0;
  line-height: 1.25;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.55);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.cg-hero-primary .cg-hero-name {
  font-size: 1.625rem;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

.cg-hero-rating {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  font-size: 0.75rem;
  color: #fbbf24;
  font-weight: 700;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

.cg-hero-primary .cg-hero-rating {
  font-size: 0.875rem;
}

/* Always-visible circular play button pinned to bottom-right corner */
.cg-hero-play {
  position: absolute;
  bottom: 1rem;
  right: 1rem;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: var(--primary-color, #667eea);
  color: #fff;
  border-radius: 50%;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3),
              inset 0 -2px 0 rgba(0, 0, 0, 0.12);
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1),
              box-shadow 0.3s ease,
              background 0.3s ease;
}

.cg-hero-play svg {
  width: 18px;
  height: 18px;
  margin-left: 2px; /* visual centering of triangle inside circle */
}

.cg-hero-primary .cg-hero-play {
  width: 52px;
  height: 52px;
  bottom: 1.5rem;
  right: 1.5rem;
}

.cg-hero-primary .cg-hero-play svg {
  width: 22px;
  height: 22px;
}

.cg-hero-card:hover .cg-hero-play {
  transform: scale(1.12);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5),
              inset 0 -2px 0 rgba(0, 0, 0, 0.12);
}

@media (prefers-reduced-motion: reduce) {
  .cg-hero-card,
  .cg-hero-img,
  .cg-hero-info,
  .cg-hero-play {
    transition: none !important;
  }
  .cg-hero-card:hover {
    transform: none;
  }
  .cg-hero-card:hover .cg-hero-img,
  .cg-hero-card:hover .cg-hero-play {
    transform: none;
  }
}

/* =============================================
   ROW SECTIONS (Game Rows)
   ============================================= */
.cg-row-section {
  margin-bottom: 1.75rem;
}

.cg-row-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.875rem;
}

.cg-row-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-color);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding-left: 13px;
  position: relative;
}

.cg-row-title::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 1em;
  border-radius: 3px;
  background: var(--primary-gradient, linear-gradient(180deg, #6366f1, #8b5cf6));
}

.cg-row-icon {
  font-size: 1.1rem;
}

.cg-show-more {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 13px 5px 11px;
  border: 1.5px solid var(--border-color, rgba(255,255,255,0.12));
  border-radius: 999px;
  color: var(--text-color, #fff);
  text-decoration: none;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
  flex-shrink: 0;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
}

.cg-show-more:hover {
  border-color: var(--primary-color, #6366f1);
  background: rgba(99, 102, 241, 0.1);
  color: var(--primary-color, #8b8cf8);
}

/* Horizontal scroll wrapper */
.cg-row-scroll {
  position: relative;
  margin: 0 -1.75rem;
  padding: 0 1.75rem;
}

.cg-row {
  display: flex;
  gap: 0.875rem;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;
  padding-bottom: 0.75rem;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--border-color) transparent;
}

.cg-row::-webkit-scrollbar {
  height: 6px;
}

.cg-row::-webkit-scrollbar-track {
  background: transparent;
}

.cg-row::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 3px;
}

.cg-row::-webkit-scrollbar-thumb:hover {
  background: var(--text-60);
}

/* Card sizing within CG rows */
.cg-row .game-card.in-row {
  width: 185px;
  border-radius: 12px;
}

.cg-row .game-card.in-row .game-card-image {
  border-radius: 12px;
}

/* Always show title on row cards */
.cg-row .game-card.in-row .game-card-gradient-overlay {
  opacity: 1;
}

/* Recently played row – slightly smaller */
#cg-recent-row .game-card.in-row {
  width: 155px;
}

/* =============================================
   ALL GAMES GRID
   ============================================= */
.cg-all-section {
  padding-top: 0.5rem;
  border-top: 1px solid var(--border-color);
}

.cg-all-grid.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
  gap: 0.875rem;
}

/* Infinite scroll loader */
.cg-loader {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 2rem;
  color: var(--text-60);
  font-size: 0.875rem;
}

.cg-spinner {
  width: 22px;
  height: 22px;
  border: 3px solid var(--border-color);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: cgSpin 0.8s linear infinite;
}

@keyframes cgSpin {
  to { transform: rotate(360deg); }
}

.cg-end {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  color: var(--text-40, var(--text-60));
  font-size: 0.875rem;
}

/* =============================================
   SEO CONTENT SECTION
   ============================================= */
.cg-seo-section {
  border-top: 1px solid var(--border-color);
  padding-top: 1.5rem;
}

.cg-seo-card {
  background: var(--card-background);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 2rem 2.5rem;
}

.cg-seo-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-color);
  margin: 0 0 1.25rem;
  padding-bottom: 0.875rem;
  border-bottom: 2px solid var(--border-color);
}

/* =============================================
   MOBILE CATEGORY BAR
   ============================================= */
.cg-mobile-cats {
  display: none;
  position: sticky;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--card-background);
  border-top: 1px solid var(--border-color);
  z-index: 50;
  padding: 0.5rem 0;
  box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.08);
}

.cg-mobile-cats-scroll {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding: 0.25rem 1rem;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.cg-mobile-cats-scroll::-webkit-scrollbar {
  display: none;
}

.cg-mob-cat {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.5rem 0.875rem;
  border-radius: 50px;
  background: var(--background-color);
  border: 1px solid var(--border-color);
  color: var(--text-color);
  font-size: 0.8125rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.cg-mob-cat:hover,
.cg-mob-cat.active {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: #fff;
}

/* =============================================
   RESPONSIVE — LARGE SCREENS (1440px+)
   ============================================= */
@media (min-width: 1440px) {
  .cg-main {
    max-width: 1380px; /* prevent unbounded stretch on ultra-wide monitors */
  }

  .cg-hero-grid {
    max-height: 500px;
    grid-template-columns: 1.3fr 1fr 1fr;
  }

  .cg-hero-primary {
    min-height: 400px;
  }

  .cg-hero-secondary {
    min-height: 200px;
  }
}

@media (min-width: 1600px) {
  .cg-hero-grid {
    max-height: 560px;
  }

  .cg-hero-primary {
    min-height: 440px;
  }

  .cg-hero-secondary {
    min-height: 225px;
  }

  .cg-all-grid.games-grid {
    grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
  }
}

/* =============================================
   RESPONSIVE — TABLET
   ============================================= */
@media (max-width: 1200px) {
  .cg-sidebar {
    width: 56px;
    min-width: 56px;
  }

  .cg-sidebar:hover {
    width: 200px;
    min-width: 200px;
  }

  .cg-hero-grid {
    max-height: 360px;
  }

  .cg-hero-primary {
    min-height: 280px;
  }

  .cg-hero-secondary {
    min-height: 130px;
  }
}

@media (max-width: 1024px) {
  .cg-mobile-cats {
    display: block;
  }

  .cg-main {
    padding: 1rem 1.25rem 5rem; /* extra bottom for sticky bar */
  }

  /* Tablet: primary full-width on top, secondaries in a 2-up grid below — shows ALL of them */
  .cg-hero-grid,
  .cg-hero[data-count="1"] .cg-hero-grid,
  .cg-hero[data-count="2"] .cg-hero-grid,
  .cg-hero[data-count="3"] .cg-hero-grid,
  .cg-hero[data-count="4"] .cg-hero-grid {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto;
    grid-auto-rows: 130px;
    max-height: none;
  }

  .cg-hero-primary {
    grid-column: 1 / -1;
    grid-row: 1;
    min-height: 220px;
    max-height: 280px;
  }

  /* Auto-flow secondaries into the 2-col grid; reset the desktop nth-child placements */
  .cg-hero-secondary,
  .cg-hero[data-count="3"] .cg-hero-secondary:nth-child(2),
  .cg-hero[data-count="3"] .cg-hero-secondary:nth-child(3),
  .cg-hero[data-count="4"] .cg-hero-secondary:nth-child(2),
  .cg-hero[data-count="4"] .cg-hero-secondary:nth-child(3),
  .cg-hero[data-count="4"] .cg-hero-secondary:nth-child(4),
  .cg-hero-secondary:nth-child(2),
  .cg-hero-secondary:nth-child(3),
  .cg-hero-secondary:nth-child(4),
  .cg-hero-secondary:nth-child(5) {
    grid-column: auto;
    grid-row: auto;
    display: block;
    min-height: 130px;
  }

  .cg-row-scroll {
    margin: 0 -1.25rem;
    padding: 0 1.25rem;
  }
}

/* =============================================
   RESPONSIVE — MOBILE
   ============================================= */
@media (max-width: 768px) {
  .cg-main {
    padding: 0.75rem 1rem 5rem;
  }

  /* Mobile: turn the hero into a horizontal scroll-snap row so EVERY featured game is reachable */
  .cg-hero {
    margin-left: -1rem;
    margin-right: -1rem;
  }

  .cg-hero-grid,
  .cg-hero[data-count="1"] .cg-hero-grid,
  .cg-hero[data-count="2"] .cg-hero-grid,
  .cg-hero[data-count="3"] .cg-hero-grid,
  .cg-hero[data-count="4"] .cg-hero-grid {
    display: flex;
    grid-template-columns: none;
    grid-template-rows: none;
    grid-auto-rows: auto;
    gap: 0.5rem;
    padding: 0 1rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    max-height: none;
    min-height: 0;
  }

  /* Hide scrollbar */
  .cg-hero-grid::-webkit-scrollbar { display: none; }
  .cg-hero-grid { scrollbar-width: none; }

  /* All hero cards become equal-size scroll-snap items — primary AND secondary */
  .cg-hero-card,
  .cg-hero-primary,
  .cg-hero-secondary,
  .cg-hero[data-count="3"] .cg-hero-secondary:nth-child(2),
  .cg-hero[data-count="3"] .cg-hero-secondary:nth-child(3),
  .cg-hero[data-count="4"] .cg-hero-secondary:nth-child(2),
  .cg-hero[data-count="4"] .cg-hero-secondary:nth-child(3),
  .cg-hero[data-count="4"] .cg-hero-secondary:nth-child(4),
  .cg-hero-secondary:nth-child(2),
  .cg-hero-secondary:nth-child(3),
  .cg-hero-secondary:nth-child(4),
  .cg-hero-secondary:nth-child(5) {
    flex: 0 0 78%;
    max-width: 78%;
    grid-column: auto;
    grid-row: auto;
    display: block;
    aspect-ratio: 16 / 10;
    min-height: 0;
    max-height: none;
    scroll-snap-align: start;
  }

  .cg-hero-gradient {
    opacity: 1; /* Always show on mobile */
  }

  .cg-hero-primary .cg-hero-gradient {
    padding: 1rem;
  }

  /* Mobile: every card uses the smaller (40px) play button */
  .cg-hero-primary .cg-hero-play {
    width: 40px;
    height: 40px;
    bottom: 0.875rem;
    right: 0.875rem;
  }

  .cg-hero-primary .cg-hero-play svg {
    width: 18px;
    height: 18px;
  }

  .cg-hero-name,
  .cg-hero-primary .cg-hero-name {
    font-size: 1rem;
  }

  .cg-row-title {
    font-size: 1.0625rem;
  }

  .cg-row-scroll {
    margin: 0 -1rem;
    padding: 0 1rem;
  }

  .cg-row {
    gap: 0.625rem;
  }

  .cg-row .game-card.in-row {
    width: 140px;
  }

  #cg-recent-row .game-card.in-row {
    width: 120px;
  }

  .cg-all-grid.games-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.625rem;
  }

  .cg-seo-card {
    padding: 1.5rem 1.25rem;
    border-radius: 12px;
  }

  .cg-seo-title {
    font-size: 1.375rem;
  }
}

@media (max-width: 480px) {
  /* On phones the hero is a horizontal scroll row — make each card a touch wider */
  .cg-hero-card,
  .cg-hero-primary,
  .cg-hero-secondary {
    flex-basis: 85%;
    max-width: 85%;
  }

  .cg-row .game-card.in-row {
    width: 120px;
  }

  .cg-all-grid.games-grid {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  }

  .cg-mob-cat {
    padding: 0.4rem 0.75rem;
    font-size: 0.75rem;
  }
}

/* gamehub-browse */
/* Clean Simple Browse & Category Pages - No Filters */

.browse-page {
  min-height: 100vh;
  background: var(--background-color);
}

/* Hero Section */
.browse-hero {
  padding: 2.5rem 2rem 2rem;
  text-align: center;
  background: linear-gradient(160deg, var(--primary-15) 0%, var(--card-background-40) 50%, var(--secondary-15, var(--primary-15)) 100%);
  border-bottom: 1px solid var(--border-color);
  position: relative;
  overflow: hidden;
}

/* Subtle radial glow behind the hero text */
.browse-hero::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 480px;
  height: 480px;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, var(--primary-15) 0%, transparent 70%);
  pointer-events: none;
}

.hero-content {
  max-width: 700px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.875rem;
  background: var(--primary-15);
  border: 1px solid var(--primary-25, var(--primary-15));
  border-radius: 50px;
  color: var(--primary-color);
  font-size: 0.8125rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.hero-badge-emoji {
  font-size: 1rem;
  line-height: 1;
}

.hero-title {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-color);
  margin-bottom: 0.5rem;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.hero-subtitle {
  font-size: 0.9375rem;
  color: var(--text-60);
  margin-bottom: 0;
  line-height: 1.6;
}

/* Hero Stats (game count / page indicator) */
.hero-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  margin-top: 1rem;
}

.hero-stat {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-60);
}

.hero-stat svg {
  color: var(--primary-color);
  flex-shrink: 0;
}

.hero-description {
  max-width: 600px;
  margin: 0 auto;
  text-align: left;
}

.hero-description .description-content {
  font-size: 0.9375rem;
  color: var(--text-60);
}

.hero-description .discover-more-btn {
  margin-top: 1rem;
}

/* Category/Tag Post Content */
.category-post-content {
  background: var(--card-background-40);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.75rem;
  margin-top: 2.5rem;
  margin-bottom: 2rem;
  position: relative;
}

.category-post-content::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  border-radius: 12px 12px 0 0;
  background: linear-gradient(90deg, var(--primary-color, #667eea), var(--secondary-color, #764ba2));
}

.category-post-content .content-wrapper {
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  font-size: 0.9375rem;
  line-height: 1.8;
  color: var(--text-60);
}

.category-post-content .content-wrapper::before {
  display: none;
}

@media (max-width: 768px) {
  .category-post-content {
    padding: 1.25rem;
    margin-top: 2rem;
  }
}

/* Discover More Button Styles */
.discover-more-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem 1.5rem;
  margin-top: 1rem;
  background: var(--card-background-60);
  border: 2px solid var(--primary-color-25);
  border-radius: 8px;
  color: var(--text-color);
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.discover-more-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--primary-gradient);
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 0;
}

.discover-more-btn svg,
.discover-more-btn span {
  position: relative;
  z-index: 1;
  transition: all 0.3s ease;
}

.discover-more-btn svg {
  width: 16px;
  height: 16px;
  stroke: var(--primary-color);
}

.discover-more-btn.expanded svg {
  transform: rotate(180deg);
}

.discover-more-btn:hover {
  border-color: var(--primary-color);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(var(--primary-rgb), 0.25);
}

.discover-more-btn:hover::before {
  opacity: 0.15;
}

.discover-more-btn:hover svg {
  stroke: var(--primary-color);
}

.discover-more-btn:active {
  transform: translateY(0);
  box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.2);
}

/* Description Content Styles */
.description-expandable {
  position: relative;
}

.description-expandable .description-preview {
  margin-bottom: 0;
}

.description-expandable .description-remaining {
  animation: fadeIn 0.4s ease;
  margin-top: 0;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

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


/* Browse Container */
.browse-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem;
}

.layout-fullwidth .browse-container {
  max-width: 100%;
  padding: 2rem 3rem;
}

@media (max-width: 1024px) {
  .layout-fullwidth .browse-container {
    padding: 1.5rem;
  }
}

@media (max-width: 768px) {
  .layout-fullwidth .browse-container {
    padding: 1rem;
  }
}

@media (max-width: 480px) {
  .layout-fullwidth .browse-container {
    padding: 0.75rem;
  }
}

/* Category / Tag Pills */
.category-pills-wrapper {
  position: relative;
  margin-bottom: 1.5rem;
}

/* Fade edges hinting at scrollability */
.category-pills-wrapper::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 48px;
  height: 100%;
  background: linear-gradient(90deg, transparent, var(--background-color));
  pointer-events: none;
  z-index: 1;
}

.category-pills {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding: 0.5rem 0 1rem;
  scrollbar-width: thin;
  scrollbar-color: var(--primary-25) transparent;
}

@media (max-width: 768px) {
  .category-pills-wrapper {
    margin-bottom: 0.875rem;
  }

  .category-pills {
    gap: 0.375rem;
    padding: 0.375rem 0 0.75rem;
    -webkit-overflow-scrolling: touch;
  }

  .cat-pill {
    font-size: 0.8rem;
    padding: 0.4rem 0.875rem;
    gap: 0.3rem;
  }

  .cat-pill .count {
    display: none;
  }
}

@media (max-width: 480px) {
  .category-pills-wrapper {
    margin-bottom: 0.625rem;
  }

  .category-pills {
    gap: 0.3rem;
    padding: 0.25rem 0 0.625rem;
    -webkit-overflow-scrolling: touch;
  }

  .cat-pill {
    font-size: 0.75rem;
    padding: 0.35rem 0.75rem;
    gap: 0.25rem;
    /* keep border-radius: 50px from base — never let pills look circular */
  }
}

.category-pills::-webkit-scrollbar {
  height: 4px;
}

.category-pills::-webkit-scrollbar-thumb {
  background: var(--primary-25);
  border-radius: 2px;
}

.cat-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  background: var(--card-background-60);
  border: 1px solid var(--border-color);
  border-radius: 50px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.8125rem;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.cat-pill:hover {
  background: var(--card-background-80);
  color: var(--text-color);
  border-color: var(--primary-25, var(--border-color));
}

.cat-pill.active {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: #fff;
  box-shadow: 0 2px 8px rgba(var(--primary-rgb, 102, 126, 234), 0.3);
}

.cat-pill .count {
  padding: 0.1rem 0.4rem;
  background: var(--card-background-60);
  border-radius: 12px;
  font-size: 0.6875rem;
}

.cat-pill.active .count {
  background: rgba(255,255,255,0.2);
  color: #fff;
}

/* Games Count Bar */
.games-count-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  background: var(--card-background-40);
  border-radius: 10px;
  margin-bottom: 2rem;
}

.count-display {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.count-display svg {
  color: var(--primary-color);
}

.count-num {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-color);
}

.count-text {
  font-size: 0.875rem;
  color: var(--text-60);
}

.view-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.view-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--card-background-60);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-60);
  cursor: pointer;
  transition: all 0.2s ease;
}

.view-btn:hover {
  color: var(--text-color);
  background: var(--card-background-80);
}

.view-btn.active {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: var(--text-color);
}

.sort-select {
  padding: 0.5rem 2rem 0.5rem 0.875rem;
  background: var(--card-background-60);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-color);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 6L11 1' stroke='white' stroke-opacity='0.6' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
}

.sort-select option {
  background: var(--card-background);
}

/* Games Section */
.games-section {
  margin-bottom: 3rem;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-color);
}

.section-title svg {
  color: var(--primary-color);
}

.see-all {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  color: var(--primary-color);
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 600;
  transition: gap 0.2s ease;
}

.see-all:hover {
  gap: 0.625rem;
}

.carousel-arrows {
  display: flex;
  gap: 0.5rem;
}

.arrow-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--card-background-60);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-color);
  cursor: pointer;
  transition: all 0.2s ease;
}

.arrow-btn:hover {
  background: var(--primary-color);
  border-color: var(--primary-color);
}

/* Games Grid */
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1.25rem;
}

/* Game Cards */
.game-card {
  display: block;
  background: var(--card-background);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  overflow: hidden;
  text-decoration: none;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.game-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12), 0 0 0 1px var(--primary-25);
  border-color: var(--primary-color);
}

.game-card-image {
  position: relative;
  width: 100%;
  padding-bottom: 100%;
  background: rgba(0, 0, 0, 0.3);
  overflow: hidden;
}

.game-card-image img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.game-card:hover .game-card-image img {
  transform: scale(1.05);
}

.game-badge {
  position: absolute;
  top: 0.625rem;
  right: 0.625rem;
  padding: 0.25rem 0.625rem;
  border-radius: 50px;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  z-index: 2;
}

.badge-new {
  background: rgb(16, 185, 129);
  color: #fff;
}

.badge-hot {
  background: rgb(239, 68, 68);
  color: #fff;
}

.badge-trending {
  background: rgb(245, 158, 11);
  color: #fff;
}

.game-card-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.7) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 2;
}

.game-card:hover .game-card-overlay {
  opacity: 1;
}

.play-button {
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  border: 3px solid var(--text-color);
  border-radius: 50%;
  color: var(--text-color);
  box-shadow: 0 6px 24px var(--primary-25), 0 0 0 0 var(--primary-25);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  cursor: pointer;
}

.play-button svg {
  width: 24px;
  height: 24px;
  margin-left: 2px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.game-card:hover .play-button {
  transform: scale(1.15);
  box-shadow: 0 8px 32px var(--primary-25), 0 0 0 8px var(--primary-20);
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

.game-card-content {
  padding: 0.875rem 1rem;
  background: var(--card-background);
}

.game-card-title {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text-color);
  margin-bottom: 0.5rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  letter-spacing: 0.01em;
  line-height: 1.3;
}

.game-card-category {
  display: inline-block;
  padding: 0.25rem 0.625rem;
  background: var(--primary-15, rgba(124, 92, 252, 0.1));
  border: none;
  border-radius: 6px;
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--primary-color);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.game-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8125rem;
}

.game-card-rating {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.game-card-rating .stars {
  color: var(--accent-color);
  font-size: 0.9375rem;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
  filter: drop-shadow(0 0 3px var(--accent-color));
}

.game-card-rating .rating-value {
  color: var(--text-color);
  font-weight: 700;
  font-size: 0.9375rem;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.game-card-plays {
  color: var(--text-80);
  font-size: 0.8125rem;
  font-weight: 600;
}

/* Hover Style Game Cards */
.game-card-hover {
  aspect-ratio: auto;
}

.game-card-hover .game-card-image {
  height: auto;
  padding-bottom: 100%;
}

.game-card-hover .game-card-overlay {
  background: rgba(0, 0, 0, 0.7);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.game-card-hover:hover .game-card-overlay {
  opacity: 1;
}

.game-card-hover .hover-content {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  transition: opacity 0.3s ease;
  text-align: center;
}

.game-card-hover:hover .hover-content {
  opacity: 1;
}

.game-card-hover .hover-title-wrapper {
  text-align: center;
  width: 100%;
}

.game-card-hover .hover-title {
  font-size: 0.875rem !important;
  font-weight: 600 !important;
  color: #fff !important;
  margin: 0 !important;
  line-height: 1.4 !important;
  text-shadow: none !important;
  letter-spacing: normal !important;
  white-space: normal !important;
  text-overflow: clip !important;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}

.game-card-hover .hover-category {
  display: block;
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.7);
  margin-top: 0.25rem;
}

/* Always-visible title area for hover cards */
.game-card-content-hover {
  padding: 0.625rem 0.75rem;
  background: var(--card-background);
}

.game-card-content-hover .game-card-title {
  font-size: 0.8125rem;
  margin-bottom: 0.25rem;
}

.game-card-content-hover .game-card-category {
  margin-bottom: 0;
  font-size: 0.625rem;
}

.game-card-hover .hover-meta {
  display: flex;
  justify-content: center;
  margin-top: 0.5rem;
}

.game-card-hover .hover-rating {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  color: #fff;
}

.game-card-hover .hover-rating .stars {
  color: #fbbf24;
  font-size: 0.7rem;
}

.game-card-hover .hover-play-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  margin-top: 0.75rem;
  padding: 0.5rem 1rem;
  background: var(--primary-color);
  border-radius: 20px;
  color: #fff !important;
  font-size: 0.75rem;
  font-weight: 600;
  transition: background 0.2s ease;
}

.game-card-hover .hover-play-button span {
  color: #fff !important;
}

.game-card-hover .hover-play-button svg {
  width: 16px;
  height: 16px;
}

.game-card-hover:hover .hover-play-button {
  background: var(--primary-dark, var(--primary-color));
}

/* =============================================
   Minimal Style – image-only with gradient title
   ============================================= */
.game-card-minimal {
  border-radius: 16px;
}

.game-card-minimal .game-card-image {
  border-radius: 16px;
}

/* Gradient overlay with title — visible on all card styles */
.game-card .game-card-gradient-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1.75rem 0.75rem 0.5rem;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.35) 55%, transparent 100%);
  z-index: 2;
  display: flex;
  align-items: flex-end;
  opacity: 0;
  transition: opacity 0.25s ease;
}

/* Minimal: always visible gradient */
.game-card-minimal .game-card-gradient-overlay {
  opacity: 1;
}

/* All other styles: show gradient on hover */
.game-card:hover .game-card-gradient-overlay {
  opacity: 1;
}

.game-card .game-card-gradient-overlay .game-card-title {
  color: #fff;
  font-size: 0.8125rem;
  font-weight: 600;
  margin: 0;
  line-height: 1.3;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.game-card-minimal .game-card-overlay {
  opacity: 0;
  transition: opacity 0.3s ease;
}

.game-card-minimal:hover .game-card-overlay {
  opacity: 1;
}

/* =============================================
   Compact Style – title only below image
   ============================================= */
.game-card-compact .game-card-content-compact {
  padding: 0.5rem 0.75rem 0.625rem;
  background: var(--card-background);
}

.game-card-compact .game-card-content-compact .game-card-title {
  font-size: 0.8125rem;
  font-weight: 600;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* =============================================
   Detailed Style – full metadata below image
   ============================================= */
.game-card-detailed .game-card-content-detailed {
  padding: 0.75rem 0.875rem;
  background: var(--card-background);
}

.game-card-detailed .game-card-content-detailed .game-card-title {
  font-size: 0.875rem;
  font-weight: 700;
  margin-bottom: 0.375rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.game-card-detailed .game-card-content-detailed .game-card-category {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  background: var(--primary-15, rgba(124, 92, 252, 0.1));
  border-radius: 5px;
  font-size: 0.625rem;
  font-weight: 600;
  color: var(--primary-color);
  margin-bottom: 0.375rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.game-card-detailed .game-card-content-detailed .game-card-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.75rem;
}

.game-card-detailed .game-card-content-detailed .game-card-rating {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.game-card-detailed .game-card-content-detailed .game-card-rating .stars {
  color: var(--accent-color);
  font-size: 0.8125rem;
}

.game-card-detailed .game-card-content-detailed .game-card-rating .rating-value {
  font-weight: 700;
  font-size: 0.8125rem;
  color: var(--text-color);
}

.game-card-detailed .game-card-content-detailed .game-card-plays {
  color: var(--text-80);
  font-size: 0.75rem;
  font-weight: 600;
}

.game-card-detailed .game-card-content-detailed .game-card-date {
  color: var(--text-60);
  font-size: 0.6875rem;
  margin-left: auto;
}

/* =============================================
   Row Context – cards inside horizontal scroll
   ============================================= */
.game-card.in-row {
  flex: 0 0 auto;
  width: 200px;
  border-radius: 14px;
}

.game-card.in-row .game-card-image {
  padding-bottom: 100%; /* square */
}

/* Always show title gradient on row cards – readable at a glance */
.game-card.in-row .game-card-gradient-overlay {
  opacity: 1;
}

.game-card.in-row .game-card-gradient-overlay .game-card-title {
  transform: translateY(0);
  opacity: 1;
}

.game-card.in-row .game-card-content,
.game-card.in-row .game-card-content-hover,
.game-card.in-row .game-card-content-compact,
.game-card.in-row .game-card-content-detailed {
  padding: 0.4rem 0.5rem;
}

.game-card.in-row .game-card-title {
  font-size: 0.75rem;
}

.game-card.in-row .game-card-category {
  font-size: 0.5625rem;
  padding: 0.125rem 0.375rem;
}

.game-card.in-row .game-card-meta {
  font-size: 0.6875rem;
}

.game-card.in-row .game-card-rating .stars {
  font-size: 0.75rem;
}

.game-card.in-row .game-card-rating .rating-value {
  font-size: 0.75rem;
}

/* Recently played row – smaller cards */
#recently-played-section .game-card.in-row {
  width: 155px;
}

/* Row responsive */
@media (max-width: 768px) {
  .game-card.in-row {
    width: 160px;
  }
  #recently-played-section .game-card.in-row {
    width: 130px;
  }
}

/* Empty State */
.empty-state {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  text-align: center;
}

.empty-state svg {
  color: var(--text-60);
  margin-bottom: 1.5rem;
}

.empty-state h3 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-color);
  margin-bottom: 0.5rem;
}

.empty-state p {
  color: var(--text-60);
  margin-bottom: 1.5rem;
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.375rem;
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
}

.pagination a,
.pagination span {
  min-width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.75rem;
  background: var(--card-background-60);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.875rem;
  transition: all 0.2s ease;
}

.pagination a:hover {
  background: var(--card-background-80);
  color: var(--text-color);
  border-color: var(--primary-25, var(--border-color));
}

.pagination .current {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: #fff;
  box-shadow: 0 2px 8px rgba(var(--primary-rgb, 102, 126, 234), 0.3);
}

.pagination .prev,
.pagination .next {
  gap: 0.25rem;
  font-weight: 600;
}

.pagination svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* Load More Button - Auto Scroll Loading */
.load-more-container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
  min-height: 60px;
}

.load-more-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.5rem;
  background: transparent;
  border: none;
  border-radius: 50px;
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: default;
  transition: all 0.3s ease;
}

.load-more-btn:disabled {
  opacity: 1;
  cursor: default;
}

.load-more-text {
  display: none;
}

.load-more-spinner {
  animation: spin 1s linear infinite;
  color: var(--primary-color);
}

/* Responsive */
@media (max-width: 1024px) {
  .browse-container {
    padding: 1.5rem;
  }

  .games-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1rem;
  }
}

@media (max-width: 768px) {
  .browse-hero {
    padding: 2rem 1.5rem;
  }

  .hero-title {
    font-size: 1.5rem;
  }

  .hero-subtitle {
    font-size: 0.875rem;
  }

  .browse-container {
    padding: 1rem;
  }

  .games-count-bar {
    flex-direction: column;
    gap: 1rem;
    align-items: stretch;
  }

  .view-controls {
    width: 100%;
    justify-content: space-between;
  }

  .sort-select {
    flex: 1;
  }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  /* Exactly 3 cards per row on mobile */
  .games-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.625rem;
  }

  /* Tighten card content so 3 columns look clean */
  .game-card-content {
    padding: 0.375rem 0.5rem 0.5rem;
  }

  .game-card-title {
    font-size: 0.7rem;
    line-height: 1.2;
    -webkit-line-clamp: 2;
  }

  .game-card-category,
  .game-card-meta {
    display: none;
  }
}

@media (max-width: 480px) {
  .browse-hero {
    padding: 1.75rem 1rem 1.5rem;
  }

  .browse-hero::before {
    width: 300px;
    height: 300px;
  }

  .hero-title {
    font-size: 1.5rem;
  }

  .hero-stats {
    gap: 0.75rem;
  }

  .hero-stat {
    font-size: 0.75rem;
  }

  /* Keep 3 columns on small phones, tighten gap */
  .games-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
  }

  .section-title {
    font-size: 1.25rem;
  }
}

/* ═══════════════════════════════════════════════
   Categories Page
   ═══════════════════════════════════════════════ */

/* ── Grid ── */
.catpage-grid {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 1.25rem;
  margin-bottom: 3rem;
}

.catpage-grid .catpage-card {
  flex: 1 1 0;
  min-width: 0;
}

/* ── Card ── */
.catpage-card {
  display: flex;
  flex-direction: column;
  background: var(--card-background);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  overflow: hidden;
  text-decoration: none;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.catpage-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.3);
  border-color: var(--primary-25);
}

/* ── Mosaic / Image area ── */
.catpage-card-mosaic {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--card-background-60);
}

/* Single image fallback */
.catpage-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.catpage-card:hover .catpage-card-img {
  transform: scale(1.05);
}

/* 4-image mosaic grid */
.catpage-mosaic-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  width: 100%;
  height: 100%;
  gap: 2px;
}

.catpage-mosaic-grid img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.catpage-card:hover .catpage-mosaic-grid img {
  transform: scale(1.06);
}

/* Placeholder when no images */
.catpage-card-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--primary-15) 0%, var(--card-background) 100%);
}

/* Dark overlay on image area */
.catpage-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.15) 0%, transparent 50%);
  pointer-events: none;
  transition: background 0.25s ease;
}

.catpage-card:hover .catpage-card-overlay {
  background: linear-gradient(to top, rgba(0,0,0,0.25) 0%, transparent 60%);
}

/* ── Info bar ── */
.catpage-card-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
}

.catpage-card-emoji {
  font-size: 1.75rem;
  line-height: 1;
  flex-shrink: 0;
}

.catpage-card-text {
  flex: 1;
  min-width: 0;
}

.catpage-card-name {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text-color);
  margin: 0;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.catpage-card-count {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-40);
  line-height: 1;
}

.catpage-card-chevron {
  flex-shrink: 0;
  color: var(--text-40);
  transition: color 0.2s ease, transform 0.2s ease;
}

.catpage-card:hover .catpage-card-chevron {
  color: var(--primary-color);
  transform: translateX(3px);
}

/* ── Empty state ── */
.catpage-empty {
  text-align: center;
  padding: 5rem 2rem;
}

.catpage-empty-icon {
  font-size: 3rem;
  display: block;
  margin-bottom: 1rem;
}

.catpage-empty h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-color);
  margin: 0 0 0.5rem;
}

.catpage-empty p {
  color: var(--text-60);
  font-size: 0.9375rem;
  margin: 0;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .catpage-grid {
    gap: 0.875rem;
  }

  .catpage-grid .catpage-card {
    flex: 1 1 180px;
  }

  .catpage-card-info {
    padding: 0.75rem 0.875rem;
  }

  .catpage-card-emoji {
    font-size: 1.5rem;
  }
}

@media (max-width: 480px) {
  .catpage-grid {
    flex-wrap: wrap;
    gap: 0.75rem;
  }

  .catpage-grid .catpage-card {
    flex: 1 1 calc(50% - 0.375rem);
  }

  .catpage-card {
    border-radius: 12px;
  }

  .catpage-card-info {
    padding: 0.625rem 0.75rem;
    gap: 0.5rem;
  }

  .catpage-card-emoji {
    font-size: 1.25rem;
  }

  .catpage-card-name {
    font-size: 0.8125rem;
  }

  .catpage-card-count {
    font-size: 0.6875rem;
  }

  .catpage-card-chevron {
    display: none;
  }
}

.page-content {
  margin-top: 3rem;
  padding: 2.5rem;
  background: var(--card-background);
  border-radius: 16px;
  color: var(--text-80);
  line-height: 1.8;
  font-size: 1rem;
  border: 2px solid var(--border-color);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  position: relative;
}

.page-content::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
  border-radius: 16px 16px 0 0;
}

.page-content h1,
.page-content h2,
.page-content h3,
.page-content h4 {
  color: var(--text-color);
  font-weight: 700;
  margin-top: 2rem;
  margin-bottom: 1rem;
  position: relative;
  padding-left: 1.75rem;
}

.page-content h1 {
  font-size: 2rem;
  margin-top: 0;
}

.page-content h1::before {
  content: '🏆';
  position: absolute;
  left: 0;
  font-size: 1.5rem;
}

.page-content h2 {
  font-size: 1.5rem;
}

.page-content h2::before {
  content: '⭐';
  position: absolute;
  left: 0;
  font-size: 1.25rem;
  top: 0.1em;
}

.page-content h3 {
  font-size: 1.25rem;
}

.page-content h3::before {
  content: '💫';
  position: absolute;
  left: 0;
  font-size: 1.1rem;
  top: 0.2em;
}

.page-content p {
  margin-bottom: 1.5rem;
}

.page-content p:first-of-type {
  font-size: 1.125rem;
  color: var(--text-color);
  font-weight: 500;
}

.page-content a {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 600;
  transition: all 0.2s ease;
}

.page-content a:hover {
  color: var(--secondary-color);
  text-decoration: underline;
}

.page-content ul,
.page-content ol {
  margin-bottom: 2rem;
  padding-left: 0;
  list-style: none;
}

.page-content ul li,
.page-content ol li {
  margin-bottom: 0.875rem;
  padding-left: 2.25rem;
  position: relative;
  line-height: 1.7;
}

.page-content ul li::before {
  content: '🎮';
  position: absolute;
  left: 0;
  font-size: 1.1rem;
}

.page-content ol {
  counter-reset: page-counter;
}

.page-content ol li {
  counter-increment: page-counter;
}

.page-content ol li::before {
  content: counter(page-counter);
  position: absolute;
  left: 0;
  top: 0;
  width: 1.75rem;
  height: 1.75rem;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: #ffffff;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.page-content strong,
.page-content b {
  color: var(--primary-color);
  font-weight: 700;
}

.page-content blockquote {
  margin: 2rem 0;
  padding: 1.5rem 1.5rem 1.5rem 3rem;
  background: var(--primary-color-10);
  border-radius: 12px;
  border-left: 4px solid var(--primary-color);
  color: var(--text-color);
  font-style: italic;
  position: relative;
}

.page-content blockquote::before {
  content: '💬';
  position: absolute;
  left: 1rem;
  top: 1.5rem;
  font-size: 1.5rem;
}

/* Category Post Content Section */
/* Content styles for .category-post-content moved to post-content.css for unified styling */

.content-wrapper {
  width: 100%;
  padding: 2.5rem;
  background: var(--card-background);
  border-radius: 16px;
  color: var(--text-80);
  line-height: 1.8;
  font-size: 1rem;
  border: 2px solid var(--border-color);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  position: relative;
}

.content-wrapper::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
  border-radius: 16px 16px 0 0;
}

.content-wrapper h1,
.content-wrapper h2,
.content-wrapper h3,
.content-wrapper h4,
.content-wrapper h5,
.content-wrapper h6 {
  color: var(--text-color);
  font-weight: 700;
  margin-top: 2rem;
  margin-bottom: 1rem;
  line-height: 1.3;
  position: relative;
  padding-left: 1.75rem;
}

.content-wrapper h1 {
  font-size: 2rem;
  margin-top: 0;
}

.content-wrapper h1::before {
  content: '🏆';
  position: absolute;
  left: 0;
  font-size: 1.5rem;
}

.content-wrapper h2 {
  font-size: 1.5rem;
}

/* h2::before style moved to post-content.css for unified styling */

.content-wrapper h3 {
  font-size: 1.25rem;
}

.content-wrapper h3::before {
  content: '💫';
  position: absolute;
  left: 0;
  font-size: 1.1rem;
  top: 0.2em;
}

.content-wrapper h4 {
  font-size: 1.1rem;
  padding-left: 0;
}

.content-wrapper p {
  margin-bottom: 1.5rem;
}

.content-wrapper p:last-child {
  margin-bottom: 0;
}

.content-wrapper p:first-of-type {
  font-size: 1.125rem;
  color: var(--text-color);
  font-weight: 500;
}

.content-wrapper a {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 600;
  transition: all 0.2s ease;
}

.content-wrapper a:hover {
  color: var(--secondary-color);
  text-decoration: underline;
}

.content-wrapper ul,
.content-wrapper ol {
  margin-bottom: 1.75rem;
  padding-left: 0;
  list-style: none;
}

.content-wrapper ul li,
.content-wrapper ol li {
  margin-bottom: 0.875rem;
  padding-left: 2.25rem;
  position: relative;
  line-height: 1.7;
}

.content-wrapper ul li::before {
  content: '🎮';
  position: absolute;
  left: 0;
  font-size: 1.1rem;
}

.content-wrapper ol {
  counter-reset: content-counter;
}

.content-wrapper ol li {
  counter-increment: content-counter;
}

.content-wrapper ol li::before {
  content: counter(content-counter);
  position: absolute;
  left: 0;
  top: 0;
  width: 1.75rem;
  height: 1.75rem;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: #ffffff;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.content-wrapper strong,
.content-wrapper b {
  color: var(--primary-color);
  font-weight: 700;
}

.content-wrapper em,
.content-wrapper i {
  font-style: italic;
  color: var(--text-secondary);
}

.content-wrapper blockquote {
  margin: 2rem 0;
  padding: 1.5rem 1.5rem 1.5rem 3rem;
  background: var(--primary-color-10);
  border-radius: 12px;
  border-left: 4px solid var(--primary-color);
  color: var(--text-color);
  font-style: italic;
  position: relative;
}

.content-wrapper blockquote::before {
  content: '💬';
  position: absolute;
  left: 1rem;
  top: 1.5rem;
  font-size: 1.5rem;
}

.content-wrapper code {
  background: var(--card-background-80);
  color: var(--primary-color);
  padding: 0.25em 0.5em;
  border-radius: 6px;
  font-family: 'Courier New', monospace;
  font-size: 0.9em;
  border: 1px solid var(--primary-color-20);
}

.content-wrapper pre {
  background: var(--card-background-80);
  padding: 1.5rem;
  border-radius: 12px;
  overflow-x: auto;
  border: 1px solid var(--border-color);
  margin: 2rem 0;
}

.content-wrapper pre code {
  background: none;
  padding: 0;
  border: none;
}

.content-wrapper img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 1.5rem 0;
}

.content-wrapper table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
}

.content-wrapper table th,
.content-wrapper table td {
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  text-align: left;
}

.content-wrapper table th {
  background: var(--primary-20);
  color: var(--text-color);
  font-weight: 600;
}

.content-wrapper table tr:nth-child(even) {
  background: rgba(0, 0, 0, 0.2);
}

.content-wrapper hr {
  border: none;
  border-top: 1px solid var(--border-color);
  margin: 2rem 0;
}

/* Responsive */
@media (max-width: 768px) {
  .content-wrapper {
    padding: 1.5rem;
    font-size: 0.9375rem;
  }

  .content-wrapper h1 {
    font-size: 1.75rem;
  }

  .content-wrapper h2 {
    font-size: 1.5rem;
  }

  .content-wrapper h3 {
    font-size: 1.25rem;
  }
}

@media (max-width: 480px) {
  .category-post-content {
    margin-top: 3rem;
    padding-top: 2rem;
  }

  .content-wrapper {
    padding: 1.25rem;
  }
}

.game-card-date {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  color: var(--text-60);
  font-size: 0.8125rem;
}

.game-card-date span {
  color: var(--text-secondary);
}

/* Browse Container with Sidebar Layout */
.browse-container {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
}

.browse-main {
  flex: 1;
  min-width: 0;
}

.browse-sidebar {
  width: 340px;
  flex-shrink: 0;
  position: sticky;
  top: 100px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
}

.browse-sidebar::-webkit-scrollbar {
  width: 6px;
}

.browse-sidebar::-webkit-scrollbar-track {
  background: var(--card-background-60);
  border-radius: 3px;
}

.browse-sidebar::-webkit-scrollbar-thumb {
  background: var(--primary-25);
  border-radius: 3px;
}

.browse-sidebar::-webkit-scrollbar-thumb:hover {
  background: var(--primary-25);
}

/* Responsive sidebar */
@media (max-width: 1200px) {
  .browse-sidebar {
    width: 300px;
  }
}

@media (max-width: 1024px) {
  .browse-container {
    flex-direction: column;
  }

  .browse-main {
    width: 100%;
  }

  .browse-sidebar {
    width: 100%;
    position: relative;
    top: 0;
    max-height: none;
    overflow-y: visible;
  }
}

/* List View Styles */
.games-grid.list-view {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.games-grid.list-view .game-card {
  display: flex;
  flex-direction: row;
  width: 100%;
  max-width: 100%;
}

.games-grid.list-view .game-card-image {
  width: 200px;
  flex-shrink: 0;
  padding-bottom: 0;
  height: 150px;
}

.games-grid.list-view .game-card-image img {
  position: relative;
  height: 100%;
  width: 100%;
}

.games-grid.list-view .game-card-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 1.5rem;
}

.games-grid.list-view .game-card-title {
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
}

.games-grid.list-view .game-card-category {
  margin-bottom: 1rem;
}

.games-grid.list-view .game-card-meta {
  margin-top: auto;
}

/* View button styles */
.view-btn {
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0.5rem;
  background: var(--card-background-60);
  border: 1px solid var(--border-color);
  border-radius: 6px;
}

.view-btn:hover {
  background: var(--card-background-60);
  border-color: var(--primary-25);
}

.view-btn.active {
  background: var(--primary-25);
  border-color: var(--primary-25);
}

.view-btn.active svg {
  color: var(--primary-color);
}

@media (max-width: 768px) {
  .games-grid.list-view .game-card {
    flex-direction: column;
  }

  .games-grid.list-view .game-card-image {
    width: 100%;
    height: 0;
    padding-bottom: 100%;
  }

  .games-grid.list-view .game-card-image img {
    position: absolute;
    top: 0;
    left: 0;
  }
}

/* Browse Sidebar Widget Styles */
.browse-sidebar .sidebar-widget,
.browse-sidebar .widget {
  background: var(--card-background-60);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(10px);
}

.browse-sidebar .sidebar-widget:last-child,
.browse-sidebar .widget:last-child {
  margin-bottom: 0;
}

.browse-sidebar .widget-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-color);
  margin: 0 0 1.25rem 0;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--primary-25);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

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

.browse-sidebar li {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-80);
}

.browse-sidebar li:last-child {
  border-bottom: none;
}

.browse-sidebar a {
  color: var(--text-80);
  text-decoration: none;
  transition: all 0.2s ease;
  display: inline-block;
}

.browse-sidebar a:hover {
  color: var(--text-color);
  padding-left: 4px;
  text-shadow: 0 0 8px var(--primary-25);
}

/* Widget Text Content */
.browse-sidebar .textwidget {
  color: var(--text-80);
  line-height: 1.6;
  font-size: 0.9375rem;
}

.browse-sidebar .textwidget p {
  margin-bottom: 1rem;
}

.browse-sidebar .textwidget p:last-child {
  margin-bottom: 0;
}

/* Widget Search Form */
.browse-sidebar .search-form {
  display: flex;
  gap: 0.5rem;
}

.browse-sidebar .search-field {
  flex: 1;
  padding: 0.625rem;
  background: var(--card-background-60);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-color);
  font-size: 0.875rem;
}

.browse-sidebar .search-field::placeholder {
  color: var(--text-60);
}

.browse-sidebar .search-submit {
  padding: 0.625rem 1rem;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  border: none;
  border-radius: 6px;
  color: var(--text-color);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.browse-sidebar .search-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--primary-25);
}

/* Widget Categories */
.browse-sidebar .cat-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.browse-sidebar .cat-item .count {
  background: var(--primary-25);
  padding: 0.125rem 0.5rem;
  border-radius: 12px;
  font-size: 0.75rem;
  color: var(--text-color);
}

/* Widget Tag Cloud */
.browse-sidebar .tagcloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.browse-sidebar .tagcloud a {
  padding: 0.375rem 0.75rem;
  background: var(--primary-20);
  border: 1px solid var(--primary-25);
  border-radius: 6px;
  font-size: 0.8125rem !important;
  color: var(--text-color);
  transition: all 0.2s ease;
}

.browse-sidebar .tagcloud a:hover {
  background: var(--primary-25);
  border-color: var(--primary-25);
  color: var(--text-color);
  transform: translateY(-2px);
  padding-left: 0.75rem;
}

/* Widget Calendar */
.browse-sidebar .calendar_wrap table {
  width: 100%;
  border-collapse: collapse;
  color: var(--text-80);
}

.browse-sidebar .calendar_wrap th,
.browse-sidebar .calendar_wrap td {
  padding: 0.5rem;
  text-align: center;
  border: 1px solid var(--border-color);
}

.browse-sidebar .calendar_wrap caption {
  color: var(--text-color);
  font-weight: 600;
  padding: 0.5rem;
  margin-bottom: 0.5rem;
}

/* Widget RSS */
.browse-sidebar .rss-date {
  display: block;
  font-size: 0.75rem;
  color: var(--text-60);
  margin-top: 0.25rem;
}

.browse-sidebar .rssSummary {
  margin-top: 0.5rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* Tag Page Specific Styles */
.tag-page .hero-badge {
  background: rgba(139, 92, 246, 0.15) !important;
  color: #8b5cf6 !important;
}

.tag-page .hero-badge svg {
  color: #8b5cf6 !important;
}

.tag-hero {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.08) 0%, rgba(139, 92, 246, 0.08) 100%) !important;
}

.tag-page .cat-pill {
  background: var(--card-background) !important;
  border-color: var(--border-color) !important;
  color: var(--text-secondary) !important;
}

.tag-page .cat-pill:hover {
  background: rgba(139, 92, 246, 0.1) !important;
  border-color: #8b5cf6 !important;
  color: #8b5cf6 !important;
  transform: translateY(-2px);
}

.tag-page .cat-pill.active {
  background: #8b5cf6 !important;
  border-color: #8b5cf6 !important;
  color: #fff !important;
}

.tag-page .cat-pill .count {
  background: rgba(0, 0, 0, 0.1) !important;
  padding: 0.125rem 0.5rem;
  border-radius: 50px;
  font-size: 0.75rem;
  color: inherit !important;
}

.tag-page .cat-pill.active .count {
  background: rgba(255, 255, 255, 0.25) !important;
  color: #fff !important;
}

.tag-page .section-title svg {
  color: #8b5cf6 !important;
}

.tag-page .count-display svg {
  color: #8b5cf6 !important;
}

/* Fix game card on tag pages */
.tag-page .game-card {
  background: var(--card-background-60) !important;
}

.tag-page .game-card-content {
  background: var(--card-background) !important;
}

.tag-page .game-card-title {
  color: var(--text-color) !important;
  background: transparent !important;
}

.tag-page .game-card-category {
  color: var(--text-60) !important;
  background: transparent !important;
}

.tag-page .game-card-meta {
  background: transparent !important;
}

.tag-page .game-card-rating {
  background: transparent !important;
}

.tag-page .game-card-plays {
  background: transparent !important;
}
/* gamehub-sidebar-nav */
/* ═══════════════════════════════════════════════
   Left Sidebar Navigation — Premium Redesign
   ═══════════════════════════════════════════════ */

/* ── Shell ───────────────────────────────────── */
.left-sidebar {
  position: fixed;
  top: 64px;
  left: 0;
  width: 68px;
  height: calc(100vh - 64px);
  background: var(--card-background);
  border-right: 1px solid var(--border-color);
  z-index: 9999;
  transition: width 0.28s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 0.28s ease;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Expand on hover (unless just closed) */
.left-sidebar:hover:not(.manually-closed) {
  width: 240px;
  box-shadow: 6px 0 32px rgba(0, 0, 0, 0.18);
}

/* Locked-open state */
.left-sidebar.active {
  width: 240px;
  box-shadow: 6px 0 32px rgba(0, 0, 0, 0.18);
}

/* ── Overlay ─────────────────────────────────── */
.sidebar-overlay {
  position: fixed;
  top: 64px;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  z-index: 9998;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  pointer-events: none;
  display: none;
}

.sidebar-overlay.active {
  display: block;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* ── Header / Logo area (hidden on desktop — header is above) */
.sidebar-header {
  flex-shrink: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--border-color);
  position: relative;
  min-height: 64px;
}

.sidebar-logo {
  height: 30px;
  width: auto;
  display: flex;
  align-items: center;
  text-decoration: none;
  color: var(--text-color);
  font-weight: 700;
  font-size: 1.1rem;
  opacity: 0;
  transform: translateX(-8px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  position: absolute;
  left: -100px;
  white-space: nowrap;
}

.sidebar-logo img {
  height: 28px;
  width: auto;
}

.left-sidebar:hover .sidebar-logo,
.left-sidebar.active .sidebar-logo {
  opacity: 1;
  transform: translateX(0);
  position: relative;
  left: 0;
}

/* ── Close button ────────────────────────────── */
.sidebar-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: var(--text-60);
  cursor: pointer;
  transition: all 0.2s ease;
  opacity: 0;
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  z-index: 10002;
}

.left-sidebar:hover .sidebar-close,
.left-sidebar.active .sidebar-close {
  opacity: 1;
  pointer-events: auto;
}

.sidebar-close:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

/* ── Scrollable nav area ─────────────────────── */
.sidebar-nav {
  flex: 1;
  padding: 0.5rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  overflow: hidden;          /* collapsed: clip items that don't fit */
  min-height: 0;
  scrollbar-width: thin;
  scrollbar-color: transparent transparent;
}

.left-sidebar:hover .sidebar-nav,
.left-sidebar.active .sidebar-nav {
  overflow-y: auto;          /* expanded: scroll to reveal all items */
  overflow-x: hidden;
  scrollbar-color: rgba(150,150,150,0.5) transparent;
}

.sidebar-nav::-webkit-scrollbar { width: 0; }
.left-sidebar:hover .sidebar-nav::-webkit-scrollbar,
.left-sidebar.active .sidebar-nav::-webkit-scrollbar { width: 5px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb {
  background: transparent;
  border-radius: 4px;
}
.left-sidebar:hover .sidebar-nav::-webkit-scrollbar-thumb,
.left-sidebar.active .sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(150,150,150,0.45);
}
.sidebar-nav::-webkit-scrollbar-thumb:hover {
  background: rgba(150,150,150,0.7);
}

/* ── Section titles (collapsed = hidden) ─────── */
.sidebar-section-title {
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-60);
  padding: 0.5rem 0.875rem 0.25rem;
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  transition: opacity 0.2s ease 0.08s, max-height 0.25s ease, padding 0.25s ease;
  white-space: nowrap;
  user-select: none;
}

.left-sidebar:hover .sidebar-section-title,
.left-sidebar.active .sidebar-section-title {
  opacity: 1;
  max-height: 40px;
  padding: 0.5rem 1.15rem 0.25rem;
}

/* ── Nav item (link) ─────────────────────────── */
.sidebar-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 0.5rem;
  margin: 0 0.5rem;
  min-height: 10px;
  box-sizing: border-box;
  border-radius: 10px;
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 0.8125rem;
  font-weight: 500;
  transition: background 0.18s ease,
              color 0.18s ease,
              padding 0.28s cubic-bezier(0.4, 0, 0.2, 1),
              margin 0.28s cubic-bezier(0.4, 0, 0.2, 1),
              min-height 0.28s cubic-bezier(0.4, 0, 0.2, 1),
              justify-content 0.28s ease,
              transform 0.18s ease;
  white-space: nowrap;
  overflow: hidden;
  justify-content: center;
  position: relative;
}

.left-sidebar:hover .sidebar-item,
.left-sidebar.active .sidebar-item {
  padding: 0.5rem 0.75rem;
  margin: 0 0.625rem;
  min-height: 30px;
  justify-content: flex-start;
}

/* Hover state */
.sidebar-item:hover {
  background: var(--primary-color-10, rgba(99, 102, 241, 0.08));
  color: var(--text-color);
  transform: translateX(2px);
}

/* Active state — CrazyGames-style subtle highlight */
.sidebar-item.active {
  background: var(--primary-color-10, rgba(99, 102, 241, 0.08));
  color: var(--text-color);
}

/* ── Tooltip (collapsed mode only) ───────────── */
.sidebar-item::after {
  content: attr(title);
  position: absolute;
  left: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%) scale(0.92);
  background: var(--card-background);
  color: var(--text-color);
  padding: 0.35rem 0.7rem;
  border-radius: 8px;
  font-size: 0.7rem;
  font-weight: 600;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease, transform 0.15s ease;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-color);
  z-index: 10001;
}

.sidebar-item:hover::after {
  opacity: 1;
  transform: translateY(-50%) scale(1);
}

.left-sidebar:hover .sidebar-item::after,
.left-sidebar.active .sidebar-item::after {
  opacity: 0 !important;
  display: none;
}

/* ── Icon containers ─────────────────────────── */
.sidebar-icon {
  font-size: 1.15rem;
  line-height: 1;
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  border-radius: 8px;
  overflow: hidden;
  transition: background 0.2s ease, transform 0.2s ease;
}

/* WordPress converts emoji to <img class="emoji"> SVGs —
   override inline/vertical-align defaults to fit correctly */
.sidebar-icon img.emoji {
  display: block !important;
  width: 20px !important;
  height: 20px !important;
  margin: 0 !important;
  padding: 0 !important;
  vertical-align: unset !important;
  border: none !important;
  box-shadow: none !important;
  background: none !important;
}

/* ── Image-based icons (game thumbnails) ─────── */
.sidebar-icon-img {
  background: none;
  padding: 0;
  border-radius: 6px;
  overflow: hidden;
}

.sidebar-icon-img img {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  object-fit: cover;
  display: block;
}

.sidebar-item:hover .sidebar-icon {
  transform: scale(1.08);
}

.sidebar-item.active .sidebar-icon-img img {
  border-radius: 8px;
}

/* ── Labels ──────────────────────────────────── */
.sidebar-label {
  font-size: 0.8125rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0;
  width: 0;
  transform: translateX(-8px);
  transition: opacity 0.22s ease,
              width 0.28s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

.left-sidebar:hover .sidebar-label,
.left-sidebar.active .sidebar-label {
  opacity: 1;
  width: auto;
  transform: translateX(0);
  transition: opacity 0.22s ease 0.06s,
              width 0.28s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.28s cubic-bezier(0.4, 0, 0.2, 1) 0.04s;
}

/* ── Category count badge (expanded only) ────── */
.sidebar-count {
  font-size: 0.625rem;
  font-weight: 600;
  color: var(--text-60);
  background: var(--card-background-40, rgba(255,255,255,0.06));
  border-radius: 6px;
  flex-shrink: 0;
  /* Collapsed: zero size + no margin so icon stays centered */
  width: 0;
  padding: 0;
  margin-left: 0;
  overflow: hidden;
  opacity: 0;
  transition: opacity 0.2s ease, width 0.25s ease, padding 0.25s ease, margin-left 0.25s ease;
}

.left-sidebar:hover .sidebar-count,
.left-sidebar.active .sidebar-count {
  width: auto;
  padding: 0.125rem 0.4rem;
  margin-left: auto;
  overflow: visible;
  opacity: 1;
  transition: opacity 0.2s ease 0.12s, width 0.25s ease, padding 0.25s ease, margin-left 0.25s ease;
}

.sidebar-item.active .sidebar-count {
  color: var(--text-60);
}

/* ── Divider ─────────────────────────────────── */
.sidebar-divider {
  height: 1px;
  background: var(--border-color);
  margin: 0.25rem 0.75rem;
  flex-shrink: 0;
  transition: margin 0.25s ease;
}

.left-sidebar:hover .sidebar-divider,
.left-sidebar.active .sidebar-divider {
  margin: 0.25rem 1rem;
}

/* ── Menu Toggle (in header) ─────────────────── */
.menu-toggle {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: var(--text-color);
  cursor: pointer;
  transition: all 0.2s ease;
  margin-right: 0.5rem;
}

.menu-toggle:hover {
  background: var(--card-background-40);
}

.menu-toggle svg {
  transition: transform 0.2s ease;
}

.menu-toggle:hover svg {
  transform: scale(1.1);
}

.header-container {
  display: flex;
  align-items: center;
}

/* ── Social links (bottom) ───────────────────── */
.sidebar-social {
  flex-shrink: 0;
  padding: 0.625rem 0;
  border-top: 1px solid var(--border-color);
  width: 100%;
  box-sizing: border-box;
}

.sidebar-social-links {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 6px;
  padding: 0;
  width: 100%;
}

.left-sidebar:hover .sidebar-social-links,
.left-sidebar.active .sidebar-social-links {
  flex-direction: row;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 0.875rem;
}

.sidebar-social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: transparent;
  color: var(--text-60);
  text-decoration: none;
  transition: all 0.25s ease;
  border: 1px solid transparent;
  flex-shrink: 0;
}

.sidebar-social-link:hover {
  color: var(--primary-color);
  background: var(--primary-color-10);
  border-color: var(--primary-color-25);
  transform: translateY(-2px);
}

.sidebar-social-link svg {
  width: 16px;
  height: 16px;
  transition: transform 0.2s ease;
}

.left-sidebar:hover .sidebar-social-link,
.left-sidebar.active .sidebar-social-link {
  width: 34px;
  height: 34px;
  border-radius: 8px;
}

.left-sidebar:hover .sidebar-social-link svg,
.left-sidebar.active .sidebar-social-link svg {
  width: 18px;
  height: 18px;
}

.sidebar-social-link:hover svg {
  transform: scale(1.12);
}

/* ── Body offset ─────────────────────────────── */
body.has-sidebar-nav {
  padding-left: 68px;
  transition: padding-left 0.3s ease;
}

/* ═══════════════════════════════════════════════
   Responsive
   ═══════════════════════════════════════════════ */
@media (max-width: 1024px) {
  body.has-sidebar-nav {
    padding-left: 0;
  }

  .sidebar-header {
    display: flex;
  }

  .left-sidebar {
    width: 0;
    left: -260px;
    transition: left 0.3s ease, width 0.3s ease;
  }

  .left-sidebar.active {
    width: 260px;
    left: 0;
  }

  .left-sidebar.active .sidebar-close {
    opacity: 1;
    pointer-events: auto;
  }

  .left-sidebar.active .sidebar-logo {
    opacity: 1;
    transform: translateX(0);
    position: relative;
    left: 0;
  }

  .sidebar-overlay.active {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
  }

  .sidebar-item {
    padding: 0.7rem 0;
    font-size: 0.875rem;
  }

  .left-sidebar.active .sidebar-item {
    padding: 0.7rem 1rem;
  }

  /* Section titles always visible on mobile when open */
  .left-sidebar.active .sidebar-section-title {
    opacity: 1;
    max-height: 40px;
  }

  .sidebar-social {
    padding: 0.625rem 0;
  }

  .left-sidebar.active .sidebar-social-links {
    gap: 10px;
  }

  .left-sidebar.active .sidebar-social-link {
    width: 38px;
    height: 38px;
  }

  .left-sidebar.active .sidebar-social-link svg {
    width: 20px;
    height: 20px;
  }

  body.sidebar-open {
    overflow: hidden;
  }
}

@media (max-width: 768px) {
  .left-sidebar {
    top: 56px;
    height: calc(100vh - 56px);
  }

  .sidebar-overlay {
    top: 56px;
  }
}

@media (max-width: 480px) {
  .left-sidebar {
    top: 52px;
    height: calc(100vh - 52px);
  }

  .left-sidebar.active {
    width: 100%;
  }

  .sidebar-overlay {
    top: 52px;
  }
}
