/* Town Hall Quiz - TV Show Style */

:root {
  /* DG-i Farbschema */
  --primary: #1a1a2e;           /* Midnight Black (aufgehellt) */
  --secondary: #252540;         /* Midnight Black (lighter) */
  --accent: #2857a4;            /* Deep Royal Blue */
  --accent-light: #5a8fc7;      /* Blue */
  --pastel: #7ea8d1;            /* Pastel Blue */
  --gold: #e25a3d;              /* Rocket Orange (als Highlight) */
  --silver: #c0c0c0;
  --bronze: #cd7f32;
  --success: #3dba7b;           /* Funky Green */
  --danger: #e25a3d;            /* Rocket Orange */
  --text: #ffffff;              /* White */
  --text-dim: #9ab;

  /* Team-Farben (nummeriert, kontrastreich) */
  --team-1: #8b7355;            /* Sandstein/Braun */
  --team-2: #e25a3d;            /* Rocket Orange */
  --team-3: #f0c000;            /* Gold/Gelb */
  --team-4: #9b59b6;            /* Lila */
  --team-5: #3dba7b;            /* Funky Green */
  --team-6: #00a8cc;            /* Blau */

  /* Legacy aliases (für Kompatibilität) */
  --team-dom: var(--team-1);
  --team-fc: var(--team-2);
  --team-koelsch: var(--team-3);
  --team-alaaf: var(--team-4);
  --team-veedel: var(--team-5);
  --team-kvb: var(--team-6);

  /* Abstände */
  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 2rem;
  --spacing-lg: 3rem;
  --spacing-xl: 4rem;

  /* Schatten */
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  --glow: 0 0 20px rgba(233, 69, 96, 0.5);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ============================================ */
/* HEADER */
/* ============================================ */

.header {
  background: rgba(0, 0, 0, 0.3);
  padding: var(--spacing-sm) var(--spacing-md);
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid var(--accent);
}

.logo {
  font-size: 1.8rem;
  font-weight: bold;
  background: linear-gradient(90deg, var(--accent), var(--accent-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.round-info {
  text-align: center;
}

.round-name {
  font-size: 1.2rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 2px;
}

.round-progress {
  font-size: 0.9rem;
  color: var(--text-dim);
}

/* ============================================ */
/* SCOREBOARD */
/* ============================================ */

.scoreboard {
  display: flex;
  justify-content: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-md);
  flex-wrap: wrap;
}

.team-card {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: var(--spacing-sm) var(--spacing-md);
  min-width: 150px;
  text-align: center;
  transition: all 0.3s ease;
  border: 2px solid transparent;
  cursor: pointer;
}

.team-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow);
}

.team-card.active {
  border-color: var(--gold);
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
}

.team-card.team-dom { border-top: 4px solid var(--team-dom); }
.team-card.team-fc { border-top: 4px solid var(--team-fc); }
.team-card.team-koelsch { border-top: 4px solid var(--team-koelsch); }
.team-card.team-alaaf { border-top: 4px solid var(--team-alaaf); }
.team-card.team-veedel { border-top: 4px solid var(--team-veedel); }
.team-card.team-kvb { border-top: 4px solid var(--team-kvb); }

.team-name {
  font-size: 1rem;
  font-weight: bold;
  margin-bottom: var(--spacing-xs);
}

.team-score {
  font-size: 2rem;
  font-weight: bold;
  color: var(--success);
}

.team-controls {
  display: flex;
  gap: var(--spacing-xs);
  justify-content: center;
  margin-top: var(--spacing-xs);
}

.team-btn {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: var(--text);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.2rem;
  transition: all 0.2s;
}

.team-btn:hover {
  background: var(--accent);
  transform: scale(1.1);
}

.team-btn.add { background: var(--success); }
.team-btn.subtract { background: var(--danger); }

/* ============================================ */
/* MAIN CONTENT */
/* ============================================ */

.main-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: var(--spacing-md);
}

/* ============================================ */
/* QUESTION DISPLAY */
/* ============================================ */

.question-container {
  background: rgba(0, 0, 0, 0.4);
  border-radius: 20px;
  padding: var(--spacing-lg);
  margin-bottom: var(--spacing-md);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.question-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--accent), var(--gold), var(--accent));
}

.question-number {
  font-size: 0.9rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: var(--spacing-sm);
}

.question-text {
  font-size: 2.5rem;
  font-weight: bold;
  line-height: 1.3;
  margin-bottom: var(--spacing-md);
  text-align: center;
}

.question-hint {
  font-size: 1rem;
  color: var(--text-dim);
  font-style: italic;
  text-align: center;
}

/* ============================================ */
/* ANSWER OPTIONS */
/* ============================================ */

