* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Orbitron", monospace;
  background: linear-gradient(135deg, #0c0c0c 0%, #1a1a2e 50%, #16213e 100%);
  overflow: hidden;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

#gameContainer {
  position: relative;
  width: 100vw;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

#gameCanvas {
  border: 2px solid #00ffff;
  border-radius: 10px;
  box-shadow: 0 0 30px rgba(0, 255, 255, 0.5);
  background: radial-gradient(circle at center, #0a0a0a 0%, #000000 100%);
}

/* Mobile-specific canvas styling */
@media (max-width: 768px) {
  #gameContainer {
    padding: 5px;
    align-items: flex-start;
    padding-top: 60px; /* Account for UI elements */
  }

  #gameCanvas {
    border-radius: 8px;
    border-width: 1px;
    max-width: calc(100vw - 10px);
    max-height: calc(100vh - 120px);
  }
}

@media (max-width: 480px) {
  #gameContainer {
    padding: 3px;
    padding-top: 50px;
  }

  #gameCanvas {
    border-radius: 6px;
    max-width: calc(100vw - 6px);
    max-height: calc(100vh - 100px);
  }
}

#ui {
  position: absolute;
  top: 10px;
  left: 10px;
  color: #00ffff;
  font-size: 16px;
  font-weight: 700;
  text-shadow: 0 0 10px rgba(0, 255, 255, 0.8);
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: calc(100vw - 20px);
}

#ui div {
  padding: 4px 8px;
  background: rgba(0, 0, 0, 0.8);
  border-radius: 4px;
  border: 1px solid rgba(0, 255, 255, 0.3);
  white-space: nowrap;
  font-size: inherit;
}

#startScreen,
#gameOver,
#pauseMenu {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  color: #00ffff;
  background: rgba(0, 0, 0, 0.9);
  padding: 40px;
  border-radius: 15px;
  border: 2px solid #00ffff;
  box-shadow: 0 0 30px rgba(0, 255, 255, 0.5);
  z-index: 20;
}

#pauseMenu h2 {
  font-size: 36px;
  font-weight: 900;
  margin-bottom: 30px;
  text-shadow: 0 0 20px rgba(0, 255, 255, 1);
}

#pauseMenu button {
  display: block;
  margin: 15px auto;
  width: 200px;
}

#startScreen h1 {
  font-size: 48px;
  font-weight: 900;
  margin-bottom: 20px;
  text-shadow: 0 0 20px rgba(0, 255, 255, 1);
  animation: glow 2s ease-in-out infinite alternate;
}

#gameOver h2 {
  font-size: 36px;
  font-weight: 900;
  margin-bottom: 20px;
  color: #ff4444;
  text-shadow: 0 0 20px rgba(255, 68, 68, 1);
}

#startScreen p,
#gameOver p {
  font-size: 16px;
  margin-bottom: 15px;
  opacity: 0.8;
}

.controls-info {
  margin-bottom: 20px;
}

.mobile-controls {
  display: none;
}

.desktop-controls {
  display: block;
}

@media (max-width: 768px) {
  .mobile-controls {
    display: block;
  }

  .desktop-controls {
    display: none;
  }
}

button {
  font-family: "Orbitron", monospace;
  font-size: 18px;
  font-weight: 700;
  padding: 15px 30px;
  background: linear-gradient(45deg, #00ffff, #0080ff);
  color: #000;
  border: none;
  border-radius: 25px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
}

button:hover {
  transform: scale(1.05);
  box-shadow: 0 0 20px rgba(0, 255, 255, 0.8);
}

button:active {
  transform: scale(0.95);
}

.hidden {
  display: none;
}

/* Developer Button */
#developerBtn {
  position: absolute;
  top: 15px;
  right: 15px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: linear-gradient(45deg, #00ffff, #0080ff);
  border: 2px solid #00ffff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 15;
  transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  box-shadow: 0 0 15px rgba(0, 255, 255, 0.5);
  animation: developerPulse 3s ease-in-out infinite;
  overflow: hidden;
}

#developerBtn::before {
  content: "";
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  border-radius: 50%;
  background: linear-gradient(45deg, #00ffff, #ff00ff, #ffff00, #00ffff);
  background-size: 300% 300%;
  animation: developerBorderRotate 4s linear infinite;
  z-index: -1;
  opacity: 0;
  transition: opacity 0.3s ease;
}

#developerBtn:hover::before {
  opacity: 1;
}

