/* ============================================================
   POKIVERSE - Main Stylesheet
   Mobile-first, responsive, SEO-friendly, AdSense-friendly
   ============================================================ */

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

/* ── CSS Variables ── */
:root {
  --bg-primary: #0f0e17;
  --bg-secondary: #1a1828;
  --bg-card: #1e1c2e;
  --bg-card-hover: #252338;
  --bg-sidebar: #160f2b;
  --bg-nav: rgba(15, 14, 23, 0.95);
  --accent: #4cce85;
  --accent-dark: #35a568;
  --accent-glow: rgba(76, 206, 133, 0.3);
  --accent2: #7c3aed;
  --text-primary: #ffffff;
  --text-secondary: #a0a0b8;
  --text-muted: #6b6b8a;
  --border: rgba(255,255,255,0.08);
  --border-accent: rgba(76, 206, 133, 0.25);
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
  --shadow-card: 0 8px 32px rgba(0,0,0,0.3);
  --radius: 14px;
  --radius-sm: 8px;
  --radius-lg: 20px;
  --sidebar-width: 220px;
  --header-h: 64px;
  --transition: all 0.25s cubic-bezier(0.4,0,0.2,1);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: 'Nunito', 'Inter', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
ul { list-style: none; }
input, select, textarea { font-family: inherit; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ════════════════════════════════════════
   LAYOUT
   ════════════════════════════════════════ */

.app-layout {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ── */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 100;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease;
  padding-bottom: 20px;
}
.sidebar::-webkit-scrollbar { width: 3px; }

.sidebar-logo {
  padding: 0 20px;
  height: var(--header-h);
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  text-decoration: none;
}
.sidebar-logo .logo-text {
  font-size: 1.5rem;
  font-weight: 900;
  letter-spacing: -0.5px;
}
.logo-p { color: var(--accent); }
.logo-oki { color: var(--text-primary); }
.logo-verse { color: var(--text-secondary); font-weight: 600; }

.sidebar-section {
  padding: 16px 12px 4px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-muted);
}

.sidebar-nav { padding: 4px 0; }
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  margin: 2px 8px;
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 600;
  transition: var(--transition);
  cursor: pointer;
  position: relative;
}
.sidebar-link:hover {
  background: rgba(76, 206, 133, 0.08);
  color: var(--text-primary);
}
.sidebar-link.active {
  background: linear-gradient(135deg, rgba(76, 206, 133, 0.15), rgba(124, 58, 237, 0.1));
  color: var(--accent);
  border-left: 3px solid var(--accent);
}
.sidebar-link .cat-emoji { font-size: 1.1rem; width: 24px; text-align: center; }
.sidebar-link .link-label { flex: 1; }
.sidebar-link .game-count {
  font-size: 0.65rem;
  background: var(--border);
  padding: 1px 6px;
  border-radius: 20px;
  color: var(--text-muted);
}
.sidebar-link.active .game-count {
  background: var(--accent-glow);
  color: var(--accent);
}

/* ── Main Content ── */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* ── Header ── */
.header {
  height: var(--header-h);
  background: var(--bg-nav);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 16px;
}

.menu-toggle {
  display: none;
  color: var(--text-primary);
  font-size: 1.3rem;
  padding: 6px;
  background: none;
  border: none;
  cursor: pointer;
}

.search-bar {
  flex: 1;
  max-width: 480px;
  position: relative;
}
.search-bar input {
  width: 100%;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 40px;
  padding: 10px 16px 10px 44px;
  font-size: 0.875rem;
  color: var(--text-primary);
  transition: var(--transition);
  outline: none;
}
.search-bar input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.search-bar input::placeholder { color: var(--text-muted); }
.search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}
.btn-header {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 8px 16px;
  border-radius: 40px;
  font-size: 0.8rem;
  font-weight: 700;
  transition: var(--transition);
  white-space: nowrap;
}
.btn-header:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.btn-header-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #000;
}
.btn-header-primary:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
  color: #000;
}

