/* ===== DESIGN SYSTEM ===== */
:root {
  --bg: #0a0a0f;
  --bg-2: #12121a;
  --bg-3: #1a1a26;
  --bg-card: #16161f;
  --border: #2a2a3d;
  --border-bright: #3d3d5c;
  --text: #e8e8f0;
  --text-dim: #8888aa;
  --text-muted: #55557a;
  --accent: #ff3c5f;
  --accent-2: #ff7043;
  --green: #00e676;
  --yellow: #ffd740;
  --blue: #448aff;
  --red: #ff1744;
  --font-display: 'Bebas Neue', sans-serif;
  --font-body: 'DM Sans', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --radius: 8px;
  --radius-lg: 16px;
  --shadow: 0 4px 24px rgba(0,0,0,0.5);
  --glow-accent: 0 0 20px rgba(255,60,95,0.3);
  --glow-green: 0 0 20px rgba(0,230,118,0.3);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-tap-highlight-color: transparent; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.5;
  min-height: 100dvh;
  overflow-x: hidden;
}
input, textarea, select, button { font-family: inherit; }
button { cursor: pointer; border: none; background: none; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ===== APP ===== */
#app { min-height: 100dvh; position: relative; }

.screen { display: none; min-height: 100dvh; animation: fadeIn 0.25s ease; }
.screen.active { display: flex; flex-direction: column; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pop { 0% { transform: scale(0.85); opacity:0; } 65% { transform: scale(1.04); } 100% { transform: scale(1); opacity:1; } }
@keyframes shake { 0%,100% { transform:translateX(0); } 25%,75% { transform:translateX(-6px); } 50% { transform:translateX(6px); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes bounce { 0%,100% { transform:translateY(0); } 50% { transform:translateY(-10px); } }
@keyframes pulseDot { 0%,100% { opacity:1; transform:scale(1); } 50% { opacity:0.4; transform:scale(0.6); } }
@keyframes pulseGlow { 0%,100% { box-shadow: var(--glow-accent); } 50% { box-shadow: 0 0 40px rgba(255,60,95,0.6); } }

/* ===== BG GRID ===== */
.bg-grid {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(255,60,95,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,60,95,0.04) 1px, transparent 1px);
  background-size: 40px 40px;
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius);
  font-family: var(--font-display);
  font-size: 1.1rem;
  letter-spacing: 0.05em;
  transition: all 0.15s ease;
  position: relative; overflow: hidden;
  white-space: nowrap;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 4px 16px rgba(255,60,95,0.3); }
.btn-primary:hover { background: #ff5577; box-shadow: var(--glow-accent); }
.btn-secondary { background: transparent; color: var(--text); border: 2px solid var(--border-bright); }
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }
.btn-ghost { background: transparent; color: var(--text-dim); border: 1px solid var(--border); }
.btn-ghost:hover { border-color: var(--border-bright); color: var(--text); }
.btn-accent { background: var(--yellow); color: #0a0a0f; }
.btn-accent:hover { background: #ffe57f; }
.btn-danger { background: var(--accent); color: #fff; animation: pulseGlow 2s ease-in-out infinite; }
.btn-xl { padding: 18px 36px; font-size: 1.4rem; border-radius: var(--radius-lg); }
.btn-full { width: 100%; }
.btn-sm { padding: 7px 14px; font-size: 0.85rem; border-radius: 6px; }
.btn-back { background: transparent; color: var(--text-dim); font-size: 0.9rem; padding: 8px 0; display: flex; align-items: center; gap: 4px; }
.btn-back:hover { color: var(--text); }
.btn-icon { font-size: 1.1em; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; pointer-events: none; }

/* ===== SCREEN HEADER ===== */
.screen-header {
  padding: 16px 20px 0;
  display: flex; align-items: center; gap: 12px;
  flex-shrink: 0;
}
.screen-header h2 { font-family: var(--font-display); font-size: 1.6rem; letter-spacing: 0.05em; flex: 1; }

/* ===== FORMS ===== */
.form-card {
  padding: 24px; display: flex; flex-direction: column; gap: 20px;
  max-width: 460px; width: 100%; margin: 24px auto 0;
}
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: 0.78rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-dim); }
.label-hint { font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--text-muted); font-size: 0.75rem; }
.form-group input, .form-group textarea, .form-group select {
  background: var(--bg-2); border: 1.5px solid var(--border);
  border-radius: var(--radius); color: var(--text); padding: 11px 14px;
  font-size: 1rem; transition: border-color 0.15s; width: 100%;
}
.form-group input:focus, .form-group textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255,60,95,0.12);
}
.form-row { display: flex; gap: 10px; }
.form-row .btn { flex: 1; }
.form-row-3 { display: flex; gap: 12px; align-items: flex-end; }
.fg-grow { flex: 1; }

