:root {
  --bg: #0a0d12;
  --bg-panel: #12171f;
  --bg-panel-2: #1a212b;
  --line: #263041;
  --text: #e8edf3;
  --text-dim: #93a1b0;
  --text-faint: #5b6b7d;
  --amber: #ffb84d;
  --amber-dim: #a67432;
  --teal: #5fe0c9;
  --red: #ff6b6b;
  --font-display: "Space Grotesk", "Segoe UI", sans-serif;
  --font-body: "Inter", "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", "Consolas", monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  overflow: hidden;
}

#app {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

#game-frame {
  position: relative;
  width: 1024px;
  height: 576px;
  max-width: 100vw;
  max-height: 100vh;
  aspect-ratio: 1024 / 576;
  background: #05070a;
  box-shadow: 0 0 60px rgba(0,0,0,0.6);
  overflow: hidden;
}

canvas#stage {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  background: #0b1a24;
}

.screen {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, rgba(5,7,10,0.72), rgba(5,7,10,0.9));
  text-align: center;
  padding: 20px;
  z-index: 10;
}
.screen.active { display: flex; }
.screen.with-bg { background-image: linear-gradient(180deg, rgba(5,7,10,0.55), rgba(5,7,10,0.85)), url("../img/background.png"); }
/* #screen-game liegt während des Spiels über dem Canvas — darf das
   Spielfeld NICHT abdunkeln. ID-Selektor gewinnt hier bewusst gegen
   .screen/.with-bg, egal welche Klassen zusätzlich gesetzt sind
   (siehe README, Bugfix-Notiz zum "Overlay, das das Spiel abdunkelt"). */
#screen-game { background: none; }

.game-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 2.6rem;
  letter-spacing: 0.02em;
  color: var(--amber);
  margin: 0 0 6px;
  text-shadow: 0 2px 20px rgba(0,0,0,0.6);
}
.screen-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.4rem;
  color: var(--text);
  margin: 0 0 22px;
}

.menu-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 260px;
}

.btn {
  font-family: var(--font-mono);
  font-size: 0.92rem;
  background: var(--amber);
  color: #14100a;
  padding: 11px 20px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.15s ease, transform 0.1s ease;
}
.btn:hover { background: #ffc770; }
.btn:active { transform: scale(0.98); }
.btn.ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text-dim);
}
.btn.ghost:hover { border-color: var(--amber-dim); color: var(--amber); }
.btn:disabled { opacity: 0.5; cursor: default; }

.panel-box {
  background: rgba(18,23,31,0.92);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 28px 34px;
  max-width: 620px;
  width: 90%;
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--text-dim);
}
.setting-row select, .setting-row input[type="range"] {
  background: #05070a;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  padding: 6px 10px;
  font-family: var(--font-mono);
}
.setting-row input[type="range"] { width: 160px; padding: 0; }

.howto-text {
  color: var(--text-dim);
  font-size: 0.92rem;
  line-height: 1.7;
  text-align: left;
  white-space: pre-line;
  margin-bottom: 18px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
}
.howto-desc {
  color: var(--text-dim);
  font-size: 0.92rem;
  margin-bottom: 16px;
}

.credits-text {
  color: var(--text-dim);
  font-size: 0.92rem;
  line-height: 1.8;
  margin-bottom: 18px;
}
.credits-text b { color: var(--text); }

#highscore-list {
  background: #05070a;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 16px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--teal);
  white-space: pre-wrap;
  max-height: 240px;
  overflow-y: auto;
  text-align: left;
  margin-bottom: 18px;
  min-width: 320px;
}

.gameover-stats {
  display: flex;
  gap: 24px;
  justify-content: center;
  margin-bottom: 18px;
  font-family: var(--font-mono);
}
.gameover-stats div { text-align: center; }
.gameover-stats .value { font-size: 1.6rem; color: var(--amber); font-weight: 700; }
.gameover-stats .label { font-size: 0.7rem; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.06em; }

.gameover-form {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 18px;
}
.gameover-form input {
  background: #05070a;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  padding: 9px 12px;
  font-family: var(--font-mono);
  width: 180px;
}

/* --------- HUD (während des Spiels) --------- */
#hud {
  position: absolute;
  top: 0; left: 0; right: 0;
  display: flex;
  justify-content: space-between;
  padding: 10px 16px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--amber);
  background: linear-gradient(180deg, rgba(5,7,10,0.75), transparent);
  z-index: 5;
  pointer-events: none;
}
#hud span { margin-right: 16px; }
#hud .hearts { color: var(--red); }

.controls-hint {
  position: absolute;
  bottom: 0;
  left: 0; right: 0;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: rgba(255,255,255,0.85);
  z-index: 5;
  pointer-events: none;
  padding: 8px 0;
  background: linear-gradient(0deg, rgba(5,7,10,0.6), transparent);
}

.status-msg {
  position: absolute;
  top: 44%;
  left: 0; right: 0;
  text-align: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.6rem;
  color: var(--amber);
  z-index: 6;
  pointer-events: none;
  text-shadow: 0 2px 12px rgba(0,0,0,0.7);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.status-msg.show { opacity: 1; }

footer.site-footer {
  position: fixed;
  bottom: 6px;
  left: 0; right: 0;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-faint);
  z-index: 1;
}
footer.site-footer a { color: var(--text-faint); }
