
/* Startscreen */
#startscreen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.start-screen {
  display: none;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
}

.start-screen.active {
  display: flex;
}

.start-box {
  background: rgba(255, 255, 255, 0.95);
  color: #1a1a2e;
  padding: 40px;
  border-radius: 20px;
  max-width: 900px;
  text-align: center;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.welcome-box {
  max-width: 1000px;
}

.welcome-content {
  display: flex;
  gap: 40px;
  align-items: center;
  text-align: left;
}

.welcome-text {
  flex: 1;
  text-align: left;
}

.welcome-image {
  flex: 1;
  min-width: 300px;
  max-width: 400px;
}

.welcome-image img {
  width: 100%;
  height: auto;
  border-radius: 15px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}

.image-placeholder {
  width: 100%;
  height: 300px;
  background: linear-gradient(135deg, #f5f5f5 0%, #e0e0e0 100%);
  border: 3px dashed #ccc;
  border-radius: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

.placeholder-content {
  text-align: center;
  color: #666;
}

.placeholder-icon {
  font-size: 4em;
  margin-bottom: 10px;
}

.placeholder-content p {
  margin: 5px 0;
  font-size: 1em;
}

.placeholder-hint {
  font-size: 0.9em !important;
  color: #999;
  margin-top: 10px;
}

.placeholder-hint code {
  background: rgba(0, 0, 0, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: monospace;
}

/* Endscreen Styling */
.end-box {
  max-width: 1000px;
}

.end-content {
  display: flex;
  gap: 40px;
  align-items: center;
  text-align: left;
}

.end-image {
  flex: 1;
  min-width: 300px;
  max-width: 400px;
}

.end-image img {
  width: 100%;
  height: auto;
  border-radius: 15px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}

.end-text {
  flex: 1;
  text-align: left;
}

.end-text h1 {
  text-align: left;
}

/* Anleitung-Screen Styling */
.instructions-box {
  max-width: 1200px;
}

.instructions-content {
  display: flex;
  gap: 40px;
  align-items: flex-start;
}

.instructions-text {
  flex: 1;
  text-align: left;
}

.instructions-list {
  list-style: none;
  padding: 0;
  margin: 20px 0;
}

.instructions-list li {
  font-size: 1.1em;
  margin: 10px 0;
  padding: 8px;
  background: rgba(211, 47, 47, 0.1);
  border-radius: 5px;
}

.demo-hint {
  font-style: italic;
  color: #666;
  margin-top: 15px;
}

.instructions-demo {
  flex: 1;
  min-width: 400px;
  height: 300px;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  border-radius: 15px;
  position: relative;
  overflow: hidden;
  border: 3px solid rgba(255, 255, 255, 0.2);
}

.demo-zone {
  position: absolute;
  top: 10%;
  width: 20%;
  height: 30%;
  border: 2px dashed rgba(255, 255, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: white;
  border-radius: 5px;
}

.demo-zone-it { left: 2%; }
.demo-zone-office { left: 26%; }
.demo-zone-sled { left: 50%; }
.demo-zone-tech { left: 74%; }

.demo-belt {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 25%;
  background: rgba(0, 0, 0, 0.4);
  border-top: 2px solid rgba(255, 255, 255, 0.3);
}

.demo-item {
  position: absolute;
  bottom: 50%;
  left: 0;
  width: 50px;
  height: 50px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translateY(-50%);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  animation: demoMove 4s ease-in-out infinite;
}

.demo-item-icon {
  font-size: 30px;
}

@keyframes demoMove {
  0% {
    left: 10%;
    opacity: 1;
  }
  30% {
    left: 10%;
    opacity: 1;
  }
  50% {
    left: 50%;
    top: 20%;
    opacity: 0.7;
    transform: translateY(-50%) scale(1.2);
  }
  70% {
    left: 50%;
    top: 20%;
    opacity: 0;
    transform: translateY(-50%) scale(0.8);
  }
  100% {
    left: 10%;
    bottom: 50%;
    opacity: 1;
    transform: translateY(-50%) scale(1);
  }
}

/* Responsive Design für Startscreen und Endscreen */
@media (max-width: 768px) {
  .welcome-content,
  .end-content,
  .instructions-content {
    flex-direction: column;
    gap: 20px;
  }
  
  .welcome-text,
  .end-text,
  .instructions-text {
    text-align: center;
  }
  
  .welcome-text h1,
  .end-text h1 {
    text-align: center;
  }
  
  .welcome-image,
  .end-image,
  .instructions-demo {
    min-width: 100%;
    max-width: 100%;
  }
  
  .start-box {
    max-width: 90%;
    padding: 20px;
  }
}

.start-box h1 {
  color: #d32f2f;
  font-size: 2em;
  margin-bottom: 20px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
  text-align: center;
}

.welcome-text h1 {
  text-align: left;
}

.start-box p {
  font-size: 1.2em;
  line-height: 1.6;
  margin-bottom: 20px;
  color: #333;
}

.start-button {
  background: #d32f2f;
  color: white;
  border: none;
  padding: 15px 40px;
  font-size: 1.3em;
  border-radius: 10px;
  cursor: pointer;
  margin-top: 20px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(211, 47, 47, 0.4);
}

.start-button:hover {
  background: #b71c1c;
  transform: scale(1.05);
  box-shadow: 0 6px 20px rgba(211, 47, 47, 0.6);
}

.start-button:active {
  transform: scale(0.98);
}

#hud {
  position: fixed;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  font-size: 18px;
  background: rgba(0, 0, 0, 0.7);
  padding: 10px 20px;
  border-radius: 8px;
  pointer-events: none;
  display: flex;
  align-items: center;
  gap: 10px;
}

#hud button {
  pointer-events: all;
  font-size: 14px;
  transition: all 0.2s ease;
}

#hud button:hover {
  background: rgba(255, 255, 255, 0.3) !important;
  transform: scale(1.05);
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: #000;
  color: #fff;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  overflow: hidden;
}

#room {
  /* Feste Proportionen - 16:9 Aspect Ratio */
  width: 100vw;
  height: 56.25vw; /* 16:9 Aspect Ratio (9/16 = 0.5625) */
  max-height: 100vh;
  max-width: 177.78vh; /* Wenn Höhe begrenzt, dann Breite anpassen (16/9 = 1.7778) */
  
  /* Hintergrundbild - immer vollständig sichtbar */
  background: url("images/backgrounds/room.jpg") center/contain no-repeat;
  /* Fallback, falls Bild nicht geladen werden kann: */
  background-color: #1a1a2e;
  position: relative;
  overflow: hidden;
  margin: 0 auto;
}

/* Zonen - angepasst an das Hintergrundbild */
.zone {
  position: absolute;
  top: 5%;
  width: 23%;
  height: 75%; /* Nach unten durchgezogen, fast bis zum Laufband */
  border: 3px dashed rgba(255,255,255,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: all 0.3s ease;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0);
  cursor: pointer;
  /* Sicherstellen, dass Zonen nicht über die Ränder hinausgehen */
  box-sizing: border-box;
}

/* Positionen basierend auf dem Hintergrundbild - mit Padding, damit sie nicht über die Ränder hinausgehen */
.it { 
  left: 1%; /* Kleines Padding vom linken Rand */
  width: 24%;
}

.office { 
  left: 23%; 
  width: 27%;
}

.sled { 
  left: 49%; 
  width: 24%;
}

.tech { 
  left: 73%; 
  width: 24%;
  right: 1%; /* Sicherstellen, dass es nicht über den rechten Rand hinausgeht */
}

.zone-label {
  background: rgba(0, 0, 0, 0.7);
  padding: 10px 15px;
  border-radius: 8px;
  text-align: center;
  font-weight: bold;
  font-size: 16px;
  border: 2px solid rgba(255, 255, 255, 0.5);
  transition: all 0.3s ease;
  pointer-events: none;
  opacity: 0; /* Standardmäßig versteckt */
  transform: scale(0.9);
}

/* Label nur beim Hover anzeigen */
.zone:hover .zone-label {
  opacity: 1;
  transform: scale(1.1);
}

/* Laufband - komplett transparent, damit das Bild-Laufband sichtbar ist */
#belt {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 15%; /* Laufband nimmt etwa 15% der Bildhöhe ein */
  background: transparent; /* Komplett transparent */
  border: none; /* Kein Rahmen */
  overflow: visible;
  pointer-events: none; /* Laufband blockiert keine Klicks */
}

