:root {
  color-scheme: light dark;
  font-family: system-ui, sans-serif;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #1e1e2e;
  color: #eee;
}

#app {
  text-align: center;
  padding: 1.5rem;
  max-width: 100vw;
}

h1 {
  margin: 0 0 0.25rem;
}

.level-label {
  margin: 0 0 0.75rem;
  font-size: 0.9rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  opacity: 0.6;
}

.level-label.modus-hart {
  color: #ff8080;
  opacity: 0.9;
}

.level-label.modus-extrem {
  color: #ff7a3d;
  opacity: 1;
  text-shadow: 0 0 6px rgba(255, 122, 61, 0.6);
}

/* Abfrage für den Schwierigkeitsgrad vor der allerersten Runde */
.modus-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 18, 0.82);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 1rem;
}

.modus-overlay.versteckt {
  display: none;
}

.modus-box {
  background: #2a2a3d;
  border: 2px solid #4a4a6a;
  border-radius: 12px;
  padding: 1.75rem 2rem;
  max-width: 420px;
  text-align: center;
}

.modus-box h2 {
  margin: 0 0 1rem;
}

.modus-box p {
  margin: 0 0 1.25rem;
  font-size: 0.9rem;
  opacity: 0.8;
}

.modus-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}

.modus-btn {
  padding: 0.65rem 1rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  color: #1e1e2e;
  background: #eee;
}

.modus-btn:hover {
  filter: brightness(1.1);
}

.modus-btn-leicht {
  background: #4caf7d;
  color: #fff;
}

.modus-btn-hart {
  background: #7a3535;
  color: #fff;
}

.modus-btn-extrem {
  background: linear-gradient(135deg, #ff8a4d, #d13a1f);
  color: #fff;
  box-shadow: 0 0 10px rgba(255, 110, 40, 0.5);
}

/* Zeigt, welcher Button gerade per Pfeiltasten ausgewählt ist */
.modus-btn.ausgewaehlt {
  outline: 3px solid #ffd166;
  outline-offset: 2px;
}

.modus-box .modus-beschreibung {
  margin: 0.9rem 0 0;
  font-size: 0.85rem;
  opacity: 0.75;
  min-height: 2.6em; /* verhindert Layout-Sprung, wenn sich die Beschreibung ändert */
}

.modus-box .modus-hint {
  margin: 0.6rem 0 0;
  font-size: 0.75rem;
  opacity: 0.55;
}

/* Hilfe-Fenster (Taste H) — listet alle Bedienungshilfen auf, jederzeit
   während des Spiels ein-/ausblendbar. */
.hilfe-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 18, 0.82);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 110;
  padding: 1rem;
}

.hilfe-overlay.versteckt {
  display: none;
}

.hilfe-box {
  background: #2a2a3d;
  border: 2px solid #4a4a6a;
  border-radius: 12px;
  padding: 1.75rem 2rem;
  max-width: 420px;
  text-align: left;
}

.hilfe-box h2 {
  margin: 0 0 1rem;
  text-align: center;
}

.hilfe-liste {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  font-size: 0.95rem;
}

.hilfe-taste {
  display: inline-block;
  padding: 0.1rem 0.45rem;
  border-radius: 5px;
  background: #45455f;
  border: 1px solid #5c5c7d;
  font-family: monospace;
  font-weight: 600;
}

.hilfe-hint {
  margin: 1.25rem 0 0;
  font-size: 0.75rem;
  opacity: 0.55;
  text-align: center;
}

.hilfe-link-btn {
  background: none;
  border: none;
  color: inherit;
  font: inherit;
  opacity: 0.85;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}

.hilfe-link-btn:hover {
  opacity: 1;
}

/* Story-Intro — wird einmal nach der Schwierigkeitsgrad-Wahl eingeblendet,
   bevor das eigentliche Spiel losgeht. */
.story-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 18, 0.86);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 105;
  padding: 1rem;
}

.story-overlay.versteckt {
  display: none;
}

.story-box {
  background: #2a2a3d;
  border: 2px solid #4a4a6a;
  border-radius: 12px;
  padding: 1.75rem 2rem;
  max-width: 460px;
  text-align: center;
}

.story-box h2 {
  margin: 0 0 1rem;
}

.story-text {
  margin: 0 0 1.5rem;
  font-size: 1rem;
  line-height: 1.5;
  font-style: italic;
  opacity: 0.9;
}

.story-weiter-btn {
  padding: 0.7rem 1.4rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  background: #ffd166;
  color: #1e1e2e;
}

