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

body {
  background: #050510;
  color: #e0e0ff;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  overflow: hidden;
  width: 100vw;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

#game-container {
  position: relative;
  width: 100%;
  height: 100%;
  max-width: 1200px;
  max-height: 900px;
}

#gameCanvas {
  display: block;
  width: 100%;
  height: 100%;
  background: radial-gradient(ellipse at center, #0a0a20 0%, #000000 100%);
}

#ui-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 16px 24px;
  z-index: 10;
}

#top-bar, #bottom-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  text-shadow: 0 0 8px rgba(100, 180, 255, 0.6);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 1px;
}

#bottom-bar {
  gap: 12px;
}

#health-bar {
  width: 200px;
  height: 12px;
  background: rgba(255, 50, 50, 0.2);
  border: 1px solid rgba(255, 80, 80, 0.5);
  border-radius: 6px;
  overflow: hidden;
}

#health-fill {
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, #ff4444, #ff8866);
  transition: width 0.2s ease;
}

#combo {
  color: #ffcc44;
  text-shadow: 0 0 10px rgba(255, 200, 60, 0.8);
}

.screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: rgba(5, 5, 16, 0.88);
  backdrop-filter: blur(4px);
  z-index: 20;
  gap: 16px;
}

.screen.active {
  display: flex;
}

.screen h1 {
  font-size: 56px;
  letter-spacing: 6px;
  background: linear-gradient(180deg, #ffffff 0%, #88bbff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: none;
  filter: drop-shadow(0 0 20px rgba(100, 160, 255, 0.5));
}

.screen h2 {
  font-size: 40px;
  letter-spacing: 4px;
  color: #ff5555;
  text-shadow: 0 0 20px rgba(255, 80, 80, 0.6);
}

.subtitle {
  font-size: 18px;
  color: #88aaff;
  margin-top: -8px;
  letter-spacing: 2px;
}

.controls-info {
  margin: 20px 0;
  text-align: center;
  line-height: 2;
  color: #aabbdd;
}

.controls-info kbd {
  background: rgba(80, 120, 200, 0.2);
  border: 1px solid rgba(100, 150, 255, 0.3);
  border-radius: 4px;
  padding: 2px 8px;
  font-family: monospace;
  font-size: 13px;
  color: #ccddff;
}

button {
  pointer-events: auto;
  padding: 14px 48px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 2px;
  color: #ffffff;
  background: linear-gradient(180deg, #4488ff 0%, #2244aa 100%);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(50, 100, 255, 0.4);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 28px rgba(60, 130, 255, 0.6);
}

button:active {
  transform: translateY(0);
}

.diff-btn {
  padding: 8px 20px;
  font-size: 13px;
  margin: 0 4px;
  background: rgba(60, 100, 200, 0.25);
  border: 1px solid rgba(100, 150, 255, 0.3);
  box-shadow: none;
}

.diff-btn:hover {
  transform: none;
  box-shadow: 0 0 12px rgba(80, 140, 255, 0.3);
}

.diff-btn.active {
  background: linear-gradient(180deg, #4488ff 0%, #2244aa 100%);
  box-shadow: 0 0 16px rgba(60, 130, 255, 0.5);
}

.weapon-btn {
  padding: 6px 14px;
  font-size: 11px;
  margin: 0 3px;
  background: rgba(60, 100, 200, 0.2);
  border: 1px solid rgba(100, 150, 255, 0.25);
  color: #aabbdd;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.2s;
}

.weapon-btn:hover {
  box-shadow: 0 0 10px rgba(80, 140, 255, 0.25);
}

.weapon-btn.active {
  background: linear-gradient(180deg, #44aa88 0%, #226644 100%);
  border-color: rgba(80, 200, 150, 0.5);
  box-shadow: 0 0 12px rgba(60, 180, 120, 0.4);
  color: #ffffff;
}

#final-score, #final-wave {
  font-size: 20px;
  color: #ccddee;
}

/* Menu entrance animations */
@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

#menu-screen h1 {
  animation: fadeInDown 0.6s ease both;
}
#menu-screen .subtitle {
  animation: fadeInDown 0.6s ease 0.15s both;
}
#menu-screen #menu-highscore {
  animation: fadeInDown 0.5s ease 0.25s both;
}
#menu-screen #difficulty-select {
  animation: fadeInUp 0.5s ease 0.35s both;
}
#menu-screen .controls-info {
  animation: fadeInUp 0.5s ease 0.45s both;
}
#menu-screen #start-btn {
  animation: fadeInUp 0.5s ease 0.55s both;
}
#menu-screen #achievement-section {
  animation: fadeInUp 0.5s ease 0.65s both;
}

#achievement-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
}

.achievement {
  background: rgba(60, 100, 180, 0.2);
  border: 1px solid rgba(100, 150, 255, 0.2);
  border-radius: 4px;
  padding: 4px 10px;
  font-size: 11px;
  color: #8899bb;
  letter-spacing: 0.5px;
}

.achievement.unlocked {
  background: rgba(80, 160, 80, 0.25);
  border-color: rgba(100, 220, 100, 0.4);
  color: #88ffaa;
}

@media (max-width: 600px) {
  .screen h1 { font-size: 36px; }
  .screen h2 { font-size: 28px; }
  #top-bar { font-size: 11px; gap: 8px; flex-wrap: wrap; }
}
