/* ===== CSS Variables ===== */
:root {
  --bg-primary: #0a0e17;
  --bg-secondary: #111827;
  --bg-card: #1a1f2e;
  --bg-card-hover: #222940;
  --bg-overlay: rgba(0, 0, 0, 0.85);
  --text-primary: #e8eaed;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  --accent: #6366f1;
  --accent-hover: #818cf8;
  --accent-glow: rgba(99, 102, 241, 0.3);
  --brand-gold: #ffd76b;
  --brand-gold-glow: rgba(255, 215, 107, 0.3);
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --border: #2d3548;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
  --shadow-hover: 0 8px 32px rgba(0, 0, 0, 0.5);
  --transition: 0.2s ease;
  --nav-height: 64px;
  --sidebar-width: 240px;
  --max-width: 1400px;
}

/* ===== Reset & Base ===== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, "Noto Sans SC", sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

a {
  text-decoration: none;
  color: inherit;
}
img {
  max-width: 100%;
  display: block;
}
button {
  cursor: pointer;
  border: none;
  background: none;
  font: inherit;
  color: inherit;
}
input {
  font: inherit;
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* ===== Loading Overlay ===== */
.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--bg-primary);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.loading-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

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

.loading-overlay .loading-text {
  font-size: 16px;
  color: var(--text-secondary);
}

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

/* ===== Navbar ===== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: rgba(10, 14, 23, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
}

.nav-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 20px;
  white-space: nowrap;
}

.logo-icon {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  filter: drop-shadow(0 0 10px rgba(99, 102, 241, 0.55))
    drop-shadow(0 0 4px rgba(255, 215, 107, 0.25));
}
.logo-text {
  color: var(--text-primary);
  font-weight: 700;
  letter-spacing: 0.5px;
}
.logo-text strong {
  color: var(--brand-gold);
  text-shadow: 0 0 14px var(--brand-gold-glow);
}

.nav-search {
  position: relative;
  flex: 1;
  max-width: 400px;
}

.nav-search input {
  width: 100%;
  padding: 8px 44px 8px 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 24px;
  color: var(--text-primary);
  font-size: 14px;
  outline: none;
  transition: border-color var(--transition);
}

.nav-search input:focus {
  border-color: var(--accent);
}

.nav-search input::placeholder {
  color: var(--text-muted);
}

.search-btn {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 14px;
  transition: background var(--transition);
}

.search-btn:hover {
  background: var(--bg-card);
}

.search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  max-height: 360px;
  overflow-y: auto;
  display: none;
  box-shadow: var(--shadow);
  z-index: 100;
}

.search-results.active {
  display: block;
}

.search-result-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  cursor: pointer;
  transition: background var(--transition);
}

.search-result-item:hover {
  background: var(--bg-card-hover);
}

.search-result-thumb {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  overflow: hidden;
  flex-shrink: 0;
}

.search-result-info h4 {
  font-size: 14px;
  margin-bottom: 2px;
}

.search-result-info span {
  font-size: 12px;
  color: var(--text-muted);
}

.nav-links {
  display: flex;
  gap: 4px;
}

.nav-link {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--transition);
  white-space: nowrap;
}

.nav-link:hover {
  color: var(--text-primary);
  background: var(--bg-card);
}
.nav-link.active {
  color: var(--accent);
  background: rgba(99, 102, 241, 0.1);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.nav-sidebar-btn {
  display: none;
  padding: 8px;
  font-size: 20px;
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  transition: background var(--transition);
}

.nav-sidebar-btn:hover {
  background: var(--bg-card);
}

.nav-menu-btn {
  display: none;
  padding: 8px;
  font-size: 24px;
  color: var(--text-primary);
}

.mobile-menu {
  display: none;
  flex-direction: column;
  padding: 12px 20px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
}

.mobile-menu.active {
  display: flex;
}

.mobile-link {
  padding: 12px 16px;
  font-size: 15px;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}

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

/* ===== Sidebar ===== */
.sidebar {
  position: fixed;
  top: var(--nav-height);
  left: 0;
  width: var(--sidebar-width);
  height: calc(100vh - var(--nav-height));
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  z-index: 900;
  transform: translateX(-100%);
  transition: transform 0.3s ease;
  padding: 16px 0;
}

.sidebar.open {
  transform: translateX(0);
}

.sidebar-overlay {
  position: fixed;
  inset: 0;
  top: var(--nav-height);
  background: rgba(0, 0, 0, 0.5);
  z-index: 899;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
  font-weight: 600;
  font-size: 14px;
  color: var(--text-secondary);
}

