@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600;800&display=swap');

:root {
  --bg-gradient: radial-gradient(circle at center, #1a0f4d 0%, #0b0624 100%);
  --primary: #ff4fd8;
  --secondary: #5b8cff;
  --text-light: #ffffff;
  --text-muted: #c7c7e0;
  --card-bg: rgba(28, 20, 74, 0.6);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Poppins', sans-serif;
}

body {
  background: var(--bg-gradient);
  color: var(--text-light);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* Prevent mobile browser interference on games */
canvas {
  touch-action: none;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

/* --- Header --- */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 40px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
}

.logo img {
  width: 48px;
}

.logo span {
  font-size: 1.8rem;
  font-weight: 700;
  color: white;
}

/* Unified Header Controls */
.header-controls {
  display: flex;
  gap: 10px;
  align-items: center;
}

.control-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: bold;
  transition: background 0.2s, border-color 0.2s;
}

.control-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: var(--primary);
}

.nav-links a {
  color: white;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s;
}

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

/* Game page wrapper */
.game-page-wrapper {
  max-width: 900px;
  margin: 20px auto;
  padding: 20px;
}

/* --- Animated Background Orbs --- */
.orb-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  overflow: hidden;
  filter: blur(80px);
}

.orb {
  position: absolute;
  border-radius: 50%;
  opacity: 0.3;
  animation: float 20s infinite alternate;
}

.orb-1 {
  width: 400px;
  height: 400px;
  background: var(--primary);
  top: -10%;
  left: -10%;
}

.orb-2 {
  width: 500px;
  height: 500px;
  background: var(--secondary);
  bottom: -10%;
  right: -10%;
  animation-duration: 25s;
}

.orb-3 {
  width: 300px;
  height: 300px;
  background: #8b5cf6;
  top: 50%;
  left: 60%;
  animation-duration: 18s;
  animation-delay: -8s;
}

@keyframes float {
  from {
    transform: translate(0, 0);
  }

  to {
    transform: translate(100px, 100px);
  }
}

/* --- Hero Section --- */
.hero {
  text-align: center;
  padding: 60px 20px 40px;
  position: relative;
}

.hero h1 {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 800;
  margin-bottom: 16px;
  line-height: 1.1;
  background: linear-gradient(135deg, #fff 0%, #ff4fd8 50%, #5b8cff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  color: var(--text-muted);
  font-size: 1.15rem;
  margin-bottom: 32px;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

.hero-floating-emojis {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  pointer-events: none;
  overflow: hidden;
}

.hero-floating-emojis span {
  position: absolute;
  font-size: 2rem;
  animation: floatEmoji 6s infinite ease-in-out;
  opacity: 0.25;
}

@keyframes floatEmoji {

  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }

  50% {
    transform: translateY(-20px) rotate(10deg);
  }
}

/* --- Premium Category Cards --- */
.category-section {
  padding: 40px 20px 60px;
  max-width: 1200px;
  margin: 0 auto;
}

.section-header {
  text-align: center;
  margin-bottom: 40px;
}

.section-header h2 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.section-header p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
  max-width: 1100px;
  margin: 0 auto;
}

.card {
  background: var(--card-bg);
  backdrop-filter: blur(15px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  padding: 32px 24px 28px;
  text-align: center;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  opacity: 0;
  transition: opacity 0.3s;
}

.card:hover::before {
  opacity: 1;
}

.card:hover {
  transform: translateY(-8px) scale(1.02);
  border-color: rgba(255, 79, 216, 0.3);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3), 0 0 30px rgba(255, 79, 216, 0.15);
}

/* Featured / Main Category Card */
.card-featured {
  grid-column: 1 / -1;
  border-color: rgba(34, 197, 94, 0.5);
  box-shadow: 0 0 40px rgba(34, 197, 94, 0.1);
  background: linear-gradient(180deg, rgba(28, 20, 74, 0.8) 0%, rgba(10, 5, 30, 0.9) 100%);
  padding: 40px 30px;
}

.card-featured:hover {
  border-color: rgba(34, 197, 94, 0.8);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4), 0 0 50px rgba(34, 197, 94, 0.25);
  transform: translateY(-8px) scale(1.01);
}

.card-featured .card-emoji {
  font-size: 4rem;
}

.card-featured h3 {
  font-size: 1.8rem;
  background: linear-gradient(90deg, #22c55e, #06b6d4);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.card-featured .card-desc {
  font-size: 1rem;
  max-width: 600px;
  margin: 0 auto 16px;
}

.featured-badge {
  position: absolute;
  top: 15px;
  right: 15px;
  background: linear-gradient(90deg, #22c55e, #06b6d4);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 6px 16px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 2px;
  animation: pulseBadge 2s infinite;
  box-shadow: 0 0 15px rgba(34, 197, 94, 0.5);
}

@keyframes pulseBadge {

  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }

  50% {
    transform: scale(1.05);
    opacity: 0.85;
  }
}

.card .card-emoji {
  font-size: 3.2rem;
  display: block;
  margin-bottom: 16px;
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.card:hover .card-emoji {
  transform: scale(1.25) rotate(5deg);
}

.card h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: #fff;
}

.card .card-desc {
  color: var(--text-muted);
  font-size: 0.85rem;
  line-height: 1.5;
  margin-bottom: 14px;
}

.card .card-count {
  display: inline-block;
  background: rgba(255, 255, 255, 0.08);
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.5);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Card accent colors */
.card-party {
  --accent: #f472b6;
}

.card-party:hover {
  border-color: rgba(244, 114, 182, 0.3);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3), 0 0 30px rgba(244, 114, 182, 0.15);
}

