/* Import fonts */
@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;700&family=Creepster&display=swap');

/* CSS Variables */
:root {
  --primary-bg: #0a0a0a;
  --secondary-bg: #1a0d2e;
  --accent-bg: #2d1b3d;
  --card-bg: #1a1a2e;
  --primary-text: #e0e0e0;
  --secondary-text: #b0b0b0;
  --accent-text: #d4af37;
  --highlight: #ff4500;
  --border-color: #3d2a4a;
  --shadow-color: rgba(0, 0, 0, 0.8);
  --gradient-1: linear-gradient(135deg, #1a0d2e 0%, #0f0f23 100%);
  --gradient-2: linear-gradient(45deg, #2d1b3d 0%, #1a1a2e 100%);
  --glow-color: rgba(212, 175, 55, 0.3);
}

/* Reset and base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Cinzel', serif;
  background: var(--primary-bg);
  color: var(--primary-text);
  line-height: 1.6;
  overflow-x: hidden;
}

/* Particles background */
.particles-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -1;
  opacity: 0.6;
}

.particles-bg::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    radial-gradient(circle at 20% 80%, rgba(120, 119, 198, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(255, 119, 198, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 40% 40%, rgba(120, 119, 198, 0.1) 0%, transparent 50%);
  animation: particleFloat 20s ease-in-out infinite alternate;
}

@keyframes particleFloat {
  0%, 100% { transform: translateY(0px) rotate(0deg); opacity: 0.4; }
  50% { transform: translateY(-20px) rotate(5deg); opacity: 0.8; }
}

/* Header styles */
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: rgba(26, 13, 46, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 2px solid var(--border-color);
  z-index: 1000;
  transition: all 0.3s ease;
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.logo {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.logo-text {
  font-family: 'Creepster', cursive;
  font-size: 1.8rem;
  color: var(--accent-text);
  text-shadow: 0 0 10px var(--glow-color);
  margin: 0;
}

.logo-subtitle {
  font-size: 0.8rem;
  color: var(--secondary-text);
  letter-spacing: 2px;
  text-transform: uppercase;
}

.nav-menu {
  display: flex;
  list-style: none;
  gap: 2rem;
}

.nav-link {
  color: var(--primary-text);
  text-decoration: none;
  font-weight: 600;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  transition: all 0.3s ease;
  position: relative;
}

.nav-link:hover,
.nav-link.active {
  color: var(--accent-text);
  background: rgba(212, 175, 55, 0.1);
  box-shadow: 0 0 15px var(--glow-color);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--accent-text);
  transition: all 0.3s ease;
  transform: translateX(-50%);
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 80%;
}

/* Dropdown styles */
.dropdown {
  position: relative;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0.5rem 0;
  min-width: 180px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s ease;
  box-shadow: 0 10px 30px var(--shadow-color);
}

.dropdown:hover .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-menu li {
  list-style: none;
}

.dropdown-menu a {
  display: block;
  padding: 0.8rem 1.5rem;
  color: var(--primary-text);
  text-decoration: none;
  transition: all 0.3s ease;
}

.dropdown-menu a:hover {
  background: var(--accent-bg);
  color: var(--accent-text);
}

/* Hamburger menu */
.hamburger {
  display: none;
  flex-direction: column;
  cursor: pointer;
  gap: 4px;
}

.hamburger span {
  width: 25px;
  height: 3px;
  background: var(--accent-text);
  transition: all 0.3s ease;
  border-radius: 2px;
}

/* Main content */
.main-content {
  margin-top: 80px;
  min-height: calc(100vh - 80px);
}

/* Hero section */
.hero-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  min-height: 60vh;
  padding: 4rem 2rem;
  max-width: 1200px;
  margin: 0 auto;
  gap: 4rem;
}

.hero-content h2 {
  font-family: 'Creepster', cursive;
  font-size: 3.5rem;
  color: var(--accent-text);
  margin-bottom: 1rem;
  text-shadow: 0 0 20px var(--glow-color);
}

.hero-description {
  font-size: 1.2rem;
  color: var(--secondary-text);
  margin-bottom: 2rem;
  line-height: 1.8;
}

.cta-button {
  background: var(--gradient-2);
  color: var(--primary-text);
  border: 2px solid var(--accent-text);
  padding: 1rem 2rem;
  font-size: 1.1rem;
  font-weight: 600;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-family: 'Cinzel', serif;
}

.cta-button:hover {
  background: var(--accent-text);
  color: var(--primary-bg);
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(212, 175, 55, 0.4);
}

/* Hero image with floating orbs */
.hero-image {
  position: relative;
  height: 400px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.floating-orb {
  position: absolute;
  width: 120px;
  height: 120px;
  background: radial-gradient(circle, var(--accent-text) 0%, transparent 70%);
  border-radius: 50%;
  opacity: 0.6;
  animation: float 6s ease-in-out infinite;
}

.floating-orb.orb-2 {
  width: 80px;
  height: 80px;
  top: 20%;
  right: 20%;
  animation-delay: -2s;
  animation-duration: 8s;
}

.floating-orb.orb-3 {
  width: 60px;
  height: 60px;
  bottom: 20%;
  left: 10%;
  animation-delay: -4s;
  animation-duration: 10s;
}

@keyframes float {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(-20px) rotate(180deg); }
}

/* Plays section */
.games-section {
  padding: 4rem 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.section-header {
  text-align: center;
  margin-bottom: 3rem;
}

.section-title {
  font-family: 'Creepster', cursive;
  font-size: 2.5rem;
  color: var(--accent-text);
  margin-bottom: 1rem;
  text-shadow: 0 0 15px var(--glow-color);
}

.section-subtitle {
  font-size: 1.1rem;
  color: var(--secondary-text);
}

.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-bottom: 3rem;
}

.game-card {
  background: var(--gradient-2);
  border: 1px solid var(--border-color);
  border-radius: 15px;
  overflow: hidden;
  transition: all 0.3s ease;
  cursor: pointer;
  position: relative;
}

.game-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 20px 40px var(--shadow-color);
  border-color: var(--accent-text);
}

.game-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg, transparent 30%, rgba(212, 175, 55, 0.1) 50%, transparent 70%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.game-card:hover::before {
  opacity: 1;
}

.game-image {
  position: relative;
  height: 200px;
  overflow: hidden;
}

.game-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.game-card:hover .game-image img {
  transform: scale(1.1);
}

.game-category-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--accent-text);
  color: var(--primary-bg);
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
}

