/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Avenir Next', sans-serif;
  color: #D0D0D0;
}

body {
  background: #0A0A1F;
  overflow-x: hidden;
  position: relative;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Neuropol', sans-serif;
  color: #FFFFFF;
  text-shadow: 0 0 20px rgba(0, 212, 255, 0.8), 0 0 30px rgba(0, 212, 255, 0.6);
  position: relative;
  margin-bottom: 30px;
  line-height: 1.2;
  transition: all 0.3s ease;
}

h1 {
  font-size: 3.5rem;
}

h3 {
  font-size: 2rem;
  text-shadow: 0 0 15px rgba(0, 212, 255, 0.6);
}

h1::after, h2::after, h3::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: 3px;
  background: linear-gradient(90deg, #00D4FF, #FF00FF);
  box-shadow: 0 0 15px rgba(0, 212, 255, 0.8);
  animation: pulseBorder 2s infinite;
}

@keyframes pulseBorder {
  0% { transform: translateX(-50%) scaleX(1); }
  50% { transform: translateX(-50%) scaleX(1.1); }
  100% { transform: translateX(-50%) scaleX(1); }
}

p {
  font-size: 1.2rem;
  line-height: 1.8;
  margin-bottom: 25px;
}

a {
  color: #00D4FF;
  text-decoration: none;
  transition: all 0.3s ease;
}

a:hover {
  color: #FF00FF;
  text-shadow: 0 0 15px rgba(255, 0, 255, 0.6);
}

button {
  background: rgba(0, 212, 255, 0.1);
  border: 2px solid #00D4FF;
  backdrop-filter: blur(12px);
  padding: 15px 35px;
  color: #FFFFFF;
  cursor: pointer;
  border-radius: 5px;
  font-size: 1.1rem;
  transition: all 0.3s ease;
  margin: 15px 0;
  box-shadow: 0 0 20px rgba(0, 212, 255, 0.4);
  position: relative;
  overflow: hidden;
}

button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(0, 212, 255, 0.3), transparent);
  transition: all 0.5s ease;
}

button:hover::before {
  left: 100%;
}

button:hover {
  border-color: #FF00FF;
  box-shadow: 0 0 30px rgba(255, 0, 255, 0.6);
  transform: scale(1.05);
}

/* Canvas for 3D Background */
#three-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

/* Dark Overlay with Gradient */
#overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.7), rgba(0, 10, 31, 0.9));
  z-index: 2;
  pointer-events: none;
}

/* Navigation Bar */
nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: rgba(0, 212, 255, 0.05);
  backdrop-filter: blur(12px);
  border-bottom: 2px solid rgba(0, 212, 255, 0.4);
  padding: 25px 50px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 10;
  box-shadow: 0 0 25px rgba(0, 212, 255, 0.3);
}

nav .logo {
  font-family: 'Neuropol', sans-serif;
  font-size: 32px;
  color: #FFFFFF;
  text-shadow: 0 0 20px rgba(0, 212, 255, 0.8);
  transition: all 0.3s ease;
}

nav .logo:hover {
  text-shadow: 0 0 30px rgba(255, 0, 255, 0.8);
  color: #FF00FF;
}

nav ul {
  display: flex;
  list-style: none;
  gap: 40px;
}

nav ul li a {
  font-size: 1.2rem;
  padding-bottom: 5px;
  position: relative;
  text-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
}

nav ul li a:hover::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: #FF00FF;
  box-shadow: 0 0 15px rgba(255, 0, 255, 0.6);
}

/* Main Content */
main {
  position: relative;
  z-index: 5;
  padding: 120px 60px;
  min-height: 100vh;
}

section {
  display: none;
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
}

section.active {
  display: block;
}

/* Section Content Wrapper */
.section-content {
  display: flex;
  flex-direction: column;
  gap: 60px;
  align-items: center;
}

/* Card Grid for Multiple Cards */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 50px;
  width: 100%;
}

