/* ============================================================
   GameHub — Main Stylesheet
   Responsive: Mobile 2-col | Tablet 3-4 col | Desktop 4-6 col
   ============================================================ */

/* ===== CSS VARIABLES ===== */
:root {
  --bg:           #e8dcf5;
  --bg2:          #ddd0ee;
  --bg3:          #cfc1e6;
  --card:         #ffffff;
  --card-hover:   #f5f0ff;
  --text:         #1e1035;
  --text2:        #4a3870;
  --text3:        #8b7aaa;
  --primary:      #7c3aed;
  --primary-h:    #6d28d9;
  --primary-glow: rgba(124,58,237,.25);
  --red:          #ef4444;
  --green:        #16a34a;
  --gold:         #d97706;
  --border:       rgba(100,60,180,.15);
  --radius:       14px;
  --radius-sm:    10px;
  --nav-h:        64px;
  --sidebar-w:    220px;
  --ease:         cubic-bezier(.4,0,.2,1);
  --trans:        .18s var(--ease);
}

/* ===== RESET ===== */
*,*::before,*::after { box-sizing:border-box; margin:0; padding:0; }
html { scroll-behavior:smooth; -webkit-text-size-adjust:100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  overflow-x: hidden;
  min-height: 100vh;
}
a { color:inherit; text-decoration:none; }
img { max-width:100%; display:block; }
ul { list-style:none; }
button { cursor:pointer; border:none; background:none; font:inherit; color:inherit; }
input,select { font:inherit; }
.sr-only { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0,0,0,0); }

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width:6px; height:5px; }
::-webkit-scrollbar-track { background:var(--bg); }
::-webkit-scrollbar-thumb { background:var(--bg3); border-radius:3px; }
::-webkit-scrollbar-thumb:hover { background:var(--primary); }

/* ===== NAVBAR ===== */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  background: rgba(232,220,245,.96);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.navbar-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 16px;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Hamburger */
.menu-btn {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
  border-radius: var(--radius-sm);
  transition: background var(--trans);
  flex-shrink: 0;
}
.menu-btn:hover { background: rgba(124,58,237,.12); }
.menu-btn span {
  display: block;
  width: 21px;
  height: 2px;
  background: var(--primary);
  border-radius: 2px;
  transition: transform var(--trans), opacity var(--trans);
}
.menu-btn.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-btn.active span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.menu-btn.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Logo */
.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.18rem;
  font-weight: 800;
  letter-spacing: -.01em;
  white-space: nowrap;
  flex-shrink: 0;
}
.logo-icon { font-size: 1.35rem; }
.logo-text {
  background: linear-gradient(135deg, #a78bfa, #7c3aed);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Search */
.search-wrap { flex: 1; max-width: 480px; margin: 0 auto; }
.search-form {
  display: flex;
  align-items: center;
  background: rgba(255,255,255,.7);
  border: 1.5px solid var(--border);
  border-radius: 24px;
  overflow: hidden;
  transition: border-color var(--trans), box-shadow var(--trans);
}
.search-form:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}
.search-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  padding: 10px 16px;
  color: var(--text);
  font-size: .9rem;
}
.search-input::placeholder { color: var(--text3); }
.search-btn { padding: 8px 14px; color: var(--text3); transition: color var(--trans); }
.search-btn:hover { color: var(--primary); }
.search-btn svg { width: 18px; height: 18px; display: block; }

/* Nav actions */
.nav-actions { display: flex; align-items: center; gap: 6px; margin-left: auto; flex-shrink: 0; }
.search-toggle {
  display: none;
  padding: 8px;
  border-radius: var(--radius-sm);
  color: var(--primary);
  transition: background var(--trans);
}
.search-toggle:hover { background: rgba(124,58,237,.12); }
.search-toggle svg { width: 20px; height: 20px; display: block; }
.btn-signin {
  padding: 7px 20px;
  background: var(--primary);
  border-radius: 20px;
  font-size: .85rem;
  font-weight: 600;
  transition: background var(--trans), transform var(--trans);
  white-space: nowrap;
}
.btn-signin:hover { background: var(--primary-h); transform: translateY(-1px); }