.options-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--spacing-sm);
  margin-top: var(--spacing-md);
}

.option {
  background: linear-gradient(135deg, rgba(255,255,255,0.1), rgba(255,255,255,0.05));
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  padding: var(--spacing-md);
  font-size: 1.4rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.option:hover {
  border-color: var(--accent);
  transform: scale(1.02);
  box-shadow: var(--glow);
}

.option-letter {
  background: var(--accent);
  color: white;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  flex-shrink: 0;
}

.option.correct {
  background: linear-gradient(135deg, var(--success), #2a9d6a);
  border-color: var(--success);
  animation: pulse 0.5s ease;
}

.option.wrong {
  background: linear-gradient(135deg, var(--danger), #c0392b);
  border-color: var(--danger);
  opacity: 0.6;
}

.option.revealed {
  pointer-events: none;
}

/* ============================================ */
/* TIMER */
/* ============================================ */

.timer-container {
  display: flex;
  justify-content: center;
  margin-bottom: var(--spacing-md);
}

.timer {
  background: rgba(0, 0, 0, 0.5);
  border-radius: 50%;
  width: 120px;
  height: 120px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 4px solid var(--accent);
  position: relative;
}

.timer-value {
  font-size: 3rem;
  font-weight: bold;
  color: var(--text);
}

.timer-label {
  font-size: 0.8rem;
  color: var(--text-dim);
  text-transform: uppercase;
}

.timer.warning {
  border-color: var(--gold);
  animation: pulse 0.5s ease infinite;
}

.timer.danger {
  border-color: var(--danger);
  animation: shake 0.3s ease infinite;
}

/* ============================================ */
/* FAMILIENDUELL BOARD */
/* ============================================ */

.feud-board {
  background: linear-gradient(135deg, #1e3c72, #2a5298);
  border-radius: 20px;
  padding: var(--spacing-md);
  box-shadow: var(--shadow);
}

.feud-answer {
  background: rgba(0, 0, 0, 0.4);
  border-radius: 10px;
  padding: var(--spacing-sm) var(--spacing-md);
  margin-bottom: var(--spacing-xs);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 1.3rem;
  border: 2px solid transparent;
  transition: all 0.3s ease;
}

.feud-answer.hidden {
  background: linear-gradient(90deg, #2c3e50, #34495e);
}

.feud-answer.revealed {
  background: linear-gradient(90deg, var(--success), #27ae60);
  border-color: var(--gold);
  animation: flipIn 0.5s ease;
}

.feud-rank {
  background: var(--gold);
  color: var(--primary);
  width: 35px;
  height: 35px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}

.feud-text {
  flex: 1;
  margin-left: var(--spacing-sm);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.feud-points {
  background: rgba(255, 255, 255, 0.2);
  padding: var(--spacing-xs) var(--spacing-sm);
  border-radius: 20px;
  font-weight: bold;
  min-width: 60px;
  text-align: center;
}

/* ============================================ */
/* RISK FINALE */
/* ============================================ */

.risk-container {
  text-align: center;
}

.risk-input {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--spacing-sm);
  margin-bottom: var(--spacing-md);
}

.risk-slider {
  width: 80%;
  max-width: 400px;
  height: 20px;
  -webkit-appearance: none;
  background: linear-gradient(90deg, var(--success), var(--gold), var(--danger));
  border-radius: 10px;
  outline: none;
}

.risk-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 40px;
  height: 40px;
  background: white;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 0 10px rgba(0,0,0,0.5);
}

.risk-amount {
  font-size: 3rem;
  font-weight: bold;
  color: var(--gold);
}

/* ============================================ */
/* ESTIMATE (SCHÄTZFRAGEN) */
/* ============================================ */

.estimate-container {
  text-align: center;
}

.estimate-input {
  font-size: 3rem;
  background: rgba(255, 255, 255, 0.1);
  border: 3px solid var(--accent);
  border-radius: 10px;
  color: var(--text);
  padding: var(--spacing-sm) var(--spacing-md);
  text-align: center;
  width: 250px;
  margin: var(--spacing-md) auto;
}

.estimate-input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: var(--glow);
}

.estimate-unit {
  font-size: 1.5rem;
  color: var(--text-dim);
}

.estimate-reveal {
  font-size: 5rem;
  font-weight: bold;
  color: var(--gold);
  animation: scaleIn 0.5s ease;
}

.team-estimates {
  display: flex;
  justify-content: center;
  gap: var(--spacing-md);
  flex-wrap: wrap;
  margin-top: var(--spacing-md);
}

.team-estimate {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: var(--spacing-sm);
  min-width: 120px;
}

.team-estimate.winner {
  background: var(--success);
  animation: pulse 0.5s ease;
}

/* ============================================ */
/* IMAGE ROUND */
/* ============================================ */

.image-container {
  text-align: center;
  margin-bottom: var(--spacing-md);
}

.quiz-image {
  max-width: 100%;
  max-height: 400px;
  border-radius: 15px;
  box-shadow: var(--shadow);
  border: 4px solid var(--accent);
  transition: filter 0.5s ease-out;
}

.quiz-image.blur-reveal {
  filter: blur(30px);
}

.image-placeholder {
  width: 100%;
  height: 300px;
  background: linear-gradient(135deg, #2c3e50, #34495e);
  border-radius: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--text-dim);
  border: 4px dashed var(--accent);
}

/* ============================================ */
/* CONTROL BUTTONS */
/* ============================================ */

.controls {
  display: flex;
  justify-content: center;
  gap: var(--spacing-sm);
  flex-wrap: wrap;
  margin-top: var(--spacing-md);
  padding: var(--spacing-md);
  background: rgba(0, 0, 0, 0.2);
  border-radius: 15px;
}

.btn {
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  border: none;
  color: white;
  padding: var(--spacing-sm) var(--spacing-md);
  font-size: 1.1rem;
  border-radius: 25px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: bold;
}

.btn:hover {
  transform: translateY(-3px);
  box-shadow: var(--glow);
}

.btn:active {
  transform: translateY(0);
}

.btn.secondary {
  background: linear-gradient(135deg, #34495e, #2c3e50);
}

.btn.success {
  background: linear-gradient(135deg, var(--success), #27ae60);
}

.btn.gold {
  background: linear-gradient(135deg, var(--gold), #f39c12);
  color: var(--primary);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* ============================================ */
/* MENU / START SCREEN */
/* ============================================ */

.menu-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 80vh;
  text-align: center;
}

.menu-title {
  font-size: 4rem;
  font-weight: bold;
  background: linear-gradient(90deg, var(--accent-light), var(--accent), var(--accent-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: var(--spacing-sm);
  animation: shimmer 3s ease infinite;
  background-size: 200% 100%;
}

.menu-subtitle {
  font-size: 1.5rem;
  color: var(--text-dim);
  margin-bottom: var(--spacing-xl);
}

.round-select {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
  width: 100%;
  max-width: 500px;
}

.round-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 15px;
  padding: var(--spacing-md);
  color: var(--text);
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: left;
}

.round-btn:hover {
  border-color: var(--accent);
  transform: translateX(10px);
  background: rgba(233, 69, 96, 0.2);
}

.round-btn.completed {
  border-color: var(--success);
  opacity: 0.7;
}

.round-btn-title {
  font-size: 1.3rem;
  font-weight: bold;
  margin-bottom: var(--spacing-xs);
}

.round-btn-desc {
  font-size: 0.9rem;
  color: var(--text-dim);
}

/* ============================================ */
/* ROUND END / ZWISCHENSTAND */
/* ============================================ */

.round-end-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 80vh;
  text-align: center;
  padding: var(--spacing-lg);
}

.round-end-badge {
  background: linear-gradient(135deg, var(--success), #27ae60);
  color: white;
  padding: 0.5rem 2rem;
  border-radius: 50px;
  font-size: 1.2rem;
  font-weight: bold;
  letter-spacing: 3px;
  margin-bottom: 1rem;
  animation: pulse-glow 2s ease infinite;
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 20px rgba(0, 184, 148, 0.5); }
  50% { box-shadow: 0 0 40px rgba(0, 184, 148, 0.8); }
}

.round-end-title {
  font-size: 3.5rem;
  color: var(--accent-light);
  margin-bottom: 0.5rem;
}

.round-end-name {
  font-size: 1.5rem;
  color: var(--text-dim);
  margin-bottom: 2rem;
}

.round-end-standings {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
  max-width: 600px;
  margin: 1rem 0 2rem;
}

.round-end-team {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  border-left: 5px solid var(--accent);
  animation: slide-in 0.5s ease backwards;
}

.round-end-team:nth-child(1) { animation-delay: 0.1s; border-left-color: var(--gold); }
.round-end-team:nth-child(2) { animation-delay: 0.2s; border-left-color: var(--silver); }
.round-end-team:nth-child(3) { animation-delay: 0.3s; border-left-color: var(--bronze); }
.round-end-team:nth-child(4) { animation-delay: 0.4s; }
.round-end-team:nth-child(5) { animation-delay: 0.5s; }
.round-end-team:nth-child(6) { animation-delay: 0.6s; }

@keyframes slide-in {
  from { opacity: 0; transform: translateX(-30px); }
  to { opacity: 1; transform: translateX(0); }
}

.round-end-rank {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--text-dim);
  width: 2rem;
}

.round-end-team:nth-child(1) .round-end-rank { color: var(--gold); }
.round-end-team:nth-child(2) .round-end-rank { color: var(--silver); }
.round-end-team:nth-child(3) .round-end-rank { color: var(--bronze); }

.round-end-team-name {
  flex: 1;
  font-size: 1.3rem;
  font-weight: bold;
  margin-left: 1rem;
}

.round-end-score {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--success);
}

.round-end-next {
  font-size: 1.2rem;
  color: var(--text-dim);
  font-style: italic;
  margin-top: 1rem;
}

/* ============================================ */
/* WINNER CELEBRATION */
/* ============================================ */

.winner-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 80vh;
  text-align: center;
}

.winner-title {
  font-size: 3rem;
  color: var(--accent-light);
  margin-bottom: var(--spacing-sm);
  animation: bounce 1s ease infinite;
}

.winner-team {
  font-size: 5rem;
  font-weight: bold;
  background: linear-gradient(90deg, var(--success), #fff, var(--success));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer 2s ease infinite;
  background-size: 200% 100%;
}

.winner-score {
  font-size: 2rem;
  color: var(--text);
  margin-top: var(--spacing-sm);
}

.podium {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: var(--spacing-md);
  margin-top: var(--spacing-xl);
}

.podium-place {
  text-align: center;
  padding: var(--spacing-md);
  border-radius: 10px 10px 0 0;
}

.podium-place.first {
  background: linear-gradient(135deg, var(--gold), #f39c12);
  height: 200px;
  width: 150px;
}

.podium-place.second {
  background: linear-gradient(135deg, var(--silver), #95a5a6);
  height: 150px;
  width: 130px;
}

.podium-place.third {
  background: linear-gradient(135deg, var(--bronze), #d35400);
  height: 100px;
  width: 130px;
}

.podium-rank {
  font-size: 2rem;
  font-weight: bold;
  color: var(--primary);
}

.podium-team {
  font-size: 1rem;
  color: var(--primary);
  font-weight: bold;
  margin-top: var(--spacing-xs);
}

.podium-score {
  font-size: 0.9rem;
  color: rgba(0,0,0,0.6);
}

/* ============================================ */
/* ANIMATIONS */
/* ============================================ */

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

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-20px); }
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

@keyframes flipIn {
  0% { transform: rotateX(90deg); opacity: 0; }
  100% { transform: rotateX(0); opacity: 1; }
}

@keyframes scaleIn {
  0% { transform: scale(0); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes slideIn {
  0% { transform: translateX(-100%); opacity: 0; }
  100% { transform: translateX(0); opacity: 1; }
}

@keyframes fadeIn {
  0% { opacity: 0; }
  100% { opacity: 1; }
}

.animate-in {
  animation: fadeIn 0.5s ease;
}

/* ============================================ */
/* KEYBOARD SHORTCUTS HELP */
/* ============================================ */

.shortcuts-panel {
  position: fixed;
  bottom: var(--spacing-md);
  right: var(--spacing-md);
  background: rgba(0, 0, 0, 0.8);
  border-radius: 10px;
  padding: var(--spacing-sm);
  font-size: 0.8rem;
  color: var(--text-dim);
  max-width: 200px;
}

.shortcuts-panel h4 {
  color: var(--accent);
  margin-bottom: var(--spacing-xs);
}

.shortcut {
  display: flex;
  justify-content: space-between;
  margin-bottom: 2px;
}

.shortcut kbd {
  background: rgba(255,255,255,0.2);
  padding: 2px 6px;
  border-radius: 3px;
}

/* ============================================ */
/* RESPONSIVE */
/* ============================================ */

@media (max-width: 768px) {
  .question-text {
    font-size: 1.5rem;
  }

  .options-grid {
    grid-template-columns: 1fr;
  }

  .menu-title {
    font-size: 2.5rem;
  }

  .scoreboard {
    gap: var(--spacing-xs);
  }

  .team-card {
    min-width: 100px;
    padding: var(--spacing-xs);
  }

  .team-score {
    font-size: 1.5rem;
  }
}

/* ============================================ */
/* FULLSCREEN MODE */
/* ============================================ */

.fullscreen-btn {
  position: fixed;
  top: var(--spacing-sm);
  right: var(--spacing-sm);
  z-index: 1000;
}

body.fullscreen {
  background: var(--primary);
}

/* ============================================ */
/* PRINT STYLES (for final results) */
/* ============================================ */

@media print {
  .controls, .shortcuts-panel, .fullscreen-btn {
    display: none;
  }

  body {
    background: white;
    color: black;
  }
}
