body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: #050816;
  color: white;
}

.app {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px;
}

.card {
  background: #0b1124;
  border: 1px solid #1b2545;
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 20px;
}

.hidden {
  display: none !important;
}

input {
  width: 100%;
  padding: 12px;
  margin-top: 6px;
  margin-bottom: 14px;
  font-size: 16px;
  box-sizing: border-box;
  border-radius: 10px;
  border: 1px solid #334155;
  background: #111827;
  color: white;
}

button {
  padding: 10px 16px;
  font-size: 15px;
  cursor: pointer;
  border: none;
  border-radius: 10px;
  background: #1b5cff;
  color: white;
}

button:hover {
  opacity: 0.92;
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.error {
  color: #ff6b6b;
  min-height: 20px;
}

ul {
  padding-left: 20px;
}

.teams {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.team-box {
  background: #121a33;
  padding: 16px;
  border-radius: 12px;
  border: 1px solid #27345c;
}

.target-points-box {
  max-width: 240px;
  margin-bottom: 12px;
}

.top-bar {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.info-card {
  flex: 1;
  background: linear-gradient(180deg, #0d1630 0%, #0a1125 100%);
  border: 1px solid #253662;
  border-radius: 18px;
  padding: 18px 22px;
}

.round-card {
  max-width: 220px;
}

.info-label {
  font-size: 12px;
  letter-spacing: 1.4px;
  color: #96a7d6;
  margin-bottom: 8px;
  font-weight: 700;
}

.info-value {
  font-size: 28px;
  font-weight: 800;
  color: #ffffff;
}

.status-strip {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  background: #0b1124;
  border: 1px solid #1f2b52;
  border-radius: 14px;
  padding: 14px 18px;
  margin-bottom: 22px;
}

.status-label {
  color: #8ea2d6;
  margin-right: 8px;
  font-weight: 700;
}

.hint-box {
  background: #081423;
  border: 2px solid rgba(15, 211, 255, 0.35);
  border-radius: 18px;
  min-height: 130px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  padding: 20px;
}

.hint-text {
  font-size: 38px;
  font-weight: 800;
  text-align: center;
}

.overlay-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  animation: fadeIn 0.5s ease;
}

.overlay-card {
  width: min(520px, 90vw);
  background: linear-gradient(180deg, #0d1630 0%, #0a1125 100%);
  border: 1px solid #2b406f;
  border-radius: 22px;
  padding: 28px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  animation: popIn 0.5s ease;
}

.overlay-title {
  font-size: 34px;
  font-weight: 900;
  color: #ffe76a;
  text-align: center;
  margin-bottom: 10px;
}

.overlay-subtitle {
  text-align: center;
  font-size: 18px;
  color: #c9d5f3;
  margin-bottom: 18px;
}

.scale-section {
  position: relative;
  margin-top: 8px;
}

.result-overlay {
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: min(560px, 88%);
  background: linear-gradient(180deg, #0b1a26 0%, #08131f 100%);
  border: 2px solid #22c55e;
  border-radius: 18px;
  padding: 20px;
  text-align: center;
  z-index: 20;
  box-shadow: 0 10px 35px rgba(0, 0, 0, 0.35);
  animation: slideFadeIn 0.5s ease;
}

.result-overlay-text {
  font-size: 30px;
  font-weight: 800;
  white-space: pre-line;
  line-height: 1.5;
}

.scale-card {
  background: #0b1124;
  border: 1px solid #1f2b52;
  border-radius: 18px;
  padding: 22px;
  padding-top: 42px;
}

.scale-labels {
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
  font-size: 14px;
  color: #dbe4ff;
  font-weight: 700;
}

.scale-bar {
  height: 16px;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    #001eff 0%,
    #00cfff 25%,
    #51ff00 50%,
    #ffe600 75%,
    #ff2a00 100%
  );
  margin-bottom: 24px;
}

.vote-buttons {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 10px;
}

.vote-buttons button {
  background: #111827;
  border: 1px solid #2d3a67;
  border-radius: 999px;
  width: 100%;
  aspect-ratio: 1 / 1;
  font-weight: 800;
  font-size: 16px;
}

.vote-buttons button.correct {
  background: #22c55e;
  border-color: #22c55e;
  color: white;
}

.vote-buttons button.near {
  background: #eab308;
  border-color: #eab308;
  color: black;
}

#nextRoundBtn {
  margin-top: 16px;
  background: #16a34a;
}

.game-scoreboard {
  margin-top: 24px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.score-team {
  background: #0b1124;
  border: 1px solid #1f2b52;
  border-radius: 16px;
  padding: 18px;
}

.score-team-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.score-team-name {
  font-size: 20px;
  font-weight: 800;
}

.score-value {
  font-size: 28px;
  font-weight: 900;
  color: #60a5fa;
}

.score-player-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.score-player-chip {
  background: #111827;
  border: 1px solid #2d3a67;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 14px;
}

.score-player-chip.active-giver {
  border-color: #facc15;
  color: #facc15;
  font-weight: 800;
}

.winner-card {
  width: min(560px, 92vw);
}

#backToLobbyBtn {
  display: block;
  margin: 18px auto 0;
  background: #16a34a;
}

/* =========================
   ZARTI BUTTON
========================= */

#gameScreen {
  position: relative;
}

.zarti-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 10000;
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.16);
  font-size: 16px;
  font-weight: 900;
  opacity: 0.18;
  transition: opacity 0.2s ease, transform 0.2s ease, background 0.2s ease;
}