/* ===== OVERLAY (mobile) ===== */
.overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(80,30,140,.45);
  backdrop-filter: blur(2px);
}
.overlay.active { display: block; }

/* ===== AD SLOTS ===== */
.ad-wrap { text-align: center; padding: 6px 16px; }
.ad-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,.4);
  border: 1px dashed rgba(124,58,237,.25);
  border-radius: var(--radius-sm);
  position: relative;
  overflow: hidden;
}
.ad-label {
  font-size: .65rem;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: .1em;
  text-align: center;
  user-select: none;
  pointer-events: none;
}
.ad-leaderboard { width: 300px; height: 250px; max-width: 100%; margin: 0 auto; }
.ad-rect        { width: 300px; height: 250px; margin: 16px auto; }
.ad-incontent   { width: 300px; max-width: 100%; height: 250px; margin: 20px auto; }
.ad-banner      { width: 320px; height: 50px;  max-width: 100%; margin: 20px auto; }

/* ===== PAGE WRAPPER (replaces main-layout) ===== */
.page-wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px 32px;
}

/* ===== AD ROW ===== */
.ad-row { text-align: center; margin: 16px 0; }
.ad-row-slim { margin: 8px 0 20px; }

/* ===== SIDEBAR (always off-canvas) ===== */
.sidebar {
  position: fixed;
  top: 0;
  left: calc(-1 * var(--sidebar-w) - 8px);
  width: var(--sidebar-w);
  height: 100vh;
  background: rgba(245,240,255,.98);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 110;
  border-right: 1px solid var(--border);
  transition: left .28s var(--ease);
  overflow-y: auto;
  overflow-x: hidden;
  padding-bottom: 48px;
  box-shadow: 4px 0 24px rgba(100,50,200,.18);
}
.sidebar.open { left: 0; }

.sidebar-inner { padding: 0; }

.sidebar-close-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 14px 10px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 6px;
}
.sidebar-logo { font-size: .95rem; font-weight: 800; color: var(--primary); }
.sidebar-close-btn {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: rgba(124,58,237,.12);
  color: var(--primary);
  font-size: .85rem;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; border: none; font-family: inherit;
  transition: background var(--trans);
}
.sidebar-close-btn:hover { background: var(--primary); color: #fff; }

.sidebar-heading {
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--text3);
  padding: 10px 14px 6px;
}

/* Category list */
.cat-list { display: flex; flex-direction: column; gap: 2px; }
.cat-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--trans), color var(--trans);
  font-size: .875rem;
  user-select: none;
}
.cat-item:hover { background: rgba(124,58,237,.1); }
.cat-item.active { background: var(--primary); color: #fff; }
.cat-icon { font-size: 1rem; width: 22px; text-align: center; flex-shrink: 0; }
.cat-name { flex: 1; font-weight: 500; }
.cat-count {
  font-size: .7rem;
  color: var(--text3);
  background: rgba(124,58,237,.12);
  padding: 2px 7px;
  border-radius: 10px;
  font-weight: 600;
}
.cat-item.active .cat-count { background: rgba(255,255,255,.25); color: rgba(255,255,255,.9); }

/* Hot list */
.hot-list { display: flex; flex-direction: column; gap: 2px; }
.hot-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--trans);
  text-decoration: none;
  color: inherit;
}
.hot-item:hover { background: rgba(124,58,237,.1); }
.hot-thumb {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
}
.hot-info { min-width: 0; }
.hot-title { font-size: .8rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hot-plays { font-size: .72rem; color: var(--text3); margin-top: 1px; }

/* ===== MAIN CONTENT ===== */
.content { min-width: 0; padding: 16px 0 32px; }

/* ===== SECTIONS ===== */
.section { margin-bottom: 30px; }
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.section-title { font-size: 1.05rem; font-weight: 700; }
.see-all {
  font-size: .78rem;
  color: var(--primary);
  font-weight: 600;
  padding: 4px 12px;
  border: 1.5px solid var(--primary);
  border-radius: 12px;
  transition: background var(--trans), color var(--trans);
}
.see-all:hover { background: var(--primary); color: #fff; }

/* ===== FEATURED SCROLL ===== */
.featured-scroll {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 6px;
  -webkit-overflow-scrolling: touch;
}
.featured-scroll::-webkit-scrollbar { height: 3px; }
.featured-card {
  flex-shrink: 0;
  width: 190px;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--card);
  cursor: pointer;
  scroll-snap-align: start;
  transition: transform var(--trans), box-shadow var(--trans);
  position: relative;
  box-shadow: 0 4px 16px rgba(100,50,200,.12);
  text-decoration: none;
  color: inherit;
  display: block;
}
.featured-card:hover { transform: translateY(-5px); box-shadow: 0 14px 32px rgba(100,50,200,.25); }
.featured-thumb {
  width: 100%;
  height: 115px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.8rem;
  position: relative;
}
.featured-thumb::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.65) 0%, transparent 55%);
}
.featured-info { padding: 10px 11px 11px; }
.featured-title { font-size: .85rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px; }
.featured-meta { display: flex; align-items: center; gap: 8px; font-size: .72rem; color: var(--text2); }
.feat-rating { color: var(--gold); font-weight: 600; }

