:root {
  --purple: #8b5cf6;
  --blue: #3b82f6;
  --green: #ffc107;
  --orange: #f97316;
  --red: #ef4444;
  --bg: #111827;
  --bg2: #1f2937;
  --text: #f9fafb;
  --muted: #9ca3af;
  --neon: #eeff41;
  --shadow: 0 14px 34px rgba(0, 0, 0, .38);
  --gold: #ffd700;
  --danger: #ff4141;
  --neon-green: #04f810;
  --dark-charcoal: #0f0f0f;
  --medium-gray: #333;
}

* {
  box-sizing: border-box
}

html,
body {
  height: 100%
}

body {
  margin: 0;
  font-family: Inter, system-ui, Segoe UI, Roboto, Arial, sans-serif;
  background: linear-gradient(135deg, #1a1c20 0%, #2c3e50 50%, #1a1c20 100%);
  color: var(--text);
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none
}

.container {
  width: 100%;
  padding: 0 6rem
}

.top-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 40px;
  z-index: 9999;
  background: linear-gradient(90deg, var(--purple), var(--blue));
  display: flex;
  align-items: center;
  justify-content: center;
}

.banner-text-container {
  position: relative;
  height: 24px;
  width: 100%;
  max-width: 900px
}

.banner-message {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  white-space: nowrap;
  font-weight: 900;
  font-size: .95rem;
  opacity: 0;
  visibility: hidden;
  transition: .35s ease;
  display: flex;
  gap: .5rem;
  align-items: center;
}

.banner-message i {
  color: var(--gold)
}

.banner-message.active {
  opacity: 1;
  visibility: visible
}

.site-header {
  background: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding: 2.0rem 0 1rem;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.8);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  /* padding: 0 removed to allow .container padding to work */
  gap: 1rem
}

.logo {
  font-weight: 900;
  display: flex;
  align-items: center;
}

.nav-links {
  display: none;
  gap: 1.1rem;
  align-items: center
}

.nav-links a {
  color: var(--muted);
  font-weight: 800
}

.nav-links a:hover {
  color: #fff
}

.nav-links a.is-active {
  color: #fff
}

.nav-right {
  display: flex;
  align-items: center;
  gap: .75rem
}

.nav-right .btn {
  color: #fff !important;
}

.cart-pill {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  padding: .6rem 1rem;
  border-radius: 999px;
  background: rgba(255, 235, 59, .12);
  border: 1px solid rgba(255, 235, 59, .3);
  font-weight: 800;
  color: #ffeb3b;
  max-width: 56vw;
  font-size: 0.85rem;
  text-shadow: 0 0 8px rgba(255, 235, 59, 0.2);
  transition: all 0.3s ease;
}

.cart-pill:hover {
  background: rgba(255, 235, 59, .18);
  box-shadow: 0 0 12px rgba(255, 235, 59, 0.15);
}

.cart-pill i {
  color: #ffeb3b;
  font-size: 1.05rem;
}

.cart-pill span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #fff;
  font-weight: 700;
}

.cart-pill .cart-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  background-color: var(--danger);
  color: white;
  font-size: 10px;
  font-weight: bold;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #1a1a2e;
}

.mobile-menu-btn {
  background: none;
  border: none;
  color: #fff;
  font-size: 1.35rem;
  cursor: pointer
}

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  width: min(86vw, 320px);
  background: rgba(31, 41, 55, .98);
  transform: translateX(-100%);
  transition: transform .25s ease;
  z-index: 1100;
  padding-top: 1rem;
}

.sidebar.active {
  transform: translateX(0)
}

.sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, .10)
}

.sidebar-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 1.25rem;
  cursor: pointer
}

.sidebar-menu {
  padding: 1rem
}

.sidebar-menu a {
  display: flex;
  gap: .65rem;
  align-items: center;
  padding: .85rem 1rem;
  border-radius: .75rem;
  font-weight: 900;
}

.sidebar-menu a:hover {
  background: rgba(255, 255, 255, .08)
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .55);
  z-index: 1090
}

.sidebar-backdrop.active {
  display: block
}

main {
  min-height: 60vh;
  padding-bottom: 120px;
}

section {
  padding: 4.8rem 0
}

.section-title {
  text-align: center;
  margin: 0 0 .75rem;
  font-size: clamp(1.8rem, 4vw, 2.35rem);
  font-weight: 900;
  color: var(--purple);
  /* Fallback */
  background: linear-gradient(90deg, var(--purple), var(--blue));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.section-subtitle {
  margin: 0 auto 2rem;
  max-width: 760px;
  text-align: center;
  color: var(--muted);
  line-height: 1.6;
}

.hero {
  min-height: calc(100vh - 40px);
  padding-top: 92px;
  position: relative;
  display: flex;
  align-items: center;
  text-align: center;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45)
}

