/* ===== CSS Variables - Fastigames theme ===== */
:root {
  --gradient-bg: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #5b21b6 100%);
  --gradient-card: linear-gradient(145deg, rgba(255,255,255,0.15) 0%, rgba(255,255,255,0.05) 100%);
  --gradient-card-hover: linear-gradient(145deg, rgba(255,255,255,0.25) 0%, rgba(255,255,255,0.1) 100%);
  --color-primary: #667eea;
  --color-primary-dark: #5a67d8;
  --color-accent: #764ba2;
  --color-text: #1a202c;
  --color-text-muted: #718096;
  --color-white: #ffffff;
  --shadow-card: 0 10px 40px rgba(102, 126, 234, 0.25);
  --shadow-card-hover: 0 20px 50px rgba(102, 126, 234, 0.35);
  --radius-card: 16px;
  --radius-btn: 12px;
  --transition: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  --touch-min: 44px;
  --safe-top: env(safe-area-inset-top);
  --safe-bottom: env(safe-area-inset-bottom);
  --safe-left: env(safe-area-inset-left);
  --safe-right: env(safe-area-inset-right);
}

/* ===== Reset & Base ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}

/* ===== Animated gradient background ===== */
body {
  font-family: 'Nunito', -apple-system, BlinkMacSystemFont, sans-serif;
  min-height: 100vh;
  min-height: 100dvh;
  color: var(--color-text);
  line-height: 1.5;
  position: relative;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background: linear-gradient(-45deg, #667eea, #764ba2, #5b21b6, #7c3aed, #667eea);
  background-size: 400% 400%;
  animation: gradientShift 12s ease infinite;
}

body.dark-mode::before {
  background: linear-gradient(-45deg, #0f172a, #1e293b, #0c4a6e, #155e75, #0f172a);
  background-size: 400% 400%;
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Hidden sections */
.hero-banner,
.featured-section,
.categories-section {
  display: none !important;
}

/* ===== Header - Sticky nav with glass morphism ===== */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  transition: background 0.3s ease, box-shadow 0.3s ease;
  padding-top: var(--safe-top);
}

.header-glass {
  background: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.2), 0 4px 24px rgba(0, 0, 0, 0.06);
}

body.dark-mode .header-glass {
  background: rgba(15, 23, 42, 0.6);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06), 0 4px 24px rgba(0, 0, 0, 0.2);
}

.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
  padding-left: max(1.5rem, var(--safe-left));
  padding-right: max(1.5rem, var(--safe-right));
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--color-primary-dark);
  font-weight: 800;
  font-size: 1.4rem;
  flex-shrink: 0;
}

body.dark-mode .logo {
  color: #38bdf8;
}

.logo-icon {
  font-size: 1.6rem;
}

/* Center search */
.nav-search-wrap {
  position: relative;
  flex: 1;
  max-width: 420px;
  margin: 0 auto;
}

.nav-search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1rem;
  opacity: 0.6;
  pointer-events: none;
}

.nav-search-input {
  width: 100%;
  padding: 0.65rem 1rem 0.65rem 2.5rem;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 999px;
  font-size: 0.95rem;
  font-family: inherit;
  background: rgba(255, 255, 255, 0.5);
  color: var(--color-text);
  transition: var(--transition);
}

.nav-search-input::placeholder {
  color: var(--color-text-muted);
}

.nav-search-input:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.7);
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

body.dark-mode .nav-search-input {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  color: #f1f5f9;
}

body.dark-mode .nav-search-input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

body.dark-mode .nav-search-input:focus {
  background: rgba(255, 255, 255, 0.15);
  border-color: #38bdf8;
}

/* Autocomplete dropdown */
.nav-autocomplete {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(16px);
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(0, 0, 0, 0.06);
  max-height: 320px;
  overflow-y: auto;
  display: none;
  z-index: 200;
}

.nav-autocomplete.is-open {
  display: block;
}

body.dark-mode .nav-autocomplete {
  background: rgba(30, 41, 59, 0.95);
  border-color: rgba(255, 255, 255, 0.1);
}

.nav-autocomplete-section {
  padding: 0.35rem 0;
}

.nav-autocomplete-section:not(:first-child) {
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

body.dark-mode .nav-autocomplete-section:not(:first-child) {
  border-top-color: rgba(255, 255, 255, 0.08);
}

.nav-autocomplete-heading {
  display: block;
  padding: 0.4rem 1rem 0.25rem;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
}

body.dark-mode .nav-autocomplete-heading {
  color: #94a3b8;
}

.nav-autocomplete-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.75rem 1rem;
  text-decoration: none;
  text-align: left;
  color: var(--color-text);
  border: none;
  background: none;
  font-family: inherit;
  font-size: inherit;
  cursor: pointer;
  border-radius: 8px;
  margin: 0 0.25rem;
  transition: background 0.15s ease;
}