/* ===== CATEGORY PILLS (mobile) ===== */
.pills-wrap { display: none; margin-bottom: 18px; }
.pills-scroll {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding: 2px 0 8px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.pills-scroll::-webkit-scrollbar { display: none; }
.pill {
  flex-shrink: 0;
  padding: 7px 15px;
  background: rgba(255,255,255,.65);
  border: 1.5px solid rgba(124,58,237,.25);
  border-radius: 20px;
  font-size: .8rem;
  font-weight: 500;
  color: var(--text2);
  cursor: pointer;
  transition: background var(--trans), border-color var(--trans), color var(--trans);
  white-space: nowrap;
  user-select: none;
}
.pill:hover,
.pill.active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ===== GAMES GRID ===== */
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 13px;
}

/* Game card */
.game-card {
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  position: relative;
  transition: transform var(--trans), box-shadow var(--trans), background var(--trans);
  box-shadow: 0 3px 12px rgba(100,50,200,.1);
  text-decoration: none;
  color: inherit;
  display: block;
}
.game-card:hover { transform: translateY(-5px); box-shadow: 0 12px 28px rgba(100,50,200,.22); background: var(--card-hover); }
.game-card:hover .game-overlay { opacity: 1; }
.game-card:hover .play-btn { transform: scale(1); }