.sidebar-close {
  font-size: 18px;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
}

.sidebar-close:hover {
  background: var(--bg-card);
}

.sidebar-category {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  font-size: 14px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
}

.sidebar-category:hover {
  background: var(--bg-card);
  color: var(--text-primary);
}
.sidebar-category.active {
  color: var(--accent);
  background: rgba(99, 102, 241, 0.08);
  border-right: 3px solid var(--accent);
}
.sidebar-category .cat-icon {
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}
.sidebar-cat-img {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  object-fit: cover;
  display: block;
  border: 1px solid color-mix(in srgb, var(--cat-color, #6366f1) 30%, transparent);
  transition: transform 0.2s;
}
.sidebar-category:hover .sidebar-cat-img {
  transform: scale(1.15);
  box-shadow: 0 0 8px color-mix(in srgb, var(--cat-color, #6366f1) 30%, transparent);
}
.sidebar-category .cat-count {
  margin-left: auto;
  font-size: 12px;
  color: var(--text-muted);
}

.sidebar-section {
  padding: 16px;
  border-top: 1px solid var(--border);
  margin-top: 8px;
}

.sidebar-section h3 {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.sidebar-recent-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-secondary);
  transition: color var(--transition);
}

.sidebar-recent-item:hover {
  color: var(--text-primary);
}

.empty-text {
  font-size: 13px;
  color: var(--text-muted);
}

/* ===== Main Content ===== */
.main-content {
  margin-top: var(--nav-height);
  min-height: calc(100vh - var(--nav-height) - 120px);
  padding: 24px;
  max-width: var(--max-width);
  margin-left: auto;
  margin-right: auto;
  transition: margin-left 0.3s ease;
}

.main-content.sidebar-open {
  margin-left: var(--sidebar-width);
}

/* ===== Hero Banner ===== */
.hero {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 40px;
  background: linear-gradient(135deg, #1a1f2e 0%, #0f172a 50%, #1e1b4b 100%);
  padding: 48px;
  min-height: 280px;
  display: flex;
  align-items: center;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    circle at 80% 20%,
    var(--accent-glow),
    transparent 50%
  );
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 600px;
}

.hero-badge {
  display: inline-block;
  padding: 4px 12px;
  background: rgba(255, 215, 107, 0.12);
  color: var(--brand-gold);
  border: 1px solid rgba(255, 215, 107, 0.3);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 16px;
}

.hero h1 {
  font-size: 36px;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 12px;
  background: linear-gradient(
    100deg,
    #fff 0%,
    var(--brand-gold) 55%,
    var(--accent-hover) 100%
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: 16px;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.hero-stats {
  display: flex;
  gap: 32px;
}

.hero-stat {
  text-align: center;
}
.hero-stat .num {
  font-size: 24px;
  font-weight: 800;
  color: var(--accent-hover);
}
.hero-stat .label {
  font-size: 12px;
  color: var(--text-muted);
}

.hero-illustration {
  position: absolute;
  right: 40px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 120px;
  opacity: 0.15;
  z-index: 0;
}

/* ===== Section ===== */
.section {
  margin-bottom: 40px;
}

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

.section-title {
  font-size: 22px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-more {
  font-size: 14px;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 4px;
  transition: color var(--transition);
}

.section-more:hover {
  color: var(--accent-hover);
}

/* ===== Game Card ===== */
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.game-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.25s ease;
  border: 1px solid transparent;
}

.game-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: 0 8px 32px rgba(99, 102, 241, 0.15);
}

.game-card-thumb {
  position: relative;
  aspect-ratio: 16/10;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 56px;
}

.game-card-thumb .card-bg {
  position: absolute;
  inset: 0;
  opacity: 0.15;
}

.game-card-thumb .card-icon {
  position: relative;
  z-index: 1;
}

.game-card-thumb .card-thumb-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
  border-radius: inherit;
}

.search-result-thumb .search-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}

.game-card-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: opacity var(--transition);
}

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

.play-circle {
  width: 48px;
  height: 48px;
  background: var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: 0 4px 16px var(--accent-glow);
}

.badges {
  position: absolute;
  top: 8px;
  left: 8px;
  display: flex;
  gap: 4px;
  z-index: 2;
}

.badge {
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}

.badge-mobile {
  background: var(--success);
  color: #fff;
}
.badge-multi {
  background: var(--danger);
  color: #fff;
}
.badge-new {
  background: var(--warning);
  color: #000;
}
.badge-external {
  background: #3b82f6;
  color: #fff;
}

.game-card-info {
  padding: 12px 14px;
}

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

.game-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
}

