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

:root {
  /* Gaming Color Palette - Emerald & Purple Theme */
  --gaming-primary: #10b981;
  --gaming-secondary: #8b5cf6;
  --gaming-accent: #f59e0b;
  --gaming-success: #22c55e;
  --gaming-warning: #eab308;
  --gaming-danger: #ef4444;
  --gaming-dark: #0f172a;
  --gaming-darker: #020617;
  --gaming-card: #1e293b;
  --gaming-slate: #334155;
  --gaming-light: #f8fafc;
  --gaming-text: #e2e8f0;
  --gaming-text-secondary: #94a3b8;

  /* Gaming Effects */
  --neon-glow: 0 0 10px #10b981, 0 0 20px #10b981, 0 0 30px #10b981;
  --accent-glow: 0 0 10px #f59e0b, 0 0 20px #f59e0b;
  --success-glow: 0 0 10px #22c55e, 0 0 20px #22c55e;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(
    135deg,
    var(--gaming-darker) 0%,
    var(--gaming-dark) 50%,
    #0c4a6e 100%
  );
  color: var(--gaming-text);
  line-height: 1.6;
  overflow-x: hidden;
  background-attachment: fixed;
}

/* Gaming Background with Pulsing Animation */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(
      circle at 20% 20%,
      rgba(16, 185, 129, 0.15) 0%,
      transparent 50%
    ),
    radial-gradient(
      circle at 80% 80%,
      rgba(139, 92, 246, 0.15) 0%,
      transparent 50%
    ),
    radial-gradient(
      circle at 40% 60%,
      rgba(245, 158, 11, 0.1) 0%,
      transparent 50%
    );
  pointer-events: none;
  z-index: -1;
  animation: breathBackground 8s ease-in-out infinite;
}

@keyframes breathBackground {
  0%,
  100% {
    opacity: 0.3;
  }
  50% {
    opacity: 0.6;
  }
}

/* Circuit Board Effect */
.circuit-effect {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    45deg,
    transparent 30%,
    rgba(16, 185, 129, 0.1) 50%,
    transparent 70%
  );
  animation: circuitFlow 6s linear infinite;
  pointer-events: none;
  z-index: -1;
}

