@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Nunito:wght@700;900&family=Barlow:wght@400;600&display=swap');

:root {
  --bg: #0a0a0f;
  --surface-1: #13131e;
  --surface-2: #1c1c2e;
  --surface-3: #252540;
  --accent: #F5A800;
  --accent-dim: rgba(245, 168, 0, 0.15);
  --text: #ffffff;
  --text-muted: #8888aa;
  --correct: #2ecc71;
  --correct-dim: rgba(46, 204, 113, 0.15);
  --wrong: #e74c3c;
  --wrong-dim: rgba(231, 76, 60, 0.15);
  --freeze: #4fc3f7;
  --freeze-dim: rgba(79, 195, 247, 0.15);
  --gold: #FFD700;
  --silver: #C0C0C0;
  --bronze: #CD7F32;
  --font-title: 'Nunito', sans-serif;
  --font-body: 'Barlow', sans-serif;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
}

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

html { font-size: 16px; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-weight: 400;
  min-height: 100vh;
  overflow-x: hidden;
}

#stars-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

#app {
  position: relative;
  z-index: 1;
  min-height: 100vh;
}

/* ——— Screens ——— */
.screen { display: none; min-height: 100vh; flex-direction: column; }
.screen.active { display: flex; }

/* ——— Loading ——— */
#screen-loading {
  align-items: center;
  justify-content: center;
  gap: 20px;
}

.spinner {
  width: 48px; height: 48px;
  border: 4px solid var(--surface-3);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loading-text {
  font-family: var(--font-title);
  font-size: 1.2rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

/* ——— Welcome ——— */
#screen-welcome {
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
  gap: 32px;
}

.welcome-logo { max-width: 200px; filter: drop-shadow(0 0 24px rgba(245,168,0,0.4)); }

.welcome-title {
  font-family: var(--font-title);
  font-size: 2rem;
  font-weight: 900;
  color: var(--accent);
  text-shadow: 0 0 40px rgba(245,168,0,0.3);
}

.welcome-subtitle {
  font-size: 1rem;
  color: var(--text-muted);
  line-height: 1.6;
  max-width: 320px;
}

.btn-twitch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: #9146FF;
  color: white;
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 1rem;
  padding: 14px 28px;
  border-radius: 50px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 4px 20px rgba(145, 70, 255, 0.4);
}

.btn-twitch:hover { transform: translateY(-2px); box-shadow: 0 6px 28px rgba(145, 70, 255, 0.5); }
.btn-twitch:active { transform: translateY(0); }

.btn-twitch svg { width: 22px; height: 22px; fill: white; }

/* ——— Main screen (viewer) ——— */
#screen-main { background: transparent; }

