:root {
  --primary-green: #00ff88;
  --accent-lime: #ccff00;
  --deep-black: #050505;
  --off-white: #e0e0e0;
  --glass-bg: rgba(255, 255, 255, 0.03);
  --glass-border: rgba(255, 255, 255, 0.1);
  --font-main: 'Space Grotesk', system-ui, sans-serif;
  --font-accent: 'Syncopate', sans-serif;
}

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

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  overflow-x: hidden; /* Prevent horizontal scroll/zoom issues */
}

body {
  font-family: var(--font-main);
  background: var(--deep-black);
  color: var(--off-white);
  overflow-y: auto;
  min-height: 100vh;
  line-height: 1.6;
}

/* Starfield Canvas Background */
#starfield {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
  background: black;
}

.bg-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  background: radial-gradient(circle at center, transparent 0%, var(--deep-black) 100%);
  pointer-events: none;
}

/* Entrance Overlay */
#entrance-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: black;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: opacity 1s ease-in-out, visibility 1s;
}

.crate-container {
  position: relative;
  width: 300px;
  height: 300px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.entrance-crate {
  width: 90vw;
  max-width: 450px;
  transition: transform 1.2s cubic-bezier(0.19, 1, 0.22, 1), opacity 0.8s ease, filter 1.2s ease;
  filter: drop-shadow(0 0 30px rgba(0, 255, 136, 0.3));
  margin-bottom: 20px;
}

.glow-effect {
  position: absolute;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, var(--primary-green) 0%, transparent 70%);
  opacity: 0;
  filter: blur(20px);
  transition: opacity 0.5s ease;
}

.crate-container:hover .entrance-crate {
  transform: scale(1.1) rotate(2deg);
}

.crate-container:hover .glow-effect {
  opacity: 0.5;
}

/* CS:GO Crate Reveal System */
#entrance-overlay.shaking #main-crate {
  animation: crateShake 0.1s infinite;
}

@keyframes crateShake {
  0% { transform: translate(1px, 1px) rotate(0deg); }
  25% { transform: translate(-1px, -2px) rotate(-1deg); }
  50% { transform: translate(-3px, 0px) rotate(1deg); }
  75% { transform: translate(3px, 2px) rotate(0deg); }
  100% { transform: translate(1px, -1px) rotate(-1deg); }
}

.ticker-wrap {
  position: absolute;
  top: 75%; /* Lowered to avoid overlap */
  width: 100%;
  height: 140px;
  background: linear-gradient(to bottom, transparent, rgba(0,0,0,0.9), transparent);
  border-top: 1px solid var(--glass-border);
  border-bottom: 1px solid var(--glass-border);
  overflow: hidden;
  display: none;
  opacity: 0;
  transition: opacity 0.5s ease;
}

#entrance-overlay.rolling .ticker-wrap {
  display: block;
  opacity: 1;
}

.ticker {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 20px;
  width: max-content;
  transform: translateX(50vw); /* Start from center-right */
}

#entrance-overlay.rolling .ticker {
  animation: csgoRoll 5s cubic-bezier(0.075, 0.82, 0.165, 1) forwards;
}

@keyframes csgoRoll {
  0% { transform: translateX(50vw); }
  100% { transform: translateX(calc(50vw - 2500px)); } /* Calibrated for the Rare Gold item */
}

.item {
  width: 100px;
  height: 100px;
  background: #111;
  border-radius: 4px;
  flex-shrink: 0;
  border-bottom: 4px solid #333;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.item::after {
  content: '';
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background: linear-gradient(45deg, transparent, rgba(255,255,255,0.05));
}

