* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}
html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #0a0a1a;
  font-family: 'Segoe UI', Arial, sans-serif;
  user-select: none;
  -webkit-user-select: none;
}
#game-container {
  position: relative;
  width: 100%;
  height: 100%;
}
#gameCanvas {
  display: block;
  width: 100%;
  height: 100%;
}
#ui-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none;
}
.screen {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
}
.screen.active {
  display: flex;
}

/* Title Screen */
#title-screen {
  justify-content: flex-start;
  padding-top: 12vh;
  background: radial-gradient(ellipse at center, rgba(0,240,255,0.06) 0%, transparent 70%);
}
#game-title {
  font-size: clamp(2rem, 8vw, 5rem);
  font-weight: 900;
  color: #fff;
  text-shadow: 0 0 10px #00f0ff, 0 0 30px #00f0ff, 0 0 60px #0088ff, 0 0 100px #0088ff;
  letter-spacing: 0.05em;
  margin-bottom: 0.2em;
}
#subtitle {
  font-size: clamp(0.7rem, 2vw, 1rem);
  color: rgba(255,255,255,0.4);
  letter-spacing: 0.15em;
  margin-bottom: 2em;
}
.neon-btn {
  background: transparent;
  border: 2px solid #00f0ff;
  color: #00f0ff;
  padding: 0.8em 2.5em;
  font-size: clamp(1rem, 3vw, 1.4rem);
  font-weight: 700;
  letter-spacing: 0.1em;
  cursor: pointer;
  border-radius: 6px;
  text-shadow: 0 0 8px #00f0ff;
  box-shadow: 0 0 12px rgba(0,240,255,0.3), inset 0 0 12px rgba(0,240,255,0.1);
  transition: all 0.15s ease;
  margin: 0.4em;
}
.neon-btn:hover, .neon-btn:active {
  background: rgba(0,240,255,0.15);
  box-shadow: 0 0 24px rgba(0,240,255,0.5), inset 0 0 20px rgba(0,240,255,0.2);
  transform: scale(1.05);
}
.neon-btn.small {
  padding: 0.5em 1.5em;
  font-size: clamp(0.8rem, 2vw, 1rem);
  border-color: rgba(0,240,255,0.5);
  color: rgba(0,240,255,0.7);
}
.neon-btn.tiny {
  padding: 0.2em 0.6em;
  font-size: 0.8rem;
  min-width: 2em;
}

/* HUD */
#hud {
  flex-direction: row;
  align-items: flex-start;
  justify-content: center;
  padding: 12px 16px;
  pointer-events: auto;
}
#attempt-label {
  position: absolute;
  top: 12px; left: 16px;
  color: rgba(255,255,255,0.6);
  font-size: clamp(0.7rem, 2vw, 0.9rem);
}
#attempt-count {
  color: #ffe600;
  font-weight: 700;
}
#progress-container {
  width: clamp(120px, 40vw, 300px);
  height: 8px;
  background: rgba(255,255,255,0.1);
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.15);
}
#progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #00f0ff, #ff00aa);
  border-radius: 4px;
  transition: width 0.05s linear;
}
#level-name {
  position: absolute;
  top: 28px; left: 16px;
  color: rgba(255,255,255,0.3);
  font-size: clamp(0.6rem, 1.5vw, 0.75rem);
}
#pause-btn {
  position: absolute;
  top: 12px; right: 16px;
}

/* Level Complete */
#complete-screen {
  background: rgba(10,10,26,0.92);
}
#complete-title {
  font-size: clamp(1.5rem, 6vw, 3rem);
  font-weight: 900;
  color: #00ff88;
  text-shadow: 0 0 15px #00ff88, 0 0 40px #00ff88;
  margin-bottom: 0.3em;
}
#complete-attempts {
  color: rgba(255,255,255,0.5);
  margin-bottom: 1.5em;
  font-size: clamp(0.9rem, 2.5vw, 1.1rem);
}
#complete-count {
  color: #ffe600;
  font-weight: 700;
}

/* Level Select */
#level-select-screen {
  background: rgba(10,10,26,0.95);
}
#level-select-screen h2 {
  font-size: clamp(1.2rem, 4vw, 2rem);
  color: #fff;
  margin-bottom: 1.5em;
  text-shadow: 0 0 10px #00f0ff;
}
#level-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.6em;
  margin-bottom: 1.5em;
}
.level-select-btn {
  background: transparent;
  border: 2px solid rgba(0,240,255,0.3);
  color: rgba(255,255,255,0.5);
  padding: 0.7em 2em;
  font-size: clamp(0.9rem, 2.5vw, 1.1rem);
  font-weight: 600;
  cursor: pointer;
  border-radius: 6px;
  min-width: 220px;
  text-align: left;
  transition: all 0.15s ease;
}
.level-select-btn.unlocked {
  border-color: #00f0ff;
  color: #00f0ff;
}
.level-select-btn.unlocked:hover, .level-select-btn.unlocked:active {
  background: rgba(0,240,255,0.1);
  transform: scale(1.03);
}
.level-select-btn.completed {
  border-color: #00ff88;
  color: #00ff88;
}
.level-select-btn.locked {
  opacity: 0.35;
  cursor: default;
}
.level-select-btn .diff {
  float: right;
  font-size: 0.75em;
  opacity: 0.7;
}

/* Pause */
#pause-screen {
  background: rgba(10,10,26,0.92);
}
#pause-screen h2 {
  font-size: clamp(1.5rem, 5vw, 2.5rem);
  color: #fff;
  margin-bottom: 1.5em;
  text-shadow: 0 0 15px #ff00aa;
}