.nav-autocomplete-item:last-child {
  border-bottom: none;
}

.nav-autocomplete-item:hover {
  background: rgba(102, 126, 234, 0.1);
}

.nav-autocomplete-recent {
  font-weight: 600;
}

body.dark-mode .nav-autocomplete-item {
  color: #e2e8f0;
  border-bottom-color: rgba(255, 255, 255, 0.06);
}

body.dark-mode .nav-autocomplete-item:hover {
  background: rgba(56, 189, 248, 0.15);
}

.nav-autocomplete-emoji {
  font-size: 1.5rem;
}

.nav-autocomplete-title {
  flex: 1;
  font-weight: 700;
  font-size: 0.95rem;
}

.nav-autocomplete-cat {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
}

body.dark-mode .nav-autocomplete-cat {
  color: #94a3b8;
}

/* Right side: dropdown, theme, profile */
.nav-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.nav-dropdown-wrap {
  position: relative;
}

.nav-dropdown-trigger {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.55rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: var(--radius-btn);
  background: rgba(255, 255, 255, 0.4);
  color: var(--color-text);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}

.nav-dropdown-trigger:hover {
  background: rgba(255, 255, 255, 0.6);
  border-color: rgba(255, 255, 255, 0.6);
}

body.dark-mode .nav-dropdown-trigger {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  color: #e2e8f0;
}

body.dark-mode .nav-dropdown-trigger:hover {
  background: rgba(255, 255, 255, 0.15);
}

.nav-dropdown-chevron {
  font-size: 0.6rem;
  opacity: 0.8;
  transition: transform 0.2s ease;
}

.nav-dropdown-wrap:has(.nav-dropdown.is-open) .nav-dropdown-chevron {
  transform: rotate(180deg);
}

.nav-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 160px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(16px);
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
  border: 1px solid rgba(0, 0, 0, 0.06);
  padding: 0.35rem;
  display: none;
  z-index: 200;
}

.nav-dropdown.is-open {
  display: block;
}

body.dark-mode .nav-dropdown {
  background: rgba(30, 41, 59, 0.95);
  border-color: rgba(255, 255, 255, 0.1);
}

.nav-dropdown-item {
  display: block;
  padding: 0.6rem 1rem;
  border-radius: 8px;
  color: var(--color-text);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  transition: background 0.15s ease;
}

.nav-dropdown-item:hover {
  background: rgba(102, 126, 234, 0.12);
}

body.dark-mode .nav-dropdown-item {
  color: #e2e8f0;
}

body.dark-mode .nav-dropdown-item:hover {
  background: rgba(56, 189, 248, 0.15);
}

.nav-icon-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  color: var(--color-text);
  cursor: pointer;
  transition: var(--transition);
  font-size: 1.2rem;
}

.nav-icon-btn:hover {
  background: rgba(255, 255, 255, 0.6);
  border-color: rgba(255, 255, 255, 0.6);
}

body.dark-mode .nav-icon-btn {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  color: #e2e8f0;
}

body.dark-mode .nav-icon-btn:hover {
  background: rgba(255, 255, 255, 0.18);
}

.theme-icon-light {
  display: none;
}

body.dark-mode .theme-icon-dark {
  display: none;
}

body.dark-mode .theme-icon-light {
  display: inline;
}

.nav-profile {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  color: var(--color-text);
  text-decoration: none;
  transition: var(--transition);
  font-size: 1.2rem;
}

.nav-profile:hover {
  background: rgba(255, 255, 255, 0.6);
  border-color: rgba(255, 255, 255, 0.6);
}

body.dark-mode .nav-profile {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  color: #e2e8f0;
}

body.dark-mode .nav-profile:hover {
  background: rgba(255, 255, 255, 0.18);
}

.nav-profile-icon {
  font-size: 1.2rem;
}

/* ===== Main ===== */
.main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

/* ===== Hero Banner ===== */
.hero-banner {
  position: relative;
  min-height: 85vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4rem 1.5rem 5rem;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 25%, #0c4a6e 50%, #155e75 75%, #0f766e 100%);
  background-size: 300% 300%;
  animation: heroGradientMove 15s ease infinite;
}