.hero .container {
  position: relative;
  z-index: 2
}

.hero h1 {
  margin: 0 0 1rem;
  font-weight: 900;
  font-size: clamp(2.2rem, 6vw, 4.2rem);
  color: var(--purple);
  /* Fallback */
  background: linear-gradient(90deg, var(--purple), var(--blue));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero p {
  margin: 0 auto 1.4rem;
  max-width: 860px;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.6
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .6rem;
  padding: 1rem 1.6rem;
  border-radius: 999px;
  border: 1px solid #ddd;
  cursor: pointer;
  background: #ffffff;
  color: #111;
  font-weight: 900;
  box-shadow: 0 5px 15px rgba(255, 255, 255, 0.1);
  transition: all 0.2s;
}

.btn:hover {
  transform: translateY(-1px);
  background: #ffeb3b;
  color: #000;
  border-color: #ffeb3b;
  box-shadow: 0 5px 20px rgba(255, 235, 59, 0.4);
}

.btn.secondary {
  background: rgba(255, 255, 255, .10);
  border: 1px solid rgba(255, 255, 255, .14);
  box-shadow: none;
}

.btn.yellow {
  background: linear-gradient(90deg, #ffeb3b, #fbc02d);
  color: #000;
  box-shadow: 0 10px 25px -8px rgba(255, 235, 59, 0.5);
}

.btn.yellow:hover {
  background: linear-gradient(90deg, #fff176, #fdd835);
  box-shadow: 0 10px 30px -5px rgba(255, 235, 59, 0.7);
}

.grid {
  display: grid;
  gap: 1.25rem
}

.grid.cols-3 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 15px;
}

@media(min-width:900px) {
  .grid.cols-3 {
    grid-template-columns: repeat(3, 1fr)
  }
}

.card {
  background: rgba(31, 41, 55, .45);
  border: 1px solid rgba(255, 255, 255, .10);
  border-radius: 1rem;
  box-shadow: var(--shadow);
  overflow: hidden;
}

/* Global Mobile Polish */
@media (max-width: 768px) {
  section {
    padding: 3rem 0;
  }

  .section-title {
    font-size: 1.75rem;
  }
}

.neon {
  border: 2px solid var(--neon);
  box-shadow: 0 0 14px rgba(238, 255, 65, .22);
}

.card-pad {
  padding: 1.15rem
}

.product-img {
  width: 100%;
  height: 240px;
  object-fit: cover;
  display: block
}

.product-title {
  font-size: 1.25rem;
  font-weight: 900;
  margin: .2rem 0
}

.product-desc {
  margin: 0 0 1rem;
  color: var(--muted);
  line-height: 1.55
}

.slider {
  display: flex;
  gap: 1rem;
  overflow: auto;
  scroll-behavior: smooth;
  padding: .75rem .25rem
}

.slider::-webkit-scrollbar {
  height: 8px
}

.slider::-webkit-scrollbar-thumb {
  background: var(--neon);
  border-radius: 8px
}

/* Equal Height Content Grid System */
.equal-height-grid {
  display: grid;
  align-items: stretch;
  /* Cards stretch to match tallest in row */
}

.equal-height-card {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.equal-height-card>.card-body,
.equal-height-card>div:not(.game-image):not(.product-img):not(.game-cover) {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  /* Content fills space */
}

.equal-height-card .push-bottom {
  margin-top: auto;
  /* Pushes buttons/tags to the bottom */
}

.game-card {
  height: 100%;
  margin: 0;
  border-radius: 20px;
  background: var(--dark-charcoal);
  border: 1px solid var(--medium-gray);
  overflow: hidden;
  position: relative;
  box-shadow: none;
  display: flex;
  flex-direction: column;
}

.game-card.is-selected {
  border-color: var(--neon-green);
  /* Neon Green selection */
  box-shadow: 0 0 15px rgba(4, 248, 16, 0.3);
}

.game-cover {
  width: 100%;
  height: 240px;
  object-fit: cover;
  border-bottom: 1px solid rgba(255, 255, 255, .10)
}

.game-image {
  border-radius: 20px 20px 0 0;
}

.game-body {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: .4rem
}

.game-title {
  font-weight: 900
}

.game-meta {
  color: var(--muted);
  font-size: .9rem
}

.controls {
  display: flex;
  justify-content: center;
  gap: .6rem;
  margin-top: 1rem
}

.icon-btn {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, .10);
  border: 2px solid var(--neon);
  color: #fff;
  cursor: pointer;
}

.icon-btn:hover {
  background: var(--neon);
  color: #111827
}

.toolbar {
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  border-radius: 1rem;
  background: rgba(31, 41, 55, .35);
  border: 1px solid rgba(255, 255, 255, .10);
}

.input {
  padding: .85rem 1rem;
  border-radius: 14px;
  background: rgba(0, 0, 0, .25);
  border: 1px solid rgba(255, 255, 255, .14);
  color: var(--text);
  min-width: min(520px, 100%);
}

.toast {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  background: rgba(0, 0, 0, .75);
  border: 1px solid rgba(255, 255, 255, .18);
  padding: .75rem 1rem;
  border-radius: .8rem;
  z-index: 9999;
  display: none;
  max-width: min(420px, 92vw);
}

.site-footer {
  background: rgba(17, 24, 39, .86);
  border-top: 1px solid rgba(255, 255, 255, .10);
  padding: 3rem 0 1.5rem;
}

.footer-wrap {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem
}

.footer-logo {
  font-weight: 900;
  font-size: 1.6rem;
  color: var(--purple);
  /* Fallback */
  background: linear-gradient(90deg, var(--purple), var(--blue));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.footer-text {
  color: var(--muted);
  line-height: 1.6
}

.footer-links h3 {
  margin: .4rem 0 1rem;
  color: var(--purple)
}

.footer-links a {
  display: block;
  color: var(--muted);
  padding: .25rem 0
}

.footer-links a:hover {
  color: #fff
}

.social-links {
  display: flex;
  gap: .75rem;
  margin-top: .75rem
}

.social-links a {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, .08);
}

.social-links a:hover {
  background: var(--neon);
  color: #111827
}

.copyright {
  margin-top: 1.25rem;
  color: var(--muted);
  text-align: center;
  font-size: .9rem
}

@media(min-width:768px) {
  .nav-links {
    display: flex
  }

  .mobile-menu-btn {
    display: none
  }

  .footer-wrap {
    grid-template-columns: 1.3fr 1fr 1fr
  }
}

@media(max-width: 768px) {

  /* Mobile Header Padding Fix (Push down for 40px banner) */
  .site-header {
    padding: 3.25rem 0 0.75rem;
  }

  /* Mobile Grid Adjustments */
  .grid.cols-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 15px;
    width: 100%;
  }

  .grid>* {
    min-width: 0;
    /* Ensures 50/50 split even with long words */
    overflow: hidden;
  }

  /* Full Image Visibility on Mobile */
  .product-img,
  .game-cover {
    object-fit: cover !important;
    height: 180px !important;
    /* Optimized for 2-column small screens */
  }

  /* Card Padding Adjustment for Small Grid */
  .card-pad {
    padding: 10px !important;
  }

  .btn {
    padding: 0.7rem 1rem !important;
    font-size: 0.85rem !important;
  }

  .product-title {
    font-size: 0.9rem !important;
    /* Smaller but clear */
    line-height: 1.2;
    margin-bottom: 4px;
    height: 2.4em;
    /* Max 2 lines height for alignment */
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-clamp: 2;
  }

  .game-meta {
    font-size: 0.7rem;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* Header Mobile Layout - Centered Logo */
  .header-inner {
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    /* Pushes nav-right to the end */
    gap: 0;
    position: relative;
  }

  /* 1. Hamburger Right (Now inside .nav-right) */
  .mobile-menu-btn {
    display: block;
    font-size: 1.5rem;
    color: #fff;
    background: none;
    border: none;
    padding: 10px;
    height: auto;
    width: auto;
    order: 10;
    /* Ensure it's last */
  }

  /* 2. Logo Center */
  .logo {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    margin: 0;
  }

  /* 3. Cart & Menu Container */
  .nav-right {
    width: auto;
    display: flex;
    align-items: center;
    gap: 15px;
    /* Space between Cart and Hamburger */
  }

  .mobile-cart-icon {
    display: block !important;
    padding: 5px;
  }

  /* Chatbot Safe Zone */
  main,
  section:last-of-type,
  .game-detail-container,
  .product-detail-container {
    padding-bottom: 150px !important;
    /* Increased for better chatbot clearance */
  }

  /* Utility */
  .desktop-only {
    display: none !important;
  }
}

/* =============================================
   IMAGE ENHANCEMENTS - Premium Visual Effects
   ============================================= */

/* Base Image Enhancement - Vibrant & Sharp */
.enhanced-img,
.product-card-item img,
.game-card img {
  filter: contrast(1.05) saturate(1.1);
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

/* Hover Zoom Effect - Only on product cards */
.product-card-item:hover img,
.game-card:hover img {
  transform: scale(1.08);
  filter: contrast(1.08) saturate(1.15) brightness(1.05);
}

/* Premium Glow Effect on Hover - Only on product cards */
.product-card-item:hover,
.game-card:hover {
  box-shadow:
    0 20px 40px rgba(0, 0, 0, 0.4),
    0 0 30px rgba(139, 92, 246, 0.15);
}

/* Image Container - Overflow Hidden for Zoom Effect */
.product-card-item,
.game-card {
  overflow: hidden;
  transition: box-shadow 0.4s ease, transform 0.3s ease;
}

.product-card-item:hover,
.game-card:hover {
  transform: translateY(-5px);
  will-change: transform, filter;
}

/* Lazy Loading Blur Placeholder Effect */
.lazy-img {
  opacity: 0;
  filter: blur(20px);
  transition: opacity 0.6s ease, filter 0.6s ease;
}

.lazy-img.loaded {
  opacity: 1;
  filter: blur(0) contrast(1.05) saturate(1.1);
}

/* Low Quality Image Placeholder (LQIP) */
.img-placeholder {
  position: relative;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  overflow: hidden;
}

.img-placeholder::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg,
      transparent 0%,
      rgba(255, 255, 255, 0.05) 50%,
      transparent 100%);
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }

  100% {
    transform: translateX(100%);
  }
}

