/* Schätz-Battle — dunkles, verspieltes Design */
* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0f1120;
  --bg-card: #1a1d33;
  --bg-input: #242848;
  --text: #eef0ff;
  --text-muted: #9aa0c3;
  --accent: #ffb545;
  --accent-2: #7c6cff;
  --green: #3ddc84;
  --red: #ff5c72;
  --radius: 16px;
}

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: radial-gradient(1200px 800px at 70% -10%, #232a58 0%, var(--bg) 55%);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
}

#app {
  max-width: 560px;
  margin: 0 auto;
  padding: 24px 16px 60px;
}

.hidden { display: none !important; }

/* ---------- Hero / Topbar ---------- */

.hero { text-align: center; margin: 24px 0 28px; }
.logo { font-size: 64px; line-height: 1; margin-bottom: 8px; }
h1 {
  font-size: 2.2rem;
  font-weight: 800;
  background: linear-gradient(90deg, var(--accent), #ff7ac8, var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.tagline { color: var(--text-muted); margin-top: 8px; max-width: 420px; margin-inline: auto; }

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.brand { font-weight: 700; }
.room-chip {
  background: var(--bg-card);
  border: 1px solid #303668;
  padding: 4px 12px;
  border-radius: 99px;
  font-weight: 700;
  letter-spacing: 2px;
}

/* ---------- Cards ---------- */

.card {
  background: var(--bg-card);
  border: 1px solid #2a2f5a;
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 16px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
}
.card-slim { padding: 16px 24px; }
.card h2 { margin-bottom: 12px; }
.card h3 { margin: 16px 0 8px; }

/* ---------- Inputs & Buttons ---------- */

label { display: block; font-size: 0.9rem; color: var(--text-muted); margin-bottom: 6px; }

input[type="text"] {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid #3a4078;
  color: var(--text);
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 1.05rem;
  outline: none;
  margin-bottom: 14px;
}
input[type="text"]:focus { border-color: var(--accent-2); }

.btn {
  display: block;
  width: 100%;
  border: none;
  border-radius: 12px;
  padding: 14px 18px;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.06s ease, filter 0.15s ease;
}
.btn:active { transform: scale(0.98); }
.btn-primary {
  background: linear-gradient(90deg, var(--accent), #ff8d3a);
  color: #241500;
}
.btn-primary:hover { filter: brightness(1.08); }
.btn-secondary {
  background: var(--bg-input);
  color: var(--text);
  border: 1px solid #3a4078;
}
.btn-big { padding: 16px 18px; font-size: 1.15rem; margin-top: 12px; }

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-muted);
  margin: 18px 0;
  font-size: 0.85rem;
}
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: #2f3566; }

.join-row, .share-row { display: flex; gap: 10px; }
.join-row input, .share-row input { flex: 1; margin-bottom: 0; }
.join-row .btn, .share-row .btn { width: auto; padding-inline: 20px; }

.error { color: var(--red); margin-top: 10px; font-size: 0.95rem; }
.hint { color: var(--text-muted); font-size: 0.9rem; margin-top: 10px; text-align: center; }
.footnote { text-align: center; color: var(--text-muted); font-size: 0.85rem; }
.room-label { margin-bottom: 14px; letter-spacing: 1px; }
.room-label strong { font-size: 1.3rem; letter-spacing: 3px; color: var(--accent); }

/* ---------- Player list ---------- */

.player-list { list-style: none; }
.player-list li {
  display: flex;
  justify-content: space-between;
  padding: 10px 14px;
  border-radius: 10px;
  margin-bottom: 6px;
  background: var(--bg-input);
}
.player-list li.you { border: 1px solid var(--accent-2); }
.player-list .score { font-weight: 800; color: var(--accent); }

/* ---------- Question ---------- */

.timer {
  font-size: 1.4rem;
  font-weight: 800;
  min-width: 52px;
  text-align: center;
  background: var(--bg-card);
  border: 1px solid #303668;
  border-radius: 99px;
  padding: 2px 14px;
}
.timer.urgent { color: var(--red); border-color: var(--red); }

.timerbar {
  height: 6px;
  background: #262b52;
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: 14px;
}
#q-timerbar-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
  transition: width 0.1s linear;
}

.cat-badge {
  display: inline-block;
  background: rgba(124, 108, 255, 0.18);
  color: #b9b0ff;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 99px;
  margin-bottom: 12px;
}
.question { font-size: 1.45rem; line-height: 1.35; margin-bottom: 20px; }

.answer-row { display: flex; align-items: center; gap: 12px; }
.answer-row input { font-size: 1.4rem; text-align: center; font-weight: 700; }
.unit { color: var(--text-muted); font-size: 1.1rem; white-space: nowrap; }

.big-check { font-size: 48px; text-align: center; }
#answered-info p { text-align: center; }

/* ---------- Reveal ---------- */

.reveal-question { color: var(--text-muted); margin-bottom: 14px; }
.correct-answer {
  text-align: center;
  background: rgba(61, 220, 132, 0.1);
  border: 1px solid rgba(61, 220, 132, 0.4);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 10px;
}
.correct-label { display: block; font-size: 0.8rem; color: var(--green); text-transform: uppercase; letter-spacing: 1px; }
.correct-value { font-size: 2rem; font-weight: 800; color: var(--green); }
.note { color: var(--text-muted); font-size: 0.92rem; text-align: center; margin-bottom: 16px; }

.results-table { width: 100%; border-collapse: collapse; margin-bottom: 8px; }
.results-table td { padding: 8px 6px; border-bottom: 1px solid #2a2f5a; }
.results-table tr:last-child td { border-bottom: none; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.pts { font-weight: 800; color: var(--accent); }
.muted { color: var(--text-muted); }

/* ---------- Finished ---------- */

.podium { list-style: none; margin-bottom: 8px; }
.podium li {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg-input);
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 8px;
  font-size: 1.1rem;
}
.podium li:first-child { border: 1px solid var(--accent); font-size: 1.25rem; }
.podium li.you { outline: 1px solid var(--accent-2); }
.podium .medal { font-size: 1.5rem; min-width: 40px; }
.podium .score { margin-left: auto; font-weight: 800; color: var(--accent); }

/* ---------- Toast ---------- */

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent-2);
  color: #fff;
  font-weight: 700;
  padding: 12px 22px;
  border-radius: 99px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  z-index: 10;
}

@media (max-width: 420px) {
  h1 { font-size: 1.8rem; }
  .question { font-size: 1.25rem; }
  .card { padding: 18px; }
}
