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

body {
  background: linear-gradient(145deg, #0a0f1e 0%, #03060c 100%);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  font-family: 'Segoe UI', 'Courier New', monospace;
}

.game-wrapper {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

canvas {
  display: block;
  margin: 0 auto;
  box-shadow: 0 0 0 2px #00ffcc33, 0 0 0 5px #0a0f1e, 0 10px 25px rgba(0,0,0,0.5);
  border-radius: 16px;
  cursor: none;
  background: #11161f;
  width: 100%;
  height: auto;
  max-width: 1000px;
  aspect-ratio: 1000 / 600;
}

.menu-overlay, .game-ui {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(8px);
  z-index: 10;
  transition: 0.2s;
}

.game-ui {
  position: absolute;
  background: transparent;
  backdrop-filter: none;
  pointer-events: none;
  justify-content: space-between;
  align-items: flex-start;
  padding: 20px;
}

.game-ui.hidden, .menu-overlay.hidden {
  display: none;
}

.menu-card {
  background: #0e1622dd;
  border: 2px solid #00ffcc;
  border-radius: 48px;
  padding: 2rem 2rem 2rem 2rem;
  text-align: center;
  color: #ccf4ff;
  box-shadow: 0 0 20px #00ffcc55;
  width: 320px;
}

.menu-card h1 {
  font-size: 1.7rem;
  margin-bottom: 1.5rem;
  text-shadow: 0 0 5px cyan;
}

.menu-card input, .menu-card button {
  width: 100%;
  margin: 8px 0;
  padding: 10px;
  background: #1e2a3a;
  border: 1px solid #00ffcc;
  color: white;
  border-radius: 60px;
  font-weight: bold;
  font-size: 1rem;
}

.menu-card button {
  background: #00aa99;
  color: #000;
  cursor: pointer;
  transition: 0.1s linear;
}

.menu-card button:active { transform: scale(0.97); }

.stats, .enemy-stats {
  background: #000000aa;
  border-radius: 60px;
  padding: 5px 12px;
  backdrop-filter: blur(4px);
  font-weight: bold;
  font-size: 1rem;
  pointer-events: none;
}

.score {
  background: #000000aa;
  border-radius: 60px;
  padding: 5px 12px;
  font-weight: bold;
}

.mobile-controls {
  position: fixed;
  bottom: 20px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  padding: 0 20px;
  pointer-events: none;
  z-index: 20;
}

.mobile-controls.hidden {
  display: none;
}

.mobile-controls .dpad, .mobile-controls .attack-buttons {
  display: flex;
  gap: 12px;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(12px);
  padding: 12px 16px;
  border-radius: 80px;
  pointer-events: auto;
}

.mobile-controls button {
  background: #1f2a36;
  border: none;
  color: cyan;
  font-size: 2rem;
  width: 65px;
  height: 65px;
  border-radius: 65px;
  font-weight: bold;
  box-shadow: 0 0 5px cyan;
  touch-action: manipulation;
  cursor: pointer;
}

.attack-buttons button {
  background: #9e3c3c;
  color: white;
  font-size: 1.2rem;
}

@media (max-width: 760px) {
  .mobile-controls button { width: 55px; height: 55px; font-size: 1.5rem; }
}