@keyframes heroGradientMove {
  0%, 100% { background-position: 0% 50%; }
  33% { background-position: 50% 100%; }
  66% { background-position: 100% 50%; }
}

.hero-particles {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  opacity: 0.85;
}

.hero-floating-icons {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.hero-icon {
  position: absolute;
  left: var(--x);
  top: var(--y);
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  opacity: 0.35;
  animation: heroIconFloat 6s ease-in-out infinite;
  animation-delay: calc(var(--i) * -0.6s);
}

@keyframes heroIconFloat {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  25% { transform: translate(8px, -12px) rotate(5deg); }
  50% { transform: translate(-6px, 6px) rotate(-3deg); }
  75% { transform: translate(10px, 8px) rotate(4deg); }
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 640px;
}

.hero-heading {
  font-family: 'Outfit', 'Nunito', sans-serif;
  font-size: clamp(2.5rem, 8vw, 4.5rem);
  font-weight: 800;
  color: #fff;
  line-height: 1.1;
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
  text-shadow:
    0 0 20px rgba(34, 211, 238, 0.5),
    0 0 40px rgba(34, 211, 238, 0.3),
    0 0 80px rgba(6, 182, 212, 0.2),
    0 2px 4px rgba(0, 0, 0, 0.3);
  animation: heroHeadingGlow 4s ease-in-out infinite;
}

@keyframes heroHeadingGlow {
  0%, 100% { text-shadow: 0 0 20px rgba(34, 211, 238, 0.5), 0 0 40px rgba(34, 211, 238, 0.3), 0 0 80px rgba(6, 182, 212, 0.2), 0 2px 4px rgba(0, 0, 0, 0.3); }
  50% { text-shadow: 0 0 28px rgba(34, 211, 238, 0.6), 0 0 56px rgba(34, 211, 238, 0.4), 0 0 100px rgba(6, 182, 212, 0.25), 0 2px 4px rgba(0, 0, 0, 0.3); }
}

.hero-sub {
  font-size: clamp(1.1rem, 2.5vw, 1.35rem);
  color: rgba(255, 255, 255, 0.85);
  font-weight: 600;
  margin-bottom: 2rem;
  letter-spacing: 0.02em;
}

.hero-cta {
  display: inline-block;
  padding: 1rem 2.25rem;
  font-family: inherit;
  font-weight: 800;
  font-size: 1.15rem;
  color: #0f172a;
  background: linear-gradient(135deg, #22d3ee 0%, #14b8a6 100%);
  border-radius: 14px;
  text-decoration: none;
  box-shadow: 0 8px 32px rgba(34, 211, 238, 0.4);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hero-cta:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(34, 211, 238, 0.5);
}

/* ===== Featured Games Carousel ===== */
.featured-section {
  margin-bottom: 3rem;
  padding: 0 0.5rem;
}

.featured-title {
  margin-bottom: 1.5rem;
}

.carousel-wrap {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  max-width: 900px;
  margin: 0 auto;
}

.carousel-viewport {
  flex: 1;
  overflow: hidden;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
}

.carousel-track {
  display: flex;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}

.carousel-slide {
  flex: 0 0 auto;
  display: block;
  text-decoration: none;
  color: inherit;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0.08) 100%);
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.25);
  position: relative;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.carousel-slide:hover {
  transform: scale(1.02);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.2);
}

.carousel-badge {
  position: absolute;
  top: 1rem;
  left: 1rem;
  z-index: 2;
  padding: 0.35rem 0.85rem;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: linear-gradient(135deg, #22d3ee 0%, #14b8a6 100%);
  color: #0f172a;
  border-radius: 999px;
  box-shadow: 0 4px 16px rgba(34, 211, 238, 0.4);
}

.carousel-slide-media {
  position: relative;
  aspect-ratio: 16 / 9;
  width: 100%;
  background: linear-gradient(135deg, #5a67d8 0%, #9f7aea 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.carousel-slide-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.carousel-slide-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 6.5rem;
  filter: drop-shadow(0 4px 16px rgba(0, 0, 0, 0.2)) drop-shadow(0 0 32px rgba(255, 255, 255, 0.4));
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), filter var(--transition);
}

.carousel-slide-placeholder::before {
  content: '';
  position: absolute;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  z-index: -1;
}

.carousel-slide:hover .carousel-slide-placeholder {
  transform: scale(1.12);
  filter: drop-shadow(0 6px 20px rgba(0, 0, 0, 0.15)) drop-shadow(0 0 40px rgba(255, 255, 255, 0.5));
}

.carousel-slide-body {
  padding: 1.25rem 1.5rem;
}

.carousel-slide-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 0.25rem;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.carousel-slide-category {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.85);
}

