* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
}

body {
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  background: linear-gradient(160deg, #1a1a2e, #16213e);
  color: #eaeaea;
  display: flex;
  justify-content: center;
  align-items: center;
}

.game {
  text-align: center;
  padding: 1rem;
}

.game__title {
  font-size: 2rem;
  margin: 0 0 0.75rem;
  letter-spacing: 0.04em;
}

.arena {
  position: relative;
  display: inline-block;
}

canvas {
  display: block;
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  max-width: 100%;
  cursor: crosshair;
}

#hud {
  position: absolute;
  top: 12px;
  left: 14px;
  right: 14px;
  pointer-events: none;
}

.bar {
  width: 300px;
  max-width: 45%;
}

.bar.right {
  margin-left: auto;
  text-align: right;
}

.name {
  font-weight: 700;
  font-size: 16px;
  margin-bottom: 4px;
}

.hp {
  height: 18px;
  background: rgba(0, 0, 0, 0.55);
  border-radius: 6px;
  overflow: hidden;
}

.hp-fill {
  height: 100%;
  width: 100%;
  background: #2ecc71;
  transition: width 0.1s linear;
}

.hud-info {
  font-size: 13px;
  color: #b0b0c0;
  margin-top: 4px;
}

.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
  border-radius: 12px;
  pointer-events: none;
}

.overlay.hidden {
  display: none;
}

.overlay-title {
  font-size: 40px;
  font-weight: 800;
}

.overlay-sub {
  font-size: 20px;
  color: #eaeaea;
  margin-top: 8px;
}

.game__controls {
  color: #b0b0c0;
  margin: 0.75rem 0 0;
  font-size: 0.95rem;
}

.game__controls b {
  color: #ffd60a;
}

.link {
  color: #7fd4ff;
  text-decoration: none;
}

.link:hover {
  text-decoration: underline;
}

/* Touch-Steuerung (nur auf Touch-Geräten sichtbar) */
#touch-ui {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: none;
}

@media (pointer: coarse) {
  #touch-ui {
    display: block;
  }
}

#joystick {
  position: absolute;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  border: 2px solid rgba(255, 255, 255, 0.45);
  display: none;
}

#joystick-thumb {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 52px;
  height: 52px;
  margin: -26px 0 0 -26px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.65);
}

#jump-btn {
  position: absolute;
  right: 24px;
  bottom: 24px;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 28px;
  pointer-events: auto;
  display: none;
}

@media (pointer: coarse) {
  #jump-btn {
    display: block;
  }
}
