/* =====================================================================
   Style – Layout, HUD, Overlay, Hinweise
   Farben und zentrale Werte stehen als CSS-Variablen in :root.
   ===================================================================== */

:root {
  /* Farben */
  --bg: #0a0a0f;
  --canvas-bg: #1a1a20;
  --text: #e0e0e0;
  --text-muted: #aaaaaa;
  --text-dim: #666666;
  --border: #333333;
  --border-light: #444444;
  --border-hover: #555555;
  --accent: #ff4d8d;
  --accent-hover: #ff6da3;
  --accent-glow: rgba(255, 77, 141, 0.5);
  --gold: #ffd24d;
  --blue: #44aaff;
  --white: #ffffff;
  --panel: rgba(0, 0, 0, 0.7);
  --hint-bg: rgba(0, 0, 0, 0.85);
  --overlay-bg: rgba(5, 5, 12, 0.92);

  /* Maße */
  --game-width: 960px;
  --game-height: 640px;
  --radius: 4px;
}

/* ---------- Grundgerüst ---------- */

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Courier New', monospace;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  overflow: hidden;
}

#gameContainer {
  position: relative;
  width: var(--game-width);
  height: var(--game-height);
}

canvas {
  display: block;
  background: var(--canvas-bg);
  border: 2px solid var(--border);
  border-radius: var(--radius);
}

/* ---------- HUD (oben, nicht klickbar) ---------- */

#hud {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  pointer-events: none;
  font-size: 13px;
}

.hud-item {
  background: var(--panel);
  padding: 6px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border-light);
}

#stamina-bar {
  width: 120px;
  height: 8px;
  background: var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-top: 4px;
}

#stamina-fill {
  height: 100%;
  width: 100%;
  background: var(--blue);
  transition: width 0.1s, background 0.2s;
}

/* ---------- Overlay (Menü, Pause, Sieg, Niederlage) ---------- */

#overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--overlay-bg);
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 40px;
  z-index: 10;
}

#overlay.active {
  display: flex;
}

#overlay h1 {
  font-size: 48px;
  margin-bottom: 8px;
  color: var(--accent);
  letter-spacing: 4px;
  text-shadow: 0 0 20px var(--accent-glow);
}

#overlay h2 {
  font-size: 20px;
  margin-bottom: 8px;
  color: var(--gold);
}

#overlay p {
  margin-bottom: 6px;
  color: var(--text-muted);
  font-size: 14px;
}

#overlay .score {
  font-size: 22px;
  color: var(--blue);
  margin: 16px 0;
  font-weight: bold;
}

#overlay button {
  background: var(--accent);
  color: var(--white);
  border: none;
  padding: 12px 28px;
  font-size: 15px;
  font-family: inherit;
  font-weight: bold;
  border-radius: var(--radius);
  cursor: pointer;
  margin: 6px;
  transition: background 0.2s, transform 0.1s;
}

#overlay button:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

#overlay button.secondary {
  background: transparent;
  border: 1px solid var(--border-hover);
  color: var(--text-muted);
}

#overlay button.secondary:hover {
  border-color: var(--accent);
  color: var(--white);
}

/* ---------- Hinweiszeile (unten) ---------- */

#hint {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--hint-bg);
  padding: 8px 18px;
  border-radius: var(--radius);
  border: 1px solid var(--gold);
  color: var(--gold);
  font-size: 14px;
  display: none;
}

#hint.active {
  display: block;
}