.story-weiter-btn:hover {
  filter: brightness(1.08);
}

.story-hint {
  margin: 0.9rem 0 0;
  font-size: 0.75rem;
  opacity: 0.55;
}

/* Shop (Taste L) — Münzen gegen Skins & Sichtweite-Upgrades eintauschen. */
.shop-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 18, 0.84);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 107;
  padding: 1rem;
}

.shop-overlay.versteckt {
  display: none;
}

.shop-box {
  background: #2a2a3d;
  border: 2px solid #4a4a6a;
  border-radius: 12px;
  padding: 1.75rem 2rem;
  max-width: 460px;
  width: 100%;
  text-align: center;
}

.shop-box h2 {
  margin: 0 0 0.5rem;
}

.shop-box h3 {
  margin: 1.25rem 0 0.65rem;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  opacity: 0.7;
}

.shop-muenzen {
  margin: 0;
  font-size: 1rem;
  opacity: 0.85;
}

.shop-skins {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.6rem;
}

.shop-skin-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  padding: 0.75rem 0.5rem;
  border-radius: 10px;
  border: 2px solid #4a4a6a;
  background: #34344a;
  color: #eee;
  cursor: pointer;
  font-size: 0.8rem;
}

.shop-skin-btn:hover {
  filter: brightness(1.1);
}

.shop-skin-btn.aktiv {
  border-color: #ffd166;
  box-shadow: 0 0 0 2px rgba(255, 209, 102, 0.35);
}

.shop-skin-swatch {
  display: block;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 50%;
  background: var(--skin-farbe, #e05555);
  border: 2px solid rgba(255, 255, 255, 0.25);
}

.shop-skin-name {
  font-weight: 600;
}

.shop-skin-preis {
  opacity: 0.75;
}

.shop-upgrade {
  margin-top: 0.5rem;
}

.shop-upgrade-btn {
  width: 100%;
  padding: 0.65rem 1rem;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  background: #ffd166;
  color: #1e1e2e;
}

.shop-upgrade-btn:hover {
  filter: brightness(1.08);
}

.shop-upgrade-btn.gekauft,
.shop-upgrade-btn:disabled {
  background: #45455f;
  color: #aaa;
  cursor: default;
}

.shop-upgrade-beschreibung {
  margin: 0.5rem 0 0;
  font-size: 0.8rem;
  opacity: 0.7;
}

.shop-hint {
  margin: 1.25rem 0 0;
  font-size: 0.75rem;
  opacity: 0.55;
}

/* Credits (Taste C) — listet alle Mitwirkenden auf. */
.credits-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 18, 0.84);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 108;
  padding: 1rem;
}

.credits-overlay.versteckt {
  display: none;
}

.credits-box {
  background: #2a2a3d;
  border: 2px solid #4a4a6a;
  border-radius: 12px;
  padding: 1.75rem 2rem;
  max-width: 420px;
  text-align: left;
}

.credits-box h2 {
  margin: 0 0 1rem;
  text-align: center;
}

.credits-liste {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.credits-rolle {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  opacity: 0.65;
}

.credits-namen {
  display: block;
  font-size: 1rem;
  font-weight: 600;
  margin-top: 0.15rem;
}

.credits-hint {
  margin: 1.25rem 0 0;
  font-size: 0.75rem;
  opacity: 0.55;
  text-align: center;
}

#hud {
  margin-bottom: 0.75rem;
  font-size: 1.2rem;
  display: flex;
  gap: 1.25rem;
  justify-content: center;
}

.meldung {
  min-height: 1.4em;
  margin: 0.5rem 0 0;
  font-size: 0.95rem;
  color: #ffd166;
}

/* Der Canvas ist immer genau so breit wie der aktuell sichtbare Bereich
   (bei Level 3/6 nur ein Kamera-Drittel der Karte, siehe main.js) — daher
   normalerweise kein Scrollen nötig. overflow-x bleibt als Sicherheitsnetz
   für sehr schmale Bildschirme (z.B. Handy quer). */
#spielfeld-rahmen {
  max-width: 100%;
  overflow-x: auto;
  display: flex;
  justify-content: center;
}

canvas {
  background: #2a2a3d;
  border: 4px solid #4a4a6a;
  border-radius: 8px;
  image-rendering: pixelated;
  flex-shrink: 0;
}

.hint {
  margin-top: 0.75rem;
  opacity: 0.7;
  font-size: 0.9rem;
}
