/* --- Grundlegendes Layout --- */
body {
  margin: 0;
  background: black;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  overflow: hidden;
  font-family: sans-serif;
}

/* --- Container für Szenen und Overlays --- */
#container {
  position: relative;
  width: 100%;
  max-width: 960px;
  aspect-ratio: 16 / 9;
  background: black;
  overflow: hidden;
}

/* --- Szenenbilder --- */
.scene {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 2s ease;
  opacity: 1;
  z-index: 1;
}

.scene.hidden {
  opacity: 0;
  pointer-events: none;
}

/* --- Overlay-Elemente (z. B. Gegenstände, Funk, Wasser) --- */
.overlay-choice {
  position: absolute;
  bottom: 10%;
  width: 20%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 3s ease, transform 0.3s ease;
  z-index: 10;
  border: clamp(4px, 0.8vw, 8px) solid black;
  outline: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 0 40px rgba(0,0,0,0.9);
}

/* Overlay Hover Effekt */
.overlay-choice:hover {
  transform: scale(1.05);
  box-shadow: 0 0 60px rgba(255,255,255,0.4);
}

/* --- Vignette für Stimmung / Isolation --- */
#vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle, rgba(0,0,0,0) 60%, rgba(0,0,0,0.6) 100%);
  transition: opacity 2s ease;
  z-index: 50;
  opacity: 0.5; /* Dynamisch per JS anpassbar */
}

/* --- UI Layer --- */
#ui {
  position: absolute;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  pointer-events: none;
}

/* Start Message */
#start-message {
  pointer-events: all;
  user-select: none;
  color: white;
  font-size: 2rem;
  text-align: center;
  background: rgba(0,0,0,0.7);
  padding: 2rem;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.3s ease;
}

#start-message:hover {
  background: rgba(0,0,0,0.85);
}

/* Choice Container */
#choices {
  position: absolute;
  bottom: 8%;
  width: 100%;
  text-align: center;
  pointer-events: all;
  display: none; /* JS zeigt es bei Entscheidung */
}

/* Choice Buttons */
.choice {
  display: inline-block;
  margin: 0 1rem;
  padding: 0.75rem 1.5rem;
  color: white;
  border: 1px solid white;
  border-radius: 6px;
  cursor: pointer;
  background: rgba(0,0,0,0.5);
  transition: background 0.3s ease, transform 0.2s ease;
}

.choice:hover {
  background: rgba(255,255,255,0.2);
  transform: scale(1.05);
}

/* --- Beispiel Positionen für Overlays (optional) --- */
#funk { left: 8%; bottom: 10%; }
#wasser { right: 8%; bottom: 10%; }
#fruit { left: 12%; bottom: 12%; }
#lighter { right: 12%; bottom: 12%; }
#path { left: 10%; bottom: 15%; }
#smoke { right: 10%; bottom: 15%; }

/* --- Szenen spezifische Filter / Stimmung --- */
.wald-tensed {
  filter: brightness(0.7) contrast(1.2) saturate(0.8);
  transition: filter 1.5s ease;
}

/* --- Hidden Class --- */
.hidden {
  display: none !important;
}

/* --- End Screen Styles --- */
#end-screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.7) 50%, rgba(0, 0, 0, 0) 100%);
  pointer-events: all;
  z-index: 200;
  padding-bottom: 3rem;
}

#end-text {
  color: white;
  font-size: 1.3rem;
  text-align: center;
  max-width: 80%;
  margin-bottom: 2rem;
  padding: 1.5rem;
  line-height: 1.6;
  text-shadow: 0 2px 10px rgba(0,0,0,0.8);
  background: rgba(0, 0, 0, 0.6);
  border-radius: 8px;
}

#restart-btn {
  padding: 1rem 2rem;
  font-size: 1.2rem;
  color: white;
  background: rgba(50, 50, 50, 0.8);
  border: 2px solid white;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
}

#restart-btn:hover {
  background: rgba(100, 100, 100, 0.9);
  transform: scale(1.05);
}

/* --- Dark Filter for Isolation End --- */
.end-isolation {
  filter: brightness(0.6) contrast(1.3) saturate(0.6);
}

/* --- Even Darker Filter for Despair End --- */
.end-despair {
  filter: brightness(0.4) contrast(1.5) saturate(0.3);
}


/* --- Black Transition Overlay --- */
#black-transition {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: black;
  opacity: 0;
  transition: opacity 1.5s ease;
  z-index: 60;
}
