/* ═══════════════════════════════════════════════════════════
   Computacenter Quiz – Design System
   ═══════════════════════════════════════════════════════════ */

/* ─── Brand Colors ─────────────────────────────────────── */
:root {
  --heritage-blue:   #0D21A0;
  --horizon-blue:    #49ABEB;
  --cloud-white:     #FAFAFF;
  --foundation-blue: #011749;
  --united-red:      #F12938;
  --neural-purple:   #7A59E2;
  --circuit-green:   #54C664;
  --fibre-orange:    #FF7900;
  --voltage-yellow:  #F2C00C;

  /* Team colors */
  --team1: #49ABEB;
  --team2: #F12938;

  /* Answer button colors – leicht gesättigt für mehr Tiefe */
  --answer-0: #D91527;
  --answer-1: #2E8FCC;
  --answer-2: #D4A000;
  --answer-3: #3DAB4E;

  /* Text-Hierarchie – NUR Weiß-Abstufungen, nie Blau auf Blau */
  --text-primary:   #FAFAFF;
  --text-secondary: rgba(250, 250, 255, 0.70);
  --text-muted:     rgba(250, 250, 255, 0.45);

  /* Surfaces */
  --surface-card:   rgba(1, 10, 45, 0.70);
  --surface-raised: rgba(255, 255, 255, 0.06);
  --surface-hover:  rgba(255, 255, 255, 0.10);

  /* Borders */
  --border-subtle:  rgba(255, 255, 255, 0.09);
  --border-accent:  rgba(73, 171, 235, 0.28);
}

/* ─── Reset & Base ──────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  /* Strukturierter Hintergrund mit Tiefe */
  background:
    radial-gradient(ellipse 80% 60% at 50% -10%, rgba(13,33,160,0.55) 0%, transparent 70%),
    radial-gradient(ellipse 50% 40% at 90% 80%,  rgba(73,171,235,0.12) 0%, transparent 60%),
    linear-gradient(160deg, #010e30 0%, #011749 45%, #010d28 100%);
  min-height: 100vh;
  color: var(--text-primary);
  overflow-x: hidden;
}

/* ─── Cursor ────────────────────────────────────────────── */
*, *::before, *::after { cursor: default; user-select: none; }
input, textarea { cursor: text !important; user-select: text !important; }
button, .btn, .team-btn, .kick-btn, [onclick] { cursor: pointer !important; }

/* ─── Logo-Bar ──────────────────────────────────────────── */
.logo-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px 28px;
  background: rgba(0, 0, 0, 0.35);
  /* Subtile leuchtende Unterlinie */
  border-bottom: 1px solid transparent;
  box-shadow: 0 1px 0 rgba(255,255,255,0.08);
  position: relative;
  z-index: 10;
}

.logo { height: 42px; object-fit: contain; }

/* ─── Collaboration Logo Strip ──────────────────────────── */
.collab-logos {
  display: flex;
  align-items: center;
  gap: 16px;
}
.collab-logo-cc {
  height: 46px;
  border-radius: 10px;
  object-fit: contain;
  display: block;
}
.collab-logo-gd {
  height: 46px;
  border-radius: 10px;
  object-fit: contain;
  display: block;
}
.collab-x {
  font-size: 1.5rem;
  font-weight: 200;
  color: rgba(250,250,255,0.35);
  line-height: 1;
  user-select: none;
  letter-spacing: 0;
}

/* ─── Lobby: Logos groß in der Mitte ────────────────────── */
.lobby-center-logos {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
  padding: 12px 0 32px;
}
.lobby-center-logos .collab-logo-cc {
  height: 88px;
  border-radius: 14px;
  object-fit: contain;
}
.lobby-center-logos .collab-logo-gd {
  height: 88px;
  border-radius: 14px;
  object-fit: contain;
}
.lobby-center-logos .collab-x {
  font-size: 2.8rem;
  color: rgba(250,250,255,0.30);
}

/* Header-Logos ausblenden wenn Lobby aktiv */
body.in-lobby .logo-bar .collab-logos {
  opacity: 0;
  pointer-events: none;
}

/* ─── Screen-System ─────────────────────────────────────── */
.screen { display: none; }
.screen.active {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 71px);
  padding: 28px 16px;
  gap: 0;
}