.carousel-btn {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.carousel-btn:hover {
  background: rgba(255, 255, 255, 0.35);
  border-color: rgba(255, 255, 255, 0.7);
  transform: scale(1.08);
}

.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1.25rem;
  flex-wrap: wrap;
}

.carousel-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.6);
  background: transparent;
  cursor: pointer;
  padding: 0;
  transition: background 0.2s ease, transform 0.2s ease;
}

.carousel-dot:hover {
  background: rgba(255, 255, 255, 0.4);
}

.carousel-dot.active {
  background: #fff;
  border-color: #fff;
  transform: scale(1.2);
}

body.dark-mode .carousel-slide-title,
body.dark-mode .carousel-slide-category {
  color: #e2e8f0;
}

body.dark-mode .carousel-slide-category {
  color: #94a3b8;
}

@media (max-width: 640px) {
  .carousel-wrap {
    gap: 0.35rem;
  }

  .carousel-btn {
    width: 40px;
    height: 40px;
    font-size: 1.5rem;
  }

  .carousel-badge {
    top: 0.75rem;
    left: 0.75rem;
    padding: 0.3rem 0.65rem;
    font-size: 0.65rem;
  }

  .carousel-slide-placeholder {
    font-size: 5rem;
  }

  .carousel-slide-body {
    padding: 1rem 1.25rem;
  }

  .carousel-slide-title {
    font-size: 1.15rem;
  }
}

/* ===== Categories (icon cards) ===== */
.categories-section {
  margin-bottom: 2.5rem;
}

.categories-title {
  margin-bottom: 1.25rem;
}

.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 1rem;
  max-width: 900px;
  margin: 0 auto;
}

.category-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 1.25rem 1rem;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.05) 100%);
  color: #fff;
  font-family: inherit;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.category-card:hover {
  transform: translateY(-4px);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.25) 0%, rgba(255, 255, 255, 0.1) 100%);
  border-color: rgba(255, 255, 255, 0.5);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
}

.category-card.active {
  background: rgba(255, 255, 255, 0.95);
  color: var(--color-primary-dark);
  border-color: rgba(255, 255, 255, 0.95);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.category-card-icon {
  font-size: 2.25rem;
  line-height: 1;
}

.category-card-label {
  font-size: 0.95rem;
  text-align: center;
}

body.dark-mode .category-card {
  border-color: rgba(255, 255, 255, 0.2);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.02) 100%);
  color: #e2e8f0;
}

body.dark-mode .category-card:hover {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.06) 100%);
  border-color: rgba(255, 255, 255, 0.35);
}

body.dark-mode .category-card.active {
  background: rgba(56, 189, 248, 0.25);
  color: #fff;
  border-color: #38bdf8;
}

/* ===== Category bar (below header, one row) ===== */
.category-bar {
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  padding: 0.5rem 1rem;
}

body.dark-mode .category-bar {
  background: rgba(15, 23, 42, 0.6);
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

.surprise-me-wrap {
  position: relative;
  flex-shrink: 0;
}

.btn-surprise-me {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.6rem 1.25rem;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #f59e0b 0%, #ef4444 50%, #ec4899 100%);
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 2px 12px rgba(245, 158, 11, 0.4);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease, border-color 0.2s ease;
  animation: surpriseBounce 2s ease-in-out infinite;
}

.btn-surprise-me:hover {
  animation: none;
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(245, 158, 11, 0.5);
  border-color: rgba(255, 255, 255, 0.7);
}

.btn-surprise-me:active {
  transform: scale(0.98);
}

@keyframes surpriseBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-2px); }
}

.btn-surprise-icon {
  font-size: 1rem;
}

.surprise-me-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.surprise-me-overlay.is-active {
  display: flex;
  opacity: 1;
}

.surprise-me-loading {
  text-align: center;
  padding: 2rem 3rem;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

body.dark-mode .surprise-me-loading {
  background: rgba(30, 41, 59, 0.98);
}

.surprise-me-spinner {
  display: block;
  width: 48px;
  height: 48px;
  margin: 0 auto 1rem;
  border: 4px solid rgba(102, 126, 234, 0.2);
  border-top-color: #667eea;
  border-radius: 50%;
  animation: surpriseSpin 0.8s linear infinite;
}

@keyframes surpriseSpin {
  to { transform: rotate(360deg); }
}

.surprise-me-message {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-text);
}