@keyframes circuitFlow {
  0% {
    transform: translateX(-100%) rotate(45deg);
  }
  100% {
    transform: translateX(100%) rotate(45deg);
  }
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Gaming Header */
header {
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(20px);
  border-bottom: 2px solid var(--gaming-primary);
  box-shadow: 0 4px 30px rgba(16, 185, 129, 0.3);
  color: var(--gaming-text);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 30px;
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 1000;
  animation: headerSlideDown 0.8s ease-out;
}

@keyframes headerSlideDown {
  from {
    transform: translateY(-100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

header .logo {
  font-size: 2.2rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 15px;
  background: linear-gradient(
    45deg,
    var(--gaming-primary),
    var(--gaming-accent)
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  position: relative;
}

.logo::after {
  content: "🎮";
  position: absolute;
  right: -30px;
  font-size: 1.2rem;
  animation: gameGlow 2s ease-in-out infinite;
}

@keyframes gameGlow {
  0%,
  100% {
    text-shadow: var(--neon-glow);
    opacity: 0.7;
  }
  50% {
    text-shadow:
      var(--neon-glow),
      0 0 40px #10b981;
    opacity: 1;
  }
}

.logo i {
  color: var(--gaming-primary);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

nav {
  display: flex;
  gap: 20px;
}

nav a {
  color: var(--gaming-text-secondary);
  text-decoration: none;
  font-weight: 600;
  padding: 12px 24px;
  border-radius: 25px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid transparent;
  text-transform: uppercase;
  font-size: 0.9rem;
  letter-spacing: 1px;
}

nav a::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(16, 185, 129, 0.3),
    transparent
  );
  transition: left 0.6s;
}

nav a:hover::before {
  left: 100%;
}

nav a:hover,
nav a.active {
  color: var(--gaming-light);
  background: rgba(16, 185, 129, 0.15);
  border-color: var(--gaming-primary);
  box-shadow: var(--neon-glow);
  transform: translateY(-2px);
}

.mobile-menu {
  display: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--gaming-primary);
  animation: pulse 2s infinite;
}

/* Gaming Hero Section */
.hero {
  background: linear-gradient(
    135deg,
    rgba(2, 6, 23, 0.9) 0%,
    rgba(15, 23, 42, 0.8) 50%,
    rgba(16, 185, 129, 0.1) 100%
  );
  padding: 180px 0 120px;
  position: relative;
  overflow: hidden;
  border-bottom: 3px solid var(--gaming-primary);
}

.hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><path d="M0,0 L100,0 L100,100 Z" fill="rgba(16,185,129,0.05)"/></svg>');
  background-size: cover;
  animation: heroPattern 20s linear infinite;
}

@keyframes heroPattern {
  0% {
    transform: translateX(0) translateY(0);
  }
  100% {
    transform: translateX(-100px) translateY(-100px);
  }
}

.hero-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  position: relative;
  z-index: 1;
}

.hero-text {
  flex: 1;
  max-width: 600px;
  animation: textSlideIn 1s ease-out;
}

@keyframes textSlideIn {
  from {
    opacity: 0;
    transform: translateX(-50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.hero-text h1 {
  font-size: 4rem;
  margin-bottom: 25px;
  line-height: 1.1;
  background: linear-gradient(
    45deg,
    var(--gaming-primary),
    var(--gaming-accent),
    var(--gaming-secondary)
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
  position: relative;
}

.hero-text h1::after {
  content: "";
  position: absolute;
  bottom: -10px;
  left: 0;
  width: 100px;
  height: 3px;
  background: linear-gradient(
    45deg,
    var(--gaming-primary),
    var(--gaming-accent)
  );
  animation: widthGrow 2s ease-in-out infinite alternate;
}

@keyframes widthGrow {
  0% {
    width: 100px;
  }
  100% {
    width: 200px;
  }
}

.hero-text p {
  font-size: 1.3rem;
  margin-bottom: 35px;
  color: var(--gaming-text-secondary);
  line-height: 1.8;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.hero-buttons {
  display: flex;
  gap: 20px;
}

.btn-primary,
.btn-secondary {
  padding: 15px 35px;
  border: none;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 1.1rem;
  position: relative;
  overflow: hidden;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-family: inherit;
}

.btn-primary {
  background: linear-gradient(45deg, var(--gaming-primary), #059669);
  color: white;
  box-shadow: 0 5px 15px rgba(16, 185, 129, 0.4);
  border: 2px solid transparent;
}

.btn-primary::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  transition: left 0.5s;
}

.btn-primary:hover::before {
  left: 100%;
}

.btn-primary:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 8px 25px rgba(16, 185, 129, 0.6);
  background: linear-gradient(45deg, #059669, var(--gaming-primary));
}

.btn-secondary {
  background: transparent;
  color: var(--gaming-text);
  border: 2px solid var(--gaming-accent);
  box-shadow: 0 5px 15px rgba(245, 158, 11, 0.3);
}

.btn-secondary:hover {
  background: rgba(245, 158, 11, 0.1);
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(245, 158, 11, 0.5);
}

.hero-image {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  animation: imageSlideIn 1s ease-out 0.3s both;
}

@keyframes imageSlideIn {
  from {
    opacity: 0;
    transform: translateX(50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.floating-games {
  position: relative;
  width: 400px;
  height: 400px;
}

.floating-game {
  position: absolute;
  font-size: 4rem;
  animation: gameFloat 6s ease-in-out infinite;
  filter: drop-shadow(0 0 10px currentColor);
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  padding: 10px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.floating-game:nth-child(1) {
  top: 10%;
  left: 10%;
  animation-delay: 0s;
  color: var(--gaming-primary);
  background: rgba(16, 185, 129, 0.1);
}

.floating-game:nth-child(2) {
  top: 60%;
  left: 20%;
  animation-delay: 1.5s;
  color: var(--gaming-accent);
  background: rgba(245, 158, 11, 0.1);
}

.floating-game:nth-child(3) {
  top: 30%;
  right: 20%;
  animation-delay: 3s;
  color: var(--gaming-secondary);
  background: rgba(139, 92, 246, 0.1);
}

.floating-game:nth-child(4) {
  bottom: 10%;
  right: 10%;
  animation-delay: 4.5s;
  color: var(--gaming-success);
  background: rgba(34, 197, 94, 0.1);
}

@keyframes gameFloat {
  0%,
  100% {
    transform: translateY(0) rotate(0deg) scale(1);
  }
  25% {
    transform: translateY(-20px) rotate(5deg) scale(1.1);
  }
  50% {
    transform: translateY(-10px) rotate(-5deg) scale(1.05);
  }
  75% {
    transform: translateY(-15px) rotate(3deg) scale(1.08);
  }
}

/* Games Section */
.games {
  padding: 120px 0;
  background: var(--gaming-darker);
  position: relative;
}

.games::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--gaming-primary),
    var(--gaming-accent),
    transparent
  );
  animation: borderFlow 3s linear infinite;
}

@keyframes borderFlow {
  0% {
    background-position: -200px 0;
  }
  100% {
    background-position: 200px 0;
  }
}

.games h2,
.about h2,
.contact h2 {
  text-align: center;
  font-size: 3rem;
  margin-bottom: 20px;
  background: linear-gradient(
    45deg,
    var(--gaming-primary),
    var(--gaming-accent)
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  position: relative;
  animation: titleGlow 3s ease-in-out infinite alternate;
}

@keyframes titleGlow {
  0% {
    text-shadow: 0 0 20px rgba(16, 185, 129, 0.5);
  }
  100% {
    text-shadow: 0 0 30px rgba(245, 158, 11, 0.5);
  }
}

.section-subtitle {
  text-align: center;
  max-width: 600px;
  margin: 0 auto 50px;
  color: var(--gaming-text-secondary);
  font-size: 1.2rem;
  line-height: 1.6;
}

.filter-buttons {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-bottom: 50px;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 12px 25px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--gaming-text-secondary);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 25px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 600;
  backdrop-filter: blur(10px);
  position: relative;
  overflow: hidden;
}

.filter-btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.1),
    transparent
  );
  transition: left 0.5s;
}

.filter-btn:hover::before {
  left: 100%;
}

.filter-btn.active,
.filter-btn:hover {
  background: linear-gradient(
    45deg,
    var(--gaming-primary),
    var(--gaming-secondary)
  );
  color: white;
  border-color: transparent;
  box-shadow: var(--neon-glow);
  transform: translateY(-2px);
}

.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 30px;
  margin-bottom: 40px;
}

.game-card {
  background: linear-gradient(
    135deg,
    rgba(51, 65, 85, 0.8) 0%,
    rgba(30, 41, 59, 0.9) 100%
  );
  border-radius: 15px;
  overflow: hidden;
  transition: all 0.4s ease;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  animation: cardAppear 0.6s ease-out;
}

@keyframes cardAppear {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.game-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    135deg,
    rgba(16, 185, 129, 0.1) 0%,
    rgba(245, 158, 11, 0.1) 100%
  );
  opacity: 0;
  transition: opacity 0.3s ease;
}

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

.game-card:hover {
  transform: translateY(-10px) scale(1.02);
  box-shadow:
    0 20px 40px rgba(0, 0, 0, 0.4),
    0 0 30px rgba(16, 185, 129, 0.2);
  border-color: var(--gaming-primary);
}

.game-image {
  height: 200px;
  background: linear-gradient(
    135deg,
    var(--gaming-primary),
    var(--gaming-secondary)
  );
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  position: relative;
  overflow: hidden;
}

.game-image::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    45deg,
    transparent 30%,
    rgba(255, 255, 255, 0.1) 50%,
    transparent 70%
  );
  animation: gameShimmer 3s infinite;
}