/* ===== LANDING ===== */
#screen-landing { align-items: center; justify-content: center; position: relative; overflow: hidden; }
#screen-landing::before {
  content: ''; position: absolute; width: 700px; height: 700px;
  background: radial-gradient(circle, rgba(255,60,95,0.1) 0%, transparent 70%);
  top: -150px; left: 50%; transform: translateX(-50%); pointer-events: none;
}
.landing-content {
  position: relative; z-index: 1; display: flex; flex-direction: column;
  align-items: center; gap: 40px; padding: 40px 24px; text-align: center;
}
.logo-block { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.logo-skull { font-size: 80px; animation: bounce 3s ease-in-out infinite; filter: drop-shadow(0 0 20px rgba(255,60,95,0.5)); }
.logo-title { font-family: var(--font-display); font-size: clamp(3rem, 12vw, 6rem); line-height: 0.9; letter-spacing: 0.02em; }
.logo-title span { color: var(--accent); text-shadow: var(--glow-accent); }
.logo-sub { font-size: 0.85rem; color: var(--text-muted); letter-spacing: 0.15em; text-transform: uppercase; }
.landing-actions { display: flex; flex-direction: column; gap: 14px; width: 100%; max-width: 360px; }
.landing-hint { font-size: 0.8rem; color: var(--text-muted); }

/* ===== AUTH ===== */
.auth-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 28px; margin: 20px auto;
  max-width: 420px; width: calc(100% - 32px);
  display: flex; flex-direction: column; gap: 20px;
}
.auth-tabs { display: flex; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.auth-tab {
  flex: 1; padding: 10px; font-family: var(--font-display); font-size: 1rem;
  letter-spacing: 0.05em; color: var(--text-muted); border-bottom: 2px solid transparent;
  margin-bottom: -1px; transition: all 0.15s;
}
.auth-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.auth-hint { font-size: 0.82rem; color: var(--text-muted); text-align: center; margin-top: 4px; }
#auth-login-form, #auth-register-form { display: flex; flex-direction: column; gap: 14px; }

/* ===== DASHBOARD ===== */
.dashboard-header {
  padding: 16px 20px; background: var(--bg-2); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-shrink: 0;
}
.dh-left { display: flex; align-items: center; gap: 12px; }
.logo-skull-sm { font-size: 28px; }
.dh-title { font-family: var(--font-display); font-size: 1.4rem; letter-spacing: 0.05em; line-height: 1; }
.dh-sub { font-size: 0.8rem; color: var(--text-muted); }
.dh-actions { display: flex; gap: 8px; }
.dashboard-body { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 16px; }

.create-quiz-form {
  background: var(--bg-3); border: 1.5px solid var(--border-bright);
  border-radius: var(--radius-lg); padding: 20px;
  display: flex; flex-direction: column; gap: 14px;
  animation: slideUp 0.2s ease;
}
.create-quiz-form h3 { font-family: var(--font-display); font-size: 1rem; letter-spacing: 0.05em; color: var(--text-dim); display: none; }

.quiz-list { display: flex; flex-direction: column; gap: 12px; }
.empty-state { display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 60px 20px; text-align: center; }
.empty-skull { font-size: 48px; opacity: 0.4; }
.empty-state p { color: var(--text-muted); }

.quiz-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 18px 20px;
  display: flex; align-items: center; gap: 16px;
  transition: border-color 0.15s; animation: slideUp 0.2s ease;
}
.quiz-card:hover { border-color: var(--border-bright); }
.qc-info { flex: 1; min-width: 0; }
.qc-title { font-family: var(--font-display); font-size: 1.2rem; letter-spacing: 0.03em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qc-meta { font-size: 0.78rem; color: var(--text-muted); margin-top: 2px; }
.qc-badge { display: inline-flex; align-items: center; gap: 4px; }
.qc-actions { display: flex; gap: 8px; flex-shrink: 0; }

/* ===== BADGE ===== */
.badge {
  background: var(--accent); color: #fff; font-size: 0.7rem;
  font-family: var(--font-body); font-weight: 600;
  padding: 2px 7px; border-radius: 100px; min-width: 20px; text-align: center;
}

/* ===== QUIZ EDITOR ===== */
.qe-header-actions { display: flex; gap: 8px; }
.qe-meta-form {
  background: var(--bg-3); border-bottom: 1px solid var(--border-bright);
  padding: 16px 20px; display: flex; flex-direction: column; gap: 12px;
}
.qe-body {
  flex: 1; display: flex; overflow: hidden;
}
.qe-questions-panel {
  flex: 1; display: flex; flex-direction: column; padding: 16px 20px;
  overflow-y: auto; border-right: 1px solid var(--border); gap: 12px;
}
.qe-history-panel {
  width: 300px; padding: 16px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px;
}

.panel-header {
  display: flex; align-items: center; justify-content: space-between;
  flex-shrink: 0;
}
.panel-header h3 { font-family: var(--font-display); font-size: 1.1rem; letter-spacing: 0.05em; display: flex; align-items: center; gap: 8px; }
.empty-hint { font-size: 0.85rem; color: var(--text-muted); font-style: italic; padding: 8px 0; }

/* Question items in editor */
.qe-q-list { display: flex; flex-direction: column; gap: 8px; }
.qe-q-item {
  background: var(--bg-3); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 14px;
  display: flex; align-items: flex-start; gap: 12px;
  animation: slideUp 0.2s ease;
}
.qe-q-num { font-family: var(--font-display); font-size: 1.2rem; color: var(--accent); min-width: 24px; line-height: 1.3; }
.qe-q-body { flex: 1; min-width: 0; }
.qe-q-text { font-size: 0.9rem; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qe-q-opts { font-size: 0.75rem; color: var(--text-muted); margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qe-q-actions { display: flex; gap: 6px; flex-shrink: 0; }
.qe-q-btn {
  width: 28px; height: 28px; border-radius: 6px; font-size: 0.85rem;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); border: 1px solid var(--border); background: var(--bg-2);
  transition: all 0.15s;
}
.qe-q-btn:hover { border-color: var(--accent); color: var(--accent); }
.qe-q-btn.del:hover { border-color: var(--red); color: var(--red); }

/* Add/Edit question form */
.add-q-form {
  background: var(--bg-3); border: 1.5px solid var(--border-bright);
  border-radius: var(--radius-lg); padding: 18px;
  display: flex; flex-direction: column; gap: 14px;
  animation: slideUp 0.2s ease; flex-shrink: 0;
}
.add-q-form h4 { font-family: var(--font-display); font-size: 1rem; letter-spacing: 0.05em; color: var(--text-dim); }

/* FIX #1: Option rows with visible radio buttons */
.option-row {
  display: flex; align-items: center; gap: 8px; margin-bottom: 8px;
}
.opt-label { font-family: var(--font-display); font-size: 1rem; color: var(--accent); width: 16px; text-align: center; flex-shrink: 0; }
.opt-input { flex: 1; }
.option-row input[type="radio"] { width: 18px; height: 18px; accent-color: var(--green); cursor: pointer; flex-shrink: 0; }

/* History items */
.qe-history-list { display: flex; flex-direction: column; gap: 8px; }
.history-item {
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 10px 12px;
  display: flex; flex-direction: column; gap: 4px;
  cursor: pointer; transition: border-color 0.15s;
}
.history-item:hover { border-color: var(--border-bright); }
.hi-date { font-size: 0.75rem; color: var(--text-muted); font-family: var(--font-mono); }
.hi-meta { font-size: 0.82rem; color: var(--text-dim); display: flex; gap: 10px; }
.hi-status { font-size: 0.7rem; padding: 2px 8px; border-radius: 100px; font-weight: 600; display: inline-block; }
.hi-status.finished { background: rgba(0,230,118,0.15); color: var(--green); }
.hi-status.active { background: rgba(255,215,64,0.15); color: var(--yellow); }
.hi-status.lobby { background: rgba(68,138,255,0.15); color: var(--blue); }

/* ===== GAME CODE ===== */
.game-code-badge {
  font-family: var(--font-mono); font-size: 0.95rem; font-weight: 700;
  letter-spacing: 0.2em; background: var(--bg-3); border: 1.5px solid var(--border-bright);
  padding: 6px 14px; border-radius: 100px; color: var(--yellow);
}
.big-code {
  font-family: var(--font-display); font-size: clamp(3rem, 14vw, 5.5rem);
  letter-spacing: 0.3em; color: var(--accent); text-shadow: var(--glow-accent); line-height: 1;
}

/* ===== HOST LOBBY ===== */
.lobby-layout { display: flex; flex-direction: column; flex: 1; overflow: hidden; }
.lobby-join-info {
  text-align: center; padding: 24px 20px;
  background: var(--bg-2); border-bottom: 1px solid var(--border);
}
.join-label { font-size: 0.8rem; color: var(--text-dim); }
.lobby-players-panel { padding: 16px 20px; overflow-y: auto; flex: 1; }
.players-list { display: flex; flex-direction: column; gap: 6px; }
.player-item {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px;
  background: var(--bg-3); border-radius: var(--radius); border: 1px solid var(--border);
  animation: slideUp 0.2s ease;
}
.player-item .p-name { flex: 1; font-size: 0.9rem; font-weight: 500; }
.player-item .p-lives { font-size: 0.82rem; color: var(--text-dim); }
.p-status { font-size: 0.7rem; padding: 2px 8px; border-radius: 100px; font-weight: 600; }
.p-status.active { background: rgba(0,230,118,0.15); color: var(--green); }
.p-status.eliminated { background: rgba(255,23,68,0.15); color: var(--red); }
.lobby-actions { padding: 16px 20px; flex-shrink: 0; border-top: 1px solid var(--border); }

/* ===== HOST GAME ===== */
.host-game-header {
  padding: 12px 20px; background: var(--bg-2); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 16px; flex-shrink: 0;
}
.hg-title { font-family: var(--font-display); font-size: 1.2rem; letter-spacing: 0.04em; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hg-stats { display: flex; gap: 16px; }
.hg-stat { display: flex; flex-direction: column; align-items: center; }
.hg-stat span { font-family: var(--font-display); font-size: 1.4rem; color: var(--accent); line-height: 1; }
.hg-stat small { font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-muted); }
.host-game-body { display: flex; flex: 1; overflow: hidden; }
.hg-question-panel { flex: 1; padding: 20px; display: flex; flex-direction: column; gap: 16px; overflow-y: auto; }
.hg-q-meta { display: flex; align-items: center; gap: 14px; }
.q-num-label { font-family: var(--font-display); font-size: 1.3rem; color: var(--text-muted); }
.hg-q-text { font-size: clamp(1rem, 2.5vw, 1.4rem); font-weight: 500; line-height: 1.4; }
.hg-options { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.hg-option {
  background: var(--bg-3); border: 1.5px solid var(--border);
  border-radius: var(--radius); padding: 12px 14px;
  display: flex; align-items: center; gap: 8px; font-size: 0.9rem;
}
.hg-option.correct { border-color: var(--green); background: rgba(0,230,118,0.08); }
.opt-letter { font-family: var(--font-display); font-size: 1rem; color: var(--accent); min-width: 18px; }
.hg-option.correct .opt-letter { color: var(--green); }
.hg-reveal-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  flex-wrap: wrap; padding-top: 10px; border-top: 1px solid var(--border); flex-shrink: 0;
}
.answer-count-info { font-size: 0.85rem; color: var(--text-dim); }
.host-controls { display: flex; gap: 8px; }
.hg-waiting-panel {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 20px; padding: 40px; text-align: center;
}
.waiting-icon { font-size: 4rem; animation: bounce 2s ease-in-out infinite; }
.hg-leaderboard { width: 240px; border-left: 1px solid var(--border); display: flex; flex-direction: column; overflow: hidden; }
.lb-title { font-family: var(--font-display); font-size: 0.85rem; letter-spacing: 0.15em; color: var(--text-muted); padding: 12px 14px 8px; border-bottom: 1px solid var(--border); }
.lb-list { flex: 1; overflow-y: auto; padding: 6px; display: flex; flex-direction: column; gap: 4px; }
.lb-item {
  display: flex; align-items: center; gap: 8px; padding: 7px 9px;
  border-radius: 6px; background: var(--bg-2); border: 1px solid transparent; transition: all 0.2s;
}
.lb-item.eliminated { opacity: 0.35; }
.lb-item.top1 { border-color: var(--yellow); background: rgba(255,215,64,0.06); }
.lb-rank { font-family: var(--font-display); font-size: 0.85rem; color: var(--text-muted); min-width: 20px; text-align: center; }
.lb-rank.gold { color: var(--yellow); }
.lb-name { flex: 1; font-size: 0.82rem; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-lives { font-size: 0.7rem; }
.lb-score { font-family: var(--font-mono); font-size: 0.78rem; color: var(--text-dim); min-width: 28px; text-align: right; }

/* ===== TIMER RING ===== */
.timer-ring-wrap { position: relative; width: 54px; height: 54px; }
.timer-ring { width: 54px; height: 54px; transform: rotate(-90deg); }
.timer-bg { fill: none; stroke: var(--bg-3); stroke-width: 4; }
.timer-fill { fill: none; stroke: var(--accent); stroke-width: 4; stroke-linecap: round; stroke-dasharray: 163.4; stroke-dashoffset: 0; transition: stroke-dashoffset 1s linear, stroke 0.3s; }
.timer-fill.warning { stroke: var(--yellow); }
.timer-fill.danger { stroke: var(--red); }
.timer-text { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-family: var(--font-mono); font-size: 0.85rem; font-weight: 700; }

/* ===== PLAYER LOBBY ===== */
#screen-player-lobby { align-items: center; justify-content: center; }
.player-lobby-content {
  display: flex; flex-direction: column; align-items: center; gap: 24px;
  padding: 40px 24px; text-align: center; max-width: 400px; width: 100%;
}
.waiting-skull { font-size: 64px; animation: bounce 2.5s ease-in-out infinite; }
.player-lobby-content h2 { font-family: var(--font-display); font-size: 2rem; letter-spacing: 0.05em; }
.pl-code-display { display: flex; flex-direction: column; gap: 4px; }
.pl-code-label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.15em; color: var(--text-muted); }
.pl-code-value { font-family: var(--font-display); font-size: 3.5rem; letter-spacing: 0.3em; color: var(--accent); text-shadow: var(--glow-accent); line-height: 1; }
.pl-lives-display { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.pl-lives-display span:first-child { font-size: 1.8rem; letter-spacing: 4px; }
.pl-lives-label { font-size: 0.72rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.1em; }
.pl-status-msg {
  display: flex; align-items: center; gap: 10px; padding: 10px 18px;
  background: var(--bg-2); border-radius: 100px; border: 1px solid var(--border); font-size: 0.85rem; color: var(--text-dim);
}
.pulse-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green); animation: pulseDot 1.5s ease-in-out infinite; }
.pl-players-count { font-size: 0.85rem; color: var(--text-dim); }
.pl-players-count span { font-weight: 700; color: var(--text); }

/* ===== PLAYER GAME ===== */
.player-game-header {
  padding: 12px 20px; background: var(--bg-2); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 14px; flex-shrink: 0;
}
.pg-name { font-family: var(--font-display); font-size: 1rem; letter-spacing: 0.04em; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pg-lives { font-size: 1.1rem; letter-spacing: 2px; }
.pg-score { font-family: var(--font-mono); font-size: 0.82rem; color: var(--text-dim); white-space: nowrap; }

.pg-question-area {
  flex: 1; padding: 20px; display: flex; flex-direction: column; gap: 16px; overflow-y: auto;
}
.pg-q-meta { display: flex; align-items: center; gap: 12px; }

/* FIX #2: Question text is large and prominent */
.pg-q-text {
  font-size: clamp(1.1rem, 4.5vw, 1.65rem);
  font-weight: 600; line-height: 1.4; color: var(--text);
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 16px 18px;
}

/* FIX #2: Options are buttons with full text visible */
.pg-options { display: flex; flex-direction: column; gap: 10px; flex: 1; }
.pg-option {
  background: var(--bg-2); border: 2px solid var(--border);
  border-radius: var(--radius-lg); padding: 14px 18px;
  display: flex; align-items: center; gap: 14px;
  font-size: 1rem; font-weight: 500; cursor: pointer;
  transition: all 0.15s ease; text-align: left;
  width: 100%; color: var(--text);
  -webkit-user-select: none; user-select: none;
  /* FIX #2: Text wraps properly so full option text is visible */
  white-space: normal; word-break: break-word;
  min-height: 52px;
}
.pg-option:hover:not(.disabled) { border-color: var(--accent); background: rgba(255,60,95,0.06); transform: translateX(3px); }
.pg-option:active:not(.disabled) { transform: scale(0.99); }
.pg-option.selected { border-color: var(--blue); background: rgba(68,138,255,0.08); }
.pg-option.correct { border-color: var(--green); background: rgba(0,230,118,0.08); animation: pop 0.3s ease; }
.pg-option.wrong { border-color: var(--red); background: rgba(255,23,68,0.08); animation: shake 0.35s ease; }
.pg-option.disabled { cursor: default; }
.pg-opt-letter { font-family: var(--font-display); font-size: 1.2rem; color: var(--accent); min-width: 22px; flex-shrink: 0; }
.pg-option.correct .pg-opt-letter { color: var(--green); }
.pg-option.wrong .pg-opt-letter { color: var(--red); }
.pg-opt-text { flex: 1; line-height: 1.4; }

.pg-feedback {
  padding: 14px 18px; border-radius: var(--radius); font-weight: 600; font-size: 1rem;
  text-align: center; animation: pop 0.3s ease; flex-shrink: 0;
}
.pg-feedback.correct { background: rgba(0,230,118,0.1); border: 1.5px solid var(--green); color: var(--green); }
.pg-feedback.wrong { background: rgba(255,23,68,0.08); border: 1.5px solid var(--red); color: var(--red); }
.pg-feedback.timeout { background: rgba(255,215,64,0.08); border: 1.5px solid var(--yellow); color: var(--yellow); }

/* Spectator */
.pg-spectator-overlay {
  position: absolute; inset: 0; background: rgba(10,10,15,0.94);
  display: flex; align-items: center; justify-content: center; z-index: 10;
  animation: fadeIn 0.4s ease;
}
.spectator-content { text-align: center; padding: 32px 24px; display: flex; flex-direction: column; align-items: center; gap: 14px; max-width: 400px; width: 100%; }
.spectator-skull { font-size: 60px; }
.spectator-content h3 { font-family: var(--font-display); font-size: 2rem; color: var(--accent); }
.spectator-content p { color: var(--text-dim); font-size: 0.9rem; }
.spectator-live-q {
  width: 100%; background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 14px; text-align: left; margin-top: 8px;
}
.spectator-live-q .sq-question { font-size: 0.95rem; font-weight: 500; margin-bottom: 10px; }
.spectator-live-q .sq-opt {
  display: flex; gap: 8px; padding: 7px 10px; margin-bottom: 5px;
  background: var(--bg-3); border-radius: 6px; font-size: 0.85rem;
}
.spectator-live-q .sq-opt.correct { background: rgba(0,230,118,0.1); border: 1px solid var(--green); }

/* ===== GAME OVER ===== */
#screen-game-over { align-items: center; justify-content: center; overflow-y: auto; }
.game-over-content {
  display: flex; flex-direction: column; align-items: center; gap: 28px;
  padding: 48px 24px; text-align: center; max-width: 480px; width: 100%;
}
.go-trophy { font-size: 72px; animation: bounce 2s ease-in-out infinite; }
.go-title { font-family: var(--font-display); font-size: clamp(2.5rem, 10vw, 4.5rem); color: var(--yellow); text-shadow: 0 0 30px rgba(255,215,64,0.4); }
.go-winners { display: flex; flex-direction: column; gap: 10px; width: 100%; }
.go-winner-item { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-radius: var(--radius-lg); animation: pop 0.4s ease backwards; }
.go-winner-item:nth-child(1) { background: rgba(255,215,64,0.08); border: 1.5px solid var(--yellow); animation-delay:0.1s; }
.go-winner-item:nth-child(2) { background: rgba(192,192,192,0.06); border: 1.5px solid #aaa; animation-delay:0.2s; }
.go-winner-item:nth-child(3) { background: rgba(205,127,50,0.06); border: 1.5px solid #cd7f32; animation-delay:0.3s; }
.go-medal { font-size: 1.5rem; }
.go-winner-name { flex: 1; font-family: var(--font-display); font-size: 1.2rem; text-align: left; }
.go-winner-score { font-family: var(--font-mono); font-size: 0.85rem; color: var(--text-dim); }
.go-full-board { width: 100%; }
.go-full-board h3 { font-family: var(--font-display); font-size: 0.9rem; letter-spacing: 0.1em; color: var(--text-muted); text-transform: uppercase; margin-bottom: 10px; }
.go-list { display: flex; flex-direction: column; gap: 5px; }
.go-list-item { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: var(--bg-2); border-radius: 6px; border: 1px solid var(--border); font-size: 0.85rem; }
.go-list-item.eliminated { opacity: 0.45; }
.go-rank { font-family: var(--font-display); color: var(--text-muted); min-width: 22px; }
.go-p-name { flex: 1; font-weight: 500; }
.go-p-score { font-family: var(--font-mono); color: var(--text-dim); }

/* ===== RESULTS SCREEN ===== */
.results-body { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 24px; max-width: 700px; width: 100%; margin: 0 auto; }
.results-summary {
  background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 18px 20px;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 16px;
}
.rs-stat { display: flex; flex-direction: column; gap: 2px; }
.rs-label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-muted); }
.rs-value { font-family: var(--font-display); font-size: 1.6rem; letter-spacing: 0.03em; color: var(--text); }
.results-section { display: flex; flex-direction: column; gap: 10px; }
.results-section h3 { font-family: var(--font-display); font-size: 1rem; letter-spacing: 0.08em; color: var(--text-dim); text-transform: uppercase; }
.rq-list { display: flex; flex-direction: column; gap: 10px; }
.rq-item {
  background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 14px 16px;
  display: flex; flex-direction: column; gap: 10px;
}
.rq-header { display: flex; gap: 10px; align-items: flex-start; }
.rq-num { font-family: var(--font-display); font-size: 1rem; color: var(--accent); min-width: 24px; }
.rq-text { flex: 1; font-size: 0.9rem; font-weight: 500; }
.rq-pct { font-family: var(--font-mono); font-size: 0.8rem; color: var(--text-muted); }
.rq-bars { display: flex; flex-direction: column; gap: 4px; }
.rq-bar-row { display: flex; align-items: center; gap: 8px; font-size: 0.8rem; }
.rq-opt-label { min-width: 16px; font-family: var(--font-display); color: var(--text-dim); }
.rq-bar-wrap { flex: 1; height: 6px; background: var(--bg-3); border-radius: 3px; overflow: hidden; }
.rq-bar-fill { height: 100%; border-radius: 3px; background: var(--blue); transition: width 0.6s ease; }
.rq-bar-fill.correct { background: var(--green); }
.rq-count { min-width: 28px; text-align: right; color: var(--text-muted); }

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(0,0,0,0.7); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; padding: 24px;
  animation: fadeIn 0.2s ease;
}
.modal-box {
  background: var(--bg-card); border: 1px solid var(--border-bright);
  border-radius: var(--radius-lg); padding: 28px; max-width: 380px; width: 100%;
  display: flex; flex-direction: column; gap: 16px; animation: pop 0.25s ease;
}
.modal-box h3 { font-family: var(--font-display); font-size: 1.4rem; letter-spacing: 0.05em; }
.modal-sub { font-size: 0.85rem; color: var(--text-dim); }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; }

