/* Wipe It! Touchscreen Game – Styles */

/* Grundlayout für 9:16 Touchscreen */
#wipeit-app {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  display: flex;
  justify-content: center;
  align-items: stretch;
  padding: 10px;
  box-sizing: border-box;
}

.wipeit-wrapper {
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  border-radius: 20px;
  padding: 12px;
  box-sizing: border-box;
  background: linear-gradient(180deg, #e3f2fd, #fce4ec);
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
  overflow: hidden;
}

/* Header: Timer + Start/Reset */

.wipeit-header {
  border-radius: 16px;
  padding: 10px;
  background: rgba(255,255,255,0.9);
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.wipeit-timer {
  font-size: 3rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-align: center;
  color: #0d47a1;
  text-shadow: 0 0 10px rgba(33,150,243,0.7);
  animation: timerPulse 1.5s infinite alternate;
}

@keyframes timerPulse {
  from { transform: scale(1); opacity: 0.9; }
  to   { transform: scale(1.05); opacity: 1; }
}

.wipeit-round-info {
  font-size: 0.9rem;
  color: #555;
}

.wipeit-top-buttons {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.wipeit-btn {
  border: none;
  border-radius: 999px;
  padding: 10px 18px;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0,0,0,0.25);
  transition: transform 0.1s ease, box-shadow 0.1s ease, filter 0.1s ease;
  touch-action: manipulation;
}

.wipeit-btn:active {
  transform: translateY(1px) scale(0.98);
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
  filter: brightness(0.95);
}

.btn-start {
  background: #e53935; /* ROT – sehr wichtig */
}

.btn-reset {
  background: #43a047; /* GRÜN – sehr wichtig */
}

/* Spieler-Buttons (blau) */

.players-container {
  margin-top: 6px;
  width: 100%;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}

.player-slot {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 3px;
}

.player-btn {
  background: #1e88e5;   /* BLAU – sehr wichtig */
  color: #fff;
  border-radius: 999px;
  border: none;
  padding: 6px 4px;
  font-size: 0.8rem;
  font-weight: 700;
  box-shadow: 0 3px 8px rgba(0,0,0,0.2);
  cursor: pointer;
  text-align: center;
  touch-action: manipulation;
  transition: transform 0.1s ease, box-shadow 0.1s ease, filter 0.1s ease, background 0.15s ease;
  white-space: nowrap;
}

.player-btn:active {
  transform: translateY(1px) scale(0.97);
  box-shadow: 0 2px 5px rgba(0,0,0,0.3);
  filter: brightness(0.95);
}

.player-btn.hidden {
  visibility: hidden;
}

.player-btn.active-player {
  background: #e53935; /* ROT = aktiver Spieler */
  box-shadow: 0 0 12px rgba(229,57,53,0.8);
  animation: activeGlow 1s infinite alternate;
}

@keyframes activeGlow {
  from { box-shadow: 0 0 6px rgba(229,57,53,0.7); }
  to   { box-shadow: 0 0 14px rgba(229,57,53,1); }
}

.player-time {
  font-size: 0.7rem;
  text-align: center;
  color: #444;
  min-height: 0.9rem;
}

/* Spielfeld (Wipe It) */

.wipeit-game-area {
  position: relative;
  flex: 1;
  min-height: 260px;
  border-radius: 18px;
  overflow: hidden;
  border: 3px solid rgba(25,118,210,0.7);
  box-shadow: 0 6px 18px rgba(0,0,0,0.25);
  background: #000;
}

.wipeit-background {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: saturate(1.2);
  /* Hier eigenes GIF/Bild eintragen */
  background-image: radial-gradient(circle at top, #ffcc80, #f48fb1);
}

#wipeit-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: none;
}

/* Konfig-Bereich unten */

.wipeit-config {
  border-radius: 16px;
  padding: 10px;
  background: rgba(255,255,255,0.9);
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  font-size: 0.85rem;
}

.wipeit-config label {
  display: flex;
  flex-direction: column;
  gap: 3px;
  color: #333;
  font-weight: 600;
}

.wipeit-config select {
  padding: 4px 6px;
  border-radius: 999px;
  border: 1px solid #90caf9;
  background: #e3f2fd;
  font-size: 0.85rem;
  outline: none;
}

/* Winner Popup */

.winner-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.winner-overlay.visible {
  pointer-events: all;
  opacity: 1;
}

.winner-box {
  background: #ffffff;
  border-radius: 18px;
  padding: 16px;
  text-align: center;
  min-width: 60%;
  max-width: 80%;
  box-shadow: 0 10px 30px rgba(0,0,0,0.35);
  animation: winnerPop 0.35s ease-out;
}

@keyframes winnerPop {
  from { transform: scale(0.8); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

.winner-title {
  font-size: 1.4rem;
  font-weight: 800;
  margin-bottom: 6px;
  color: #d81b60;
}

.winner-player {
  font-size: 1.1rem;
  margin-bottom: 4px;
}

.winner-time {
  font-size: 1rem;
  color: #555;
}

.winner-hint {
  margin-top: 8px;
  font-size: 0.8rem;
  color: #777;
}

/* Kleinere Screens */

@media (max-width: 480px) {
  .wipeit-timer {
    font-size: 2.4rem;
  }
  .players-container {
    grid-template-columns: repeat(5, 1fr);
  }
}
