:root {
  --primary: #1a9fd9;
  --primary-dark: #1580b0;
  --primary-light: #e8f6fc;
  --accent: #f5a623;
  --accent-dark: #e09315;
  --accent-light: #fff6e5;
  --bg-body: #f0f4f8;
  --bg-white: #ffffff;
  --bg-sidebar: #ffffff;
  --bg-card: #ffffff;
  --text-primary: #1a1a2e;
  --text-secondary: #6b7280;
  --text-muted: #9ca3af;
  --border-color: #e5e7eb;
  --border-light: #f3f4f6;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.1);
  --shadow-card: 0 2px 8px rgba(0,0,0,0.06);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 100px;
  --ease: cubic-bezier(0.25, 0.8, 0.25, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-body);
  color: var(--text-primary);
  display: flex;
  height: 100vh;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

.app-container {
  display: flex;
  width: 100%;
  height: 100%;
}

/* ── Sidebar ── */
.sidebar {
  width: 240px;
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  z-index: 100;
  padding: 20px 0;
  overflow-y: auto;
}

.sidebar::-webkit-scrollbar { width: 0; }

.logo {
  padding: 4px 20px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-img {
  width: 140px;
  height: auto;
  object-fit: contain;
}

/* Sidebar search */
.sidebar-search {
  padding: 0 16px 16px;
}

.sidebar-search-input {
  width: 100%;
  padding: 10px 14px 10px 38px;
  border-radius: var(--radius-full);
  border: 2px solid var(--border-color);
  background: var(--bg-body);
  font-size: 14px;
  color: var(--text-primary);
  outline: none;
  transition: all 0.2s var(--ease);
  font-family: inherit;
}

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

.sidebar-search-input:focus {
  border-color: var(--primary);
  background: var(--bg-white);
  box-shadow: 0 0 0 3px rgba(26, 159, 217, 0.12);
}

.sidebar-search-wrap {
  position: relative;
}

.sidebar-search-icon {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 14px;
  pointer-events: none;
}

/* Nav menu */
.nav-menu {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 10px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  transition: all 0.2s var(--ease);
}

.nav-item:hover {
  background-color: var(--bg-body);
  color: var(--text-primary);
}

.nav-item.active {
  background-color: var(--primary-light);
  color: var(--primary);
}

.nav-item .icon {
  font-size: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
}

.nav-item.active .icon {
  opacity: 1;
}

.divider {
  height: 1px;
  background-color: var(--border-color);
  margin: 12px 16px;
}

.nav-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-muted);
  font-weight: 700;
  padding: 8px 24px 6px;
}

/* ── Main Content ── */
.main-content {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* Top bar */
.topbar {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 32px;
  background: var(--bg-white);
  border-bottom: 1px solid var(--border-color);
  gap: 12px;
  flex-shrink: 0;
}

.topbar-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin-right: auto;
}

.topbar-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: var(--bg-body);
  color: var(--text-secondary);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s var(--ease);
}

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

/* ── Scroll Area ── */
.scroll-area {
  flex-grow: 1;
  overflow-y: auto;
  padding: 28px 32px;
}

.scroll-area::-webkit-scrollbar { width: 6px; }
.scroll-area::-webkit-scrollbar-track { background: transparent; }
.scroll-area::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 3px;
}
.scroll-area::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* ── Category Pills ── */
.category-pills {
  display: flex;
  gap: 10px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.category-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: var(--radius-full);
  background: var(--bg-white);
  border: 1.5px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s var(--ease);
  white-space: nowrap;
}

.category-pill:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}

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

.category-pill .pill-icon {
  font-size: 16px;
}

/* ── Hero Slider ── */
.hero-slider {
  position: relative;
  margin-bottom: 36px;
  border-radius: var(--radius-xl);
  overflow: hidden;
}

.hero-slider-track {
  position: relative;
  width: 100%;
  height: 320px;
}

.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.6s ease;
  pointer-events: none;
  z-index: 0;
}

.hero-slide.active {
  opacity: 1;
  pointer-events: auto;
  z-index: 1;
}

/* Slider arrows */
.slider-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.85);
  color: var(--text-primary);
  font-size: 24px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  transition: all 0.2s var(--ease);
  opacity: 0;
  line-height: 1;
}

.hero-slider:hover .slider-arrow {
  opacity: 1;
}

.slider-arrow:hover {
  background: #fff;
  transform: translateY(-50%) scale(1.08);
  box-shadow: var(--shadow-lg);
}

.slider-arrow-left { left: 16px; }
.slider-arrow-right { right: 16px; }

/* Slider dots */
.slider-dots {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  display: flex;
  gap: 8px;
}

.slider-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.7);
  background: transparent;
  cursor: pointer;
  padding: 0;
  transition: all 0.25s var(--ease);
}

.slider-dot.active {
  background: #fff;
  border-color: #fff;
  transform: scale(1.2);
}

.slider-dot:hover {
  background: rgba(255,255,255,0.6);
}

/* ── Hero Banner (single slide) ── */
.hero-banner {
  position: relative;
  height: 320px;
  border-radius: var(--radius-xl);
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  padding: 40px;
  box-shadow: var(--shadow-lg);
  cursor: pointer;
}

.hero-bg {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease);
}