@keyframes gameShimmer {
  0% {
    transform: translateX(-100%) skewX(-15deg);
  }
  100% {
    transform: translateX(200%) skewX(-15deg);
  }
}

.game-info {
  padding: 25px;
  position: relative;
  z-index: 1;
}

.game-info h3 {
  margin-bottom: 15px;
  font-size: 1.4rem;
  color: var(--gaming-light);
}

.game-info p {
  color: var(--gaming-text-secondary);
  margin-bottom: 20px;
  font-size: 0.95rem;
  line-height: 1.6;
}

.game-tags {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.game-tag {
  background: linear-gradient(
    45deg,
    var(--gaming-primary),
    var(--gaming-secondary)
  );
  color: white;
  padding: 5px 12px;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.play-btn {
  display: block;
  width: 100%;
  padding: 12px;
  background: linear-gradient(
    45deg,
    var(--gaming-accent),
    var(--gaming-primary)
  );
  color: var(--gaming-light);
  text-align: center;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 700;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
  box-shadow: 0 5px 15px rgba(245, 158, 11, 0.4);
  border: none;
  cursor: pointer;
  font-family: inherit;
}

.play-btn:hover {
  background: linear-gradient(
    45deg,
    var(--gaming-primary),
    var(--gaming-accent)
  );
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(245, 158, 11, 0.6);
}

/* About Section */
.about {
  padding: 100px 0;
  background: var(--gaming-dark);
  position: relative;
}

.about::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--gaming-accent),
    var(--gaming-primary),
    transparent
  );
  animation: borderFlow 3s linear infinite;
}

