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

body {
  background-color: #222;
  font-family: "Courier New", monospace;
  color: #ccc;
}

h1 {
  font-size: 15px;
  text-align: center;
}

h2 {
  font-size: 20px;
  color: #aaa;
  margin-top: 30px;
  margin-bottom: 15px;
  border-bottom: 1px solid #444;
  padding-bottom: 10px;
}

p {
  margin-bottom: 15px;
  font-size: 14px;
}

a {
  color: #4da6ff;
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: #66b3ff;
}

#game-container {
  max-width: 768px;
  margin: auto;
  display: flex;
  flex-direction: column;
}

#game {
  display: block;
  line-height: 0;
  width: 100%;
  max-width: 800px;
  aspect-ratio: 4 / 3;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

#mobile-controls {
  display: none;
  width: 100%;
  flex-direction: row;
  justify-content: space-evenly;
  align-items: flex-start;
  gap: 5vw;
  flex-shrink: 0;
  height: 66vw;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  position: relative;
}

#grid-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10;
}

#buttons-container {
  width: 40vw;
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4.4vw;
}

#joystick-container {
  margin-top: 17.7vw;
  flex: 1;
  max-width: 40vw;
  aspect-ratio: 1;
  position: relative;
  display: flex;
  justify-content: center;
}

/* Loading spinner styles */
#loading-overlay {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 768px;
  aspect-ratio: 4 / 3;
  background-position: center;
  background-repeat: no-repeat;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  margin-top: 17px;
}

#loading-spinner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.spinner {
  width: 60px;
  height: 60px;
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top: 4px solid white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

#loading-text {
  color: white;
  font-family: "Courier New", monospace;
  font-size: 18px;
  font-weight: bold;
}

.sticky-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: rgba(34, 34, 34, 0.95);
  border-top: 1px solid #444;
  padding: 12px 20px;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 100;
}

.sticky-footer a {
  color: #aaa;
  text-decoration: none;
  font-size: 13px;
  font-family: "Courier New", monospace;
  transition: color 0.2s ease;
  margin: 0 15px;
}

.sticky-footer a:hover {
  color: #fff;
}

.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 40px 20px 100px 20px;
}

/* Mobile breakpoint */
@media (max-width: 768px) {
  #mobile-controls {
    display: flex;
  }
}