/* ===== TOASTS ===== */
.toast-container { position: fixed; bottom: 20px; right: 16px; z-index: 1000; display: flex; flex-direction: column; gap: 8px; max-width: 320px; }
.toast { padding: 11px 16px; border-radius: var(--radius); font-size: 0.88rem; font-weight: 500; animation: slideUp 0.25s ease; display: flex; align-items: center; gap: 8px; }
.toast-info { background: rgba(68,138,255,0.15); border: 1px solid rgba(68,138,255,0.4); color: var(--blue); }
.toast-success { background: rgba(0,230,118,0.12); border: 1px solid rgba(0,230,118,0.4); color: var(--green); }
.toast-error { background: rgba(255,23,68,0.12); border: 1px solid rgba(255,23,68,0.4); color: var(--red); }
.toast-warning { background: rgba(255,215,64,0.1); border: 1px solid rgba(255,215,64,0.4); color: var(--yellow); }

/* ===== LOADING ===== */
.loading-overlay { position: fixed; inset: 0; z-index: 2000; background: rgba(10,10,15,0.8); display: flex; align-items: center; justify-content: center; backdrop-filter: blur(4px); }
.loading-spinner { width: 40px; height: 40px; border: 3px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; }

/* ===== UTILS ===== */
.hidden { display: none !important; }
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-bright); border-radius: 2px; }

/* ===== RESPONSIVE ===== */
@media (min-width: 768px) {
  .pg-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .lobby-layout { display: grid; grid-template-rows: auto 1fr auto; grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .hg-options { grid-template-columns: 1fr; }
  .hg-leaderboard { display: none; }
  .host-controls { flex-wrap: wrap; }
  .qe-history-panel { display: none; }
  .qe-body { flex-direction: column; }
  .qe-questions-panel { border-right: none; border-bottom: 1px solid var(--border); }
}