body.dark-mode .surprise-me-message {
  color: #e2e8f0;
}

.category-bar .category-filters {
  max-width: none;
  flex-wrap: nowrap;
  justify-content: center;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0.25rem 0;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.category-bar .category-filters::-webkit-scrollbar {
  height: 6px;
}

.category-bar .category-filters::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

.category-bar .category-filters::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 3px;
}

.search-wrapper {
  position: relative;
  flex: 1;
  min-width: 200px;
  max-width: 400px;
}

.search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.1rem;
  opacity: 0.7;
}

.search-input {
  width: 100%;
  padding: 0.875rem 1rem 0.875rem 2.75rem;
  border: none;
  border-radius: var(--radius-btn);
  font-size: 1rem;
  font-family: inherit;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  transition: var(--transition);
}

.search-input:focus {
  outline: none;
  box-shadow: 0 4px 24px rgba(102, 126, 234, 0.3);
}

.search-input::placeholder {
  color: var(--color-text-muted);
}

.filter-select {
  padding: 0.875rem 2rem 0.875rem 1rem;
  border: none;
  border-radius: var(--radius-btn);
  font-size: 1rem;
  font-family: inherit;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.95);
  color: var(--color-text);
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  transition: var(--transition);
}

.filter-select:focus {
  outline: none;
  box-shadow: 0 4px 24px rgba(102, 126, 234, 0.3);
}

/* ===== Category filter chips ===== */
.category-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  width: 100%;
  max-width: 500px;
  margin: 0 auto;
}

.category-bar .category-filters {
  flex-shrink: 0;
}

.category-chip {
  padding: 0.6rem 1.25rem;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.95);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  backdrop-filter: blur(8px);
}

.category-chip:hover {
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.6);
  transform: translateY(-2px);
}

.category-chip.active {
  background: rgba(255, 255, 255, 0.95);
  color: var(--color-primary-dark);
  border-color: rgba(255, 255, 255, 0.95);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

/* ===== Section titles ===== */
.section-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--color-white);
  margin-bottom: 1.25rem;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
}

.section-title-icon {
  font-size: 1.35rem;
}

/* ===== Trending Now (horizontal scroll) ===== */
.trending-now-section {
  margin-bottom: 2.5rem;
}

.trending-now-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.trending-now-title {
  margin-bottom: 0;
}

.btn-see-all-trending {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.55rem 1.25rem;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.95rem;
  color: #fff;
  background: rgba(255, 255, 255, 0.2);
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-radius: 999px;
  text-decoration: none;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.btn-see-all-trending:hover {
  background: rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.6);
  transform: translateY(-2px);
}

.trending-scroll-wrap {
  margin: 0 -0.5rem;
  overflow: hidden;
}

.trending-scroll {
  display: flex;
  gap: 1.25rem;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0.5rem;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

.trending-scroll::-webkit-scrollbar {
  height: 8px;
}

.trending-scroll::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

.trending-scroll::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.35);
  border-radius: 4px;
}

.trending-scroll::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.5);
}

.trending-card {
  flex: 0 0 auto;
  width: 200px;
  display: block;
  text-decoration: none;
  color: inherit;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.18) 0%, rgba(255, 255, 255, 0.06) 100%);
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.25);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  scroll-snap-align: start;
  position: relative;
}

.trending-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.2);
}

.trending-card-fire {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  z-index: 2;
  font-size: 1.25rem;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

.trending-card-thumb {
  position: relative;
  aspect-ratio: 16 / 10;
  width: 100%;
  background: linear-gradient(135deg, #5a67d8 0%, #9f7aea 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.trending-card-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.trending-card-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  filter: drop-shadow(0 3px 10px rgba(0, 0, 0, 0.25)) drop-shadow(0 0 20px rgba(255, 255, 255, 0.3));
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), filter var(--transition);
}

.trending-card-placeholder::before {
  content: '';
  position: absolute;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(6px);
  z-index: -1;
}

.trending-card:hover .trending-card-placeholder {
  transform: scale(1.15);
  filter: drop-shadow(0 4px 14px rgba(0, 0, 0, 0.2)) drop-shadow(0 0 28px rgba(255, 255, 255, 0.45));
}

.trending-card-body {
  padding: 0.85rem 1rem;
}

.trending-card-title {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.4rem;
  line-height: 1.25;
}

.trending-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.trending-views {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.85);
  font-weight: 600;
}