.item.blue { border-color: #4b69ff; background: linear-gradient(to bottom, #4b69ff11, #000); }
.item.purple { border-color: #8847ff; background: linear-gradient(to bottom, #8847ff11, #000); }
.item.red { border-color: #eb4b4b; background: linear-gradient(to bottom, #eb4b4b11, #000); }
.item.rare-gold { 
  border-color: #eadb3e; 
  background: radial-gradient(circle, #eadb3e44, #000);
  box-shadow: 0 0 40px #eadb3e22;
  width: 110px;
  height: 110px;
  z-index: 2;
}

.item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.8;
  transition: opacity 0.3s ease;
}

.item:hover img {
  opacity: 1;
}

.item.rare-gold img {
  width: 80%;
  height: auto;
  object-fit: contain;
  opacity: 1;
  filter: drop-shadow(0 0 15px #eadb3e);
  animation: goldPulse 2s infinite ease-in-out;
}

@keyframes goldPulse {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 0 10px #eadb3e); }
  50% { transform: scale(1.1); filter: drop-shadow(0 0 25px #eadb3e); }
}

.ticker-pointer {
  position: absolute;
  left: 50%;
  top: 0;
  transform: translateX(-50%);
  width: 2px;
  height: 100%;
  background: #ffffff;
  z-index: 10;
  box-shadow: 0 0 20px #ffffff, 0 0 40px var(--primary-green);
  border-radius: 10px;
}

/* Crate Opening Animation Sequence Update */
#entrance-overlay.revealing .entrance-crate {
  transform: scale(4);
  opacity: 0;
  filter: brightness(10) blur(10px);
}

@keyframes pulse {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 0.8; }
}

/* Improved Typography & Motion Blur Hover */
h1, h2, h3 {
  font-family: var(--font-accent);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.hover-text {
  display: inline-block;
  transition: all 0.3s ease;
  cursor: pointer;
  position: relative;
}

.hover-text:hover {
  font-weight: 900;
  color: var(--primary-green);
  text-shadow: 0 0 10px var(--primary-green), 2px 0 5px rgba(0, 255, 136, 0.5), -2px 0 5px rgba(0, 255, 136, 0.5);
  filter: blur(0.3px);
}

/* Hidden Main Content Classes */
header, .search-container, .category-container, main, footer, #starfield, .bg-overlay {
  opacity: 0;
  transition: opacity 1.5s ease;
  pointer-events: none;
}

body.unlocked {
  overflow: auto;
}

body.unlocked #entrance-overlay {
  opacity: 0;
  visibility: hidden;
}

body.unlocked header, 
body.unlocked .search-container,
body.unlocked .category-container,
body.unlocked main, 
body.unlocked footer, 
body.unlocked #starfield, 
body.unlocked .bg-overlay {
  opacity: 1;
  pointer-events: all;
}

/* Modern Header with Tabs */
header {
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--glass-border);
}

.header-top {
  padding: 20px 5%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  flex-wrap: wrap;
  gap: 15px;
}

.header-intro {
  background: rgba(255, 255, 255, 0.03);
  padding: 8px 0;
  border-top: 1px solid var(--glass-border);
  text-align: center;
}

.header-intro p {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--primary-green) !important;
  letter-spacing: 0.5px;
  margin: 0;
  padding: 5px 20px;
  white-space: normal; /* Allow wrapping on small screens */
  word-wrap: break-word;
  max-width: 100%;
}

.logo-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 20px;
}

.logo-img {
  width: 40px;
  height: 40px;
}

.slogan {
  font-size: 0.7rem;
  font-family: var(--font-accent);
  color: var(--accent-lime);
  opacity: 0.8;
}

/* Category Tabs */
.category-container {
  width: 100%;
  margin: 0 auto 40px;
  display: flex;
  justify-content: center;
  overflow-x: auto; /* Allow horizontal scroll on mobile */
  -webkit-overflow-scrolling: touch;
  padding: 10px 20px;
}

.category-container::-webkit-scrollbar {
  display: none; /* Hide scrollbar for clean look */
}

.category-tabs {
  display: flex;
  gap: 12px;
  background: rgba(255, 255, 255, 0.03);
  padding: 8px;
  border-radius: 50px;
  border: 1px solid var(--glass-border);
  white-space: nowrap; /* Prevent tabs from wrapping */
}

.category-tab {
  background: transparent;
  border: none;
  color: white;
  padding: 12px 25px; /* Increased padding for better touch target */
  border-radius: 30px;
  cursor: pointer;
  font-family: var(--font-accent);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: all 0.3s ease;
  opacity: 0.6;
  position: relative;
  z-index: 5;
}

.category-tab:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.05);
}

.category-tab.active {
  opacity: 1;
  background: var(--primary-green);
  color: var(--deep-black);
  box-shadow: 0 0 20px rgba(0, 255, 136, 0.4);
}

.nav-tabs {
  display: flex;
  gap: 40px;
}