/* Image Overlay Gradient for Text Readability */
.img-overlay {
  position: relative;
}

.img-overlay::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60%;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, transparent 100%);
  pointer-events: none;
}

/* Hero Image Enhancement */
.hero {
  background-size: cover;
  background-position: center;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
}

/* Product Image Specific Enhancements */
.product-img,
.game-cover {
  filter: contrast(1.05) saturate(1.08);
  object-fit: cover;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
}

/* Featured Product Glow */
.card.featured img,
.product-card-item.featured img {
  box-shadow: 0 0 20px rgba(255, 235, 59, 0.3);
}

/* Image Loading Animation */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.img-animate {
  animation: fadeInUp 0.6s ease forwards;
}

/* Skeleton Loading for Images */
.skeleton-img {
  background: linear-gradient(90deg, #1a1a2e 25%, #252540 50%, #1a1a2e 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
}

@keyframes skeleton-loading {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

/* Responsive Image Optimization */
@media (max-width: 768px) {

  .card:hover img,
  .product-card-item:hover img,
  .game-card:hover img {
    transform: scale(1.03);
  }

  .card:hover,
  .product-card-item:hover,
  .game-card:hover {
    transform: translateY(-3px);
  }
}

/* High DPI / Retina Display Optimization */
@media (-webkit-min-device-pixel-ratio: 2),
(min-resolution: 192dpi) {

  .enhanced-img,
  .card img,
  .product-card-item img,
  .game-card img {
    image-rendering: -webkit-optimize-contrast;
  }
}

/* ===== FIX FOR MOBILE OVERFLOW ===== */

/* Ensure html and body don't overflow */
html {
  overflow-x: hidden;
  max-width: 100vw;
}

body {
  max-width: 100vw;
  position: relative;
}

/* Fix chatbot overflow on mobile */
@media (max-width: 768px) {

  /* Chatbot button positioning fix */
  .chatbot-toggle,
  .chatbot-container,
  #chatbot-toggle,
  #chatbot-container {
    max-width: calc(100vw - 20px) !important;
    right: 10px !important;
    left: auto !important;
  }

  /* Prevent any absolute positioned elements from overflowing */
  *[style*="position: absolute"],
  *[style*="position: fixed"] {
    max-width: 100vw;
  }

  /* Fix for floating action buttons */
  .fab-container,
  .action-buttons {
    right: 10px !important;
    max-width: calc(100vw - 20px) !important;
  }
}

/* Ensure cards don't cause overflow */
.card,
.game-card,
.product-card-item {
  max-width: 100%;
  box-sizing: border-box;
}

/* Container responsive adjustments */
@media (max-width: 1200px) {

  .container,
  .grid,
  .toolbar {
    max-width: 100%;
    overflow: visible;
  }
}

/* Container responsive adjustments */
@media (max-width: 1200px) {
  .container {
    padding: 0 1.5rem;
  }
}

@media (max-width: 768px) {
  .container {
    padding: 0 1.5rem;
  }
}