/* Lokale Google Font Poppins einbinden */
@font-face {
  font-family: 'Poppins';
  src: url('fonts/Poppins-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Poppins';
  src: url('fonts/Poppins-Bold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* Reset & Basics */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
    Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
  background: linear-gradient(135deg, #fceabb, #f8b500);
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

.screen {
  display: none;
}

.screen.active {
  display: block;
}

#intro-container {
  text-align: center;
  color: #333;
  max-width: 600px;
  padding: 20px;
  position: relative;
  user-select: none;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Text */
#intro-text {
  margin-bottom: 40px;
}

/* Smartphones container */
#smartphones {
  margin-bottom: 40px;
  position: relative;
  height: 180px;
  display: flex;
  justify-content: center;
  gap: 60px;
  align-items: center;
  opacity: 0;
  transition: opacity 1s ease-in;
}

/* Phone Basis */
.phone {
  width: 100px;
  height: 180px;
  background: linear-gradient(145deg, #2c3e50, #34495e);
  border-radius: 35px;
  box-shadow: 0 12px 25px rgba(0, 0, 0, 0.5);
  position: relative;
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
  overflow: hidden;
}

/* Bildschirm mit Glanz und Farbverlauf */
.phone::before {
  content: "";
  position: absolute;
  top: 20px;
  left: 15px;
  right: 15px;
  bottom: 20px;
  background: linear-gradient(180deg, #1abc9c, #16a085);
  border-radius: 25px;
  box-shadow: inset 0 0 20px rgba(255, 255, 255, 0.3);
  filter: brightness(1);
  transition: filter 3s ease-in-out;
}

/* Bildschirm Pulsieren */
.phone.show::before {
  animation: screenPulse 3s ease-in-out infinite;
}

/* Lautsprecher */
.phone::after {
  content: "";
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 50px;
  height: 7px;
  background: #145a4f;
  border-radius: 4px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.7);
}

/* Kamera */
.phone .camera {
  position: absolute;
  top: 14px;
  right: 22px;
  width: 12px;
  height: 12px;
  background: radial-gradient(circle at center, #7fdbca, #16a085);
  border-radius: 50%;
  box-shadow: 0 0 5px rgba(255,255,255,0.7);
  filter: drop-shadow(0 0 2px rgba(0,0,0,0.9));
}

/* Animation Keyframes */
@keyframes screenPulse {
  0%, 100% {
    filter: brightness(1);
  }
  50% {
    filter: brightness(1.2);
  }
}

/* Show phones with animation */
.phone.show {
  opacity: 1;
  transform: translateY(0);
}

/* Farbvarianten für links und rechts */
.phone-left {
  background: linear-gradient(145deg, #2980b9, #3498db);
}

.phone-left::before {
  background: linear-gradient(180deg, #85c1e9, #2980b9);
}

.phone-left .camera {
  background: radial-gradient(circle at center, #a9cce3, #2980b9);
}

.phone-right {
  background: linear-gradient(145deg, #27ae60, #2ecc71);
}

.phone-right::before {
  background: linear-gradient(180deg, #82e0aa, #27ae60);
}

.phone-right .camera {
  background: radial-gradient(circle at center, #a3e4d7, #27ae60);
}

/* Signal animation */
#signal {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 120px;
  height: 120px;
  transform: translate(-50%, -50%);
  pointer-events: none;
  opacity: 0;
}

/* Signal waves */
.signal-wave {
  position: absolute;
  border: 2px solid #25d366;
  border-radius: 50%;
  opacity: 0.7;
  animation: pulseSignal 2.5s infinite;
}

.signal-wave:nth-child(1) {
  width: 40px;
  height: 40px;
  top: 40px;
  left: 40px;
  animation-delay: 0s;
}

.signal-wave:nth-child(2) {
  width: 70px;
  height: 70px;
  top: 25px;
  left: 25px;
  animation-delay: 0.8s;
}

.signal-wave:nth-child(3) {
  width: 100px;
  height: 100px;
  top: 10px;
  left: 10px;
  animation-delay: 1.6s;
}

@keyframes pulseSignal {
  0% {
    transform: scale(0.6);
    opacity: 0.7;
  }
  100% {
    transform: scale(1.4);
    opacity: 0;
  }
}

/* Textzeilen fade-in */
.fade-line {
  opacity: 0;
  transform: translateY(15px) scale(0.95);
  transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1), 
              transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  margin: 0.5rem 0;
  font-weight: 400;
  font-size: 1.2rem;
  color: #222;
  text-shadow: 0 0 3px rgba(255,255,255,0.1);
}

.fade-line.show {
  opacity: 1;
  transform: translateY(0) scale(1);
  text-shadow: 0 0 8px rgba(37, 211, 102, 0.7);
}

/* Start Button */
#start-button {
  margin-top: 20px;
  padding: 15px 50px;
  font-size: 1.3rem;
  font-weight: 700;
  color: white;
  background-color: #25d366;
  border: none;
  border-radius: 30px;
  cursor: pointer;
  box-shadow: 0 6px 12px rgba(37, 211, 102, 0.6);
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.8s ease, transform 0.8s ease;
  user-select: none;
}

#start-button.show {
  opacity: 1;
  transform: translateY(0);
}

#start-button:hover {
  background-color: #128c4a;
}

/* Zusätzliche Styles für neue Screens */
.screen {
  display: none;
  max-width: 600px;
  width: 100%;
  background: white;
  border-radius: 15px;
  padding: 20px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.15);
  margin: 20px;
  box-sizing: border-box;
}

.screen.active {
  display: block;
}

h2 {
  margin-top: 0;
}

#gender-selection button,
#city-list button,
#choices button {
  margin: 10px 10px 0 0;
  padding: 12px 25px;
  font-size: 1rem;
  border: none;
  border-radius: 25px;
  cursor: pointer;
  background-color: #25d366;
  color: white;
  transition: background-color 0.3s;
}

#gender-selection button:hover,
#city-list button:hover,
#choices button:hover {
  background-color: #128c4a;
}

#playerName {
  width: 100%;
  padding: 12px;
  font-size: 1rem;
  margin-bottom: 15px;
  border-radius: 8px;
  border: 1.5px solid #ccc;
  box-sizing: border-box;
}

/* Chat Styles */
.chat-window {
  border: 1px solid #ccc;
  border-radius: 12px;
  height: 300px;
  overflow-y: auto;
  padding: 15px;
  margin: 15px 0;
  background: #f9f9f9;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 1rem;
}

.message {
  max-width: 70%;
  padding: 10px 15px;
  border-radius: 20px;
  word-wrap: break-word;
}

.message.player {
  background-color: #25d366;
  color: white;
  align-self: flex-end;
  border-bottom-right-radius: 5px;
}

.message.character {
  background-color: #e5e5ea;
  color: #333;
  align-self: flex-start;
  border-bottom-left-radius: 5px;
}

.chat-controls {
  display: flex;
  gap: 10px;
}

#chat-input {
  flex: 1;
  padding: 10px 15px;
  font-size: 1rem;
  border-radius: 20px;
  border: 1.5px solid #ccc;
  outline: none;
}

#send-button {
  padding: 10px 25px;
  font-size: 1rem;
  border-radius: 20px;
  border: none;
  background-color: #25d366;
  color: white;
  cursor: pointer;
  transition: background-color 0.3s;
}

#send-button:hover {
  background-color: #128c4a;
}

.dots {
  display: inline-block;
  animation: blink 1.4s infinite;
  font-weight: bold;
  margin-left: 5px;
}

@keyframes blink {
  0%, 20% {
    color: transparent;
  }
  40% {
    color: black;
  }
  60% {
    color: transparent;
  }
  80%, 100% {
    color: black;
  }
}