/* ─── Card ──────────────────────────────────────────────── */
.card {
  background: var(--surface-card);
  /* Leuchtender oberer Rand als Akzent */
  border: 1px solid var(--border-subtle);
  box-shadow:
    inset 0 1px 0 rgba(73,171,235,0.35);
  border-radius: 22px;
  padding: 36px 32px;
  width: 100%;
  max-width: 460px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

/* ─── Typografie ────────────────────────────────────────── */
h1 {
  font-size: clamp(1.7rem, 5vw, 2.5rem);
  font-weight: 800;
  text-align: center;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}
h2 {
  font-size: 1.45rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 28px;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}
h3 {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 14px;
}

/* ─── Formular ──────────────────────────────────────────── */
.form-group { margin-bottom: 22px; }

label {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  /* Weißlich statt Blau → kein Blau-auf-Blau-Problem */
  color: var(--text-muted);
  margin-bottom: 9px;
}

input[type="text"], input[type="password"] {
  width: 100%;
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.06);
  border: 1.5px solid var(--border-subtle);
  border-radius: 12px;
  color: var(--text-primary);
  font-size: 1rem;
  font-family: inherit;
  font-weight: 500;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  outline: none;
}
input[type="text"]:focus, input[type="password"]:focus {
  border-color: rgba(73, 171, 235, 0.6);
  background: rgba(255, 255, 255, 0.09);
  box-shadow: 0 0 0 3px rgba(73, 171, 235, 0.12);
}
input[type="text"]::placeholder, input[type="password"]::placeholder { color: var(--text-muted); }

/* ─── Team-Auswahl ──────────────────────────────────────── */
.team-select { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.team-btn {
  padding: 20px 14px;
  border: 2px solid transparent;
  border-radius: 14px;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 700;
  font-family: inherit;
  transition: transform 0.18s, box-shadow 0.18s, background 0.18s;
  text-align: center;
  color: var(--text-primary);
  line-height: 1.3;
}
.team-btn.team1 {
  background: rgba(73, 171, 235, 0.10);
  border-color: rgba(73, 171, 235, 0.40);
}
.team-btn.team2 {
  background: rgba(241, 41, 56, 0.10);
  border-color: rgba(241, 41, 56, 0.40);
}
.team-btn:hover { transform: translateY(-1px); }
.team-btn.team1:hover { box-shadow: 0 4px 10px rgba(73,171,235,0.15); }
.team-btn.team2:hover { box-shadow: 0 4px 10px rgba(241,41,56,0.15); }

/* Ausgewählt: volle Farbe, weißer Text */
.team-btn.selected.team1 {
  background: var(--team1);
  border-color: var(--team1);
  color: #fff;
  box-shadow: 0 3px 10px rgba(73,171,235,0.20);
}
.team-btn.selected.team2 {
  background: var(--team2);
  border-color: var(--team2);
  color: #fff;
  box-shadow: 0 3px 10px rgba(241,41,56,0.20);
}

/* ─── Buttons ───────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 15px 20px;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: transform 0.18s, box-shadow 0.18s, filter 0.18s;
  letter-spacing: 0.01em;
}
.btn:active { transform: scale(0.97) !important; }

/* Primär: kräftiges Blau mit weißem Text */
.btn-primary {
  background: linear-gradient(135deg, #3EA0E0, #2580C0);
  color: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}
.btn-primary:hover:not(:disabled) {
  filter: brightness(1.07);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.30);
}
.btn-primary:disabled { opacity: 0.38; cursor: not-allowed; }

/* Erfolg: Circuit Green */
.btn-success {
  background: linear-gradient(135deg, #54C664, #3CAF4E);
  color: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}
.btn-success:hover {
  filter: brightness(1.07);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.30);
}

/* Ghost: klarer weißer Rand, weißer Text – kein Blau */
.btn-ghost {
  background: rgba(255, 255, 255, 0.07);
  border: 1.5px solid rgba(255, 255, 255, 0.2);
  color: var(--text-secondary);
}
.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.35);
  color: var(--text-primary);
}

/* ─── Fehlermeldung ─────────────────────────────────────── */
.error-msg {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: #ff6b7a;
  font-size: 0.88rem;
  font-weight: 500;
  text-align: center;
  margin-top: 12px;
  min-height: 22px;
}

/* ─── Timer & Fortschrittsbalken ────────────────────────── */
.progress-bar-wrap {
  width: 100%;
  height: 10px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 5px;
  overflow: hidden;
  margin-bottom: 6px;
}
.progress-bar {
  height: 100%;
  background: var(--circuit-green);
  border-radius: 5px;
  transition: width 0.3s linear, background 0.6s ease;
  box-shadow: none;
}