#belt > * {
  pointer-events: all; /* Items sind aber klickbar */
}

/* Items - deutlich größer, auf den BALKEN des Laufbands (über den Rollen) */
.item {
  position: absolute;
  top: -90px; /* Perfekt auf den Balken positioniert */
  left: 0;
  width: 128px; /* Noch größer: 128px (doppelt so groß wie ursprünglich) */
  height: 128px;
  cursor: grab;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
  user-select: none;
  transition: transform 0.1s ease;
  /* Zentriere Item vertikal auf den Balken */
  transform: translateY(-50%); /* Zentriert das Item auf der Position */
}

.item:active {
  cursor: grabbing;
}

.item img {
  max-width: 100%;
  max-height: 100%;
  pointer-events: none;
}

/* Niedliche Animationen */
@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

@keyframes wiggle {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-5deg); }
  75% { transform: rotate(5deg); }
}

@keyframes snowflake {
  0% {
    transform: translateY(-100vh) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(100vh) rotate(360deg);
    opacity: 0;
  }
}

/* Schneeflocken-Animation */
.snowflake {
  position: absolute;
  top: -50px;
  color: white;
  font-size: 60px; /* Größeres Fallback-Emoji */
  animation: snowflake linear;
  pointer-events: none;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.snowflake img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 0 3px rgba(255, 255, 255, 0.8));
}

