* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #0f172a;
  color: white;
}

button, input, textarea { font: inherit; }

.app {
  width: min(520px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 18px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
}

.back-link { color: #d8b4fe; text-decoration: none; font-weight: 700; }
.status { font-size: 13px; color: #94a3b8; }

.screen { display: none; }
.screen.active { display: block; }

h1 { margin: 16px 0 8px; font-size: 52px; line-height: 1; }
h2 { margin: 24px 0 14px; font-size: 28px; }

.subtitle, .hint { color: #cbd5e1; line-height: 1.5; }

label {
  display: block;
  margin-top: 22px;
  color: #cbd5e1;
  font-weight: 700;
}

input {
  width: 100%;
  margin-top: 8px;
  padding: 16px;
  border: 1px solid #334155;
  border-radius: 16px;
  background: #020617;
  color: white;
  outline: none;
  font-size: 18px;
}

input:focus { border-color: #d8b4fe; }

button {
  width: 100%;
  margin-top: 18px;
  padding: 16px 18px;
  border: 0;
  border-radius: 16px;
  background: #7c3aed;
  color: white;
  font-weight: 800;
  font-size: 18px;
  cursor: pointer;
}

button:active { transform: scale(0.99); }
button.secondary { background: #1e293b; }
button:disabled { opacity: 0.45; cursor: default; }

.divider { margin: 26px 0 6px; text-align: center; color: #64748b; }
.error { min-height: 24px; color: #fca5a5; font-weight: 700; }

/* ROOM CODE */
.room-code-box {
  padding: 22px;
  border-radius: 22px;
  background: #1e293b;
  border: 1px solid #334155;
  text-align: center;
}
.room-code-box span { display: block; color: #94a3b8; margin-bottom: 8px; }
.room-code-box strong { font-size: 44px; letter-spacing: 0.18em; }

/* PLAYER LIST */
.player-list { list-style: none; padding: 0; margin: 0; }
.player-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid #1e293b;
}
.player-list small { color: #94a3b8; }

.kick-btn {
  width: auto;
  margin-top: 0;
  padding: 2px 10px;
  font-size: 18px;
  line-height: 1;
  background: #991b1b;
  border-radius: 6px;
  color: #fca5a5;
  cursor: pointer;
}

/* CONFIG */
.config-label { color: #cbd5e1; font-weight: 700; margin: 22px 0 10px; }
.config-btns { display: flex; gap: 8px; }
.config-btn {
  flex: 1;
  margin-top: 0;
  padding: 12px 8px;
  font-size: 16px;
  background: #1e293b;
  border: 2px solid transparent;
  border-radius: 12px;
  cursor: pointer;
}
.config-btn.active { border-color: #7c3aed; background: #3b0764; }

/* PHASE INFO */
.phase-info { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.phase-info span {
  padding: 4px 10px;
  border-radius: 20px;
  background: #1e293b;
  color: #94a3b8;
  font-size: 13px;
  font-weight: 700;
}
.phase-tag { background: #3b0764 !important; color: #d8b4fe !important; }

/* TIMER */
.timer-row { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.timer-bar-wrap {
  flex: 1;
  height: 8px;
  background: #1e293b;
  border-radius: 4px;
  overflow: hidden;
}
.timer-bar {
  height: 100%;
  background: #7c3aed;
  border-radius: 4px;
  transition: width 0.25s linear, background 0.5s;
  width: 100%;
}
.timer-bar.urgent { background: #dc2626; }
.timer-num { font-size: 22px; font-weight: 800; min-width: 32px; text-align: right; color: #d8b4fe; }
.timer-num.urgent { color: #fca5a5; }

/* QUESTION CARD */
.question-card {
  padding: 22px;
  border-radius: 20px;
  background: radial-gradient(circle at top left, #4c1d95, transparent 60%), #1e293b;
  border: 1px solid #334155;
  margin-bottom: 18px;
}
.question-text {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.4;
  margin: 0;
}
.question-text.small { font-size: 16px; margin-bottom: 14px; color: #cbd5e1; }

/* SUBMIT */
textarea {
  width: 100%;
  margin-top: 8px;
  padding: 16px;
  border: 1px solid #334155;
  border-radius: 16px;
  background: #020617;
  color: white;
  outline: none;
  font-size: 17px;
  min-height: 100px;
  resize: vertical;
}
textarea:focus { border-color: #d8b4fe; }

.submit-hint { color: #94a3b8; font-size: 14px; margin: 0 0 6px; }

.answered-count { color: #64748b; font-size: 14px; text-align: center; margin: 10px 0 0; }

/* VOTE OPTIONS */
.vote-hint { color: #cbd5e1; font-weight: 700; margin: 0 0 14px; font-size: 15px; }

.vote-options { display: flex; flex-direction: column; gap: 10px; }

.vote-btn {
  padding: 16px 20px;
  border: 2px solid #334155;
  border-radius: 16px;
  background: #1e293b;
  color: white;
  font-size: 16px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  margin-top: 0;
  width: 100%;
  transition: border-color 0.15s, background 0.15s;
  line-height: 1.4;
}
.vote-btn:hover:not(:disabled) { border-color: #7c3aed; background: #3b0764; }
.vote-btn.selected { border-color: #7c3aed; background: #3b0764; }
.vote-btn.my-answer { border-color: #334155; opacity: 0.5; cursor: default; }
.vote-btn.my-answer::after {
  content: " (deine Antwort)";
  font-size: 12px;
  color: #94a3b8;
  font-weight: 400;
}
.vote-btn:disabled { opacity: 0.5; cursor: default; }

/* REVEAL */
.real-answer-box {
  padding: 18px 20px;
  border-radius: 18px;
  background: #14532d;
  border: 2px solid #16a34a;
  margin-bottom: 18px;
}
.real-label {
  display: block;
  color: #4ade80;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
}
.real-answer-box p {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.4;
}

.reveal-list { list-style: none; padding: 0; margin: 0; }
.reveal-list li {
  padding: 12px 0;
  border-bottom: 1px solid #1e293b;
}
.reveal-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}
.reveal-author { font-weight: 800; font-size: 15px; }
.reveal-points { font-weight: 800; color: #d8b4fe; }
.reveal-answer-text { color: #cbd5e1; font-size: 15px; line-height: 1.3; }
.reveal-voters { margin-top: 5px; font-size: 13px; color: #64748b; }
.reveal-voters span { color: #f87171; }
.reveal-fooled { color: #fbbf24; font-size: 13px; margin-top: 4px; }

.reveal-actions { margin-top: 14px; }

/* AUTO ADVANCE */
.auto-advance { margin-top: 12px; height: 4px; background: #1e293b; border-radius: 2px; overflow: hidden; }
.auto-bar { height: 100%; background: #334155; border-radius: 2px; width: 100%; transition: width 0.25s linear; }

/* SCOREBOARD / RANKING */
.answer-recap {
  padding: 14px 16px;
  border-radius: 14px;
  background: #1e293b;
  border: 1px solid #334155;
  margin-bottom: 18px;
  font-size: 14px;
  color: #94a3b8;
  line-height: 1.5;
}
.answer-recap strong { color: white; }

.ranking-list { list-style: none; padding: 0; margin: 0; }
.ranking-list li {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid #1e293b;
  font-size: 18px;
}
.rank-pos { width: 36px; font-weight: 800; font-size: 22px; color: #64748b; text-align: center; }
.rank-pos.gold { color: #fbbf24; }
.rank-pos.silver { color: #94a3b8; }
.rank-pos.bronze { color: #b45309; }
.rank-name { flex: 1; font-weight: 700; }
.rank-score { font-weight: 800; color: #d8b4fe; font-size: 20px; }

/* WINNER */
.winner-box {
  padding: 28px;
  border-radius: 22px;
  background: radial-gradient(circle at top left, #4c1d95, transparent 50%), #1e293b;
  border: 1px solid #334155;
  text-align: center;
  margin-bottom: 24px;
}
.winner-label { color: #d8b4fe; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; font-size: 13px; }
.winner-name { display: block; font-size: 40px; font-weight: 800; margin-top: 10px; }
.winner-score { display: block; color: #cbd5e1; margin-top: 6px; }