.header {
  background: rgba(19, 19, 30, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(245,168,0,0.15);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-logo { height: 36px; }

.header-spacer { flex: 1; }

.user-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  object-fit: cover;
}

.user-name {
  font-family: var(--font-title);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text);
  max-width: 90px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.score-chips {
  display: flex;
  gap: 6px;
}

.score-chip {
  background: var(--surface-2);
  border-radius: 20px;
  padding: 4px 10px;
  font-family: var(--font-title);
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.score-chip.manche { color: var(--accent); border: 1px solid rgba(245,168,0,0.3); }
.score-chip.season { color: var(--text-muted); }
.score-chip .chip-label { font-weight: 400; color: var(--text-muted); font-size: 0.65rem; }

.btn-logout {
  background: none;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.75rem;
  padding: 5px 9px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.btn-logout:hover { border-color: var(--wrong); color: var(--wrong); }

.btn-home {
  background: none;
  border: 1px solid rgba(245,168,0,0.25);
  border-radius: var(--radius-sm);
  color: var(--accent);
  font-size: 0.75rem;
  padding: 5px 9px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.btn-home:hover { border-color: var(--accent); background: var(--accent-dim); }

/* ——— Main content area ——— */
.main-content {
  flex: 1;
  padding: 20px 16px 40px;
  max-width: 640px;
  margin: 0 auto;
  width: 100%;
}

/* ——— Waiting screen ——— */
.waiting-card {
  background: var(--surface-1);
  border-radius: var(--radius);
  padding: 40px 24px;
  text-align: center;
  margin-top: 24px;
  border: 1px solid rgba(245,168,0,0.1);
  box-shadow: var(--shadow);
}

.waiting-emoji { font-size: 3rem; margin-bottom: 16px; }
.waiting-title {
  font-family: var(--font-title);
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--accent);
  margin-bottom: 8px;
}
.waiting-subtitle { color: var(--text-muted); line-height: 1.6; }

/* ——— Question card ——— */
.question-card {
  background: var(--surface-1);
  border-radius: var(--radius);
  border: 1px solid rgba(255,255,255,0.06);
  box-shadow: var(--shadow);
  overflow: hidden;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.question-meta {
  padding: 12px 20px;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.question-theme {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.question-progress {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* Progress dots */
.progress-dots {
  display: flex;
  gap: 6px;
  padding: 12px 20px 0;
  flex-wrap: wrap;
}

.progress-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--surface-3);
  transition: background 0.2s;
  cursor: default;
}

.progress-dot.answered { background: var(--accent); }
.progress-dot.current { background: var(--accent); box-shadow: 0 0 8px var(--accent); }
.progress-dot.presenter-clickable { cursor: pointer; }
.progress-dot.presenter-clickable:hover { transform: scale(1.3); }

/* Visual question image */
.question-visual {
  padding: 20px 20px 0;
}

.question-visual img {
  width: 100%;
  border-radius: var(--radius-sm);
  max-height: 240px;
  object-fit: cover;
  display: block;
}

.question-text {
  padding: 20px 20px 16px;
  font-family: var(--font-title);
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.4;
}

/* ——— Options grid ——— */
.options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 0 20px 20px;
}

.option-btn {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--surface-2);
  border: 2px solid rgba(255,255,255,0.06);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  cursor: pointer;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.3;
  text-align: left;
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
  min-height: 60px;
}

.option-btn:not(:disabled):hover {
  border-color: var(--accent);
  background: var(--accent-dim);
  transform: scale(1.02);
}

.option-btn:active:not(:disabled) { transform: scale(0.98); }

.option-btn:disabled { cursor: default; }

.option-label {
  font-family: var(--font-title);
  font-weight: 900;
  font-size: 1rem;
  color: var(--accent);
  min-width: 18px;
  flex-shrink: 0;
}

.option-btn.selected {
  border-color: var(--accent);
  background: var(--accent-dim);
}

.option-btn.correct {
  border-color: var(--correct);
  background: var(--correct-dim);
}

.option-btn.correct .option-label { color: var(--correct); }

.option-btn.wrong {
  border-color: var(--wrong);
  background: var(--wrong-dim);
  opacity: 0.7;
}

.option-btn.wrong .option-label { color: var(--wrong); }

.option-btn.correct-unselected {
  border-color: var(--correct);
  background: var(--correct-dim);
}

.option-btn.correct-unselected .option-label { color: var(--correct); }

/* ——— Free-text question type ——— */
.question-visual-portrait img {
  width: auto;
  max-width: 100%;
  max-height: 320px;
  object-fit: contain;
  border-radius: var(--radius-sm);
  display: block;
  margin: 0 auto;
}

.free-text-input-wrap {
  display: flex;
  gap: 8px;
  padding: 0 20px 20px;
}

.free-text-input {
  flex: 1;
  background: var(--surface-2);
  border: 2px solid rgba(255,255,255,0.10);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 12px 14px;
  outline: none;
  transition: border-color 0.15s;
}

.free-text-input:focus {
  border-color: var(--accent);
}

.free-text-input:disabled {
  opacity: 0.5;
  cursor: default;
}

.free-text-submit {
  background: var(--accent);
  color: #000;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 0.95rem;
  padding: 12px 18px;
  cursor: pointer;
  transition: opacity 0.15s;
  white-space: nowrap;
}

.free-text-submit:disabled {
  opacity: 0.4;
  cursor: default;
}

.free-text-result {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0 20px 20px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.95rem;
}

.free-text-result.correct {
  background: var(--correct-dim);
  border: 2px solid var(--correct);
  color: var(--correct);
}

.free-text-result.wrong {
  background: var(--wrong-dim);
  border: 2px solid var(--wrong);
  color: var(--wrong);
}

.free-text-result.no-answer {
  background: var(--surface-2);
  border: 2px solid rgba(255,255,255,0.1);
  color: var(--text-muted);
}

.free-text-typed {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 0.85rem;
  opacity: 0.85;
}

.free-text-expected {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Answer pending feedback */
.answer-feedback {
  margin: 0 20px 16px;
  padding: 10px 14px;
  background: var(--accent-dim);
  border: 1px solid rgba(245,168,0,0.3);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--accent);
  text-align: center;
}

/* ——— Freeze button ——— */
.freeze-section {
  padding: 0 20px 20px;
}

.btn-freeze {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--freeze-dim);
  border: 2px solid var(--freeze);
  border-radius: var(--radius-sm);
  color: var(--freeze);
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 0.9rem;
  padding: 10px;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}

.btn-freeze:hover { background: rgba(79, 195, 247, 0.25); transform: scale(1.02); }
.btn-freeze:disabled { opacity: 0.4; cursor: default; transform: none; }

/* Frozen overlay */
.frozen-overlay {
  position: absolute;
  inset: 0;
  background: rgba(79, 195, 247, 0.12);
  border-radius: var(--radius);
  border: 2px solid var(--freeze);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  backdrop-filter: blur(2px);
  z-index: 10;
}

.frozen-icon { font-size: 3rem; }
.frozen-text {
  font-family: var(--font-title);
  font-weight: 900;
  font-size: 1.2rem;
  color: var(--freeze);
  text-align: center;
}
.frozen-countdown {
  font-family: var(--font-title);
  font-size: 2rem;
  font-weight: 900;
  color: var(--freeze);
}

.question-card-wrap { position: relative; }

/* ——— Standings ——— */
.standings-header {
  text-align: center;
  padding: 24px 0 8px;
}

.standings-title {
  font-family: var(--font-title);
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--accent);
}

.standings-subtitle {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Podium */
.podium {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 8px;
  padding: 24px 0 16px;
}

.podium-place {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  flex: 1;
  max-width: 160px;
}

.podium-place.first { order: 2; }
.podium-place.second { order: 1; }
.podium-place.third { order: 3; }

.podium-avatar {
  width: 56px; height: 56px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid transparent;
}

.podium-place.first .podium-avatar { border-color: var(--gold); width: 68px; height: 68px; }
.podium-place.second .podium-avatar { border-color: var(--silver); }
.podium-place.third .podium-avatar { border-color: var(--bronze); }

.podium-name {
  font-family: var(--font-title);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text);
  text-align: center;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.podium-pts {
  font-family: var(--font-title);
  font-weight: 900;
  font-size: 1.1rem;
  color: var(--accent);
}

.podium-place.first .podium-pts { font-size: 1.4rem; }

.podium-block {
  width: 100%;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-title);
  font-size: 1.2rem;
  font-weight: 900;
}

.podium-place.first .podium-block { height: 80px; background: linear-gradient(135deg, #B8860B, var(--gold)); }
.podium-place.second .podium-block { height: 60px; background: linear-gradient(135deg, #808080, var(--silver)); }
.podium-place.third .podium-block { height: 44px; background: linear-gradient(135deg, #8B4513, var(--bronze)); }

/* Standings list */
.standings-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px 0;
}

.standings-entry {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface-1);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  border: 1px solid rgba(255,255,255,0.04);
}

.standings-rank {
  font-family: var(--font-title);
  font-weight: 900;
  font-size: 1rem;
  color: var(--text-muted);
  min-width: 24px;
  text-align: center;
}

.standings-rank.top1 { color: var(--gold); }
.standings-rank.top2 { color: var(--silver); }
.standings-rank.top3 { color: var(--bronze); }

.standings-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.standings-name {
  flex: 1;
  font-weight: 600;
  font-size: 0.9rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.standings-name.is-me { color: var(--accent); }

.standings-points {
  font-family: var(--font-title);
  font-weight: 900;
  font-size: 1rem;
  color: var(--accent);
  white-space: nowrap;
}

.standings-detail {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
}

/* ——— Freeze picker modal ——— */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
  animation: fadeIn 0.15s ease;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal-sheet {
  background: var(--surface-1);
  border-radius: var(--radius) var(--radius) 0 0;
  width: 100%;
  max-width: 480px;
  max-height: 70vh;
  overflow-y: auto;
  padding: 24px 16px 32px;
  animation: slideSheet 0.2s ease;
}

@keyframes slideSheet {
  from { transform: translateY(40px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.modal-title {
  font-family: var(--font-title);
  font-size: 1.1rem;
  font-weight: 900;
  color: var(--freeze);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-desc {
  font-size: 0.825rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.freeze-targets { display: flex; flex-direction: column; gap: 8px; }

.freeze-target-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface-2);
  border: 2px solid rgba(255,255,255,0.06);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  cursor: pointer;
  color: var(--text);
  transition: border-color 0.15s, background 0.15s;
  width: 100%;
  text-align: left;
}

.freeze-target-btn:hover {
  border-color: var(--freeze);
  background: var(--freeze-dim);
}

.freeze-target-avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.freeze-target-name { flex: 1; font-weight: 600; font-size: 0.9rem; }
.freeze-target-pts { font-family: var(--font-title); font-weight: 900; color: var(--accent); font-size: 0.9rem; }
.freeze-target-frozen { font-size: 0.75rem; color: var(--freeze); }

.btn-modal-cancel {
  width: 100%;
  margin-top: 12px;
  background: none;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.875rem;
  padding: 10px;
  cursor: pointer;
}

.btn-modal-cancel:hover { border-color: var(--wrong); color: var(--wrong); }

/* ——— Presenter screen ——— */
#screen-presenter {
  background: transparent;
  height: 100vh;
  overflow: hidden;
}

.presenter-header {
  background: rgba(19,19,30,0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 2px solid var(--accent);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
  z-index: 100;
}

.presenter-badge {
  background: var(--accent);
  color: #000;
  font-family: var(--font-title);
  font-weight: 900;
  font-size: 0.7rem;
  padding: 3px 10px;
  border-radius: 20px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.presenter-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  padding: 20px 16px 40px;
  max-width: 900px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
}

@media (min-width: 700px) {
  .presenter-body {
    grid-template-columns: 1fr 340px;
  }
}

.presenter-panel {
  background: var(--surface-1);
  border-radius: var(--radius);
  border: 1px solid rgba(255,255,255,0.06);
  padding: 20px;
}

.presenter-panel-title {
  font-family: var(--font-title);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 16px;
  border-bottom: 1px solid rgba(245,168,0,0.2);
  padding-bottom: 8px;
}

/* Emission selector */
.emission-selector {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.emission-option {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface-2);
  border: 2px solid rgba(255,255,255,0.06);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  cursor: pointer;
  color: var(--text);
  transition: border-color 0.15s;
  width: 100%;
  text-align: left;
}

.emission-option:hover { border-color: var(--accent); }
.emission-option.active { border-color: var(--accent); background: var(--accent-dim); }

.emission-emoji { font-size: 1.3rem; }
.emission-info .emission-label { font-weight: 700; font-size: 0.95rem; }
.emission-info .emission-date { font-size: 0.775rem; color: var(--text-muted); margin-top: 2px; }

/* Status badge */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 700;
  font-family: var(--font-title);
  margin-bottom: 12px;
}

.status-badge.waiting { background: rgba(136,136,170,0.15); color: var(--text-muted); }
.status-badge.active { background: rgba(46,204,113,0.15); color: var(--correct); }
.status-badge.revealed { background: rgba(245,168,0,0.15); color: var(--accent); }
.status-badge.closed { background: rgba(231,76,60,0.15); color: var(--wrong); }
.status-badge.between { background: rgba(79,195,247,0.15); color: var(--freeze); }
.status-badge-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

.status-badge.active .status-badge-dot { animation: blink 1s ease-in-out infinite; }

/* Presenter controls */
.control-buttons {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}

.btn-control {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  border: none;
  transition: transform 0.1s, opacity 0.15s;
}

.btn-control:active { transform: scale(0.98); }
.btn-control:disabled { opacity: 0.4; cursor: default; }

.btn-control.primary { background: var(--accent); color: #000; }
.btn-control.secondary { background: var(--surface-2); color: var(--text); border: 1px solid rgba(255,255,255,0.1); }
.btn-control.danger { background: rgba(231,76,60,0.15); color: var(--wrong); border: 1px solid rgba(231,76,60,0.3); }
.btn-control.discord { background: rgba(88,101,242,0.15); color: #5865F2; border: 1px solid rgba(88,101,242,0.3); }

/* Answer counts */
.answer-counts { display: flex; flex-direction: column; gap: 6px; }

.answer-count-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  border: 2px solid transparent;
  transition: border-color 0.15s;
}

.answer-count-row.is-correct { border-color: var(--correct); background: var(--correct-dim); }

.answer-count-label {
  font-family: var(--font-title);
  font-weight: 900;
  font-size: 0.9rem;
  color: var(--accent);
  min-width: 18px;
}

.answer-count-text {
  flex: 1;
  font-size: 0.825rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.answer-count-num {
  font-family: var(--font-title);
  font-weight: 900;
  font-size: 1rem;
  color: var(--accent);
  min-width: 28px;
  text-align: right;
}

.answer-count-bar {
  height: 4px;
  background: var(--surface-3);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 2px;
}

.answer-count-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.3s ease;
}

/* Freeze log */
.freeze-log { display: flex; flex-direction: column; gap: 6px; }
.freeze-log-empty { font-size: 0.825rem; color: var(--text-muted); text-align: center; padding: 8px; }

.freeze-log-entry {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.825rem;
  padding: 6px 10px;
  background: var(--freeze-dim);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(79,195,247,0.2);
}

.freeze-log-entry .freezer { color: var(--freeze); font-weight: 600; }
.freeze-log-entry .target { color: var(--text); font-weight: 600; }

/* ——— General buttons ——— */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent);
  color: #000;
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 1rem;
  padding: 14px 32px;
  border-radius: 50px;
  border: none;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 4px 20px rgba(245,168,0,0.3);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 28px rgba(245,168,0,0.4); }
.btn-primary:active { transform: translateY(0); }

/* ——— Error toast ——— */
#toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--surface-2);
  color: var(--text);
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  box-shadow: var(--shadow);
  z-index: 300;
  transition: transform 0.25s ease;
  border: 1px solid rgba(255,255,255,0.1);
  text-align: center;
  max-width: 320px;
}
#toast.show { transform: translateX(-50%) translateY(0); }
#toast.error { border-color: var(--wrong); color: var(--wrong); }

/* ——— Responsive ——— */
@media (min-width: 480px) {
  .main-content { padding: 24px 24px 48px; }
  .welcome-title { font-size: 2.4rem; }
  .options-grid { gap: 12px; }
  .option-btn { padding: 14px 16px; }
}

@media (min-width: 768px) {
  .header { padding: 14px 24px; }
  .header-logo { height: 42px; }
  .user-name { max-width: 140px; }
  .score-chip { font-size: 0.8rem; padding: 5px 12px; }
  .question-text { font-size: 1.25rem; }
}

/* ——— Lobby screen ——— */
#screen-lobby { background: transparent; }

.lobby-content {
  flex: 1;
  padding: 20px 16px 60px;
  max-width: 480px;
  margin: 0 auto;
  width: 100%;
}

.lobby-section-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--text-muted);
  text-transform: uppercase;
  margin: 28px 0 12px;
}

.lobby-emission-banner {
  background: linear-gradient(135deg, rgba(245,168,0,0.12), rgba(245,168,0,0.04));
  border: 1px solid rgba(245,168,0,0.3);
  border-radius: 16px;
  padding: 20px;
  position: relative;
  overflow: hidden;
  margin-top: 8px;
}

.lobby-emission-banner::after {
  content: '';
  position: absolute;
  top: -30px; right: -30px;
  width: 120px; height: 120px;
  background: radial-gradient(circle, rgba(245,168,0,0.12), transparent 70%);
  pointer-events: none;
}

.lobby-emission-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 8px;
}

.lobby-emission-title {
  font-family: 'Bebas Neue', var(--font-title);
  font-size: 26px;
  letter-spacing: 1px;
  line-height: 1.1;
  margin-bottom: 6px;
}

.lobby-emission-date {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.lobby-emission-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
}

.lobby-status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
  animation: blink 2s ease-in-out infinite;
}

.lobby-manche-card {
  background: var(--surface-2);
  border: 1px solid rgba(245,168,0,0.15);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.lobby-manche-emoji { font-size: 32px; flex-shrink: 0; }
.lobby-manche-info { flex: 1; min-width: 0; }
.lobby-manche-name { font-weight: 700; font-size: 15px; }
.lobby-manche-sub { font-size: 12px; color: var(--text-muted); margin-top: 3px; }

.lobby-manche-badge {
  background: var(--accent-dim);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 4px 10px;
  border-radius: 999px;
  text-transform: uppercase;
  flex-shrink: 0;
  white-space: nowrap;
}

.lobby-connected-count {
  background: var(--surface-1);
  border: 1px solid rgba(245,168,0,0.1);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.lobby-count-label { font-size: 13px; color: var(--text-muted); }

.lobby-count-num {
  font-family: 'Bebas Neue', var(--font-title);
  font-size: 28px;
  color: var(--correct);
}

.lobby-connected-grid { display: flex; flex-wrap: wrap; gap: 8px; }

.lobby-connected-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-1);
  border: 1px solid rgba(245,168,0,0.1);
  border-radius: 999px;
  padding: 6px 12px 6px 8px;
  font-size: 13px;
  font-weight: 500;
}

.lobby-chip-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--correct);
  flex-shrink: 0;
}