/* Spezielle Schneeflocke - größer und auffälliger, weniger transparent */
.snowflake-special {
  z-index: 2; /* Etwas höher, damit sie sichtbarer ist */
  opacity: 0.95 !important; /* Fast vollständig sichtbar */
}

.snowflake-special img {
  filter: drop-shadow(0 0 8px rgba(255, 255, 255, 1));
  animation: sparkle 2s ease-in-out infinite;
  opacity: 1 !important; /* Vollständig sichtbar */
}

@keyframes sparkle {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.8;
    transform: scale(1.1);
  }
}

/* Verbesserte Hover-Effekte für Zonen */
.zone:hover {
  background: rgba(255, 255, 255, 0.15) !important;
  border-color: rgba(255, 255, 255, 0.8) !important;
  border-width: 4px;
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.5),
              inset 0 0 30px rgba(255, 255, 255, 0.2);
  transform: scale(1.02);
  animation: pulse 1s ease-in-out infinite;
}

.zone:hover .zone-label {
  background: rgba(0, 0, 0, 0.9);
  border-color: rgba(255, 255, 255, 0.9);
  transform: scale(1.1);
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.6);
}

/* Spezifische Farben für jede Zone beim Hover */
.zone.it:hover {
  background: rgba(100, 150, 255, 0.2) !important;
  box-shadow: 0 0 20px rgba(100, 150, 255, 0.6),
              inset 0 0 30px rgba(100, 150, 255, 0.2);
}

.zone.office:hover {
  background: rgba(255, 200, 100, 0.2) !important;
  box-shadow: 0 0 20px rgba(255, 200, 100, 0.6),
              inset 0 0 30px rgba(255, 200, 100, 0.2);
}

.zone.sled:hover {
  background: rgba(255, 100, 100, 0.2) !important;
  box-shadow: 0 0 20px rgba(255, 100, 100, 0.6),
              inset 0 0 30px rgba(255, 100, 100, 0.2);
}

.zone.tech:hover {
  background: rgba(150, 255, 150, 0.2) !important;
  box-shadow: 0 0 20px rgba(150, 255, 150, 0.6),
              inset 0 0 30px rgba(150, 255, 150, 0.2);
}

/* Schwebende Items */
.item {
  animation: float 3s ease-in-out infinite;
}

.item:hover {
  animation: float 0.5s ease-in-out infinite, wiggle 0.5s ease-in-out infinite;
  transform: scale(1.1);
}

/* Pulsierender Score */
#score {
  animation: pulse 2s ease-in-out infinite;
}

/* Weihnachtsmann-Animation im Endscreen (wird per JavaScript hinzugefügt) */
.santa-bounce {
  animation: float 2s ease-in-out infinite;
}