.game-thumb {
  width: 100%;
  aspect-ratio: 4/3;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.4rem;
  position: relative;
  overflow: hidden;
}
.game-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.48);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--trans);
}
.play-btn {
  width: 46px;
  height: 46px;
  background: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: scale(.78);
  transition: transform var(--trans);
  box-shadow: 0 4px 16px rgba(124,58,237,.5);
}
.play-btn svg { width: 18px; height: 18px; fill: #fff; margin-left: 2px; }

.game-badge {
  position: absolute;
  top: 7px;
  left: 7px;
  padding: 2px 7px;
  border-radius: 6px;
  font-size: .62rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
  line-height: 1.5;
}
.badge-hot { background: var(--red); color: #fff; }
.badge-new { background: var(--green); color: #052010; }

.game-info { padding: 9px 10px 8px; }
.game-title {
  font-size: .82rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 5px;
  color: var(--text);
}
.game-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: .72rem;
}
.game-rating { color: var(--gold); font-weight: 700; }
.game-plays { color: var(--text3); }

/* ===== SORT ===== */
.sort-wrap { display: flex; align-items: center; gap: 8px; }
.sort-select {
  background: rgba(255,255,255,.7);
  border: 1.5px solid rgba(124,58,237,.25);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: .8rem;
  color: var(--text);
  outline: none;
  cursor: pointer;
  transition: border-color var(--trans);
}
.sort-select:focus { border-color: var(--primary); }

/* ===== LOAD MORE ===== */
.load-more-wrap { text-align: center; margin-top: 24px; }
.btn-load-more {
  padding: 11px 36px;
  background: transparent;
  border: 2px solid var(--primary);
  border-radius: 24px;
  color: var(--primary);
  font-size: .9rem;
  font-weight: 600;
  transition: background var(--trans), color var(--trans), transform var(--trans);
}
.btn-load-more:hover { background: var(--primary); color: #fff; transform: translateY(-1px); }
.btn-load-more:disabled { opacity: .5; cursor: not-allowed; transform: none; }

/* ===== NO RESULTS ===== */
.no-results {
  grid-column: 1 / -1;
  padding: 52px 24px;
  text-align: center;
  color: var(--text3);
}
.no-results .nr-icon { font-size: 3rem; margin-bottom: 12px; }
.no-results h3 { font-size: 1.1rem; color: var(--text2); margin-bottom: 6px; }
.no-results p { font-size: .88rem; }

/* ===== FOOTER ===== */
.footer { background: var(--bg2); border-top: 1px solid rgba(124,58,237,.2); margin-top: 16px; }
.footer-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 40px 24px 32px;
  display: flex;
  gap: 40px;
  flex-wrap: wrap;
}
.footer-brand { max-width: 230px; flex-shrink: 0; }
.footer-tagline { font-size: .84rem; color: var(--text3); margin-top: 10px; line-height: 1.7; }
.footer-nav { flex: 1; display: flex; gap: 32px; flex-wrap: wrap; min-width: 0; }
.footer-col h3 {
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text2);
  margin-bottom: 12px;
}
.footer-col ul { display: flex; flex-direction: column; gap: 8px; }
.footer-col a { font-size: .84rem; color: var(--text3); transition: color var(--trans); }
.footer-col a:hover { color: var(--primary); }
.footer-bottom {
  border-top: 1px solid var(--border);
  padding: 16px 24px;
  text-align: center;
  font-size: .78rem;
  color: var(--text3);
}

/* ===== BACK TO TOP ===== */
.back-to-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 42px;
  height: 42px;
  background: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: #fff;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .28s, transform .28s;
  pointer-events: none;
  z-index: 80;
  box-shadow: 0 4px 14px var(--primary-glow);
  font-weight: 700;
}
.back-to-top.visible { opacity: 1; transform: translateY(0); pointer-events: all; }