.lobby-chip-more { color: var(--text-muted); background: transparent; border-style: dashed; }

.lobby-leaderboard {
  background: var(--surface-1);
  border: 1px solid rgba(245,168,0,0.1);
  border-radius: var(--radius);
  overflow: hidden;
}

.lobby-leaderboard-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  transition: background 0.15s;
}

.lobby-leaderboard-row:last-child { border-bottom: none; }
.lobby-leaderboard-row:hover { background: rgba(255,255,255,0.02); }

.lobby-rank {
  font-family: 'Bebas Neue', var(--font-title);
  font-size: 20px;
  width: 28px;
  text-align: center;
  flex-shrink: 0;
}

.lobby-rank-1 { color: var(--gold); }
.lobby-rank-2 { color: var(--silver); }
.lobby-rank-3 { color: var(--bronze); }
.lobby-rank-other { color: var(--text-muted); font-size: 14px; font-family: var(--font-body); }

.lobby-player-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.lobby-player-info { flex: 1; min-width: 0; }

.lobby-player-name {
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lobby-player-name.is-me { color: var(--accent); }
.lobby-player-sub { font-size: 11px; color: var(--text-muted); margin-top: 1px; }

.lobby-player-score {
  font-family: 'Bebas Neue', var(--font-title);
  font-size: 20px;
  color: var(--accent);
  flex-shrink: 0;
}

.lobby-btn-see-all {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 0;
  opacity: 0.8;
  transition: opacity 0.15s;
}

.lobby-btn-see-all:hover { opacity: 1; }

.lobby-admin-section {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid rgba(245,168,0,0.15);
}

/* ——— Carousel admin ——— */
.lobby-manche-card-carousel {
  cursor: pointer;
  padding: 12px 4px;
  user-select: none;
}

.lobby-manche-card-carousel:active { background: rgba(255,255,255,0.04); }

.lobby-manche-nav {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
  padding: 6px 12px;
  flex-shrink: 0;
  opacity: 0.6;
  transition: opacity 0.15s;
}

.lobby-manche-nav:hover { opacity: 1; }

.lobby-manche-center {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.lobby-carousel-dots {
  display: flex;
  justify-content: center;
  gap: 7px;
  margin-top: 10px;
}

.lobby-carousel-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: background 0.15s, transform 0.15s;
}

.lobby-carousel-dot.active {
  background: var(--accent);
  transform: scale(1.4);
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* ——— Lobby rules ——— */
.lobby-rules-card {
  background: var(--surface-1);
  border: 1px solid rgba(245,168,0,0.1);
  border-radius: var(--radius);
  overflow: hidden;
}

.lobby-rule-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 13px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  font-size: 13px;
  line-height: 1.45;
  color: var(--text);
}

.lobby-rule-item:last-child { border-bottom: none; }

.lobby-rule-icon { font-size: 15px; flex-shrink: 0; margin-top: 1px; }

/* ——— Lobby next manche ——— */
.lobby-manche-next { opacity: 0.65; }

.lobby-badge-next {
  background: rgba(136,136,170,0.12);
  color: var(--text-muted);
}