.about-content {
  display: flex;
  align-items: center;
  gap: 50px;
}

.about-text {
  flex: 1;
}

.about-text p {
  margin-bottom: 30px;
  font-size: 1rem;
  line-height: 1.7;
  color: var(--gaming-text-secondary);
}

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-top: 30px;
}

.feature {
  text-align: center;
  padding: 25px 20px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 10px;
  transition: all 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.feature:hover {
  transform: translateY(-5px);
  border-color: var(--gaming-primary);
  box-shadow: 0 8px 25px rgba(16, 185, 129, 0.15);
}

.feature i {
  font-size: 2.5rem;
  color: var(--gaming-primary);
  margin-bottom: 15px;
}

.feature h3 {
  margin-bottom: 10px;
  font-size: 1.2rem;
  color: var(--gaming-light);
}

.feature p {
  font-size: 0.85rem;
  color: var(--gaming-text-secondary);
  line-height: 1.5;
}

.about-image {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
}

.gaming-character {
  width: 300px;
  height: 300px;
  background: linear-gradient(
    135deg,
    var(--gaming-primary),
    var(--gaming-secondary)
  );
  border-radius: 50%;
  position: relative;
  overflow: hidden;
  box-shadow: 0 15px 35px rgba(16, 185, 129, 0.2);
  animation: gameFloat 4s ease-in-out infinite;
}

.gaming-character::before,
.gaming-character::after {
  content: "";
  position: absolute;
  background: white;
  border-radius: 50%;
}

.gaming-character::before {
  width: 80px;
  height: 80px;
  top: 70px;
  left: 70px;
  box-shadow: 120px 0 white;
}

.gaming-character::after {
  width: 40px;
  height: 40px;
  top: 85px;
  left: 85px;
  background: #333;
  box-shadow: 120px 0 #333;
}

/* Contact Section */
.contact {
  padding: 100px 0;
  background: var(--gaming-darker);
  position: relative;
}

.contact::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--gaming-secondary),
    var(--gaming-primary),
    transparent
  );
  animation: borderFlow 3s linear infinite;
}

.contact-content {
  display: flex;
  gap: 50px;
  margin-top: 40px;
}

.contact-info {
  flex: 1;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 25px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 10px;
  transition: all 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.contact-item:hover {
  transform: translateX(5px);
  border-color: var(--gaming-primary);
}

.contact-item i {
  font-size: 1.8rem;
  color: var(--gaming-primary);
}

.contact-item h3 {
  margin-bottom: 5px;
  font-size: 1.1rem;
  color: var(--gaming-light);
}

.contact-item p {
  color: var(--gaming-text-secondary);
}

.contact-form {
  flex: 1;
  background: rgba(255, 255, 255, 0.03);
  padding: 30px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.form-group {
  margin-bottom: 20px;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 12px 15px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  color: var(--gaming-text);
  font-size: 1rem;
  transition: all 0.3s ease;
  font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--gaming-primary);
  background: rgba(255, 255, 255, 0.08);
}

.form-group textarea {
  resize: vertical;
  min-height: 120px;
}

/* Footer */
footer {
  background: var(--gaming-dark);
  padding: 60px 0 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 40px;
  margin-bottom: 40px;
}

.footer-section h3 {
  margin-bottom: 20px;
  font-size: 1.3rem;
  color: var(--gaming-light);
}

.footer-section p {
  color: var(--gaming-text-secondary);
  margin-bottom: 20px;
  line-height: 1.6;
}

.social-links {
  display: flex;
  gap: 12px;
}

.social-links a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  color: var(--gaming-text-secondary);
  transition: all 0.3s ease;
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.social-links a:hover {
  background: var(--gaming-primary);
  color: white;
  transform: translateY(-2px);
}

.footer-section ul {
  list-style: none;
}

.footer-section ul li {
  margin-bottom: 10px;
}

.footer-section ul li a {
  color: var(--gaming-text-secondary);
  text-decoration: none;
  transition: all 0.3s ease;
}

.footer-section ul li a:hover {
  color: var(--gaming-primary);
  padding-left: 5px;
}

.footer-bottom {
  text-align: center;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--gaming-text-secondary);
  font-size: 0.9rem;
}