/* ===== SKELETON ANIMATION ===== */
@keyframes shimmer {
  0%   { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}
.skeleton {
  background: linear-gradient(90deg, var(--bg2) 25%, var(--bg) 50%, var(--bg2) 75%);
  background-size: 800px 100%;
  animation: shimmer 1.4s infinite linear;
  border-radius: var(--radius);
}

/* ===== FADE IN ANIMATION ===== */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.game-card { animation: fadeUp .3s var(--ease) both; }

/* ============================================================
   HERO SECTION
   ============================================================ */
.hero-section {
  max-width: 1200px;
  margin: 16px auto 0;
  padding: 0 16px;
}
.hero-inner {
  display: flex;
  gap: 12px;
  height: 300px;
}

/* Main big card */
.hero-main {
  flex: 1;
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
  cursor: pointer;
  min-width: 0;
  text-decoration: none;
  color: inherit;
  display: block;
}
.hero-bg-img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .4s var(--ease);
}
.hero-main:hover .hero-bg-img { transform: scale(1.04); }
.hero-gradient {
  position: absolute; inset: 0;
  background: linear-gradient(105deg, rgba(20,5,50,.88) 0%, rgba(20,5,50,.55) 50%, transparent 80%);
}
.hero-content {
  position: absolute;
  bottom: 0; left: 0;
  padding: 24px 28px;
  max-width: 420px;
}
.hero-cat-badge {
  display: inline-block;
  background: var(--primary);
  color: #fff;
  padding: 3px 12px;
  border-radius: 12px;
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 10px;
}
.hero-title {
  font-size: 1.7rem;
  font-weight: 900;
  color: #fff;
  line-height: 1.15;
  margin-bottom: 7px;
  text-shadow: 0 2px 8px rgba(0,0,0,.4);
}
.hero-desc {
  font-size: .82rem;
  color: rgba(255,255,255,.8);
  margin-bottom: 12px;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.hero-meta {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 14px;
  font-size: .78rem;
}
.hero-rating { color: var(--gold); font-weight: 700; }
.hero-plays  { color: rgba(255,255,255,.7); }
.hero-play-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 22px;
  background: var(--primary);
  border-radius: 22px;
  font-size: .88rem;
  font-weight: 700;
  color: #fff;
  border: none; cursor: pointer;
  transition: background var(--trans), transform var(--trans), box-shadow var(--trans);
  box-shadow: 0 4px 16px rgba(124,58,237,.45);
}
.hero-play-btn svg { width: 14px; height: 14px; fill: #fff; flex-shrink: 0; }
.hero-play-btn:hover { background: var(--primary-h); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(124,58,237,.5); }

/* Side cards */
.hero-side {
  width: 210px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.hero-side-card {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--card);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--trans), transform var(--trans), box-shadow var(--trans);
  box-shadow: 0 2px 10px rgba(100,50,200,.1);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
}
.hero-side-card:hover {
  background: var(--card-hover);
  transform: translateX(4px);
  box-shadow: 0 4px 16px rgba(100,50,200,.18);
}
.hero-side-img {
  width: 52px; height: 52px;
  object-fit: cover;
  border-radius: 10px;
  flex-shrink: 0;
}
.hero-side-info { flex: 1; min-width: 0; }
.hero-side-title {
  font-size: .82rem; font-weight: 700;
  color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-bottom: 3px;
}
.hero-side-meta { font-size: .7rem; color: var(--text3); }
.hero-side-arrow {
  font-size: .65rem; color: var(--primary);
  flex-shrink: 0; opacity: 0;
  transition: opacity var(--trans);
}
.hero-side-card:hover .hero-side-arrow { opacity: 1; }

/* ============================================================
   CATEGORY BAR
   ============================================================ */
.cat-bar-outer {
  position: sticky;
  top: var(--nav-h);
  z-index: 50;
  background: rgba(232,220,245,.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  margin-top: 14px;
}
.cat-bar-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
}
/* reuse .pills-scroll / .pill from existing but override display */
.cat-bar-outer .pills-scroll {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 10px 0;
  scrollbar-width: none;
}
.cat-bar-outer .pills-scroll::-webkit-scrollbar { display: none; }
.cat-bar-outer .pill {
  flex-shrink: 0;
  padding: 7px 16px;
  background: rgba(255,255,255,.6);
  border: 1.5px solid rgba(124,58,237,.2);
  border-radius: 20px;
  font-size: .8rem;
  font-weight: 600;
  color: var(--text2);
  cursor: pointer;
  transition: background var(--trans), border-color var(--trans), color var(--trans), box-shadow var(--trans);
  white-space: nowrap;
  user-select: none;
  display: flex; align-items: center; gap: 5px;
}
.cat-bar-outer .pill:hover { background: rgba(124,58,237,.1); border-color: var(--primary); color: var(--primary); }
.cat-bar-outer .pill.active { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 3px 12px rgba(124,58,237,.35); }
.pill-count {
  font-size: .65rem;
  background: rgba(0,0,0,.1);
  border-radius: 8px;
  padding: 1px 6px;
  font-weight: 700;
}
.cat-bar-outer .pill.active .pill-count { background: rgba(255,255,255,.25); }

/* ===== HAMBURGER always visible ===== */
.menu-btn { display: flex; }

/* ===== RESPONSIVE — TABLET ===== */
@media (max-width: 1100px) {
  .games-grid { grid-template-columns: repeat(auto-fill, minmax(136px, 1fr)); }
  .hero-inner { height: 260px; }
  .hero-side  { width: 185px; }
}