.hero-banner:hover .hero-bg {
  transform: scale(1.03);
}

.hero-overlay {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: linear-gradient(
    to top,
    rgba(0,0,0,0.75) 0%,
    rgba(0,0,0,0.25) 50%,
    rgba(0,0,0,0.05) 100%
  );
}

.hero-content {
  position: relative;
  z-index: 10;
  max-width: 550px;
}

.hero-tag {
  display: inline-block;
  padding: 5px 12px;
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.2px;
  margin-bottom: 14px;
  text-transform: uppercase;
}

.hero-title {
  font-size: 40px;
  font-weight: 900;
  line-height: 1.1;
  margin-bottom: 12px;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.hero-desc {
  font-size: 15px;
  color: rgba(255,255,255,0.85);
  margin-bottom: 24px;
  line-height: 1.5;
}

.btn-play {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: var(--radius-full);
  background: var(--primary);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(26, 159, 217, 0.35);
  transition: all 0.25s var(--ease);
}

.btn-play:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(26, 159, 217, 0.45);
}

/* ── Section Headers ── */
.category-section {
  margin-bottom: 36px;
}

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

.section-header h2 {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
}

.view-all {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  transition: color 0.2s;
}

.view-all:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

/* ── Game Grid ── */
.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
  gap: 20px;
}

.game-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: all 0.25s var(--ease);
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  border: 1px solid transparent;
}

.game-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-color);
}

.game-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: var(--bg-body);
}

.game-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s var(--ease);
}

.game-card:hover .game-thumb img {
  transform: scale(1.06);
}

.game-thumb-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 56px;
  transition: transform 0.4s var(--ease);
}

.game-card:hover .game-thumb-placeholder {
  transform: scale(1.06);
}

.gt-1 { background: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 100%); }
.gt-2 { background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%); }
.gt-3 { background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%); }
.gt-4 { background: linear-gradient(135deg, #ede9fe 0%, #ddd6fe 100%); }
.gt-5 { background: linear-gradient(135deg, #fce7f3 0%, #fbcfe8 100%); }
.gt-6 { background: linear-gradient(135deg, #ffedd5 0%, #fed7aa 100%); }

.hover-play {
  position: absolute;
  inset: 0;
  background: rgba(26, 159, 217, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.25s var(--ease);
}

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

.play-icon-btn {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  transform: scale(0.8);
  transition: all 0.25s var(--ease);
  box-shadow: 0 4px 16px rgba(26, 159, 217, 0.4);
}

.game-card:hover .play-icon-btn {
  transform: scale(1);
}

.play-icon-btn::before {
  content: "";
  display: block;
  width: 0;
  height: 0;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  border-left: 14px solid #fff;
  margin-left: 3px;
}

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

.game-info h3 {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-primary);
}

.game-info span {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

/* ── Empty state ── */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-muted);
  font-size: 15px;
}

/* ── About Section ── */
.about-section {
  margin-top: 24px;
  padding: 36px 32px;
  background: var(--bg-white);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
}

.about-block {
  margin-bottom: 28px;
}

.about-block:last-child {
  margin-bottom: 0;
}

.about-block h2 {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 10px;
}

.about-block p {
  font-size: 14px;
  line-height: 1.75;
  color: var(--text-secondary);
}

.about-block ul {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 10px;
}

.about-block ul li {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-secondary);
  padding-left: 20px;
  position: relative;
}

.about-block ul li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--primary);
  font-weight: 700;
}

.about-block ul li strong {
  color: var(--text-primary);
}

/* ── Footer ── */
.site-footer {
  margin-top: 24px;
  padding: 32px 0 16px;
  border-top: 1px solid var(--border-color);
  text-align: center;
}

.footer-logo {
  width: 100px;
  height: auto;
  margin-bottom: 12px;
  opacity: 0.6;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: color 0.2s;
}

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

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

/* ── Responsive ── */
@media (max-width: 1200px) {
  .game-grid {
    grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
    gap: 16px;
  }
}

@media (max-width: 1024px) {
  .hero-title { font-size: 32px; }
  .hero-slider-track { height: 260px; }
  .hero-banner { height: 260px; padding: 28px; }
}

@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    left: 0; top: 0;
    height: 100%;
    transform: translateX(-100%);
    transition: transform 0.3s var(--ease);
    box-shadow: var(--shadow-lg);
    z-index: 1000;
  }

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

  .sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.3);
    z-index: 999;
  }

  .sidebar-overlay.active {
    display: block;
  }

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

  .scroll-area { padding: 20px 16px; }
  .topbar { padding: 0 16px; }

  .game-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
  }

  .hero-slider { margin-bottom: 24px; }
  .hero-slider-track { height: 220px; }
  .hero-banner { height: 220px; padding: 20px; }
  .slider-arrow { width: 36px; height: 36px; font-size: 20px; }
  .slider-arrow-left { left: 10px; }
  .slider-arrow-right { right: 10px; }
  .hero-title { font-size: 26px; }
  .hero-desc { display: none; }

  .category-pills { gap: 8px; margin-bottom: 20px; }
  .category-pill { padding: 6px 14px; font-size: 13px; }
}

@media (max-width: 480px) {
  .game-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .game-info { padding: 8px 10px; }
  .game-info h3 { font-size: 13px; }
}
