/* Modern Mazaber.io Styles */
.preload * {
  transition: none !important;
}

:root {
  --primary: #00D4FF;
  --primary-dark: #00a8cc;
  --secondary: #FF6B35;
  --bg-dark: #0a0a0f;
  --bg-card: #141419;
  --bg-elevated: #1c1c24;
  --text-primary: #ffffff;
  --text-secondary: #a8a8b3;
  --border-color: rgba(255, 255, 255, 0.08);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-dark);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

a {
  color: inherit;
  text-decoration: none;
}

h1, h2, h3 {
  font-weight: 700;
}

/* Header */
.header {
  position: sticky;
  top: 0;
  background: rgba(10, 10, 15, 0.95);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
  z-index: 1000;
  transition: all 0.3s ease;
}

.header.scrolled {
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0;
  gap: 2rem;
}

/* Logo */
.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text-primary);
  transition: transform 0.3s ease;
}

.logo:hover {
  transform: scale(1.05);
}

.logo-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.logo-text {
  font-size: 1.5rem;
  font-weight: 800;
  margin: 0;
}

.highlight {
  color: var(--primary);
}

/* Search */
.search-wrapper {
  flex: 1;
  max-width: 500px;
  position: relative;
}

.search-input {
  width: 100%;
  padding: 0.875rem 1.25rem 0.875rem 3rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 50px;
  color: var(--text-primary);
  font-size: 0.95rem;
  font-family: inherit;
  transition: all 0.3s ease;
}

.search-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1);
}

.search-icon {
  position: absolute;
  left: 1.25rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-secondary);
  pointer-events: none;
}

/* Navigation */
.nav ul {
  display: flex;
  gap: 0.5rem;
  list-style: none;
  align-items: center;
}

.nav ul li a {
  padding: 0.625rem 1rem;
  border-radius: 8px;
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.9rem;
  transition: all 0.3s ease;
  display: block;
}

.nav ul li a:hover {
  color: var(--text-primary);
  background: var(--bg-card);
}

.hamburger {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.hamburger span {
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  transition: all 0.3s ease;
}

/* Hero */
.hero {
  position: relative;
  height: 60vh;
  min-height: 400px;
  max-height: 600px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #1a0033 0%, #0a0a0f 100%);
}

.hero-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background: 
    radial-gradient(circle at 20% 50%, rgba(0, 212, 255, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 50%, rgba(255, 107, 53, 0.1) 0%, transparent 50%);
}

.hero-content {
  position: relative;
  text-align: center;
  padding: 2rem 1.5rem;
  max-width: 800px;
  animation: fadeInUp 0.8s ease;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-title {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, var(--primary), #fff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: clamp(1rem, 2vw, 1.25rem);
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

.hero-stats {
  display: flex;
  gap: 2rem;
  justify-content: center;
  flex-wrap: wrap;
}

.stat-item {
  text-align: center;
}

.stat-number {
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary);
}

.stat-label {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* Filters */
.filters-section {
  padding: 2rem 0 1rem;
}

.filters {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.filters::-webkit-scrollbar {
  display: none;
}

.filter-btn {
  padding: 0.625rem 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 50px;
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
  flex-shrink: 0;
  font-family: inherit;
}

.filter-btn:hover {
  background: var(--bg-elevated);
  border-color: var(--primary);
  color: var(--text-primary);
}

.filter-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #000;
}

/* Games Grid */
.games {
  padding: 2rem 0;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s ease;
  animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0, 212, 255, 0.15);
  border-color: var(--primary);
}

.card img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  background: var(--bg-elevated);
}

.card-body {
  padding: 1rem;
}

.card-body h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tags {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.genre {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background: rgba(0, 212, 255, 0.15);
  color: var(--primary);
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 500;
}

.card-actions {
  display: flex;
  gap: 0.5rem;
}

.btn-play {
  flex: 1;
  padding: 0.75rem;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border: none;
  border-radius: 8px;
  color: #000;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: inherit;
}

.btn-play:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 212, 255, 0.3);
}

.btn-fav {
  width: 40px;
  height: 40px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-fav:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: #000;
}

.btn-fav.active {
  background: var(--secondary);
  border-color: var(--secondary);
  color: #fff;
  animation: heartbeat 1.5s infinite;
}

@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

/* Load More */
.load-more {
  display: flex;
  justify-content: center;
  padding: 1rem 2.5rem;
  margin: 2rem auto;
  max-width: 300px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 50px;
  color: var(--text-primary);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
}

.load-more:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: #000;
  transform: translateY(-2px);
}

/* No Results */
.no-results {
  text-align: center;
  padding: 4rem 2rem;
  display: none;
}

.no-results.show {
  display: block;
}

.empty-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.no-results h3 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.no-results p {
  color: var(--text-secondary);
}

/* Favorites */
.my-favorites {
  padding: 3rem 0;
}

.my-favorites h2 {
  font-size: 2rem;
  margin-bottom: 2rem;
}

/* About */
.about {
  background: var(--bg-card);
  border-radius: 20px;
  padding: 4rem 2rem;
  margin: 4rem 0;
  text-align: center;
}

.about h2 {
  font-size: 2rem;
  margin-bottom: 1.5rem;
}

.metaverse-explainer {
  max-width: 800px;
  margin: 0 auto 2rem;
  font-size: 1.1rem;
  line-height: 1.8;
  color: var(--text-secondary);
}

.btn-primary {
  display: inline-block;
  padding: 1rem 2rem;
  background: var(--primary);
  color: #000;
  border-radius: 50px;
  font-weight: 600;
  transition: all 0.3s ease;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 212, 255, 0.3);
}

/* Footer */
footer {
  background: var(--bg-card);
  border-top: 1px solid var(--border-color);
  padding: 3rem 0 1.5rem;
  margin-top: 4rem;
  text-align: center;
}

footer p {
  margin-bottom: 1rem;
}

.footer-links {
  margin: 1.5rem 0;
}

.footer-links a {
  color: var(--text-secondary);
  transition: color 0.3s ease;
  margin: 0 0.5rem;
}

.footer-links a:hover {
  color: var(--primary);
}

.copyright {
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .header-inner {
    padding: 0.875rem 0;
  }

  .search-wrapper {
    order: 3;
    flex-basis: 100%;
    max-width: 100%;
  }

  .hamburger {
    display: flex;
  }

  .nav ul {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 120vh; /* or whatever value you want */
  min-height: 100vh; /* optional: always at least full screen */
    background: var(--bg-dark);
    flex-direction: column;
    padding: 5rem 2rem 2rem;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
    z-index: 999;
  }

  .nav ul.active {
    transform: translateX(0);
  }

  .nav ul li {
    width: 100%;
  }

  .nav ul li a {
    width: 100%;
    padding: 1rem;
    font-size: 1.1rem;
  }

  .hero {
    height: 50vh;
    min-height: 350px;
  }

  .hero-stats {
    gap: 1.5rem;
  }

  .stat-number {
    font-size: 1.5rem;
  }

  .grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1rem;
  }

  .card-body {
    padding: 0.75rem;
  }

  .card-body h3 {
    font-size: 0.9rem;
  }

  .filters {
    flex-wrap: nowrap;
    padding-bottom: 0.5rem;
  }

  .about {
    padding: 3rem 1.5rem;
    margin: 3rem 0;
  }
}

@media (max-width: 480px) {
  .grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .logo-icon {
    width: 36px;
    height: 36px;
    font-size: 1.3rem;
  }

  .logo-text {
    font-size: 1.3rem;
  }
}

/* Accessibility */
button:focus-visible,
.filter-btn:focus-visible,
a:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}