/* ===== RESPONSIVE — MOBILE ===== */
@media (max-width: 768px) {
  :root { --nav-h: 56px; --sidebar-w: 280px; }

  /* Navbar: hide desktop search, show toggle */
  .search-wrap { display: none; }
  .search-wrap.mobile-open {
    display: flex;
    position: fixed;
    top: var(--nav-h);
    left: 0; right: 0;
    padding: 8px 12px;
    background: rgba(232,220,245,.97);
    border-bottom: 1px solid var(--border);
    z-index: 111;
    animation: fadeUp .18s var(--ease) both;
  }
  .search-toggle { display: flex; }
  .btn-signin { display: none; }

  /* Hero collapses to single column */
  .hero-inner { flex-direction: column; height: auto; }
  .hero-main  { height: 200px; }
  .hero-side  { width: 100%; flex-direction: row; overflow-x: auto; }
  .hero-side-card { flex: 0 0 160px; }

  /* Category bar: smaller padding */
  .cat-bar-outer .cat-bar-inner { padding: 0 10px; }

  /* Grid: 2 columns */
  .games-grid { grid-template-columns: repeat(2, 1fr); gap: 9px; }

  /* Page wrap */
  .page-wrap { padding: 0 10px 24px; }
  .hero-section { padding: 0 10px; }

  /* Footer */
  .footer-inner { flex-direction: column; gap: 20px; padding: 28px 16px 24px; }
  .footer-nav { gap: 20px; }
  .footer-col { min-width: 120px; }

  .back-to-top { bottom: 16px; right: 14px; }
}

/* ===== WIDE SCREENS ===== */
@media (min-width: 1200px) {
  .games-grid { grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); }
  .hero-inner { height: 320px; }
}
@media (min-width: 1440px) {
  .games-grid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
}

/* ============================================================
   GAME CARD — real image thumbnails
   ============================================================ */
.game-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .35s var(--ease);
}
.game-card:hover .game-thumb img { transform: scale(1.06); }

.featured-thumb { overflow: hidden; }
.featured-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .35s var(--ease);
}
.featured-card:hover .featured-thumb img { transform: scale(1.06); }

.hot-thumb {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  flex-shrink: 0;
  overflow: hidden;
  object-fit: cover;
}

/* ============================================================
   GAME DETAIL PAGE  (new layout)
   ============================================================ */

.hidden { display: none !important; }

/* ── Page wrapper ── */
.gp-wrap {
  max-width: 960px;
  margin: 0 auto;
  padding: 12px 16px 24px;
}

/* ── Breadcrumb ── */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .82rem;
  color: var(--text3);
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.breadcrumb a { color: var(--text2); transition: color var(--trans); }
.breadcrumb a:hover { color: var(--primary); }
.bc-sep { opacity: .4; }
.bc-cat { color: var(--text2); }
.bc-current { color: var(--text); font-weight: 600; }

/* ── Landing layout ── */
.gp-landing {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 28px;
  align-items: start;
  margin-bottom: 20px;
}

/* Cover */
.gp-cover-wrap {
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
  cursor: pointer;
  aspect-ratio: 4/3;
  background: var(--bg3);
  box-shadow: 0 8px 28px rgba(100,50,200,.2);
}
.gp-cover-img {
  width: 100%; height: 100%;
  object-fit: cover; display: block;
  transition: transform .35s var(--ease);
}
.gp-cover-wrap:hover .gp-cover-img { transform: scale(1.04); }
.gp-cover-overlay {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.5);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 10px;
  opacity: 0;
  transition: opacity var(--trans);
  color: #fff; font-size: .88rem; font-weight: 600;
}
.gp-cover-wrap:hover .gp-cover-overlay { opacity: 1; }
.gp-play-circle {
  width: 64px; height: 64px;
  background: var(--primary);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 24px rgba(124,58,237,.6);
  transition: transform var(--trans);
}
.gp-cover-wrap:hover .gp-play-circle { transform: scale(1.1); }
.gp-play-circle svg { width: 26px; height: 26px; margin-left: 3px; }
.gp-click-label { letter-spacing: .02em; }