/* Search Results Dropdown */
.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);
  box-shadow: var(--shadow);
  max-height: 400px;
  overflow-y: auto;
  z-index: 200;
  display: none;
}
.search-results.show { display: block; }
.search-result-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  cursor: pointer;
  transition: var(--transition);
  border-bottom: 1px solid var(--border);
}
.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover { background: var(--bg-card-hover); }
.search-result-thumb {
  width: 48px;
  height: 36px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
}
.search-result-info { flex: 1; }
.search-result-title { font-size: 0.875rem; font-weight: 700; }
.search-result-cat { font-size: 0.7rem; color: var(--text-muted); text-transform: capitalize; }

/* ════════════════════════════════════════
   AD SLOTS
   ════════════════════════════════════════ */
.ad-slot {
  display: flex;
  justify-content: center;
  align-items: center;
  background: var(--bg-secondary);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.7rem;
  text-align: center;
  overflow: hidden;
  min-height: 60px;
}
.ad-slot-728 { width: 100%; max-width: 728px; height: 90px; margin: 0 auto; }
.ad-slot-300 { width: 300px; min-height: 250px; }
.ad-slot-320 { width: 100%; height: 50px; }
.ad-slot-responsive { width: 100%; min-height: 90px; }
.ad-label { font-size: 0.6rem; color: var(--text-muted); margin-bottom: 4px; display: block; }

/* ════════════════════════════════════════
   PAGE CONTENT
   ════════════════════════════════════════ */
.page-wrapper {
  flex: 1;
  padding: 24px;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}

/* ── Hero Section ── */
.hero-section {
  background: linear-gradient(135deg, #160e35, #0f0e17, #0b1a13, #160e35);
  background-size: 300% 300%;
  animation: gradientBG 15s ease infinite;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px;
  margin-bottom: 32px;
  display: flex;
  align-items: center;
  gap: 40px;
  position: relative;
  overflow: hidden;
  min-height: 220px;
}
@keyframes gradientBG {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
.hero-bg-effects {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.hero-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.4;
  animation: float 6s ease-in-out infinite;
}
.hero-glow-1 {
  width: 300px;
  height: 300px;
  background: var(--accent);
  top: -100px;
  right: -80px;
  opacity: 0.15;
  animation-delay: 0s;
}
.hero-glow-2 {
  width: 200px;
  height: 200px;
  background: var(--accent2);
  bottom: -60px;
  right: 200px;
  opacity: 0.2;
  animation-delay: 2s;
}
@keyframes float {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-20px) scale(1.05); }
}

/* Floating Particles in Hero Background */
.hero-particle {
  position: absolute;
  pointer-events: none;
  opacity: 0.15;
  animation: floatParticle 15s linear infinite;
  color: var(--accent);
  font-family: sans-serif;
  font-weight: 800;
  user-select: none;
}
.hero-particle-1 { font-size: 1.4rem; top: 15%; left: 25%; animation-duration: 16s; animation-delay: -2s; color: var(--accent); }
.hero-particle-2 { font-size: 2.2rem; bottom: 20%; left: 45%; animation-duration: 22s; animation-delay: -5s; color: var(--accent2); }
.hero-particle-3 { font-size: 1.2rem; top: 60%; left: 10%; animation-duration: 18s; animation-delay: -10s; color: var(--accent); }
.hero-particle-4 { font-size: 1.8rem; top: 25%; left: 55%; animation-duration: 14s; animation-delay: -1s; color: var(--accent2); }
.hero-particle-5 { font-size: 1rem; bottom: 10%; left: 70%; animation-duration: 25s; animation-delay: -8s; color: var(--accent); }