.game-info {
  padding: 1.5rem;
}

.game-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--primary-text);
  margin-bottom: 0.5rem;
}

.game-description {
  color: var(--secondary-text);
  font-size: 0.95rem;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Loading spinner */
.loading-spinner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 3px solid var(--border-color);
  border-top: 3px solid var(--accent-text);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 1rem;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Category page styles */
.category-hero {
  padding: 2rem;
  text-align: center;
  background: var(--gradient-1);
  border-bottom: 2px solid var(--border-color);
}

.category-title {
  font-family: 'Creepster', cursive;
  font-size: 2.8rem;
  color: var(--accent-text);
  margin-bottom: 1rem;
  text-shadow: 0 0 15px var(--glow-color);
}

.category-description {
  font-size: 1.1rem;
  color: var(--secondary-text);
}

/* About page styles */
.about-hero {
  padding: 4rem 2rem;
  text-align: center;
  background: var(--gradient-1);
}

.about-title {
  font-family: 'Creepster', cursive;
  font-size: 3rem;
  color: var(--accent-text);
  margin-bottom: 1rem;
  text-shadow: 0 0 15px var(--glow-color);
}

.about-description {
  font-size: 1.2rem;
  color: var(--secondary-text);
  max-width: 600px;
  margin: 0 auto;
}

.about-details {
  padding: 4rem 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.about-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-bottom: 4rem;
}

.about-card {
  background: var(--gradient-2);
  border: 1px solid var(--border-color);
  border-radius: 15px;
  padding: 2rem;
  text-align: center;
  transition: all 0.3s ease;
}

.about-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 30px var(--shadow-color);
}

.about-card h3 {
  color: var(--accent-text);
  margin-bottom: 1rem;
  font-size: 1.3rem;
}

.team-section {
  text-align: center;
  padding: 2rem 0;
}

.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.team-member {
  text-align: center;
}

.member-avatar {
  width: 100px;
  height: 100px;
  background: var(--gradient-2);
  border: 3px solid var(--accent-text);
  border-radius: 50%;
  margin: 0 auto 1rem;
  position: relative;
}

.member-avatar::before {
  content: '👤';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 2rem;
  opacity: 0.7;
}

/* Play detail page styles */
.game-detail-container {
  padding: 2rem;
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 3rem;
  align-items: start;
}

.game-info {
  background: var(--gradient-2);
  border: 1px solid var(--border-color);
  border-radius: 15px;
  padding: 2rem;
  position: sticky;
  top: 100px;
}

.game-header {
  margin-bottom: 1.5rem;
}

