* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; user-select: none; touch-action: none; }
html, body {
  margin: 0; padding: 0; width: 100%; height: 100%; overflow: hidden;
  background: #10141c; color: #eef1f7;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  touch-action: none;
}
.screen { width: 100%; height: 100%; position: relative; }
.hidden { display: none !important; }

/* Menu */
#menu-screen {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; padding: 24px; text-align: center;
}
#menu-screen h1 { font-size: 2.2em; margin: 0; letter-spacing: 2px; color: #ffd23f; text-shadow: 0 2px 0 #7a5200; }
#menu-screen .sub { margin: 0; color: #a9b2c3; }
#char-grid { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; max-width: 640px; }
.char-card {
  width: 130px; padding: 12px; border-radius: 12px; border: 2px solid #2c3546;
  background: #1a2130; cursor: pointer; transition: transform .1s, border-color .1s;
}
.char-card:hover { transform: translateY(-3px); }
.char-card.selected { border-color: #ffd23f; box-shadow: 0 0 12px rgba(255,210,63,.5); }
.char-icon { width: 64px; height: 64px; border-radius: 50%; margin: 0 auto 8px; }
.char-card h3 { margin: 4px 0; font-size: 1em; }
.char-card p { margin: 2px 0; font-size: .72em; color: #9aa4b8; }
#start-btn {
  padding: 14px 36px; font-size: 1.1em; font-weight: bold; border-radius: 30px; border: none;
  background: #ffd23f; color: #2a2000; cursor: pointer; letter-spacing: 1px;
}
#start-btn:disabled { background: #3a4152; color: #6b7387; cursor: not-allowed; }
.hint { font-size: .78em; color: #6b7387; max-width: 460px; }

/* Game */
#game-screen { background: #1c2333; }
canvas { display: block; width: 100%; height: 100%; touch-action: none; }

#hud { position: absolute; top: 10px; left: 10px; right: 10px; pointer-events: none; }
#kill-counter { font-weight: bold; font-size: 1.1em; text-shadow: 0 1px 3px #000; margin-bottom: 6px; }
#player-health-wrap {
  width: 220px; height: 16px; background: #000a; border-radius: 8px; overflow: hidden;
  border: 1px solid #000;
}
#player-health-bar { height: 100%; width: 100%; background: linear-gradient(#4ade80,#22c55e); transition: width .15s; }
#special-wrap {
  width: 220px; height: 12px; background: #000a; border-radius: 6px; overflow: hidden;
  border: 1px solid #000; margin-top: 6px; position: relative;
}
#special-bar { height: 100%; width: 0%; background: linear-gradient(#60a5fa,#3b82f6); transition: width .1s; }
#special-label {
  position: absolute; top: -1px; left: 6px; font-size: .65em; font-weight: bold; text-shadow: 0 1px 2px #000;
}

/* Touch controls */
#touch-controls { position: absolute; inset: 0; pointer-events: none; }
.stick {
  position: absolute; bottom: 30px; width: 110px; height: 110px; border-radius: 50%;
  background: rgba(255,255,255,.08); border: 2px solid rgba(255,255,255,.25);
  pointer-events: auto; touch-action: none;
}
#stick-left { left: 30px; }
#stick-right { right: 30px; }
.stick-knob {
  position: absolute; top: 50%; left: 50%; width: 46px; height: 46px; border-radius: 50%;
  background: rgba(255,255,255,.5); transform: translate(-50%,-50%);
}
#special-btn {
  position: absolute; right: 40px; bottom: 160px; width: 90px; height: 90px; border-radius: 50%;
  background: rgba(96,165,250,.35); border: 2px solid #60a5fa; color: #fff; font-weight: bold;
  font-size: .8em; pointer-events: auto;
}
#special-btn.ready { background: rgba(96,165,250,.85); box-shadow: 0 0 16px #60a5fa; }

@media (hover: hover) and (pointer: fine) {
  #touch-controls { display: none; }
}

/* End screen */
#end-screen {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px;
}
#end-screen h1 { font-size: 2.4em; margin: 0; letter-spacing: 2px; }
#restart-btn {
  padding: 14px 36px; font-size: 1.1em; font-weight: bold; border-radius: 30px; border: none;
  background: #ffd23f; color: #2a2000; cursor: pointer;
}