.zarti-btn:hover {
  opacity: 0.95;
  transform: scale(1.08);
  background: rgba(255, 255, 255, 0.18);
}

/* =========================
   ZARTI OVERLAY
========================= */

.zarti-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 20% 20%, rgba(255, 0, 128, 0.20), transparent 25%),
    radial-gradient(circle at 80% 30%, rgba(0, 255, 255, 0.20), transparent 25%),
    radial-gradient(circle at 30% 80%, rgba(255, 255, 0, 0.18), transparent 25%),
    radial-gradient(circle at 80% 80%, rgba(0, 255, 128, 0.20), transparent 25%),
    rgba(0, 0, 0, 0.72);
  animation: zartiBgShift 1.2s linear infinite;
  pointer-events: none;
}

.zarti-text {
  font-size: clamp(56px, 12vw, 180px);
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: center;
  line-height: 0.95;
  user-select: none;
  animation:
    zartiPulse 0.8s ease-in-out infinite alternate,
    zartiWobble 0.16s linear infinite,
    zartiHue 2.2s linear infinite;
  text-shadow:
    0 0 10px rgba(255,255,255,0.95),
    0 0 24px rgba(255,0,255,0.85),
    0 0 48px rgba(0,255,255,0.85),
    0 0 80px rgba(255,255,0,0.75);
}

/* =========================
   ZARTI CHAOS
========================= */

.zarti-chaos .top-bar,
.zarti-chaos .status-strip,
.zarti-chaos .hint-box,
.zarti-chaos .scale-section,
.zarti-chaos .game-scoreboard {
  position: relative;
  z-index: 40;
  will-change: transform;
}

.zarti-chaos .top-bar {
  animation: screensaverFloatA 9s ease-in-out infinite alternate;
}

.zarti-chaos .status-strip {
  animation: screensaverFloatB 11s ease-in-out infinite alternate;
}

.zarti-chaos .hint-box {
  animation: screensaverFloatC 8.5s ease-in-out infinite alternate;
}

.zarti-chaos .scale-section {
  animation: screensaverFloatD 10s ease-in-out infinite alternate;
}

.zarti-chaos .game-scoreboard {
  animation: screensaverFloatE 12s ease-in-out infinite alternate;
}

.zarti-chaos .info-card,
.zarti-chaos .score-team,
.zarti-chaos .scale-card,
.zarti-chaos .hint-box,
.zarti-chaos .status-strip {
  box-shadow:
    0 0 18px rgba(255, 0, 128, 0.18),
    0 0 30px rgba(0, 255, 255, 0.14);
}

