/* Datei: css/styles.css */
/* Win-Animation (Konfetti/Daumen hoch) */
#winAnimation {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 48px;
  opacity: 0;
  pointer-events: none;
  z-index: 5;
}
@keyframes winAnim {
  0% { transform: translate(-50%, -50%) scale(0.5); opacity: 0; }
  50% { transform: translate(-50%, -50%) scale(1.2); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(1); opacity: 0; }
}

/* Fade-in für neue Spieler */
.fade-in {
  animation: fadeIn 1s;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Grundstil und Responsiveness */
body {
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 0;
  background-color: #f4f4f4;
  color: #333;
}

header {
  background-color: #0D3B66;
  color: white;
  padding: 20px;
  text-align: center;
}

.container {
  padding: 20px;
}

.match {
  background: white;
  margin: 10px 0;
  padding: 15px;
  border-radius: 5px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.match h3 {
  margin: 0;
  font-size: 1.2em;
}

.match p {
  margin: 10px 0;
  display: flex;
  align-items: center;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.btn {
  background-color: #0D3B66;
  color: white;
  padding: 10px 20px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  margin-top: 10px;
}

.btn:disabled {
  background-color: #888;
  cursor: not-allowed;
}

.flex-center {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
}

#minigame {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.8);
  z-index: 999;
}

#playerModal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.8);
  z-index: 1000;
}

.modal-content {
  position: relative;
  background: white;
  padding: 20px;
  border-radius: 5px;
  text-align: center;
}

.modal-close {
  position: absolute;
  top: 5px;
  right: 10px;
  cursor: pointer;
  font-size: 20px;
  color: #aaa;
}
.modal-close:hover {
  color: #000;
}

#gameArea {
  position: relative;
  width: 300px;
  height: 200px;
  background: #fff;
  border: 2px solid #0D3B66;
  border-radius: 5px;
  overflow: hidden;
  margin-bottom: 20px;
  cursor: auto;
}

#tennisNet {
  position: absolute;
  left: 50%;
  top: 0;
  transform: translateX(-50%);
  width: 4px;
  height: 100%;
  background-image: repeating-linear-gradient(
    to bottom,
    #fff,
    #fff 2px,
    #000 2px,
    #000 4px
  );
  opacity: 0.5;
  z-index: 2;
}

.targetZone { display: none; }

#ball {
  position: absolute;
  top: 95px;
  left: 0;
  width: 10px;
  height: 10px;
  background: #fbbc05;
  border-radius: 50%;
  z-index: 3;
}

#mobileRacket, #desktopRacket {
  position: absolute;
  width: 50px;
  height: 50px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='50' height='50'><ellipse cx='25' cy='18' rx='15' ry='12' fill='none' stroke='black' stroke-width='3'/><rect x='24' y='30' width='2' height='15' fill='black'/></svg>");
  background-size: contain;
  pointer-events: none;
  z-index: 4;
  display: none;
}

#gameMessage {
  color: white;
  text-align: center;
  margin-bottom: 10px;
}

.registered-players .registered-player {
  margin-right: 5px;
  font-size: 1.2em;
  margin-left: 8px;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.remove-player {
  color: red;
  cursor: pointer;
  margin-left: 3px;
  font-weight: bold;
}

@media (max-width: 600px) {
  .container { padding: 10px; }
  #gameArea { width: 90%; height: 150px; }
  .match h3 { font-size: 1em; }
  .btn { padding: 8px 15px; }

  .registered-players { display: block; }
  .registered-players .registered-player {
    display: block;
    white-space: nowrap;
    margin-bottom: 4px;
  }
}