.trending-stars {
  display: inline-flex;
  align-items: center;
  gap: 0.1rem;
  font-size: 0.85rem;
}

.trending-star {
  color: rgba(255, 255, 255, 0.35);
}

.trending-star.full {
  color: #fbbf24;
}

.trending-star.half {
  color: #fbbf24;
  opacity: 0.7;
}

body.dark-mode .trending-card-title {
  color: #e2e8f0;
}

body.dark-mode .trending-views {
  color: #94a3b8;
}

/* ===== Games Grid ===== */
.games-section {
  margin-top: 1rem;
}

.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.5rem;
}

.game-card {
  background: var(--gradient-card);
  backdrop-filter: blur(10px);
  border-radius: var(--radius-card);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: transform var(--transition-smooth), box-shadow var(--transition), background var(--transition), border-color var(--transition);
  text-decoration: none;
  color: inherit;
  display: block;
  will-change: transform;
}

.game-card:hover {
  transform: translateY(-10px) scale(1.02);
  box-shadow: var(--shadow-card-hover), 0 0 40px rgba(102, 126, 234, 0.3);
  background: var(--gradient-card-hover);
  border-color: rgba(255, 255, 255, 0.4);
}

.game-card-thumb {
  aspect-ratio: 16 / 10;
  width: 100%;
  position: relative;
  background: linear-gradient(135deg, #5a67d8 0%, #9f7aea 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.game-card:hover .game-card-thumb-img {
  transform: scale(1.08);
}

.game-card-thumb-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-smooth);
}

.game-card-thumb-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 5rem;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.25)) drop-shadow(0 0 24px rgba(255, 255, 255, 0.35));
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), filter var(--transition);
}

.game-card-thumb-placeholder::before {
  content: '';
  position: absolute;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(8px);
  z-index: -1;
}

.game-card:hover .game-card-thumb-placeholder {
  transform: scale(1.2);
  filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.2)) drop-shadow(0 0 32px rgba(255, 255, 255, 0.5));
}

.game-card-body {
  padding: 1rem;
}

.game-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--color-white);
  margin-bottom: 0.25rem;
  line-height: 1.3;
}

.game-card-category {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.8);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.no-results {
  padding: 2.5rem 1rem 3rem;
}

.no-results-message {
  text-align: center;
  color: rgba(255, 255, 255, 0.95);
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
}

.no-results-recommend-label {
  text-align: center;
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.no-results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.25rem;
  max-width: 700px;
  margin: 0 auto;
}

/* ===== Footer ===== */
.footer {
  text-align: center;
  padding: 2rem 1rem;
  padding-bottom: max(2rem, var(--safe-bottom));
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.9rem;
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .nav-search-wrap {
    max-width: 240px;
  }

  .nav-dropdown-trigger span:first-child {
    display: none;
  }

  .nav-dropdown-trigger .nav-dropdown-chevron {
    margin: 0;
  }
}

@media (max-width: 640px) {
  .header-inner {
    padding: 0.6rem 1rem;
    gap: 0.75rem;
  }

  .logo-text {
    font-size: 1.2rem;
  }

  .nav-search-wrap {
    max-width: 140px;
  }

  .nav-search-input {
    padding: 0.5rem 0.75rem 0.5rem 2rem;
    font-size: 0.875rem;
  }

  .hero-banner {
    min-height: 75vh;
    padding: 3rem 1rem 4rem;
  }

  .category-filters {
    max-width: 100%;
  }

  .category-bar .category-filters {
    max-width: none;
    justify-content: flex-start;
  }

  .category-chip {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
  }

  .btn-surprise-me {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
  }

  .btn-surprise-icon {
    font-size: 0.9rem;
  }

  .section-title {
    font-size: 1.25rem;
  }

  .categories-section {
    margin-bottom: 2rem;
  }

  .categories-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
  }

  .category-card {
    padding: 1rem 0.75rem;
  }

  .category-card-icon {
    font-size: 1.85rem;
  }

  .category-card-label {
    font-size: 0.85rem;
  }

  .trending-now-section {
    margin-bottom: 2rem;
  }

  .trending-card {
    flex: 0 0 calc(33.333% - 0.5rem);
    min-width: calc(33.333% - 0.5rem);
    width: calc(33.333% - 0.5rem);
  }

  .trending-card-body {
    padding: 0.7rem 0.85rem;
  }

  .trending-card-title {
    font-size: 0.9rem;
  }

  .games-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
  }

  .game-card-thumb-placeholder {
    font-size: 4rem;
  }

  .game-card-thumb-placeholder::before {
    width: 80px;
    height: 80px;
  }

  .trending-card-placeholder {
    font-size: 3.25rem;
  }

  .trending-card-placeholder::before {
    width: 60px;
    height: 60px;
  }

  .game-card-body {
    padding: 0.75rem;
  }

  .game-card-title {
    font-size: 0.95rem;
  }

  .no-results-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1rem;
  }
}