.game-card-rating {
  color: var(--warning);
}
.game-card-cat {
  color: var(--accent);
}

/* ===== Categories Grid ===== */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
}

.category-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 20px 12px 16px;
  background: var(--bg-card);
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.22, 0.61, 0.36, 1);
  border: 1px solid rgba(255, 255, 255, 0.06);
  overflow: hidden;
  isolation: isolate;
}

.category-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 14px;
  background: radial-gradient(ellipse at 50% 0%, color-mix(in srgb, var(--cat-color, #6366f1) 25%, transparent) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 0;
  pointer-events: none;
}

.category-card:hover {
  border-color: var(--cat-color, #6366f1);
  transform: translateY(-4px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), 0 0 20px color-mix(in srgb, var(--cat-color, #6366f1) 15%, transparent);
}

.category-card:hover::before {
  opacity: 1;
}

.category-card:active {
  transform: translateY(-1px);
}

.category-card.active {
  border-color: var(--cat-color, #6366f1);
  background: color-mix(in srgb, var(--cat-color, #6366f1) 12%, var(--bg-card));
}

/* 图标容器 */
.cat-card-icon-wrap {
  position: relative;
  width: 64px;
  height: 64px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, color-mix(in srgb, var(--cat-color, #6366f1) 20%, transparent), color-mix(in srgb, var(--cat-color, #6366f1) 8%, transparent));
  border: 1px solid color-mix(in srgb, var(--cat-color, #6366f1) 25%, transparent);
  overflow: hidden;
  transition: all 0.3s ease;
  z-index: 1;
}

.category-card:hover .cat-card-icon-wrap {
  background: linear-gradient(135deg, color-mix(in srgb, var(--cat-color, #6366f1) 35%, transparent), color-mix(in srgb, var(--cat-color, #6366f1) 15%, transparent));
  border-color: color-mix(in srgb, var(--cat-color, #6366f1) 50%, transparent);
  box-shadow: 0 0 20px color-mix(in srgb, var(--cat-color, #6366f1) 25%, transparent);
  transform: scale(1.05);
}

.cat-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.category-card:hover .cat-card-img {
  transform: scale(1.1);
}

.cat-card-emoji {
  font-size: 30px;
  line-height: 1;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.cat-card-name {
  position: relative;
  z-index: 1;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--text-primary);
  transition: color 0.2s;
}

.category-card:hover .cat-card-name {
  color: var(--cat-color, #6366f1);
}

.cat-card-count {
  position: relative;
  z-index: 1;
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  padding: 2px 10px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  transition: all 0.2s;
}

.category-card:hover .cat-card-count {
  background: color-mix(in srgb, var(--cat-color, #6366f1) 12%, transparent);
  border-color: color-mix(in srgb, var(--cat-color, #6366f1) 25%, transparent);
  color: var(--text-secondary);
}

/* ===== Game Detail Page ===== */
.game-detail {
  max-width: 960px;
  margin: 0 auto;
}

.game-player-wrapper {
  position: relative;
  width: 100%;
  min-height: 500px;
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 24px;
}

.game-player-wrapper iframe {
  width: 100%;
  height: 100%;
  min-height: 500px;
  border: none;
  display: block;
}

.game-play-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
  cursor: pointer;
  gap: 12px;
  transition: background var(--transition);
}

.game-play-overlay:hover {
  background: rgba(0, 0, 0, 0.5);
}

.play-btn-big {
  width: 72px;
  height: 72px;
  background: var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  box-shadow: 0 4px 24px var(--accent-glow);
  transition: transform var(--transition);
}

.game-play-overlay:hover .play-btn-big {
  transform: scale(1.1);
}

.play-text {
  font-size: 16px;
  font-weight: 600;
}

.game-info-bar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.game-detail-title {
  font-size: 28px;
  font-weight: 800;
}

.game-detail-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  color: var(--text-secondary);
}

.meta-rating {
  color: var(--warning);
}
.meta-plays {
  color: var(--text-muted);
}

.game-detail-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tag {
  padding: 4px 12px;
  background: var(--bg-card);
  border-radius: 16px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
}

.tag:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

.game-description {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
}

.game-description h3 {
  font-size: 16px;
  margin-bottom: 12px;
  color: var(--text-primary);
}

.game-description p {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.8;
}

.game-controls-info {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
}

.game-controls-info h3 {
  font-size: 16px;
  margin-bottom: 12px;
}

.game-controls-info p {
  color: var(--text-secondary);
  font-size: 14px;
}

/* ===== Filter Bar ===== */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.filter-chip {
  padding: 6px 16px;
  background: var(--bg-card);
  border-radius: 20px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
  border: 1px solid transparent;
}

.filter-chip:hover {
  border-color: var(--accent);
  color: var(--text-primary);
}
.filter-chip.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.filter-chip-img {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  object-fit: cover;
  vertical-align: middle;
  margin-right: 4px;
  display: inline-block;
}

/* ===== Back Button ===== */
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 24px;
  transition: all var(--transition);
}

.back-btn:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

/* ===== Page Title ===== */
.page-title {
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 24px;
}

/* ===== Footer ===== */
.footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  padding: 32px 24px;
  margin-top: 60px;
}

.footer-content {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.footer-brand-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
  font-weight: 700;
}
.footer-brand-row .logo-icon {
  width: 26px;
  height: 26px;
}

.footer-brand p {
  font-size: 13px;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  gap: 20px;
}

.footer-links a {
  font-size: 13px;
  color: var(--text-secondary);
  transition: color var(--transition);
}

.footer-links a:hover {
  color: var(--accent);
}

.footer-copy p {
  font-size: 12px;
  color: var(--text-muted);
}

/* ===== Toast ===== */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  padding: 12px 24px;
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius-sm);
  font-size: 14px;
  z-index: 3000;
  transition: transform 0.3s ease;
  pointer-events: none;
}

.toast.active {
  transform: translateX(-50%) translateY(0);
}

/* ===== Ad Containers ===== */
.ad-container {
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ad-placeholder {
    border: 2px dashed var(--border);
    opacity: 0.5;
}

.ad-label {
    font-size: 12px;
    color: var(--text-muted);
    letter-spacing: 2px;
    text-transform: uppercase;
}

.ad-feed {
    aspect-ratio: 16/9;
}

.ad-sidebar {
    width: 300px;
    min-height: 250px;
    position: fixed;
    top: calc(var(--nav-height) + 24px);
    right: 24px;
    z-index: 100;
}

.ad-game-loading {
    position: fixed;
    inset: 0;
    background: var(--bg-overlay);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    z-index: 2000;
}

.ad-game-loading .ad-skip-btn {
    padding: 10px 24px;
    background: var(--accent);
    color: #fff;
    border-radius: var(--radius-sm);
    font-size: 14px;
    cursor: pointer;
}

.ad-game-loading .ad-skip-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

@media (max-width: 1200px) {
    .ad-sidebar { display: none; }
}

@media (max-width: 768px) {
    .ad-container { min-height: 80px; }
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
  .nav-sidebar-btn {
    display: block;
  }
  .hero {
    padding: 32px;
  }
  .hero h1 {
    font-size: 28px;
  }
  .hero-illustration {
    display: none;
  }
  .games-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  }
}

@media (max-width: 768px) {
  .nav-search {
    display: none;
  }
  .nav-links {
    display: none;
  }
  .nav-sidebar-btn {
    display: block;
  }
  .nav-menu-btn {
    display: block;
  }
  .hero {
    padding: 24px;
    min-height: 200px;
  }
  .hero h1 {
    font-size: 24px;
  }
  .hero p {
    font-size: 14px;
  }
  .hero-stats {
    gap: 20px;
  }
  .hero-stat .num {
    font-size: 20px;
  }
  .games-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
  }
  .categories-grid {
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 10px;
  }
  .category-card {
    padding: 16px 8px 12px;
  }
  .cat-card-icon-wrap {
    width: 52px;
    height: 52px;
    border-radius: 13px;
  }
  .cat-card-name {
    font-size: 12px;
  }
  .cat-card-count {
    font-size: 10px;
    padding: 1px 8px;
  }
  .section-title {
    font-size: 18px;
  }
  .game-detail-title {
    font-size: 22px;
  }
  .game-info-bar {
    flex-direction: column;
  }
  .main-content {
    padding: 16px;
  }
  .footer-content {
    flex-direction: column;
    text-align: center;
  }
  .sidebar {
    width: 260px;
  }
  .main-content.sidebar-open {
    margin-left: 0;
  }
}

@media (max-width: 480px) {
  .games-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .categories-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }
  .category-card {
    padding: 14px 6px 10px;
  }
  .cat-card-icon-wrap {
    width: 44px;
    height: 44px;
    border-radius: 11px;
  }
  .cat-card-name {
    font-size: 11px;
    letter-spacing: 0.5px;
  }
  .cat-card-count {
    font-size: 9px;
    padding: 1px 6px;
  }
  .filter-chip {
    font-size: 12px;
    padding: 5px 12px;
  }
  .filter-chip-img {
    width: 16px;
    height: 16px;
  }
}