@keyframes floatParticle {
  0% { transform: translateY(0) rotate(0deg) scale(0.8); opacity: 0; }
  20% { opacity: 0.15; }
  50% { transform: translateY(-40px) rotate(180deg) scale(1.1); opacity: 0.15; }
  80% { opacity: 0.15; }
  100% { transform: translateY(-80px) rotate(360deg) scale(0.8); opacity: 0; }
}

.hero-content { position: relative; z-index: 1; flex: 1; }
.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent-glow);
  border: 1px solid var(--border-accent);
  color: var(--accent);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 40px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 12px;
  box-shadow: 0 0 10px var(--accent-glow);
}
.hero-title {
  font-size: clamp(1.6rem, 3.5vw, 2.6rem);
  font-weight: 900;
  line-height: 1.15;
  margin-bottom: 12px;
}
.hero-title span { color: var(--accent); text-shadow: 0 0 15px var(--accent-glow); }
.hero-desc {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: 24px;
  max-width: 420px;
  line-height: 1.6;
}
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.btn-primary {
  background: var(--accent);
  color: #000;
  font-weight: 800;
  padding: 12px 24px;
  border-radius: 40px;
  font-size: 0.875rem;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  position: relative;
  overflow: hidden;
}
.btn-primary::after {
  content: '';
  position: absolute;
  top: 0;
  left: -150%;
  width: 50%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
  transform: skewX(-20deg);
  animation: shimmerBtn 4s infinite linear;
}
@keyframes shimmerBtn {
  0% { left: -150%; }
  30% { left: 150%; }
  100% { left: 150%; }
}
.btn-primary:hover {
  background: var(--accent-dark);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px var(--accent-glow);
}
.btn-secondary {
  background: transparent;
  color: var(--text-primary);
  font-weight: 700;
  padding: 12px 24px;
  border-radius: 40px;
  font-size: 0.875rem;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}
.hero-stats { display: flex; gap: 24px; margin-top: 20px; }
.hero-stat { text-align: left; }
.hero-stat-num {
  font-size: 1.45rem;
  font-weight: 900;
  color: var(--accent);
  line-height: 1;
  text-shadow: 0 0 10px var(--accent-glow);
  animation: pulseStat 3s infinite ease-in-out;
}
.hero-stat:nth-child(2) .hero-stat-num { animation-delay: 1s; }
.hero-stat:nth-child(3) .hero-stat-num { animation-delay: 2s; }
@keyframes pulseStat {
  0%, 100% { opacity: 1; text-shadow: 0 0 8px var(--accent-glow); }
  50% { opacity: 0.8; text-shadow: 0 0 18px var(--accent-glow); }
}
.hero-stat-label { font-size: 0.7rem; color: var(--text-muted); font-weight: 600; margin-top: 2px; }
.hero-visual { position: relative; z-index: 1; flex-shrink: 0; }
.hero-game-cards {
  display: grid;
  grid-template-columns: repeat(2, 100px);
  grid-template-rows: repeat(2, 75px);
  gap: 8px;
  transform: rotate(-5deg);
}
.hero-mini-card {
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  cursor: pointer;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s, border-color 0.3s;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.05);
}
.hero-mini-card:nth-child(1) { animation: cardFloat1 5.5s ease-in-out infinite; }
.hero-mini-card:nth-child(2) { animation: cardFloat2 4.8s ease-in-out infinite; }
.hero-mini-card:nth-child(3) { animation: cardFloat3 6s ease-in-out infinite; }
.hero-mini-card:nth-child(4) { animation: cardFloat4 5.2s ease-in-out infinite; }

