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

:root {
  --bg:        #f4f7ff;
  --surface:   #ffffff;
  --surface2:  #f6f8ff;
  --surface3:  #eef2ff;
  --border:    #d7def2;
  --primary:   #5a56e8;
  --primary-h: #4b46d8;
  --secondary: #0f9f88;
  --danger:    #d94457;
  --success:   #0f9f88;
  --warning:   #b98616;
  --text:      #1d2440;
  --muted:     #647092;
  --primary-muted: rgba(90,86,232,.3);
  --ring:      0 0 0 3px rgba(90,86,232,.2);
  --header-bg: rgba(255,255,255,.9);
  --nav-active-bg: rgba(90,86,232,.14);
  --input-focus-bg: #eef2ff;
  --radius:    12px;
  --shadow:    0 10px 26px rgba(40,66,140,.12);
}

:root[data-theme="dark"] {
  --bg:        #0b0e15;
  --surface:   #171b26;
  --surface2:  #212738;
  --surface3:  #2b3349;
  --border:    #303a55;
  --primary:   #7c74ff;
  --primary-h: #928bff;
  --secondary: #00c9a7;
  --danger:    #ff5f6d;
  --success:   #00c9a7;
  --warning:   #ffc857;
  --text:      #e2e4f0;
  --muted:     #7a7f99;
  --primary-muted: rgba(124,116,255,.45);
  --ring:      0 0 0 3px rgba(124,116,255,.22);
  --header-bg: rgba(23,27,38,.88);
  --nav-active-bg: rgba(124,116,255,.14);
  --input-focus-bg: #252c41;
  --shadow:    0 10px 30px rgba(0,0,0,.35);
}

