/* Retro Logo Styles */
@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

#logo {
  font-family: 'Press Start 2P', cursive;
  font-size: 2.2rem;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 2px;
  position: relative;
  display: inline-block;
  color: transparent;
  /* Changed initial gradient to blue (the hover color) */
  background: linear-gradient(
    to bottom,
    #00ffff 0%,
    #0080ff 50%,
    #0000ff 100%
  );
  background-clip: text;
  -webkit-background-clip: text;
  text-shadow: 
    0 0 10px rgba(0, 255, 255, 0.8),
    0 0 20px rgba(0, 128, 255, 0.5),
    3px 3px 0px rgba(0, 0, 0, 1);
  margin: 0 auto;
  padding: 10px 15px;
  user-select: none;
  cursor: pointer;
  animation: textGlow 3s infinite alternate, pixelShake 0.5s infinite alternate;
  transition: all 0.3s ease;
}

/* Add hover state that keeps the current purple/pink/cyan gradient */
#logo:hover {
  background: linear-gradient(
    to bottom,
    #8a2be2 0%,
    #ff00ff 50%,
    #00ffff 100%
  );
  background-clip: text;
  -webkit-background-clip: text;
  text-shadow: 
    0 0 10px rgba(255, 0, 255, 0.8),
    0 0 20px rgba(0, 255, 255, 0.5),
    3px 3px 0px rgba(0, 0, 0, 1);
}

#logo::before {
  content: 'Mind Maze';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  /* Changed initial gradient to blue tones */
  background: linear-gradient(
    to right,
    #00ffff 0%,
    #0080ff 33%,
    #0000ff 66%,
    #00ffff 100%
  );
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  z-index: -1;
  animation: textSlide 8s linear infinite;
  padding: 10px 15px;
  transition: all 0.3s ease;
}

/* Add hover state for the before pseudo-element */
#logo:hover::before {
  background: linear-gradient(
    to right,
    #ff00ff 0%,
    #00ffff 33%,
    #ffff00 66%,
    #ff00ff 100%
  );
  background-clip: text;
  -webkit-background-clip: text;
}

#logo::after {
  content: '';
  position: absolute;
  top: -5px;
  left: -5px;
  right: -5px;
  bottom: -5px;
  /* Changed initial gradient to blue tones */
  background: linear-gradient(
    45deg,
    #00ffff 0%,
    #0080ff 50%,
    #0000ff 100%
  );
  border-radius: 8px;
  z-index: -2;
  filter: blur(6px);
  opacity: 0.5;
  animation: borderGlow 3s infinite alternate;
  transition: all 0.3s ease;
}

/* Add hover state for the after pseudo-element */
#logo:hover::after {
  background: linear-gradient(
    45deg,
    #ff00ff 0%,
    #00ffff 50%,
    #ffff00 100%
  );
}

#game-title {
  position: relative;
  width: 100%;
  text-align: center;
  margin-bottom: 10px;
  margin-top: 10px;
  padding: 10px 0;
  z-index: 5;
  overflow: visible;
}

/* Arcade Scan Lines Effect */
#game-title::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.1),
    rgba(0, 0, 0, 0.1) 1px,
    transparent 1px,
    transparent 2px
  );
  z-index: 1;
  pointer-events: none;
}

/* Retro Pixel Grid */
#game-title::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    radial-gradient(rgba(0, 255, 255, 0.1) 1px, transparent 1px);
  background-size: 4px 4px;
  z-index: 0;
  opacity: 0.5;
  pointer-events: none;
}

@keyframes textGlow {
  0% {
    text-shadow: 
      0 0 5px rgba(0, 255, 255, 0.8),
      0 0 10px rgba(0, 128, 255, 0.5),
      3px 3px 0px rgba(0, 0, 0, 1);
  }
  100% {
    text-shadow: 
      0 0 10px rgba(0, 255, 255, 0.8),
      0 0 20px rgba(0, 128, 255, 0.8),
      0 0 30px rgba(0, 0, 255, 0.8),
      3px 3px 0px rgba(0, 0, 0, 1);
  }
}

/* Updated hover animation for text glow */
#logo:hover .textGlow {
  0% {
    text-shadow: 
      0 0 5px rgba(255, 0, 255, 0.8),
      0 0 10px rgba(0, 255, 255, 0.5),
      3px 3px 0px rgba(0, 0, 0, 1);
  }
  100% {
    text-shadow: 
      0 0 10px rgba(255, 0, 255, 0.8),
      0 0 20px rgba(0, 255, 255, 0.8),
      0 0 30px rgba(255, 255, 0, 0.8),
      3px 3px 0px rgba(0, 0, 0, 1);
  }
}

@keyframes borderGlow {
  0% {
    opacity: 0.3;
    filter: blur(6px);
    transform: scale(0.95);
  }
  100% {
    opacity: 0.7;
    filter: blur(10px);
    transform: scale(1.05);
  }
}

@keyframes textSlide {
  0% {
    background-position: 0% center;
  }
  100% {
    background-position: 200% center;
  }
}

@keyframes pixelShake {
  0% {
    transform: translate(0, 0);
  }
  25% {
    transform: translate(-1px, 1px);
  }
  50% {
    transform: translate(1px, -1px);
  }
  75% {
    transform: translate(-1px, 0px);
  }
  100% {
    transform: translate(1px, 1px);
  }
}

/* Mobile responsive adjustments */
@media (max-width: 480px) {
  #logo {
    font-size: 1.8rem;
    padding: 8px 12px;
  }
}

/* Add arcade style glitches occasionally */
@keyframes glitchText {
  0% {
    transform: translate(0);
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.8);
  }
  2% {
    transform: translate(-2px, 2px);
    text-shadow: 0 0 10px rgba(0, 128, 255, 0.8);
  }
  4% {
    transform: translate(2px, -2px);
    text-shadow: 0 0 10px rgba(0, 0, 255, 0.8);
  }
  5% {
    transform: translate(0);
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.8);
  }
  100% {
    transform: translate(0);
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.8);
  }
}

/* Updated glitch animation for hover state */
#logo:hover.glitch {
  animation: glitchTextHover 3s infinite, textGlow 3s infinite alternate, pixelShake 0.5s infinite alternate;
}

@keyframes glitchTextHover {
  0% {
    transform: translate(0);
    text-shadow: 0 0 10px rgba(255, 0, 255, 0.8);
  }
  2% {
    transform: translate(-2px, 2px);
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.8);
  }
  4% {
    transform: translate(2px, -2px);
    text-shadow: 0 0 10px rgba(255, 255, 0, 0.8);
  }
  5% {
    transform: translate(0);
    text-shadow: 0 0 10px rgba(255, 0, 255, 0.8);
  }
  100% {
    transform: translate(0);
    text-shadow: 0 0 10px rgba(255, 0, 255, 0.8);
  }
}

#logo.glitch {
  animation: glitchText 3s infinite, textGlow 3s infinite alternate, pixelShake 0.5s infinite alternate;
}