@keyframes cardFloat1 {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
@keyframes cardFloat2 {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}
@keyframes cardFloat3 {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}
@keyframes cardFloat4 {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.hero-mini-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}
.hero-mini-card:hover {
  transform: scale(1.15) rotate(2deg) translateY(-5px) !important;
  box-shadow: 0 12px 28px var(--accent-glow);
  z-index: 10;
  border-color: var(--accent);
}

/* ── Section Headers ── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 16px;
}
.section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.1rem;
  font-weight: 800;
}
.section-title .section-emoji { font-size: 1.3rem; }
.section-badge {
  background: var(--accent-glow);
  color: var(--accent);
  border: 1px solid var(--border-accent);
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.see-all-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 6px 14px;
  border-radius: 40px;
  font-size: 0.75rem;
  font-weight: 700;
  transition: var(--transition);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.see-all-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ── Category Pills ── */
.category-pills {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin-bottom: 24px;
  scrollbar-width: none;
}
.category-pills::-webkit-scrollbar { display: none; }
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 40px;
  font-size: 0.8rem;
  font-weight: 700;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  flex-shrink: 0;
}
.pill:hover {
  border-color: var(--accent);
  color: var(--text-primary);
}
.pill.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #000;
}

/* ════════════════════════════════════════
   GAME CARDS
   ════════════════════════════════════════ */
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
}
.games-grid-wide {
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

.game-card {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: var(--transition);
  background: var(--bg-card);
  border: 1px solid var(--border);
  group: true;
}
.game-card:hover {
  transform: translateY(-4px) scale(1.02);
  border-color: var(--accent);
  box-shadow: 0 12px 40px rgba(76, 206, 133, 0.2);
  z-index: 2;
}

.game-thumb {
  position: relative;
  width: 100%;
  padding-top: 75%;
  overflow: hidden;
  border-radius: var(--radius) var(--radius) 0 0;
}
.game-thumb-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}
.game-card:hover .game-thumb-img { transform: scale(1.08); }
.game-thumb-gradient {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  transition: transform 0.3s ease;
}
.game-card:hover .game-thumb-gradient { transform: scale(1.1); }
.game-thumb-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.5) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.25s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.game-card:hover .game-thumb-overlay { opacity: 1; }
.play-btn-overlay {
  background: var(--accent);
  color: #000;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transform: scale(0.8);
  transition: transform 0.25s;
  box-shadow: 0 0 20px var(--accent-glow);
}
.game-card:hover .play-btn-overlay { transform: scale(1); }

/* Badges */
.game-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  font-size: 0.6rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.badge-new { background: #00b894; color: #fff; }
.badge-hot { background: #ff4757; color: #fff; }
.badge-trending { background: #ff6348; color: #fff; }
.badge-featured { background: var(--accent2); color: #fff; }

.game-info { padding: 10px 12px 12px; }
.game-title {
  font-size: 0.825rem;
  font-weight: 800;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}
.game-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.7rem;
  color: var(--text-muted);
}
.game-rating {
  display: flex;
  align-items: center;
  gap: 3px;
  color: #ffd700;
  font-weight: 700;
}
.game-plays { color: var(--text-muted); }
.mobile-badge {
  display: flex;
  align-items: center;
  gap: 2px;
  color: var(--accent);
  margin-left: auto;
  font-size: 0.65rem;
}

/* Featured Card (large) */
.game-card-featured {
  grid-column: span 2;
  grid-row: span 2;
}
.game-card-featured .game-thumb { padding-top: 56.25%; }
.game-card-featured .game-thumb-gradient { font-size: 4rem; }
.game-card-featured .game-title { font-size: 1rem; }

/* ── Category Cards ── */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px;
  margin-bottom: 32px;
}
.category-card {
  border-radius: var(--radius);
  padding: 20px 12px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}
.category-card::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.08;
  background: inherit;
  transition: opacity 0.25s;
}
.category-card:hover { transform: translateY(-3px); border-color: rgba(255,255,255,0.2); }
.category-card:hover::before { opacity: 0.15; }
.category-card .cat-emoji { font-size: 1.8rem; display: block; margin-bottom: 8px; }
.category-card .cat-name {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--text-primary);
  display: block;
}
.category-card .cat-count { font-size: 0.65rem; color: rgba(255,255,255,0.5); margin-top: 2px; }