.game-title {
  font-family: 'Creepster', cursive;
  font-size: 2rem;
  color: var(--accent-text);
  margin-bottom: 0.5rem;
  text-shadow: 0 0 10px var(--glow-color);
}

.game-meta {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
}

.game-category {
  background: var(--accent-text);
  color: var(--primary-bg);
  padding: 0.3rem 1rem;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 600;
  text-transform: uppercase;
}

.game-description {
  color: var(--secondary-text);
  line-height: 1.6;
  margin-bottom: 2rem;
}

.game-controls {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.control-btn {
  background: var(--gradient-1);
  color: var(--primary-text);
  border: 2px solid var(--border-color);
  padding: 0.8rem 1.5rem;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: 'Cinzel', serif;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.control-btn:hover {
  border-color: var(--accent-text);
  background: var(--accent-bg);
  transform: translateY(-2px);
}

.control-btn.active {
  background: var(--accent-text);
  color: var(--primary-bg);
  border-color: var(--accent-text);
}

.home-btn {
  background: var(--highlight);
  border-color: var(--highlight);
}

.home-btn:hover {
  background: #ff6500;
  border-color: #ff6500;
}

.game-frame-wrapper {
  position: relative;
}

.game-frame-container {
  background: var(--card-bg);
  border: 2px solid var(--border-color);
  border-radius: 15px;
  overflow: hidden;
  position: relative;
  aspect-ratio: 16 / 9;
  transition: all 0.3s ease;
}

.game-frame-container iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--card-bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

/* Footer styles */
.footer {
  background: var(--gradient-1);
  border-top: 2px solid var(--border-color);
  padding: 3rem 2rem 1rem;
  margin-top: 4rem;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-section h3,
.footer-section h4 {
  color: var(--accent-text);
  margin-bottom: 1rem;
}

.footer-section p,
.footer-section li {
  color: var(--secondary-text);
  margin-bottom: 0.5rem;
}

.footer-section ul {
  list-style: none;
}

.footer-section a {
  color: var(--secondary-text);
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer-section a:hover {
  color: var(--accent-text);
}

.footer-bottom {
  text-align: center;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
  color: var(--secondary-text);
}

/* Responsive Design */
@media (max-width: 1024px) {
  .hero-section {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 2rem;
  }
  
  .hero-content h2 {
    font-size: 2.5rem;
  }
  
  .game-detail-container {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
  .game-info {
    position: static;
  }
}

@media (max-width: 768px) {
  .nav-menu {
    position: fixed;
    top: 100%;
    left: 0;
    width: 100%;
    background: var(--card-bg);
    flex-direction: column;
    padding: 1rem;
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    border-top: 1px solid var(--border-color);
  }
  
  .nav-menu.active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }
  
  .hamburger {
    display: flex;
  }
  
  .hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }
  
  .hamburger.active span:nth-child(2) {
    opacity: 0;
  }
  
  .hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
  }
  
  .dropdown-menu {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    border: none;
    background: transparent;
    padding-left: 1rem;
  }
  
  .hero-content h2 {
    font-size: 2rem;
  }
  
  .hero-description {
    font-size: 1rem;
  }
  
  .games-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .section-title {
    font-size: 2rem;
  }
  
  .category-title,
  .about-title {
    font-size: 2rem;
  }
  
  .nav-container {
    padding: 1rem;
  }
  
  .logo-text {
    font-size: 1.5rem;
  }
  
  .hero-section,
  .games-section,
  .about-details {
    padding: 2rem 1rem;
  }
  
  .game-detail-container {
    padding: 1rem;
  }
  
  .about-grid {
    grid-template-columns: 1fr;
  }
  
  .team-grid {
    grid-template-columns: 1fr;
  }
}

/* Mobile game fullscreen styles */
@media (max-width: 768px) {
  .game-frame-container.mobile-fullscreen {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    z-index: 9999 !important;
    border-radius: 0 !important;
  }
  
  body.mobile-game-active {
    overflow: hidden;
  }
  
  .mobile-game-active .header,
  .mobile-game-active .footer,
  .mobile-game-active .game-info {
    display: none;
  }
}

/* Lazy loading image placeholder */
.game-image img[data-src] {
  background: var(--card-bg);
  background-image: linear-gradient(45deg, transparent 30%, rgba(212, 175, 55, 0.1) 50%, transparent 70%);
  background-size: 200% 200%;
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Focus states for accessibility */
button:focus,
a:focus,
input:focus {
  outline: 2px solid var(--accent-text);
  outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  :root {
    --primary-text: #ffffff;
    --secondary-text: #cccccc;
    --border-color: #666666;
  }
}