html, body {
  height: 100%;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: radial-gradient(1200px 700px at 20% -15%, #e6ecff 0%, rgba(230,236,255,0) 55%),
              radial-gradient(1000px 600px at 85% -20%, #e8f3ff 0%, rgba(232,243,255,0) 50%),
              var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ═══════════════════════════════════════ UTILITIES ═══ */
.hidden   { display: none !important; }
.muted    { color: var(--muted); font-size: .9em; }
.center   { text-align: center; }
.error-msg { color: var(--danger); font-size: .9em; margin-top: 8px; }

/* ═══════════════════════════════════════════ HEADER ══ */
#app-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--header-bg);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
}
.header-inner {
  max-width: 960px;
  margin: 0 auto;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.logo { font-size: 1.2rem; font-weight: 700; color: var(--primary); flex: 0 0 auto; }
nav { display: flex; gap: 4px; flex: 1; }
.nav-btn {
  background: none;
  border: none;
  color: var(--muted);
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: .9rem;
  transition: color .15s, background .15s;
}
.nav-btn:hover, .nav-btn.active { color: var(--text); background: var(--nav-active-bg); }
.header-user { display: flex; align-items: center; gap: 12px; }
#header-username { font-size: .9rem; color: var(--muted); }

/* ════════════════════════════════════════════ VIEWS ══ */
#app { max-width: 920px; margin: 0 auto; padding: 32px 16px 72px; }

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

/* ════════════════════════════════════════════ AUTH ═══ */
.auth-card {
  max-width: 420px;
  margin: 60px auto 0;
  background: linear-gradient(180deg, rgba(255,255,255,.02), rgba(255,255,255,0)) , var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px 32px;
  box-shadow: var(--shadow);
}
.auth-card h1 { font-size: 2rem; margin-bottom: 4px; }
.subtitle { color: var(--muted); margin-bottom: 24px; }

.tabs { display: flex; gap: 4px; margin-bottom: 20px; border-bottom: 1px solid var(--border); }
.tab {
  background: none; border: none; color: var(--muted);
  padding: 8px 16px; cursor: pointer; font-size: .95rem;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  transition: color .15s;
}
.tab.active { color: var(--primary); border-color: var(--primary); }

.tab-panel { display: none; }
.tab-panel.active { display: flex; flex-direction: column; gap: 14px; }

label { display: flex; flex-direction: column; gap: 5px; font-size: .88rem; color: var(--muted); }
input, select, textarea {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 12px;
  color: var(--text);
  font-size: .95rem;
  outline: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--primary);
  box-shadow: var(--ring);
  background: var(--input-focus-bg);
}
input::placeholder { color: var(--muted); }

.api-config {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

/* ═══════════════════════════════════════════ BUTTONS ══ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 18px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-size: .92rem;
  font-weight: 500;
  transition: opacity .15s, transform .12s, box-shadow .15s, filter .15s;
  box-shadow: 0 4px 14px rgba(40,66,140,.15);
}
.btn:active { transform: translateY(1px) scale(.98); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary, .btn.primary { background: var(--primary); color: #fff; }
.btn-primary:hover:not(:disabled), .btn.primary:hover:not(:disabled) {
  background: var(--primary-h);
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(124,116,255,.35);
}
.btn-secondary { background: var(--secondary); color: #000; }
.btn-secondary:hover:not(:disabled) { filter: brightness(1.05); transform: translateY(-1px); }
.btn-danger    { background: var(--danger);    color: #fff; }
.btn-ghost     { background: var(--surface2);  color: var(--text); border: 1px solid var(--border); }
.btn-ghost:hover:not(:disabled) { background: #2f3750; transform: translateY(-1px); }
.btn-full { width: 100%; }
.btn-lg { font-size: 1.05rem; padding: 12px 28px; }
.btn-sm { font-size: .82rem; padding: 6px 12px; }

/* ═══════════════════════════════════════════ CARDS ═══ */
.card {
  background: linear-gradient(180deg, rgba(255,255,255,.015), rgba(255,255,255,0)) , var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.card h3 { margin-bottom: 14px; }

.page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px; gap: 10px; flex-wrap: wrap;
}

/* ═════════════════════════════════════════ LOBBY ═══ */
.form-row { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.form-row label { flex: 1 1 120px; }
.form-actions { display: flex; gap: 10px; margin-top: 16px; }
.form-actions.center { justify-content: center; }

.join-code-row { display: flex; gap: 10px; align-items: flex-end; }

/* Room cards */
.room-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 10px;
  background: rgba(255,255,255,.015);
  transition: border-color .15s, transform .12s, background .15s;
}
.room-item:hover { border-color: var(--primary); background: rgba(124,116,255,.08); transform: translateY(-1px); }
.room-item:last-child { margin-bottom: 0; }
.room-info { flex: 1; }
.room-name { font-weight: 600; }
.room-meta { font-size: .82rem; color: var(--muted); }
.badge {
  display: inline-block; padding: 2px 8px; border-radius: 20px;
  font-size: .75rem; font-weight: 600;
}
.badge-green  { background: rgba(0,201,167,.15); color: var(--success); }
.badge-purple { background: rgba(108,99,255,.15); color: var(--primary); }
.badge-yellow { background: rgba(255,200,87,.15); color: var(--warning); }

/* ══════════════════════════════════ WAITING ROOM ═══ */
.waiting-card { max-width: 560px; margin: 0 auto; text-align: center; }
.waiting-card h2 { margin-bottom: 8px; }
.join-code-badge {
  display: inline-block;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 20px;
  font-size: 1.1rem;
  letter-spacing: 2px;
  margin: 12px 0;
}
.join-code-badge strong { color: var(--primary); font-size: 1.4rem; letter-spacing: 6px; }
.game-meta { color: var(--muted); font-size: .88rem; margin-bottom: 16px; }

.player-list {
  list-style: none;
  text-align: left;
  max-width: 320px;
  margin: 0 auto 20px;
}
.player-list li {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.player-list li:last-child { border-bottom: none; }
.player-avatar {
  width: 36px; height: 36px;
  background: var(--primary);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
}
.player-name { flex: 1; }
.host-badge {
  font-size: .75rem; color: var(--warning);
  background: rgba(255,200,87,.1);
  padding: 2px 7px; border-radius: 10px;
}
#waiting-status { margin-top: 12px; font-size: .9rem; }

/* ════════════════════════════════════════ GAME ═══ */
.game-hud {
  display: flex; gap: 12px; margin-bottom: 24px;
}
.hud-item {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  text-align: center;
}
.hud-label { display: block; font-size: .75rem; color: var(--muted); margin-bottom: 4px; }
.hud-value { font-size: 1.5rem; font-weight: 700; }
.hud-timer .hud-value { color: var(--primary); }
.hud-timer.urgent .hud-value { color: var(--danger); animation: pulse 1s infinite; }

@keyframes pulse { 0%,100% { opacity:1; } 50% { opacity:.5; } }

.question-card {
  background: linear-gradient(180deg, rgba(124,116,255,.08), rgba(124,116,255,0)) , var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 28px 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}
.question-type-badge {
  font-size: .75rem; color: var(--primary);
  background: rgba(108,99,255,.1);
  display: inline-block; padding: 2px 10px; border-radius: 12px;
  margin-bottom: 12px;
}
.question-text {
  font-size: 1.2rem;
  font-weight: 500;
  line-height: 1.6;
}

.answer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}
.answer-btn {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  color: var(--text);
  font-size: .95rem;
  cursor: pointer;
  text-align: left;
  transition: border-color .15s, background .15s, transform .1s, box-shadow .15s;
  display: flex; align-items: center; gap: 12px;
}
.answer-btn:hover:not(:disabled) {
  border-color: var(--primary);
  background: rgba(124,116,255,.11);
  box-shadow: 0 6px 16px rgba(0,0,0,.22);
}
.answer-btn:active:not(:disabled) { transform: scale(.98); }
.answer-btn:disabled { cursor: not-allowed; opacity: .7; }
.answer-btn.selected { border-color: var(--primary); background: rgba(108,99,255,.15); }
.answer-btn.correct  { border-color: var(--success); background: rgba(0,201,167,.15); }
.answer-btn.wrong    { border-color: var(--danger);  background: rgba(255,95,109,.12); }

.answer-key {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px;
  background: var(--surface2);
  border-radius: 6px;
  font-weight: 700;
  flex-shrink: 0;
  font-size: .85rem;
}

/* True/False: full-width single column */
.answer-grid.tf-grid { grid-template-columns: 1fr; }

.feedback {
  background: linear-gradient(180deg, rgba(255,255,255,.02), rgba(255,255,255,0)) , var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 20px;
  text-align: center;
}
.feedback-icon { font-size: 2.5rem; margin-bottom: 8px; }
.explanation { color: var(--muted); font-size: .9rem; margin-top: 8px; }
.score-delta { font-size: 1rem; font-weight: 700; color: var(--success); margin-top: 6px; }
.score-delta.zero { color: var(--muted); }

/* Live scores */
.scores-list { list-style: none; }
.scores-list li {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
  font-size: .9rem;
}
.scores-list li:last-child { border-bottom: none; }
.score-rank { width: 22px; text-align: center; font-weight: 700; color: var(--muted); }
.score-name { flex: 1; }
.score-val  { font-weight: 700; color: var(--primary); }

/* ═══════════════════════════════════════ RESULTS ═══ */
.results-card { max-width: 560px; margin: 0 auto; }
.results-header { text-align: center; margin-bottom: 20px; }
.trophy { font-size: 3.5rem; }
.my-final-score {
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 20px;
  font-size: 1.1rem;
}

.results-list { list-style: none; margin-bottom: 24px; }
.results-list li {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.results-list li:last-child { border-bottom: none; }
.result-rank { font-size: 1.3rem; width: 36px; text-align: center; }
.result-name { flex: 1; font-weight: 500; }
.result-score { font-weight: 700; color: var(--primary); }
.result-correct { color: var(--muted); font-size: .85rem; }

/* ════════════════════════════════ LEADERBOARD ═══ */
.lb-table { width: 100%; border-collapse: collapse; }
.lb-table th {
  text-align: left; padding: 8px 12px;
  font-size: .8rem; color: var(--muted); text-transform: uppercase;
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: var(--surface2); z-index: 1;
}
.lb-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); }
.lb-table tr:last-child td { border-bottom: none; }
.lb-table tr:hover td { background: var(--surface2); }
.lb-rank-1 td:first-child { color: gold; font-weight: 800; }
.lb-rank-2 td:first-child { color: silver; font-weight: 800; }
.lb-rank-3 td:first-child { color: #cd7f32; font-weight: 800; }

/* ════════════════════════════════════════ TOAST ═══ */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 22px;
  font-size: .9rem;
  z-index: 9999;
  box-shadow: var(--shadow);
  animation: slideUp .2s ease;
}
.toast.toast-success { border-color: var(--success); color: var(--success); }
.toast.toast-error   { border-color: var(--danger);  color: var(--danger);  }
@keyframes slideUp { from { opacity:0; transform:translateX(-50%) translateY(10px); } }

/* ═══════════════════════════ RESPONSIVE ═══ */
@media (max-width: 520px) {
  .answer-grid { grid-template-columns: 1fr; }
  .game-hud { gap: 8px; }
  .hud-value { font-size: 1.2rem; }
}

/* ═══════════════════════════════ GUEST / UPGRADE ═══ */
.auth-divider {
  display: flex; align-items: center; gap: 12px;
  color: var(--muted); font-size: .85rem; margin: 8px 0;
}
.auth-divider::before,
.auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }

.badge-guest { background: rgba(255,200,87,.15); color: var(--warning); font-size: .75rem; }

.guest-banner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
  border-left: 3px solid var(--warning);
  background: rgba(255,200,87,.06);
}
.guest-banner p { margin: 0; flex: 1; font-size: .9rem; }