/* ── Horizontal Scroll ── */
.games-scroll {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 8px;
  scrollbar-width: none;
}
.games-scroll::-webkit-scrollbar { display: none; }
.games-scroll .game-card { min-width: 160px; flex-shrink: 0; }

/* ── Ad Containers ── */
.ad-container {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 16px 0;
  width: 100%;
}
.ad-container-leaderboard {
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin: 16px 0 24px;
}

/* ════════════════════════════════════════
   RECENTLY PLAYED
   ════════════════════════════════════════ */
.recently-played-section {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 28px;
}

/* ════════════════════════════════════════
   GAME PAGE
   ════════════════════════════════════════ */
.game-player-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 24px;
}
.game-player-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}
.game-player-title {
  font-size: 1.4rem;
  font-weight: 900;
}
.game-player-actions { display: flex; gap: 8px; }
.action-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  font-size: 1rem;
}
.action-btn:hover { border-color: var(--accent); color: var(--accent); }
.action-btn.liked { color: #ff4757; border-color: #ff4757; background: rgba(255,71,87,0.1); }

.game-layout { display: flex; gap: 20px; align-items: flex-start; }
.game-main { flex: 1; min-width: 0; }
.game-sidebar-right { width: 300px; flex-shrink: 0; }

.game-frame-wrapper {
  position: relative;
  width: 100%;
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 16/9;
  border: 1px solid var(--border);
  min-height: 400px;
}
.game-frame-wrapper iframe,
.game-frame-wrapper #rufflePlayerContainer,
.game-frame-wrapper .game-placeholder {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}
.fullscreen-btn {
  position: absolute;
  bottom: 12px;
  right: 12px;
  background: rgba(0,0,0,0.7);
  border: 1px solid rgba(255,255,255,0.2);
  color: white;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.9rem;
  transition: var(--transition);
  z-index: 10;
}
.fullscreen-btn:hover { background: var(--accent); color: #000; }
.mute-btn-game {
  position: absolute;
  bottom: 12px;
  right: 54px;
  background: rgba(0,0,0,0.7);
  border: 1px solid rgba(255,255,255,0.2);
  color: white;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.9rem;
  transition: var(--transition);
  z-index: 10;
}
.mute-btn-game:hover { background: var(--accent); color: #000; }
.rotate-btn-game {
  position: absolute;
  bottom: 12px;
  right: 96px;
  background: rgba(0,0,0,0.7);
  border: 1px solid rgba(255,255,255,0.2);
  color: white;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.9rem;
  transition: var(--transition);
  z-index: 10;
}
.rotate-btn-game:hover { background: var(--accent); color: #000; }

/* Rotated layout for mobile view simulation */
.game-frame-wrapper.rotated-mode {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vh !important;
  height: 100vw !important;
  z-index: 999999 !important;
  transform: rotate(90deg) translateY(-100%) !important;
  transform-origin: top left !important;
  border-radius: 0 !important;
  border: none !important;
}

.game-frame-wrapper.rotated-mode .fullscreen-btn,
.game-frame-wrapper.rotated-mode .mute-btn-game,
.game-frame-wrapper.rotated-mode .rotate-btn-game {
  z-index: 1000001 !important;
  bottom: 16px !important;
}


.game-placeholder {
  width: 100%;
  height: 100%;
  min-height: 400px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: linear-gradient(135deg, #1a1828, #0f0e17);
}
.game-placeholder-emoji { font-size: 4rem; animation: float 3s ease-in-out infinite; }
.game-placeholder-text { font-size: 1.1rem; font-weight: 700; color: var(--text-secondary); }
.game-placeholder-btn {
  background: var(--accent);
  color: #000;
  border: none;
  padding: 12px 28px;
  border-radius: 40px;
  font-size: 0.875rem;
  font-weight: 800;
  cursor: pointer;
  transition: var(--transition);
}
.game-placeholder-btn:hover { background: var(--accent-dark); transform: scale(1.05); }

.game-details-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-top: 16px;
}
.game-details-title { font-size: 0.875rem; font-weight: 800; margin-bottom: 12px; color: var(--accent); }
.game-details-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.detail-item { font-size: 0.75rem; }
.detail-label { color: var(--text-muted); display: block; margin-bottom: 2px; }
.detail-value { color: var(--text-primary); font-weight: 700; }

.game-description-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-top: 12px;
  font-size: 0.85rem;
  line-height: 1.7;
  color: var(--text-secondary);
}

.rating-widget { display: flex; align-items: center; gap: 6px; margin-bottom: 12px; }
.stars { color: #ffd700; font-size: 1.1rem; }
.rating-number { font-size: 1.5rem; font-weight: 900; color: var(--text-primary); }
.rating-count { font-size: 0.75rem; color: var(--text-muted); }

.tags-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.tag-chip {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  cursor: pointer;
  transition: var(--transition);
}
.tag-chip:hover { border-color: var(--accent); color: var(--accent); }

/* ════════════════════════════════════════
   CATEGORY PAGE
   ════════════════════════════════════════ */
.category-page-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
  padding: 24px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  position: relative;
  overflow: hidden;
}
.category-page-emoji { font-size: 3rem; }
.category-page-title { font-size: 1.6rem; font-weight: 900; }
.category-page-count { font-size: 0.85rem; color: var(--text-muted); margin-top: 4px; }

.sort-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.sort-label { font-size: 0.8rem; color: var(--text-muted); font-weight: 600; white-space: nowrap; }
.sort-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 6px 14px;
  border-radius: 40px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}
.sort-btn.active, .sort-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #000;
}

/* ── Pagination ── */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  padding: 32px 0 16px;
  flex-wrap: wrap;
}
.page-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}
.page-btn.active { background: var(--accent); border-color: var(--accent); color: #000; }
.page-btn:hover:not(.active) { border-color: var(--accent); color: var(--accent); }
.page-btn:disabled { opacity: 0.3; cursor: not-allowed; }

/* ════════════════════════════════════════
   FOOTER
   ════════════════════════════════════════ */
.footer {
  background: var(--bg-sidebar);
  border-top: 1px solid var(--border);
  padding: 40px 24px 24px;
  margin-top: auto;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 32px;
  max-width: 1400px;
  margin: 0 auto;
  margin-bottom: 32px;
}
.footer-brand .logo-text { font-size: 1.5rem; font-weight: 900; margin-bottom: 12px; display: block; }
.footer-desc { font-size: 0.825rem; color: var(--text-secondary); line-height: 1.7; max-width: 280px; }
.footer-col-title { font-size: 0.8rem; font-weight: 800; color: var(--text-primary); margin-bottom: 12px; text-transform: uppercase; letter-spacing: 0.5px; }
.footer-links { display: flex; flex-direction: column; gap: 8px; }
.footer-links a {
  font-size: 0.825rem;
  color: var(--text-secondary);
  transition: var(--transition);
}
.footer-links a:hover { color: var(--accent); }
.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  max-width: 1400px;
  margin: 0 auto;
}
.footer-copyright { font-size: 0.8rem; color: var(--text-muted); }
.footer-badges { display: flex; gap: 8px; flex-wrap: wrap; }
.footer-badge {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.65rem;
  padding: 3px 8px;
  border-radius: 20px;
  font-weight: 600;
}