/* Glassmorphism Card */
.card {
  background: rgba(0, 212, 255, 0.05);
  border: 2px solid rgba(0, 212, 255, 0.4);
  backdrop-filter: blur(15px);
  padding: 40px;
  border-radius: 10px;
  box-shadow: 0 4px 40px rgba(0, 212, 255, 0.3);
  display: flex;
  flex-direction: column;
  gap: 20px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 2px solid transparent;
  border-radius: 10px;
  animation: neonBorder 3s infinite;
}

@keyframes neonBorder {
  0% { border-color: #00D4FF; box-shadow: 0 0 20px rgba(0, 212, 255, 0.6); }
  25% { border-color: #FF00FF; box-shadow: 0 0 20px rgba(255, 0, 255, 0.6); }
  50% { border-color: #00FF00; box-shadow: 0 0 20px rgba(0, 255, 0, 0.6); }
  75% { border-color: #AA00FF; box-shadow: 0 0 20px rgba(170, 0, 255, 0.6); }
  100% { border-color: #00D4FF; box-shadow: 0 0 20px rgba(0, 212, 255, 0.6); }
}

.card:hover {
  transform: scale(1.03);
  box-shadow: 0 8px 50px rgba(0, 212, 255, 0.5);
}

/* Form Styles */
form {
  display: flex;
  flex-direction: column;
  gap: 30px;
  max-width: 500px;
  margin: 0 auto;
  width: 100%;
}

form label {
  font-size: 1.1rem;
  margin-bottom: 5px;
  text-align: left;
}

form input {
  background: rgba(0, 212, 255, 0.05);
  border: 2px solid rgba(0, 212, 255, 0.5);
  padding: 15px;
  border-radius: 5px;
  color: #FFFFFF;
  font-size: 1.1rem;
  box-shadow: 0 0 15px rgba(0, 212, 255, 0.3);
  transition: all 0.3s ease;
}

form input:focus {
  border-color: #FF00FF;
  box-shadow: 0 0 20px rgba(255, 0, 255, 0.5);
}

/* Leaderboard Table */
table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 40px;
}

table th, table td {
  padding: 20px;
  text-align: left;
  border-bottom: 1px solid rgba(0, 212, 255, 0.3);
}

table th {
  background: rgba(0, 212, 255, 0.1);
  text-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
}

/* Button Group */
.button-group {
  display: flex;
  flex-wrap: wrap;
  gap: 25px;
  justify-content: center;
}

/* Glitch Effect for Headings */
.glitch:hover {
  animation: glitch 0.5s infinite;
}

@keyframes glitch {
  0% { transform: translate(0); }
  20% { transform: translate(-2px, 2px); color: #FF00FF; }
  40% { transform: translate(2px, -2px); color: #00FF00; }
  60% { transform: translate(-2px, 2px); color: #AA00FF; }
  80% { transform: translate(2px, -2px); color: #00D4FF; }
  100% { transform: translate(0); }
}

/* Full-Screen Flash Effect */
.flash {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: transparent;
  z-index: 3;
  pointer-events: none;
}

/* Responsive Design */
@media (max-width: 768px) {
  main {
    padding: 100px 30px;
  }

  nav {
    padding: 20px 30px;
  }

  nav ul {
    flex-direction: column;
    position: absolute;
    top: 80px;
    left: 0;
    background: rgba(0, 212, 255, 0.05);
    backdrop-filter: blur(12px);
    width: 100%;
    padding: 30px;
    display: none;
    gap: 20px;
  }

  nav.active ul {
    display: flex;
  }

  nav .menu-toggle {
    display: block;
    cursor: pointer;
    font-size: 1.8rem;
  }

  h1 {
    font-size: 2.5rem;
  }

  h3 {
    font-size: 1.6rem;
  }

  p {
    font-size: 1.1rem;
  }

  .card {
    padding: 30px;
  }

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

@media (min-width: 769px) {
  nav .menu-toggle {
    display: none;
  }
}