/* ══════════════════════════════ ADMIN PANEL ═══ */
.subtabs {
  display: flex; gap: 4px; margin-bottom: 16px;
  border-bottom: 1px solid var(--border); padding-bottom: 0;
}
.subtab {
  background: none; border: none; border-bottom: 2px solid transparent;
  color: var(--muted); padding: 8px 16px; cursor: pointer;
  font-size: .9rem; font-weight: 500; transition: color .15s, border-color .15s;
  margin-bottom: -1px;
}
.subtab.active { color: var(--primary); border-bottom-color: var(--primary); }
.subtab:hover:not(.active) { color: var(--text); }

.admin-subview { animation: fadeIn .15s ease; }
@keyframes fadeIn { from { opacity: 0; } }

.admin-toolbar {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-bottom: 16px;
}
.admin-filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.admin-filters select { font-size: .85rem; padding: 5px 8px; }

.admin-table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.admin-table th {
  text-align: left; padding: 8px 10px;
  background: var(--surface2); color: var(--muted);
  font-size: .78rem; text-transform: uppercase; letter-spacing: .04em;
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: var(--surface2); z-index: 1;
}
.admin-table td {
  padding: 9px 10px; border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.admin-table tr:hover td { background: rgba(255,255,255,.03); }
.admin-table .col-text { max-width: 320px; }
.admin-table .q-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 300px; display: block; }
.admin-table .col-actions { white-space: nowrap; text-align: right; }
.admin-table .col-actions .btn { margin-left: 4px; }
.badge-inactive { background: rgba(255,80,80,.12); color: var(--danger); font-size: .75rem; }
.badge-active   { background: rgba(0,201,167,.12);  color: var(--success); font-size: .75rem; }
.badge-tf       { background: rgba(255,200,87,.12); color: var(--warning); font-size: .75rem; }
.badge-mc       { background: rgba(108,99,255,.12); color: var(--primary); font-size: .75rem; }
.suspicious-count { font-weight: 700; color: var(--danger); }