.footer-bottom a {
  color: var(--gaming-text-secondary);
  text-decoration: none;
  transition: all 0.3s ease;
}

.footer-bottom a:hover {
  color: var(--gaming-primary);
}

/* Game Modal - Gaming Style */
.game-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(2, 6, 23, 0.98);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(10px);
}

.modal-content {
  background: linear-gradient(
    135deg,
    var(--gaming-slate) 0%,
    var(--gaming-card) 100%
  );
  border-radius: 15px;
  width: 100%;
  max-width: 900px;
  max-height: 90vh;
  overflow: auto;
  position: relative;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
  border: 2px solid var(--gaming-primary);
  animation: modalAppear 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes modalAppear {
  from {
    opacity: 0;
    transform: scale(0.8) translateY(-50px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.close-modal {
  position: absolute;
  top: 20px;
  right: 25px;
  font-size: 2rem;
  color: var(--gaming-text-secondary);
  cursor: pointer;
  z-index: 10;
  transition: all 0.3s ease;
  background: rgba(16, 185, 129, 0.1);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.close-modal:hover {
  color: var(--gaming-primary);
  background: rgba(16, 185, 129, 0.2);
  transform: rotate(90deg) scale(1.1);
  box-shadow: var(--neon-glow);
}

.modal-body {
  padding: 30px;
}

.modal-body h2 {
  margin-bottom: 15px;
  color: var(--gaming-light);
  font-size: 2rem;
  background: linear-gradient(
    45deg,
    var(--gaming-primary),
    var(--gaming-accent)
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.modal-body p {
  margin-bottom: 20px;
  color: var(--gaming-text-secondary);
  line-height: 1.6;
}

/* Game Controls */
.game-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding: 15px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.game-stats {
  display: flex;
  gap: 25px;
  font-weight: bold;
  color: var(--gaming-accent);
}

.inline-game {
  text-align: center;
}

/* Game-specific Styles */
#snakeCanvas {
  border: 2px solid var(--gaming-primary);
  background: #000;
  border-radius: 8px;
  margin: 15px 0;
  max-width: 100%;
  box-shadow: 0 5px 15px rgba(16, 185, 129, 0.2);
}

.ttt-board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  max-width: 320px;
  margin: 20px auto;
  background: rgba(255, 255, 255, 0.05);
  padding: 8px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.ttt-cell {
  aspect-ratio: 1;
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  cursor: pointer;
  transition: all 0.3s ease;
  border-radius: 6px;
}

.ttt-cell:hover {
  background: rgba(255, 255, 255, 0.1);
}

.ttt-cell.x::before {
  content: "X";
  color: var(--gaming-primary);
  font-weight: bold;
}

.ttt-cell.o::before {
  content: "O";
  color: var(--gaming-accent);
  font-weight: bold;
}

.memory-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  max-width: 400px;
  margin: 20px auto;
}

.memory-card {
  aspect-ratio: 1;
  background: linear-gradient(
    135deg,
    var(--gaming-primary),
    var(--gaming-secondary)
  );
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  cursor: pointer;
  transform-style: preserve-3d;
  transition: transform 0.5s;
  position: relative;
}

.memory-card.flipped {
  transform: rotateY(180deg);
}

.memory-card .front,
.memory-card .back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
}

.memory-card .front {
  background: var(--gaming-slate);
  transform: rotateY(180deg);
  border: 1px solid var(--gaming-primary);
}

.memory-card .back {
  background: linear-gradient(
    135deg,
    var(--gaming-primary),
    var(--gaming-secondary)
  );
  color: white;
  font-weight: bold;
}

/* 2048 Game */
.game-2048-container {
  text-align: center;
}

#game2048Grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  max-width: 400px;
  margin: 20px auto;
  background: #bbada0;
  padding: 12px;
  border-radius: 6px;
}

.grid-cell {
  aspect-ratio: 1;
  background: rgba(238, 228, 218, 0.35);
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  font-weight: bold;
  color: #776e65;
}

.tile-2 {
  background: #eee4da;
}
.tile-4 {
  background: #ede0c8;
}
.tile-8 {
  background: #f2b179;
  color: #f9f6f2;
}
.tile-16 {
  background: #f59563;
  color: #f9f6f2;
}
.tile-32 {
  background: #f67c5f;
  color: #f9f6f2;
}
.tile-64 {
  background: #f65e3b;
  color: #f9f6f2;
}
.tile-128 {
  background: #edcf72;
  color: #f9f6f2;
  font-size: 1.2rem;
}
.tile-256 {
  background: #edcc61;
  color: #f9f6f2;
  font-size: 1.2rem;
}
.tile-512 {
  background: #edc850;
  color: #f9f6f2;
  font-size: 1.2rem;
}
.tile-1024 {
  background: #edc53f;
  color: #f9f6f2;
  font-size: 1rem;
}
.tile-2048 {
  background: #edc22e;
  color: #f9f6f2;
  font-size: 1rem;
}

/* Particle System */
.particle {
  position: fixed;
  width: 2px;
  height: 2px;
  background: var(--gaming-primary);
  border-radius: 50%;
  pointer-events: none;
  z-index: -1;
  animation: particleFloat 6s linear forwards;
}

@keyframes particleFloat {
  0% {
    transform: translateY(0) translateX(0);
    opacity: var(--opacity, 0.3);
  }
  100% {
    transform: translateY(-100vh) translateX(var(--random-x, 0px));
    opacity: 0;
  }
}

/* Responsive Design */
@media (max-width: 768px) {
  header {
    padding: 12px 20px;
  }

  nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: var(--gaming-dark);
    flex-direction: column;
    padding: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    border-top: 1px solid rgba(16, 185, 129, 0.3);
  }

  nav.active {
    display: flex;
  }

  .mobile-menu {
    display: block;
  }

  .hero-text h1 {
    font-size: 2.5rem;
  }

  .hero-content {
    flex-direction: column;
    text-align: center;
  }

  .hero-text {
    margin-bottom: 40px;
  }

  .about-content {
    flex-direction: column;
  }

  .contact-content {
    flex-direction: column;
  }

  .game-grid {
    grid-template-columns: 1fr;
  }

  .floating-games {
    width: 280px;
    height: 280px;
  }

  .gaming-character {
    width: 250px;
    height: 250px;
  }

  .hero-buttons {
    flex-direction: column;
    gap: 15px;
  }

  .btn-primary,
  .btn-secondary {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .hero-text h1 {
    font-size: 2rem;
  }

  .games h2,
  .about h2,
  .contact h2 {
    font-size: 2rem;
  }

  .filter-buttons {
    gap: 8px;
  }

  .filter-btn {
    padding: 10px 16px;
    font-size: 0.9rem;
  }

  .game-controls {
    flex-direction: column;
    gap: 15px;
  }

  .game-stats {
    flex-direction: column;
    gap: 10px;
  }
}

/* ==================================
   Game 9: Chess Master AI
================================== */

.chess-game-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.chess-board-wrapper {
  margin: 20px auto;
  max-width: 100%;
  overflow: hidden;
  display: flex;
  justify-content: center;
}

.chess-board {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  grid-template-rows: repeat(8, 1fr);
  width: 400px;
  height: 400px;
  max-width: 90vw;
  max-height: 90vw;
  border: 4px solid var(--gaming-darker);
  border-radius: 8px;
  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.5),
    0 0 15px rgba(16, 185, 129, 0.3);
}

.chess-square {
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 2.5rem;
  user-select: none;
  transition:
    background-color 0.2s,
    box-shadow 0.2s;
  position: relative;
}

@media (max-width: 480px) {
  .chess-board {
    width: 320px;
    height: 320px;
  }
  .chess-square {
    font-size: 1.8rem;
  }
}

.chess-square.light {
  background-color: #f0d9b5;
}

.chess-square.dark {
  background-color: #b58863;
}

.chess-square.selected {
  background-color: #f59e0b !important;
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.5);
}

.chess-square.possible-move::after {
  content: "";
  position: absolute;
  width: 30%;
  height: 30%;
  border-radius: 50%;
  background-color: rgba(16, 185, 129, 0.7);
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
}

.chess-piece {
  filter: drop-shadow(0 3px 3px rgba(0, 0, 0, 0.5));
  line-height: 1;
}

.chess-piece.w {
  color: #ffffff;
  text-shadow: 0 0 2px #000;
}

.chess-piece.b {
  color: #111111;
  text-shadow: 0 0 2px #fff;
}

.chess-stats {
  background: linear-gradient(
    135deg,
    rgba(30, 41, 59, 0.9),
    rgba(15, 23, 42, 0.9)
  );
  padding: 10px 20px;
  border-radius: 8px;
  border: 1px solid var(--gaming-primary);
  box-shadow: var(--neon-glow);
  font-weight: bold;
  color: var(--gaming-text);
}
