.game-page {
  padding-top: 4rem;
  padding-bottom: 4rem;
  min-height: 80vh;
  background-color: #0a1a2a; /* Deep ocean dark */
  color: white;
}

.game-header {
  margin-bottom: 2rem;
  text-align: center;
}

.back-link {
  display: inline-block;
  margin-top: 1rem;
  color: var(--color-accent);
  text-decoration: none;
  font-weight: bold;
}

.game-container {
  position: relative;
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  aspect-ratio: 4/3;
  background: #000;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 0 30px rgba(30, 155, 215, 0.2);
  border: 2px solid #1e3a5a;
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
}

#ui-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

#start-screen, #game-over-screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  transition: opacity 0.3s ease;
}

.hidden {
  opacity: 0;
  pointer-events: none !important;
  z-index: -1;
}

.active {
  opacity: 1;
  pointer-events: auto;
  z-index: 10;
}

.sonar-button {
  position: absolute;
  bottom: 20px;
  right: 20px;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(30, 155, 215, 0.3);
  border: 2px solid var(--color-primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  cursor: pointer;
  transition: transform 0.1s;
  touch-action: manipulation;
  z-index: 6;
}

.sonar-button:active {
  transform: scale(0.95);
  background: rgba(30, 155, 215, 0.6);
}

/* Mobile-specific button sizing */
@media (max-width: 768px) {
  .sonar-button {
    width: 72px;
    height: 72px;
    bottom: 15px;
    right: 15px;
  }
}

/* Hide sonar button on desktop if desired, but good for accessibility/clicking */
@media (min-width: 768px) {
  /* .sonar-button { display: none; } */
}

/* Joystick overlay */
#joystick-overlay {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 4;
}

/* Settings Button */
.settings-button {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(30, 155, 215, 0.3);
  border: 2px solid var(--color-primary);
  color: white;
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  cursor: pointer;
  transition: transform 0.1s, background 0.2s;
  touch-action: manipulation;
  z-index: 5;
}

.settings-button:hover {
  background: rgba(30, 155, 215, 0.5);
  transform: scale(1.1);
}

.settings-button:active {
  transform: scale(0.95);
}

/* Settings Panel */
.settings-panel {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  transition: opacity 0.3s ease;
  z-index: 20;
}

.settings-content {
  background: #1e3a5a;
  border: 2px solid var(--color-primary);
  border-radius: var(--radius-lg);
  padding: 2rem;
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  position: relative;
}

.settings-content h2 {
  margin-top: 0;
  margin-bottom: 1.5rem;
  color: var(--color-primary);
}

.settings-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  color: white;
  font-size: 2rem;
  cursor: pointer;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.2s;
}

.settings-close:hover {
  background: rgba(255, 255, 255, 0.1);
}

.settings-section {
  margin-bottom: 1.5rem;
}

.settings-section label {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.settings-section label span:first-child {
  min-width: 120px;
  font-weight: bold;
}

.settings-section input[type="range"] {
  flex: 1;
  height: 6px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
  outline: none;
  -webkit-appearance: none;
}

.settings-section input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  background: var(--color-primary);
  border-radius: 50%;
  cursor: pointer;
}

.settings-section input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  background: var(--color-primary);
  border-radius: 50%;
  cursor: pointer;
  border: none;
  appearance: none;
  -moz-appearance: none;
}

.volume-value {
  min-width: 50px;
  text-align: right;
  color: var(--color-primary);
}

.settings-section select {
  flex: 1;
  padding: 0.5rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--color-primary);
  border-radius: var(--radius);
  color: white;
  font-size: 1rem;
  cursor: pointer;
}

.settings-section select option {
  background: #1e3a5a;
  color: white;
}

.settings-section h3 {
  margin-top: 0;
  margin-bottom: 0.5rem;
  color: var(--color-primary);
}

.settings-section p {
  margin: 0.5rem 0;
  line-height: 1.6;
}

/* Tutorial Overlay */
.tutorial-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  transition: opacity 0.3s ease;
  z-index: 30;
}

.tutorial-content {
  background: #1e3a5a;
  border: 2px solid var(--color-primary);
  border-radius: var(--radius-lg);
  padding: 2rem;
  max-width: 600px;
  width: 90%;
  text-align: center;
}

.tutorial-content h2 {
  margin-top: 0;
  margin-bottom: 1rem;
  color: var(--color-primary);
}

.tutorial-content p {
  margin-bottom: 2rem;
  line-height: 1.6;
  font-size: 1.1rem;
}

.tutorial-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.tutorial-highlight {
  animation: pulse-glow 1.5s ease-in-out infinite;
  box-shadow: 0 0 20px rgba(30, 155, 215, 0.8) !important;
}

@keyframes pulse-glow {
  0%, 100% {
    box-shadow: 0 0 20px rgba(30, 155, 215, 0.8);
  }
  50% {
    box-shadow: 0 0 30px rgba(30, 155, 215, 1);
  }
}

/* Achievement Notification */
.achievement-notification {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: linear-gradient(135deg, #1e3a5a, #0a1a2a);
  border: 3px solid #ffd700;
  border-radius: var(--radius-lg);
  padding: 2rem;
  max-width: 400px;
  width: 90%;
  text-align: center;
  pointer-events: auto;
  z-index: 40;
  opacity: 0;
  transition: opacity 0.3s ease;
  box-shadow: 0 0 30px rgba(255, 215, 0, 0.5);
}

.achievement-notification.show {
  opacity: 1;
}

.achievement-notification h3 {
  margin-top: 0;
  color: #ffd700;
  font-size: 1.5rem;
}

.achievement-notification p {
  margin: 0.5rem 0;
  line-height: 1.4;
}