/* ══════════════════════════════ MODAL ═══ */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.65);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 40px 16px; overflow-y: auto; z-index: 1000;
}
.modal {
  background: linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,0)) , var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px; width: 100%; max-width: 680px;
  box-shadow: 0 8px 32px rgba(0,0,0,.4);
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 24px 14px; border-bottom: 1px solid var(--border);
}
.modal-header h3 { margin: 0; font-size: 1.1rem; }
.modal-close {
  background: none; border: none; color: var(--muted); font-size: 1.2rem;
  cursor: pointer; line-height: 1; padding: 4px 6px; border-radius: 4px;
}
.modal-close:hover { background: var(--surface2); color: var(--text); }
.modal-body { padding: 20px 24px; display: flex; flex-direction: column; gap: 12px; }
.modal-footer {
  display: flex; gap: 10px; padding: 14px 24px 20px;
  border-top: 1px solid var(--border);
}
.checkbox-label { display: flex; flex-direction: row; align-items: center; gap: 8px; padding-top: 22px; }
.checkbox-label input[type=checkbox] { width: 16px; height: 16px; }

/* Answer editor */
.answer-editor { display: flex; flex-direction: column; gap: 8px; }
.answer-editor h4 { margin: 4px 0; font-size: .85rem; color: var(--muted); text-transform: uppercase; }
.answer-row { display: flex; align-items: center; gap: 10px; }
.answer-row .answer-id-label {
  font-weight: 700; width: 28px; text-align: center;
  color: var(--primary); flex-shrink: 0;
}
.answer-row input[type=text] { flex: 1; }
.answer-row input[type=radio] { width: 16px; height: 16px; flex-shrink: 0; }
.answer-row .correct-label { font-size: .8rem; color: var(--muted); white-space: nowrap; }