#developerBtn:hover {
  transform: scale(1.15) rotate(5deg);
  box-shadow: 0 0 30px rgba(0, 255, 255, 1), 0 0 50px rgba(0, 255, 255, 0.5);
  animation-play-state: paused;
}

#developerBtn:active {
  transform: scale(0.95) rotate(-2deg);
  transition: all 0.1s ease;
}

#developerBtn:hover::after {
  content: "Click me!";
  position: absolute;
  bottom: -35px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.9);
  color: #00ffff;
  padding: 5px 10px;
  border-radius: 5px;
  font-size: 12px;
  font-family: "Orbitron", monospace;
  white-space: nowrap;
  border: 1px solid #00ffff;
}

#developerLogo {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.3);
  transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  filter: brightness(1) contrast(1.1) saturate(1.2);
  position: relative;
  z-index: 2;
}

#developerBtn:hover #developerLogo {
  border-color: rgba(255, 255, 255, 0.8);
  filter: brightness(1.2) contrast(1.3) saturate(1.4);
  transform: rotate(-5deg) scale(1.05);
}

/* Developer Modal */
#developerModal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 30;
}

#modalContent {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  border: 2px solid #00ffff;
  border-radius: 15px;
  padding: 30px;
  max-width: 400px;
  width: 90%;
  box-shadow: 0 0 30px rgba(0, 255, 255, 0.5);
}

#modalHeader {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  border-bottom: 1px solid rgba(0, 255, 255, 0.3);
  padding-bottom: 15px;
}

#modalHeader h3 {
  color: #00ffff;
  font-family: "Orbitron", monospace;
  font-size: 24px;
  font-weight: 900;
  text-shadow: 0 0 10px rgba(0, 255, 255, 0.8);
}

#closeModal {
  background: none;
  border: none;
  color: #00ffff;
  font-size: 30px;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.3s ease;
}

#closeModal:hover {
  background: rgba(0, 255, 255, 0.2);
  transform: scale(1.1);
}

#modalBody {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.follow-us-text {
  text-align: center;
  margin-bottom: 10px;
  padding-bottom: 15px;
  border-bottom: 1px solid rgba(0, 255, 255, 0.3);
}

.follow-us-text p {
  color: #00ffff;
  font-family: "Orbitron", monospace;
  font-size: 18px;
  font-weight: 700;
  text-shadow: 0 0 10px rgba(0, 255, 255, 0.8);
  margin: 0;
  letter-spacing: 1px;
}

.social-link {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 10px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 8px;
  border: 1px solid rgba(0, 255, 255, 0.2);
  transition: all 0.3s ease;
}

.social-link:hover {
  background: rgba(0, 255, 255, 0.1);
  border-color: rgba(0, 255, 255, 0.5);
  transform: translateX(5px);
}

.social-icon {
  font-size: 20px;
  width: 25px;
  text-align: center;
}

.social-link a {
  color: #00ffff;
  text-decoration: none;
  font-family: "Orbitron", monospace;
  font-weight: 400;
  transition: all 0.3s ease;
}

.social-link a:hover {
  color: #ffffff;
  text-shadow: 0 0 5px rgba(0, 255, 255, 0.8);
}

@keyframes glow {
  from {
    text-shadow: 0 0 20px rgba(0, 255, 255, 1);
  }
  to {
    text-shadow: 0 0 30px rgba(0, 255, 255, 1), 0 0 40px rgba(0, 255, 255, 0.8);
  }
}