.card-party::before {
  background: linear-gradient(90deg, #f472b6, #fb923c);
}

.card-drunk {
  --accent: #f59e0b;
}

.card-drunk:hover {
  border-color: rgba(245, 158, 11, 0.3);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3), 0 0 30px rgba(245, 158, 11, 0.15);
}

.card-drunk::before {
  background: linear-gradient(90deg, #f59e0b, #ef4444);
}

.card-mind {
  --accent: #a78bfa;
}

.card-mind:hover {
  border-color: rgba(167, 139, 250, 0.3);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3), 0 0 30px rgba(167, 139, 250, 0.15);
}

.card-mind::before {
  background: linear-gradient(90deg, #a78bfa, #06b6d4);
}

.card-solo {
  --accent: #22c55e;
}

.card-solo:hover {
  border-color: rgba(34, 197, 94, 0.3);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3), 0 0 30px rgba(34, 197, 94, 0.15);
}

.card-solo::before {
  background: linear-gradient(90deg, #22c55e, #06b6d4);
}

.card-racing {
  --accent: #06b6d4;
}

.card-racing:hover {
  border-color: rgba(6, 182, 212, 0.3);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3), 0 0 30px rgba(6, 182, 212, 0.15);
}

.card-racing::before {
  background: linear-gradient(90deg, #06b6d4, #8b5cf6);
}

/* --- Hero Button --- */
#heroBtn {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border: none;
  color: white;
  padding: 16px 48px;
  font-size: 1.1rem;
  font-weight: 700;
  border-radius: 50px;
  cursor: pointer;
  transition: transform 0.3s, box-shadow 0.3s;
  box-shadow: 0 4px 20px rgba(255, 79, 216, 0.3);
  position: relative;
  z-index: 2;
}

#heroBtn:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 30px rgba(255, 79, 216, 0.5);
}

/* --- Stats Bar --- */
.stats-bar {
  display: flex;
  justify-content: center;
  gap: 50px;
  padding: 30px 20px;
  max-width: 800px;
  margin: 0 auto 20px;
}

.stats-bar .stat-item {
  text-align: center;
}

.stats-bar .stat-num {
  font-size: 2rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stats-bar .stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* --- Footer --- */
footer {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
  font-size: 0.9rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  margin-top: 40px;
}

/* --- Preloader --- */
#preloader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #0b0624;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  transition: opacity 0.8s ease-out, visibility 0.8s;
}

.loader-content {
  text-align: center;
}

.loader-circle {
  width: 60px;
  height: 60px;
  border: 4px solid rgba(255, 255, 255, 0.1);
  border-top: 4px solid var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 20px;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

/* --- Reveal Animations --- */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s ease-out;
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

.delay-1 {
  transition-delay: 0.15s;
}

.delay-2 {
  transition-delay: 0.3s;
}

.delay-3 {
  transition-delay: 0.45s;
}

.delay-4 {
  transition-delay: 0.6s;
}

/* --- Ad Container --- */
.ad-container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 20px auto;
  min-height: 90px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 12px;
  max-width: 728px;
  overflow: hidden;
  color: var(--text-muted);
  font-size: 0.7rem;
  text-transform: uppercase;
  border: 1px solid rgba(255, 255, 255, 0.04);
}

/* --- Mobile Responsive --- */
@media (max-width: 600px) {
  header {
    padding: 15px 20px;
  }

  .logo img {
    width: 36px;
  }

  .logo span {
    font-size: 1.4rem;
  }

  .hero {
    padding: 40px 16px 30px;
  }

  .hero h1 {
    font-size: 2.2rem;
  }

  .stats-bar {
    gap: 30px;
  }

  .stats-bar .stat-num {
    font-size: 1.5rem;
  }

  .category-section {
    padding: 30px 16px 40px;
  }

  .categories-grid {
    gap: 16px;
  }
}

/* --- Particle Canvas --- */
#particleCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* --- Cursor Glow --- */
#cursorGlow {
  position: fixed;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 79, 216, 0.08) 0%, transparent 70%);
  pointer-events: none;
  z-index: 1;
  transform: translate(-50%, -50%);
  transition: left 0.08s ease-out, top 0.08s ease-out;
}

/* --- Animated Hero Gradient --- */
.hero h1 {
  background-size: 200% 200%;
  animation: gradientShift 4s ease-in-out infinite;
}

@keyframes gradientShift {
  0% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }

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

/* --- Card 3D Tilt Smoothing --- */
.card {
  transition: all 0.15s ease-out;
  will-change: transform;
}

/* --- Hero Button Pulse --- */
#heroBtn {
  animation: btnPulse 2s ease-in-out infinite;
}

@keyframes btnPulse {

  0%,
  100% {
    box-shadow: 0 4px 20px rgba(255, 79, 216, 0.3);
  }

  50% {
    box-shadow: 0 4px 35px rgba(255, 79, 216, 0.55), 0 0 60px rgba(91, 140, 255, 0.2);
  }
}

/* --- Floating Emoji Enhancement --- */
.hero-floating-emojis span {
  filter: blur(0.5px);
  transition: opacity 2s;
}

/* --- Card Inner Shimmer --- */
.card::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.04), transparent);
  transition: left 0.5s;
}

.card:hover::after {
  left: 100%;
}