.timer-display {
  font-size: 3.8rem;
  font-weight: 900;
  text-align: center;
  color: var(--voltage-yellow);
  line-height: 1;
  letter-spacing: -0.02em;
  text-shadow: none;
  transition: color 0.3s;
}
.timer-display.urgent {
  color: var(--united-red);
  text-shadow: none;
  animation: pulse-scale 0.5s infinite;
}
@keyframes pulse-scale {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.1); }
}

/* ─── Antwort-Buttons (Spieler) ─────────────────────────── */
.answers-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  width: 100%;
  max-width: 560px;
}
.answers-grid.two-answers {
  grid-template-columns: 1fr;
  max-width: 400px;
}

.answer-btn {
  padding: 20px 16px;
  border: none;
  border-radius: 14px;
  font-size: 1.05rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  text-align: left;
  min-height: 78px;
  transition: transform 0.15s, filter 0.2s;
  position: relative;
  overflow: hidden;
  /* Tiefe durch Innen-Highlight */
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.18), 0 2px 6px rgba(0,0,0,0.20);
}
/* Subtiler Glanz oben */
.answer-btn::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 50%;
  background: linear-gradient(to bottom, rgba(255,255,255,0.12), transparent);
  border-radius: 14px 14px 0 0;
  pointer-events: none;
}

.answer-btn.answer-0 { background: var(--answer-0); }
.answer-btn.answer-1 { background: var(--answer-1); }
.answer-btn.answer-2 { background: var(--answer-2); }
.answer-btn.answer-3 { background: var(--answer-3); }

.answer-btn:hover:not(:disabled) {
  transform: scale(1.03) translateY(-1px);
  filter: brightness(1.12);
}
.answer-btn:disabled { cursor: default; }

.answer-btn .shape-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
  width: 30px;
  text-align: center;
  opacity: 0.9;
}

.answer-btn.selected {
  outline: 3px solid rgba(255,255,255,0.8);
  outline-offset: 2px;
  filter: brightness(0.85);
  transform: scale(0.98);
}
.answer-btn.dimmed {
  filter: brightness(0.35) saturate(0.3);
  opacity: 0.6;
}

/* ─── Fragetext (Spieler) ───────────────────────────────── */
.question-box {
  text-align: center;
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.55;
  padding: 18px 22px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
  border-radius: 14px;
  margin-bottom: 20px;
  width: 100%;
  max-width: 560px;
  color: var(--text-primary);
}

/* ─── Fragen-Bild ───────────────────────────────────────── */
.question-image-wrap {
  display: none;
  width: 100%;
  max-width: 560px;
  text-align: center;
  margin-bottom: 4px;
}
.question-image-wrap img {
  max-height: 180px;
  max-width: 100%;
  border-radius: 12px;
  object-fit: contain;
}