/* ═════════════════════════════ WS DISCONNECT BANNER ═══ */
#ws-disconnect-banner {
  position: fixed; top: 0; left: 0; right: 0; z-index: 999;
  display: flex; align-items: center; justify-content: center; gap: 16px;
  padding: 12px 24px;
  background: var(--danger); color: #fff;
  font-weight: 600; font-size: .95rem;
  box-shadow: 0 2px 12px rgba(0,0,0,.5);
}
#ws-disconnect-banner .btn {
  background: rgba(255,255,255,.2); border: 1px solid rgba(255,255,255,.5);
  color: #fff; padding: 4px 14px; font-size: .85rem;
}
#ws-disconnect-banner .btn:hover { background: rgba(255,255,255,.35); }

/* ════════════════════════ RATE / REPORT SECTION ═══ */
.feedback-actions {
  margin-top: 14px; padding-top: 12px;
  border-top: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 10px;
}
.rate-section {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.rate-label { font-size: .85rem; color: var(--muted); }
.stars { display: flex; gap: 2px; }
.star {
  background: none; border: none; cursor: pointer;
  font-size: 1.4rem; color: var(--border);
  padding: 0 2px; transition: color .1s, transform .1s;
  line-height: 1;
}
.star:hover, .star.active { color: var(--warning); transform: scale(1.2); }
.stars.rated .star.active ~ .star { color: var(--border); }
.stars.submitted { pointer-events: none; opacity: .7; }

.report-section {
  font-size: .85rem;
}
.report-section > summary {
  cursor: pointer; color: var(--muted);
  list-style: none; padding: 4px 0;
  transition: color .15s;
}
.report-section > summary:hover { color: var(--danger); }
.report-body {
  display: flex; flex-direction: column; gap: 8px;
  margin-top: 8px;
}
.report-body textarea {
  width: 100%; resize: vertical; min-height: 60px;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 8px; color: var(--text); padding: 8px 10px; font-size: .85rem;
}
.btn-danger {
  background: var(--danger); color: #fff; border: none;
}
.btn-danger:hover { filter: brightness(1.15); }
.btn-sm { padding: 5px 12px; font-size: .82rem; }

/* ══════════════════════════════ DIFFICULTY BADGE ═══ */
.question-badges {
  display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 4px;
}
.question-diff-badge {
  display: inline-flex; align-items: center;
  background: rgba(255,200,87,.12); color: var(--warning);
  border-radius: 20px; padding: 3px 10px; font-size: .78rem; font-weight: 600;
}

/* ══════════════════════════════ ANSWERED BADGE (live scores) ═══ */
.answered-badge { font-size: .9rem; flex-shrink: 0; }
#live-scores-list li {
  display: flex; align-items: center; gap: 8px;
}
#live-scores-list .score-name { flex: 1; }