/* ── Sidebar Overlay ── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 95;
  backdrop-filter: blur(2px);
}

/* ── Toast Notifications ── */
.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.825rem;
  font-weight: 600;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 8px;
  animation: slideInRight 0.3s ease;
  max-width: 280px;
}
.toast-success { border-color: var(--accent); }
.toast-icon { font-size: 1rem; }
@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ── Loading Spinner ── */
.loading-spinner {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 60px;
}
.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Empty State ── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.empty-state-emoji { font-size: 3rem; margin-bottom: 16px; }
.empty-state-title { font-size: 1.1rem; font-weight: 800; color: var(--text-secondary); margin-bottom: 8px; }
.empty-state-text { font-size: 0.875rem; line-height: 1.6; }

/* ════════════════════════════════════════
   RESPONSIVE - TABLET
   ════════════════════════════════════════ */
@media (max-width: 1024px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .menu-toggle { display: flex; }
  .sidebar-overlay.show { display: block; }
  .games-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .hero-visual { display: none; }
  .game-sidebar-right { width: 260px; }
}

/* ════════════════════════════════════════
   RESPONSIVE - MOBILE
   ════════════════════════════════════════ */
@media (max-width: 768px) {
  .page-wrapper { padding: 16px; }
  .hero-section { padding: 24px 20px; min-height: 180px; }
  .hero-title { font-size: 1.4rem; }
  .hero-stats { gap: 16px; }
  .games-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
  .category-grid { grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); }
  .games-scroll .game-card { min-width: 140px; }
  .game-card-featured { grid-column: span 1; grid-row: span 1; }
  .game-layout { flex-direction: column; }
  .game-sidebar-right { width: 100%; }
  .game-frame-wrapper { aspect-ratio: 4/3; min-height: 280px; }
  .footer-grid { grid-template-columns: 1fr; gap: 20px; }
  .footer-bottom { flex-direction: column; text-align: center; }
  .header { padding: 0 12px; gap: 10px; }
  .btn-header span { display: none; }
  .search-bar { max-width: none; }
  .ad-slot-728 { height: 50px; }
}