/* Info panel */
.gp-info { padding-top: 4px; }
.gp-badges { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.gp-badge-cat {
  padding: 4px 14px;
  background: var(--primary);
  border-radius: 20px;
  font-size: .7rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em; color: #fff;
}
.gp-badge-hot, .gp-badge-new {
  display: none;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: .7rem; font-weight: 700; color: #fff;
}
.gp-badge-hot { background: var(--red); }
.gp-badge-new { background: var(--green); }

.gp-title {
  font-size: 1.9rem; font-weight: 900;
  line-height: 1.15; letter-spacing: -.02em;
  color: var(--text); margin-bottom: 12px;
}
.gp-stats {
  display: flex; align-items: center; gap: 16px;
  margin-bottom: 14px; font-size: .88rem; flex-wrap: wrap;
}
.gp-rating { color: var(--gold); font-weight: 700; font-size: .95rem; }
.gp-plays  { color: var(--text3); }

.gp-desc {
  font-size: .9rem; color: var(--text2);
  line-height: 1.8; margin-bottom: 22px;
}
.gp-btn-play {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 36px;
  background: var(--primary);
  border-radius: 28px;
  font-size: 1rem; font-weight: 700; color: #fff;
  border: none; cursor: pointer;
  transition: background var(--trans), transform var(--trans), box-shadow var(--trans);
  box-shadow: 0 4px 20px var(--primary-glow);
  width: 100%; justify-content: center;
}
.gp-btn-play svg { width: 18px; height: 18px; fill: #fff; flex-shrink: 0; }
.gp-btn-play:hover { background: var(--primary-h); transform: translateY(-2px); box-shadow: 0 8px 28px var(--primary-glow); }
.gp-hint {
  text-align: center; font-size: .75rem;
  color: var(--text3); margin-top: 10px;
}

/* Ad in landing */
.gp-ad { margin: 0 0 20px; }

/* ── Playing state ── */
.gp-playing { margin-bottom: 28px; }
.gp-frame-bar {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--primary); padding: 10px 16px;
  border-radius: var(--radius) var(--radius) 0 0; gap: 12px;
}
.gp-frame-left {
  display: flex; align-items: center; gap: 10px; min-width: 0;
}
.gp-frame-icon { width: 28px; height: 28px; border-radius: 6px; object-fit: cover; flex-shrink: 0; }
.gp-frame-title {
  font-size: .88rem; font-weight: 600;
  color: rgba(255,255,255,.9);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.gp-frame-actions { display: flex; gap: 8px; flex-shrink: 0; }
.gp-frame-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px;
  background: rgba(255,255,255,.2);
  border: 1px solid rgba(255,255,255,.35);
  border-radius: 8px;
  font-size: .78rem; color: #fff; cursor: pointer;
  transition: background var(--trans);
}
.gp-frame-btn:hover { background: rgba(255,255,255,.35); }
.gp-frame-btn-exit:hover { background: var(--red); border-color: var(--red); }

.gp-frame-container {
  border: 2px solid var(--primary); border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  overflow: hidden; background: #000; line-height: 0;
}
#gameFrame {
  width: 100%;
  height: calc(100vh - var(--nav-h) - 56px);
  min-height: 480px; max-height: 900px;
  border: none; display: block;
}

/* More games */
.more-games-wrap {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 16px 32px;
}

/* ============================================================
   GAME PAGE — RESPONSIVE
   ============================================================ */
@media (max-width: 700px) {
  .gp-landing {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .gp-cover-overlay { opacity: 1; background: rgba(0,0,0,.38); }
  .gp-title { font-size: 1.4rem; }
  #gameFrame {
    height: 56vw;
    min-height: 260px;
    max-height: none;
  }
  .gp-wrap, .more-games-wrap { padding-left: 10px; padding-right: 10px; }
}