@media (max-width: 480px) {
  .nav-right {
    gap: 0.35rem;
  }

  .nav-icon-btn,
  .nav-profile {
    width: 36px;
    height: 36px;
    font-size: 1rem;
  }

  .nav-dropdown-trigger {
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
  }
}

/* ===== Mobile Enhancements - Touch, Safe Areas, FAB ===== */
@media (max-width: 768px) {
  .nav-search-wrap {
    max-width: none;
    flex: 1;
    min-width: 180px;
  }

  .nav-search-input {
    min-height: var(--touch-min);
    padding: 0.75rem 1rem 0.75rem 2.75rem;
    font-size: 1rem;
  }

  .category-chip,
  .btn-surprise-me {
    min-height: var(--touch-min);
    min-width: var(--touch-min);
    padding: 0.5rem 1rem;
  }

  .game-card {
    position: relative;
    padding: 0.75rem;
  }

  .game-card::before {
    content: '';
    position: absolute;
    inset: -8px;
    z-index: -1;
  }

  .nav-icon-btn,
  .nav-profile {
    min-width: var(--touch-min);
    min-height: var(--touch-min);
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .category-bar {
    padding-left: max(1rem, var(--safe-left));
    padding-right: max(1rem, var(--safe-right));
  }

  .main {
    padding-left: max(1rem, var(--safe-left));
    padding-right: max(1rem, var(--safe-right));
    padding-bottom: max(4rem, calc(var(--safe-bottom) + 4rem));
  }
}

/* Floating Random Game button - mobile only */
.mobile-random-fab {
  display: none;
  position: fixed;
  bottom: max(1.5rem, calc(var(--safe-bottom) + 1rem));
  right: max(1.5rem, var(--safe-right));
  width: 56px;
  height: 56px;
  min-width: 56px;
  min-height: 56px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);
  color: #fff;
  font-size: 1.75rem;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(245, 158, 11, 0.5);
  z-index: 90;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

@media (max-width: 768px) {
  .mobile-random-fab {
    display: flex;
    align-items: center;
    justify-content: center;
  }
}

.mobile-random-fab:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 24px rgba(245, 158, 11, 0.6);
}

.mobile-random-fab:active {
  transform: scale(0.95);
}

/* Hamburger for categories - mobile */
.mobile-hamburger {
  display: none;
  flex-shrink: 0;
  width: var(--touch-min);
  height: var(--touch-min);
  min-width: var(--touch-min);
  min-height: var(--touch-min);
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  padding: 0;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.15);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.mobile-hamburger span {
  display: block;
  width: 20px;
  height: 2px;
  background: #fff;
  border-radius: 1px;
  transition: transform 0.2s ease;
}