@media (max-width: 480px) {
  .hero-actions { flex-direction: column; }
  .btn-primary, .btn-secondary { width: 100%; justify-content: center; }
  .games-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .game-player-container { padding: 12px 16px; }
  .game-player-header { flex-direction: column; align-items: flex-start; }
}

/* ── Utility classes ── */
.mb-32 { margin-bottom: 32px; }
.mb-24 { margin-bottom: 24px; }
.mb-16 { margin-bottom: 16px; }
.text-accent { color: var(--accent); }
.text-muted { color: var(--text-muted); }
.font-bold { font-weight: 800; }
.section-divider { height: 1px; background: var(--border); margin: 32px 0; }

/* ── Scroll to top ── */
.scroll-top {
  position: fixed;
  bottom: 80px;
  right: 20px;
  width: 42px;
  height: 42px;
  background: var(--accent);
  color: #000;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 50;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
  box-shadow: 0 4px 16px var(--accent-glow);
  font-size: 1rem;
  border: none;
}
.scroll-top.visible { opacity: 1; visibility: visible; }
.scroll-top:hover { transform: translateY(-3px); }

/* ── Warning & Protocol Banners ── */
.security-banner {
  background: linear-gradient(135deg, #e84393, #ff7675);
  color: #fff;
  padding: 10px 20px;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 700;
  position: sticky;
  top: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  box-shadow: 0 4px 15px rgba(255, 71, 87, 0.25);
}
.security-banner a {
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
  padding: 3px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  transition: var(--transition);
  border: 1px solid rgba(255, 255, 255, 0.5);
  text-decoration: none;
}
.security-banner a:hover {
  background: #fff;
  color: #000;
  transform: scale(1.05);
}

.localhost-warning {
  background: rgba(124, 58, 237, 0.1);
  border: 1px solid rgba(124, 58, 237, 0.3);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-top: 12px;
  font-size: 0.825rem;
  color: var(--text-secondary);
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.localhost-warning-title {
  font-weight: 800;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 6px;
}
.btn-launch-direct {
  background: var(--accent);
  color: #000;
  padding: 6px 14px;
  border-radius: 20px;
  font-weight: 800;
  font-size: 0.75rem;
  width: fit-content;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-launch-direct:hover {
  background: var(--accent-dark);
  transform: scale(1.03);
}