/* ─── Mute-Button ───────────────────────────────────────── */
.mute-btn {
  position: fixed;
  bottom: 18px;
  left: 18px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(0,0,0,0.55);
  color: rgba(255,255,255,0.80);
  font-size: 1.15rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 200;
  backdrop-filter: blur(8px);
  transition: background 0.15s, color 0.15s;
}
.mute-btn:hover { background: rgba(0,0,0,0.75); color: #fff; }

.q-counter {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  /* Weißlich statt Blau */
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 10px;
}

/* ─── Feedback-Screen ───────────────────────────────────── */
.feedback-icon { font-size: 5rem; text-align: center; margin-bottom: 10px; }

.feedback-label {
  font-size: 1.9rem;
  font-weight: 800;
  text-align: center;
  letter-spacing: -0.02em;
}
.feedback-label.correct { color: #6FDA80; }
.feedback-label.wrong   { color: #FF6B7A; }

.points-big {
  font-size: 3rem;
  font-weight: 900;
  text-align: center;
  margin: 18px 0 6px;
  letter-spacing: -0.03em;
}
.feedback-total {
  font-size: 0.95rem;
  text-align: center;
  color: var(--text-secondary);
}
.feedback-hint {
  font-size: 0.88rem;
  text-align: center;
  color: var(--text-muted);
  margin-top: 10px;
  padding: 8px 14px;
  background: rgba(255,255,255,0.05);
  border-radius: 8px;
}

/* ─── Lade-Animation (Dots) ─────────────────────────────── */
.dot-loader {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin: 22px 0 10px;
}
.dot {
  width: 10px; height: 10px;
  background: rgba(73, 171, 235, 0.6);
  border-radius: 50%;
  animation: bounce 1.3s infinite ease-in-out;
}
.dot:nth-child(2) { animation-delay: 0.18s; }
.dot:nth-child(3) { animation-delay: 0.36s; }
@keyframes bounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.6; }
  40%           { transform: translateY(-16px); opacity: 1; }
}

/* ─── Team-Badge ────────────────────────────────────────── */
.team-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 11px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}
/* Weißer Text auf farbigem Hintergrund – kein Blau-auf-Blau */
.team-badge.team1 { background: rgba(73,171,235,0.25); color: #fff; border: 1px solid rgba(73,171,235,0.5); }
.team-badge.team2 { background: rgba(241,41,56,0.25);  color: #fff; border: 1px solid rgba(241,41,56,0.5); }

/* ─── Leaderboard ───────────────────────────────────────── */
.team-scores {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 18px;
  width: 100%;
  max-width: 560px;
}
.team-score-card {
  padding: 20px 16px;
  border-radius: 18px;
  text-align: center;
  transition: box-shadow 0.4s;
  position: relative;
  overflow: hidden;
}
/* Highlight-Schimmer oben */
.team-score-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  border-radius: 2px 2px 0 0;
}
.team-score-card.team1 {
  background: rgba(73,171,235,0.12);
  border: 1px solid rgba(73,171,235,0.35);
}
.team-score-card.team1::before { background: var(--team1); }
.team-score-card.team2 {
  background: rgba(241,41,56,0.12);
  border: 1px solid rgba(241,41,56,0.35);
}
.team-score-card.team2::before { background: var(--team2); }

.team-score-card .team-label { font-size: 0.82rem; color: var(--text-muted); margin-bottom: 8px; font-weight: 600; }
.team-score-card .score-num  { font-size: 2.6rem; font-weight: 900; color: var(--text-primary); letter-spacing: -0.03em; line-height: 1; }
.team-score-card .score-sub  { font-size: 0.7rem; color: var(--text-muted); margin-top: 4px; }

.team-score-card.team1.winner { box-shadow: 0 0 0 2px rgba(73,171,235,0.50); }
.team-score-card.team2.winner { box-shadow: 0 0 0 2px rgba(241,41,56,0.50); }

.winner-banner {
  text-align: center;
  padding: 16px 22px;
  border-radius: 14px;
  font-size: 1.3rem;
  font-weight: 800;
  margin-bottom: 22px;
  width: 100%;
  max-width: 560px;
  letter-spacing: -0.01em;
}

/* Leaderboard-Zeilen */
.lb-entry {
  display: flex;
  align-items: center;
  padding: 12px 14px;
  border-radius: 12px;
  margin-bottom: 7px;
  background: var(--surface-raised);
  border: 1px solid var(--border-subtle);
  gap: 10px;
  transition: background 0.15s;
}
.lb-entry:hover { background: var(--surface-hover); }
.lb-entry.rank-1 { background: rgba(242,192,12,0.14); border-color: rgba(242,192,12,0.35); }
.lb-entry.rank-2 { background: rgba(200,205,212,0.10); border-color: rgba(200,205,212,0.25); }
.lb-entry.rank-3 { background: rgba(255,121,0,0.12);  border-color: rgba(255,121,0,0.30); }

.rank-num {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800;
  font-size: 0.85rem;
  flex-shrink: 0;
}
.lb-name  { font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-primary); }
.lb-score { font-weight: 800; font-size: 1.05rem; color: var(--voltage-yellow); margin-left: 6px; flex-shrink: 0; }

/* ─── Scrollbar ─────────────────────────────────────────── */
.scrollable { overflow-y: auto; max-height: 52vh; padding-right: 4px; }
.scrollable::-webkit-scrollbar { width: 4px; }
.scrollable::-webkit-scrollbar-track { background: transparent; }
.scrollable::-webkit-scrollbar-thumb { background: rgba(73,171,235,0.35); border-radius: 4px; }
.scrollable::-webkit-scrollbar-thumb:hover { background: rgba(73,171,235,0.55); }

/* ─── Utilities ─────────────────────────────────────────── */
.w-full  { width: 100%; }
.max-560 { max-width: 560px; width: 100%; }
.text-center { text-align: center; }
.mt-8  { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.mt-24 { margin-top: 24px; }
.mb-16 { margin-bottom: 16px; }
.mb-20 { margin-bottom: 20px; }
.text-muted { color: var(--text-muted); }

/* ─── Responsive ────────────────────────────────────────── */
@media (max-width: 480px) {
  .card { padding: 26px 20px; }
  .answers-grid { grid-template-columns: 1fr; }
  h1 { font-size: 1.5rem; }
}