.nav-tabs a {
  text-decoration: none;
  font-family: var(--font-accent);
  font-size: 0.7rem;
  color: var(--off-white);
  opacity: 0.5;
  transition: opacity 0.3s, color 0.3s;
}

.nav-tabs a:hover {
  opacity: 1;
  color: var(--primary-green);
}

/* Search Bar */
.search-container {
  max-width: 600px;
  margin: 60px auto 40px;
  position: relative;
}

.search-bar {
  width: 100%;
  padding: 18px 30px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  color: white;
  font-family: var(--font-main);
  font-size: 0.9rem;
  outline: none;
  transition: all 0.3s ease;
}

.search-bar:focus {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--primary-green);
  box-shadow: 0 0 30px rgba(0, 255, 136, 0.1);
}

/* Product Advertising Section */
main {
  padding: 60px 10%;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
  gap: 40px;
}

.product-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 20px;
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), border-color 0.4s;
  text-decoration: none;
  display: block;
  cursor: pointer;
  color: inherit;
  will-change: transform; /* GPU acceleration hint */
  backface-visibility: hidden; /* Fixes potential flickering */
}

.product-card:hover {
  transform: translateY(-10px) scale(1.02);
  border-color: var(--primary-green);
}

.media-container {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 14; /* Much longer vertical presence */
  border-radius: 16px;
  overflow: hidden;
  background: #000;
  margin-bottom: 25px;
  box-shadow: inset 0 0 20px rgba(0,0,0,0.5);
  transform: translateZ(0); /* Force layer creation */
}

.product-video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.product-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity 0.4s ease;
}

.product-card.video-playing .product-video {
  opacity: 1;
}

.product-card.video-playing .product-image {
  opacity: 0;
}

.product-info {
  text-align: left;
}

.product-title {
  font-size: 1.1rem;
  margin-bottom: 5px;
}

.price {
  font-family: var(--font-accent);
  color: var(--accent-lime);
  font-size: 1.1rem;
}

footer {
  padding: 80px 10% 40px;
  text-align: center;
  border-top: 1px solid var(--glass-border);
  margin-top: 100px;
}

.footer-socials {
  display: flex;
  justify-content: center;
  gap: 30px;
  margin-bottom: 30px;
}

.footer-socials a {
  color: var(--off-white);
  text-decoration: none;
  font-family: var(--font-accent);
  font-size: 0.7rem;
  opacity: 0.6;
}

.footer-socials a:hover {
  opacity: 1;
  color: var(--primary-green);
}

.copyright {
  font-size: 0.8rem;
  opacity: 0.4;
}

/* --- Responsive Media Queries --- */

/* Tablet and Small Laptops */
@media (max-width: 1024px) {
  main {
    padding: 40px 5%;
  }
  
  .product-grid {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  }
}

/* Mobile Devices (phones) */
@media (max-width: 768px) {
  .header-top {
    flex-direction: column;
    text-align: center;
    padding: 15px 5%;
  }

  h1.hover-text {
    font-size: 1.5rem; /* Shrink title to fit mobile */
    word-break: break-all;
  }
  
  .nav-tabs {
    gap: 15px;
    margin-top: 5px;
  }
  
  .header-intro p {
    font-size: 0.75rem;
    line-height: 1.4;
  }
  
  .search-container {
    margin: 30px 20px;
  }
  
  .category-container {
    justify-content: flex-start; /* Align to left for swiping */
  }
  
  .product-grid {
    grid-template-columns: 1fr; /* Single column on mobile */
    gap: 25px;
    padding: 0 10px; /* Extra padding to prevent edge hitting */
  }

  .section-title h2 {
    font-size: 1.2rem;
    padding: 0 15px;
  }
  
  .product-card {
    padding: 15px;
  }
  
  .media-container {
    aspect-ratio: 16 / 15; /* Even more presence on mobile */
  }
  
  .product-title {
    font-size: 1rem;
  }
  
  .price {
    font-size: 1rem;
  }
  
  footer {
    padding: 60px 20px 30px;
    margin-top: 60px;
  }
}

/* Extra Small Devices */
@media (max-width: 480px) {
  .nav-tabs {
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
  }
  
  .category-tab {
    padding: 8px 18px;
    font-size: 0.65rem;
  }
}