/* Overlays sollen sauber drüber bleiben */
.zarti-chaos #wordOverlayBackdrop,
.zarti-chaos #winnerOverlayBackdrop,
.zarti-chaos #resultOverlay {
  z-index: 200;
}

/* =========================
   KEYFRAMES
========================= */

@keyframes popIn {
  from {
    opacity: 0;
    transform: scale(0.94);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideFadeIn {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

@keyframes zartiPulse {
  from {
    transform: scale(0.92) rotate(-2deg);
  }
  to {
    transform: scale(1.18) rotate(2deg);
  }
}

@keyframes zartiWobble {
  0% {
    translate: 0 0;
  }
  20% {
    translate: 6px -4px;
  }
  40% {
    translate: -7px 5px;
  }
  60% {
    translate: 5px 3px;
  }
  80% {
    translate: -4px -6px;
  }
  100% {
    translate: 0 0;
  }
}

@keyframes zartiHue {
  0% {
    color: #ff2a6d;
  }
  20% {
    color: #ff9f1c;
  }
  40% {
    color: #f7ff00;
  }
  60% {
    color: #00ff85;
  }
  80% {
    color: #00d9ff;
  }
  100% {
    color: #ff2aff;
  }
}

@keyframes zartiBgShift {
  0% {
    filter: hue-rotate(0deg) saturate(1);
  }
  50% {
    filter: hue-rotate(120deg) saturate(1.3);
  }
  100% {
    filter: hue-rotate(360deg) saturate(1);
  }
}

@keyframes screensaverFloatA {
  0% {
    transform: translate(0, 0) rotate(-1deg) scale(1);
  }
  25% {
    transform: translate(120px, 28px) rotate(2deg) scale(1.03);
  }
  50% {
    transform: translate(-80px, 48px) rotate(-2deg) scale(0.98);
  }
  75% {
    transform: translate(90px, -18px) rotate(1.5deg) scale(1.02);
  }
  100% {
    transform: translate(-110px, 24px) rotate(-1deg) scale(1);
  }
}

@keyframes screensaverFloatB {
  0% {
    transform: translate(0, 0) rotate(0deg);
  }
  25% {
    transform: translate(-90px, 32px) rotate(-2deg);
  }
  50% {
    transform: translate(110px, -26px) rotate(2deg);
  }
  75% {
    transform: translate(-60px, 18px) rotate(-1deg);
  }
  100% {
    transform: translate(80px, -12px) rotate(1deg);
  }
}

@keyframes screensaverFloatC {
  0% {
    transform: translate(0, 0) scale(1);
  }
  25% {
    transform: translate(60px, -25px) scale(1.03);
  }
  50% {
    transform: translate(-120px, 35px) scale(0.97);
  }
  75% {
    transform: translate(85px, 22px) scale(1.04);
  }
  100% {
    transform: translate(-70px, -18px) scale(1);
  }
}

@keyframes screensaverFloatD {
  0% {
    transform: translate(0, 0) rotate(0deg);
  }
  25% {
    transform: translate(-70px, -16px) rotate(1deg);
  }
  50% {
    transform: translate(100px, 30px) rotate(-2deg);
  }
  75% {
    transform: translate(-120px, 10px) rotate(1.5deg);
  }
  100% {
    transform: translate(75px, -22px) rotate(-1deg);
  }
}

@keyframes screensaverFloatE {
  0% {
    transform: translate(0, 0);
  }
  25% {
    transform: translate(80px, -20px);
  }
  50% {
    transform: translate(-100px, 32px);
  }
  75% {
    transform: translate(60px, 18px);
  }
  100% {
    transform: translate(-70px, -16px);
  }
}

/* =========================
   RESPONSIVE
========================= */

@media (max-width: 900px) {
  .vote-buttons {
    grid-template-columns: repeat(5, 1fr);
  }

  .game-scoreboard,
  .teams {
    grid-template-columns: 1fr;
  }

  .top-bar {
    flex-direction: column;
  }

  .round-card {
    max-width: none;
  }

  .zarti-text {
    font-size: clamp(44px, 14vw, 120px);
  }
}