@media (max-width: 768px) {
  .mobile-hamburger {
    display: none;
  }

  .category-bar .category-chip[data-hide-mobile] {
    display: none;
  }

  .category-bar .category-filters {
    display: flex;
    justify-content: center;
    flex: none;
    min-width: 0;
  }

  .category-bar {
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
  }

  /* Top banner: row 1 = logo + (top right) theme & leaderboard; row 2 = search (same size as Surprise Me) + Surprise Me; row 2 bar different background */
  .top-banner-wrap {
    display: grid;
    grid-template-rows: auto auto;
    grid-template-columns: 1fr auto;
    gap: 0;
    background: rgba(255, 255, 255, 0.28);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  }

  body.dark-mode .top-banner-wrap {
    background: rgba(15, 23, 42, 0.65);
    border-bottom-color: rgba(255, 255, 255, 0.08);
  }

  .header.header-glass {
    display: contents;
  }

  .header-inner {
    display: contents;
  }

  .category-bar {
    display: contents;
  }

  .logo {
    grid-row: 1;
    grid-column: 1;
    align-self: center;
    padding: 0.5rem 0 0.5rem max(0.75rem, var(--safe-left));
    font-size: 1.1rem;
  }

  .logo-icon {
    font-size: 1.25rem;
  }

  .nav-right {
    grid-row: 1;
    grid-column: 2;
    justify-self: end;
    padding: 0.5rem max(0.75rem, var(--safe-right)) 0.5rem 0;
    gap: 0.35rem;
  }

  .nav-icon-btn,
  .nav-profile {
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
    padding: 0;
  }

  .nav-search-wrap {
    grid-row: 2;
    grid-column: 1;
    margin: 0;
    max-width: none;
    padding: 0.35rem 0.25rem 0.35rem max(0.75rem, var(--safe-left));
    display: flex;
    align-items: stretch;
    background: rgba(255, 255, 255, 0.2);
    border-top: 1px solid rgba(255, 255, 255, 0.12);
  }

  body.dark-mode .nav-search-wrap {
    background: rgba(0, 0, 0, 0.2);
    border-top-color: rgba(255, 255, 255, 0.06);
  }

  .nav-search-wrap .nav-search-input {
    flex: 1;
    min-width: 0;
    min-height: 40px;
    height: 40px;
  }

  .nav-search-input {
    padding: 0 0.75rem 0 2.25rem;
    font-size: 0.85rem;
  }

  .nav-search-icon {
    left: 0.75rem;
    font-size: 0.9rem;
  }

  .category-filters {
    grid-row: 2;
    grid-column: 2;
    display: flex;
    justify-content: flex-end;
    align-items: stretch;
    padding: 0.35rem max(0.75rem, var(--safe-right)) 0.35rem 0.25rem;
    background: rgba(255, 255, 255, 0.2);
    border-top: 1px solid rgba(255, 255, 255, 0.12);
  }

  body.dark-mode .category-filters {
    background: rgba(0, 0, 0, 0.2);
    border-top-color: rgba(255, 255, 255, 0.06);
  }

  .category-filters .btn-surprise-me {
    min-height: 40px;
    height: 40px;
    align-self: center;
  }

  .trending-now-header .btn-see-all-trending {
    display: none;
  }

  .trending-scroll-wrap {
    margin-left: 0;
    margin-right: 0;
  }

  .trending-scroll {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    gap: 0.75rem;
    padding: 0.5rem 0;
  }

  .trending-card {
    flex: 0 0 calc(33.333% - 0.5rem);
    min-width: calc(33.333% - 0.5rem);
    width: calc(33.333% - 0.5rem);
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
    aspect-ratio: 2 / 3;
    overflow: hidden;
  }

  .trending-card-thumb {
    flex: 0 0 50%;
    min-height: 0;
    aspect-ratio: unset;
    border-radius: var(--radius-card) var(--radius-card) 0 0;
  }

  .trending-card-body {
    padding: 0.3rem 0.35rem 0.4rem;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
  }

  .trending-card-title {
    font-size: 0.68rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0.2rem;
    margin-left: 0;
    padding-left: 0;
  }

  .trending-card-meta {
    margin-left: 0;
    padding-left: 0;
    gap: 0.25rem;
  }

  .trending-views {
    font-size: 0.6rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .trending-stars {
    font-size: 0.6rem;
  }

  .games-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
  }

  .game-card {
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
    aspect-ratio: 2 / 3;
  }

  .game-card-thumb {
    flex: 0 0 65%;
    min-height: 0;
    width: 100%;
    border-radius: var(--radius-card) var(--radius-card) 0 0;
  }

  .game-card-thumb-img,
  .game-card-thumb-placeholder {
    object-fit: cover;
  }

  .game-card-body {
    padding: 0.35rem 0.5rem 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
  }

  .game-card-title {
    font-size: 0.7rem;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0.25rem;
    margin-left: 0;
    padding-left: 0;
    flex-shrink: 0;
  }

  .game-card-category {
    font-size: 0.55rem;
    margin-top: auto;
    margin-left: 0;
    margin-right: 0;
    margin-bottom: 0;
    align-self: center;
    text-align: center;
    background: none;
    color: rgba(255, 255, 255, 0.75);
    padding: 0.1rem 0;
    border-radius: 0;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
  }

  body.dark-mode .game-card-category {
    background: none;
    color: rgba(255, 255, 255, 0.7);
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  body::before {
    animation: none;
  }

  .btn-surprise-me {
    animation: none;
  }
}

/* Touch-friendly autocomplete items */
@media (max-width: 768px) {
  .nav-autocomplete-item {
    min-height: var(--touch-min);
    padding: 0.85rem 1rem;
  }

  .carousel-btn {
    min-width: var(--touch-min);
    min-height: var(--touch-min);
  }

  .carousel-dot {
    min-width: 32px;
    min-height: 32px;
  }

}