/* ══════════════════════════════ RESULTS BREAKDOWN ═══ */
.results-breakdown { margin-top: 20px; }
.breakdown-details summary {
  cursor: pointer; font-weight: 600; font-size: 1rem; padding: 6px 0;
  list-style: none;
}
.breakdown-details summary:hover { color: var(--primary); }
.breakdown-table {
  width: 100%; border-collapse: collapse; margin-top: 10px; font-size: .85rem;
}
.breakdown-table th, .breakdown-table td {
  padding: 6px 8px; border-bottom: 1px solid var(--border); text-align: left;
}
.breakdown-table .col-text { max-width: 220px; white-space: normal; }
.breakdown-table .row-correct td { color: var(--success); }
.breakdown-table .row-wrong td { color: var(--danger); }
.breakdown-table .row-correct .col-text,
.breakdown-table .row-wrong .col-text { color: var(--text); }

/* ══════════════════════════════ SUSPICIOUS REPORT REASONS ═══ */
.report-reasons-row td { background: var(--surface2); padding: 8px 14px; }
.report-reasons-list { display: flex; flex-direction: column; gap: 6px; }
.report-item {
  display: flex; gap: 10px; align-items: flex-start; font-size: .85rem;
  border-left: 3px solid var(--warning); padding-left: 8px;
}
.report-date { color: var(--muted); white-space: nowrap; min-width: 80px; font-size: .78rem; }
.report-text { flex: 1; }

/* ══════════════════════════════ ANSWER DISTRIBUTION CHART ═══ */
.dist-chart {
  margin: 12px 0 6px;
  padding: 10px 12px;
  background: var(--surface2);
  border-radius: 10px;
}
.dist-title { margin: 0 0 8px; font-weight: 600; font-size: .88rem; color: var(--muted); }
.dist-bar-row {
  display: flex; align-items: center; gap: 8px; margin-bottom: 6px; font-size: .82rem;
}
.dist-label { min-width: 28px; font-weight: 700; flex-shrink: 0; }
.dist-bar-track {
  flex: 1; height: 14px; background: var(--surface3);
  border-radius: 8px; overflow: hidden;
}
.dist-bar {
  height: 100%; background: var(--primary-muted, rgba(99,179,237,.45));
  border-radius: 8px; transition: width .4s ease;
  min-width: 2px;
}
.dist-bar-correct { background: var(--success); }
.dist-count { min-width: 64px; text-align: right; color: var(--muted); }

/* ══════════════════════════════ ADMIN ANALYTICS ═══ */
.analytics-row td { background: var(--surface2); padding: 8px 14px; }
.admin-analytics { font-size: .85rem; }
.admin-analytics strong { display: block; margin-bottom: 8px; }

/* ══════════════════════════════ FORGOT/RESET PASSWORD ═══ */
.btn-link {
  background: none; border: none; color: var(--primary);
  cursor: pointer; font-size: .85rem; padding: 0; text-decoration: underline;
}
.btn-link:hover { color: var(--primary-hover, var(--primary)); opacity: .8; }
.success-msg { color: var(--success); font-size: .9rem; margin-top: 8px; }
.text-center { text-align: center; }

@media (max-width: 860px) {
  #app-header { padding: 0 12px; }
  .header-inner { height: auto; min-height: 56px; padding: 8px 0; flex-wrap: wrap; }
  nav { order: 3; width: 100%; overflow-x: auto; padding-bottom: 4px; }
  .page-header h2 { font-size: 1.25rem; }
  .admin-filters { width: 100%; }
  .admin-filters input, .admin-filters select { flex: 1 1 140px; }
}