/* Responsive design */
@media (max-width: 768px) {
  #ui {
    font-size: 14px;
    top: 8px;
    left: 8px;
    gap: 6px;
    z-index: 20; /* Ensure UI stays above canvas */
  }

  #ui div {
    padding: 4px 8px;
    font-size: 13px;
    background: rgba(
      0,
      0,
      0,
      0.85
    ); /* Slightly more opaque for better visibility */
  }

  #startScreen h1 {
    font-size: 28px;
  }

  #startScreen,
  #gameOver,
  #pauseMenu {
    padding: 20px;
    width: 90%;
    max-width: 350px;
  }

  #pauseMenu h2 {
    font-size: 24px;
    margin-bottom: 20px;
  }

  #pauseMenu button {
    width: 180px;
    margin: 10px auto;
  }

  button {
    font-size: 14px;
    padding: 10px 20px;
  }
}

@media (max-width: 480px) {
  #ui {
    font-size: 12px;
    top: 5px;
    left: 5px;
    gap: 4px;
    z-index: 20;
  }

  #ui div {
    padding: 2px 4px;
    font-size: 11px;
  }

  #startScreen h1 {
    font-size: 24px;
  }

  #startScreen p,
  #gameOver p {
    font-size: 14px;
  }

  #startScreen,
  #gameOver,
  #pauseMenu {
    padding: 15px;
    width: 95%;
    max-width: 300px;
  }

  #pauseMenu h2 {
    font-size: 20px;
    margin-bottom: 15px;
  }

  #pauseMenu button {
    width: 160px;
    margin: 8px auto;
  }

  button {
    font-size: 12px;
    padding: 8px 16px;
  }
}

@media (max-height: 600px) {
  #ui {
    font-size: 12px;
    top: 3px;
    left: 3px;
    gap: 3px;
  }

  #ui div {
    padding: 2px 4px;
    font-size: 10px;
  }

  #menuBtn {
    font-size: 8px;
    padding: 2px 4px;
    margin-top: 2px;
  }

  #startScreen,
  #gameOver,
  #pauseMenu {
    padding: 15px;
    max-height: 80vh;
    overflow-y: auto;
  }

  #startScreen h1 {
    font-size: 20px;
    margin-bottom: 10px;
  }

  #pauseMenu h2 {
    font-size: 18px;
    margin-bottom: 10px;
  }

  #startScreen p,
  #gameOver p {
    font-size: 12px;
    margin-bottom: 8px;
  }

  button {
    font-size: 11px;
    padding: 6px 12px;
  }

  #pauseMenu button {
    width: 140px;
    margin: 5px auto;
  }

  #developerBtn {
    width: 40px;
    height: 40px;
    top: 8px;
    right: 8px;
    z-index: 20; /* Ensure it stays above canvas */
  }

  #developerLogo {
    width: 36px;
    height: 36px;
  }

  #modalContent {
    padding: 20px;
    max-width: 350px;
  }

  #modalHeader h3 {
    font-size: 20px;
  }

  .follow-us-text p {
    font-size: 16px;
  }

  .social-link {
    padding: 8px;
    gap: 10px;
  }

  .social-icon {
    font-size: 16px;
    width: 20px;
  }
}

/* Developer Button Animations */
@keyframes developerPulse {
  0%,
  100% {
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.5);
  }
  50% {
    box-shadow: 0 0 25px rgba(0, 255, 255, 0.8), 0 0 35px rgba(0, 255, 255, 0.3);
  }
}

@keyframes developerBorderRotate {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

/* Additional floating animation for extra coolness */
@keyframes developerFloat {
  0%,
  100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-3px);
  }
}

/* Apply floating animation on hover */
#developerBtn:hover {
  animation: developerFloat 2s ease-in-out infinite;
}
