:root {
  --neon-blue: #00f3ff;
  --neon-pink: #ff00ff;
  --neon-purple: #bc13fe;
  --dark-bg: #0a0a12;
  --overlay-bg: rgba(10, 10, 18, 0.85);
  --font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
}

body {
  background-color: var(--dark-bg);
  color: white;
  font-family: var(--font-family);
  overflow: hidden;
  height: 100vh;
  width: 100vw;
  display: flex;
  justify-content: center;
  align-items: center;
}

#game-container {
  position: relative;
  width: 100%;
  height: 100%;
  max-width: 800px; /* Optional cap for desktop */
  max-height: 600px;
  background: linear-gradient(to bottom, #1a1a2e, #16213e);
  box-shadow: 0 0 20px rgba(0, 243, 255, 0.2);
  border-radius: 8px;
  overflow: hidden;
}

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

#ui-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none; /* Let clicks pass to canvas when needed */
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--overlay-bg);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  pointer-events: auto;
  backdrop-filter: blur(5px);
  z-index: 10;
  transition: opacity 0.3s ease;
}

.hidden {
  opacity: 0;
  pointer-events: none;
}

.title {
  font-size: 3rem;
  margin-bottom: 1rem;
  color: var(--neon-blue);
  text-shadow: 0 0 10px var(--neon-blue);
  text-transform: uppercase;
  letter-spacing: 2px;
}

.subtitle {
  font-size: 1.2rem;
  margin-bottom: 2rem;
  color: #ccc;
}

.btn {
  background: transparent;
  color: var(--neon-pink);
  border: 2px solid var(--neon-pink);
  padding: 1rem 2rem;
  font-size: 1.5rem;
  cursor: pointer;
  text-transform: uppercase;
  font-weight: bold;
  border-radius: 4px;
  transition: all 0.2s;
  box-shadow: 0 0 10px rgba(255, 0, 255, 0.2);
}

.btn:hover {
  background: var(--neon-pink);
  color: white;
  box-shadow: 0 0 20px var(--neon-pink);
}

.btn:active {
  transform: scale(0.95);
}

#hud {
  position: absolute;
  top: 20px;
  left: 20px;
  right: 20px;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
}

.score-container {
  font-size: 2rem;
  font-weight: bold;
  text-shadow: 0 0 5px black;
  pointer-events: auto;
}

.icon-btn {
  background: none;
  border: none;
  font-size: 2rem;
  cursor: pointer;
  color: white;
  text-shadow: 0 0 5px black;
  pointer-events: auto;
}

#leaderboard {
  margin-top: 2rem;
  width: 80%;
  max-width: 400px;
  background: rgba(0, 0, 0, 0.5);
  padding: 1rem;
  border-radius: 8px;
  border: 1px solid var(--neon-purple);
}

#leaderboard h3 {
  text-align: center;
  color: var(--neon-purple);
  margin-bottom: 0.5rem;
}

#high-scores-list {
  list-style: none;
  padding: 0;
  max-height: 150px;
  overflow-y: auto;
}

#high-scores-list li {
  display: flex;
  justify-content: space-between;
  padding: 0.25rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.controls-hint {
    margin-bottom: 2rem;
    font-size: 0.9rem;
    opacity: 0.7;
}

/* Mobile adjustments */
@media (max-width: 600px) {
  .title {
    font-size: 2rem;
  }
  .btn {
    padding: 0.8rem 1.5rem;
    font-size: 1.2rem;
  }
  #game-container {
    border-radius: 0;
    max-width: 100%;
    max-height: 100%;
  }
}
