/* ================================================================
   WhoennrlQuiz — Main Stylesheet
   ================================================================ */

/* ── Reset & Base ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 20px;
    --transition: 0.18s ease;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

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

body {
    font-family: var(--font);
    line-height: 1.5;
    min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; outline: none; }
input, textarea, select { font-family: inherit; outline: none; border: none; }
img { display: block; max-width: 100%; }

/* ── Admin Theme (always light-dark neutral) ──────────────────── */
body.admin-body {
    background: #0d0d14;
    color: #e8e8f0;
}

/* ── Quiz Themes (for session/player screens) ─────────────────── */
[data-theme="midnight"] {
    --bg:           #09090f;
    --surface:      #12121f;
    --surface2:     #1c1c2e;
    --border:       #2a2a40;
    --text:         #e8e8f8;
    --text-muted:   #55556a;
    --accent:       #7c3aed;
    --accent-light: #9d5cf0;
    --accent-glow:  rgba(124,58,237,.35);
}
[data-theme="ocean"] {
    --bg:           #040e1c;
    --surface:      #091828;
    --surface2:     #102236;
    --border:       #183050;
    --text:         #ddf0ff;
    --text-muted:   #3a6888;
    --accent:       #0ea5e9;
    --accent-light: #38bdf8;
    --accent-glow:  rgba(14,165,233,.35);
}
[data-theme="ember"] {
    --bg:           #0f0600;
    --surface:      #1a0e00;
    --surface2:     #261800;
    --border:       #3d2200;
    --text:         #fff4e8;
    --text-muted:   #7a5030;
    --accent:       #f97316;
    --accent-light: #fb923c;
    --accent-glow:  rgba(249,115,22,.35);
}
[data-theme="forest"] {
    --bg:           #020c06;
    --surface:      #071410;
    --surface2:     #0e1e18;
    --border:       #1a3028;
    --text:         #e0f5ec;
    --text-muted:   #3a6a52;
    --accent:       #10b981;
    --accent-light: #34d399;
    --accent-glow:  rgba(16,185,129,.35);
}
[data-theme="arctic"] {
    --bg:           #f0f4f8;
    --surface:      #ffffff;
    --surface2:     #e8edf4;
    --border:       #d0d8e4;
    --text:         #1a2030;
    --text-muted:   #6b7a90;
    --accent:       #6366f1;
    --accent-light: #818cf8;
    --accent-glow:  rgba(99,102,241,.3);
}

/* ── Admin Layout ─────────────────────────────────────────────── */
.admin-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    min-height: 100vh;
}

.sidebar {
    background: #09090f;
    border-right: 1px solid #1e1e2e;
    display: flex;
    flex-direction: column;
    padding: 24px 0;
    position: sticky;
    top: 0;
    height: 100vh;
}

.sidebar-logo {
    padding: 0 24px 32px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-logo .logo-icon {
    width: 32px;
    height: 32px;
    background: #7c3aed;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-logo span {
    font-size: 15px;
    font-weight: 700;
    color: #e8e8f0;
    letter-spacing: -0.3px;
}

.sidebar-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 0 12px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    color: #888898;
    font-size: 14px;
    font-weight: 500;
    transition: all var(--transition);
}
.nav-item:hover { background: #1c1c2c; color: #e8e8f0; }
.nav-item.active { background: #1e1040; color: #9d5cf0; }
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }

.sidebar-footer {
    padding: 0 12px;
    margin-top: auto;
}

.admin-content {
    padding: 40px 48px;
    background: #0d0d14;
    overflow-y: auto;
}

/* ── Page Header ──────────────────────────────────────────────── */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 36px;
}

.page-title {
    font-size: 26px;
    font-weight: 700;
    color: #e8e8f0;
    letter-spacing: -0.5px;
}

.page-subtitle {
    font-size: 14px;
    color: #55556a;
    margin-top: 4px;
}

/* ── Buttons ──────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    transition: all var(--transition);
    white-space: nowrap;
}

.btn-primary {
    background: #7c3aed;
    color: #fff;
}
.btn-primary:hover { background: #6d28d9; box-shadow: 0 0 20px rgba(124,58,237,.4); }

.btn-secondary {
    background: #1c1c2c;
    color: #aaaacc;
    border: 1px solid #2a2a40;
}
.btn-secondary:hover { background: #22223a; color: #e8e8f0; }

.btn-danger {
    background: transparent;
    color: #f87171;
    border: 1px solid #3a1818;
}
.btn-danger:hover { background: #1a0808; }

.btn-ghost {
    background: transparent;
    color: #888898;
    padding: 8px 12px;
}
.btn-ghost:hover { color: #e8e8f0; background: #1c1c2c; }

.btn-sm { padding: 7px 14px; font-size: 13px; }
.btn-lg { padding: 14px 28px; font-size: 16px; }
.btn-icon { padding: 8px; border-radius: var(--radius-sm); }
.btn svg { width: 16px; height: 16px; }

/* ── Cards ────────────────────────────────────────────────────── */
.card {
    background: #12121f;
    border: 1px solid #1e1e2e;
    border-radius: var(--radius);
    padding: 24px;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.quiz-card {
    background: #12121f;
    border: 1px solid #1e1e2e;
    border-radius: var(--radius);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    transition: border-color var(--transition), box-shadow var(--transition);
    cursor: pointer;
}
.quiz-card:hover {
    border-color: #3a2060;
    box-shadow: 0 4px 24px rgba(124,58,237,.15);
}

.quiz-card-title {
    font-size: 17px;
    font-weight: 700;
    color: #e8e8f0;
    letter-spacing: -0.3px;
}

.quiz-card-meta {
    display: flex;
    gap: 12px;
    font-size: 13px;
    color: #55556a;
}

.quiz-card-footer {
    display: flex;
    gap: 8px;
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid #1e1e2e;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 100px;
    font-size: 12px;
    font-weight: 600;
}
.badge-purple { background: #1e1040; color: #9d5cf0; }
.badge-blue   { background: #0a1e30; color: #38bdf8; }
.badge-green  { background: #071f16; color: #34d399; }

/* ── Forms ────────────────────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: 8px; }

.form-label {
    font-size: 13px;
    font-weight: 600;
    color: #aaaacc;
    letter-spacing: 0.3px;
}

.form-input {
    background: #0d0d18;
    border: 1px solid #2a2a40;
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    color: #e8e8f0;
    font-size: 14px;
    transition: border-color var(--transition);
    width: 100%;
}
.form-input:focus { border-color: #7c3aed; }
.form-input::placeholder { color: #44445a; }

.form-input[type="number"] { -moz-appearance: textfield; }
.form-input[type="number"]::-webkit-inner-spin-button { display: none; }

textarea.form-input { resize: vertical; min-height: 80px; }

.form-select {
    background: #0d0d18;
    border: 1px solid #2a2a40;
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    color: #e8e8f0;
    font-size: 14px;
    width: 100%;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23555566' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    cursor: pointer;
}
.form-select:focus { border-color: #7c3aed; }

/* ── Theme Picker ─────────────────────────────────────────────── */
.theme-picker {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.theme-option {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    border: 3px solid transparent;
    transition: all var(--transition);
    position: relative;
}
.theme-option:hover { transform: scale(1.12); }
.theme-option.selected { border-color: #fff; box-shadow: 0 0 0 2px #7c3aed; }
.theme-option input { position: absolute; opacity: 0; width: 0; height: 0; }

/* ── Logo Upload ──────────────────────────────────────────────── */
.logo-upload {
    position: relative;
    border: 2px dashed #2a2a40;
    border-radius: var(--radius);
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: border-color var(--transition);
}
.logo-upload:hover { border-color: #7c3aed; }
.logo-upload input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.logo-upload-text { color: #55556a; font-size: 14px; }
.logo-preview { max-height: 80px; margin: 0 auto 12px; object-fit: contain; }

/* ── Quiz Builder ─────────────────────────────────────────────── */
.builder-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 24px;
    align-items: start;
}

.questions-list { display: flex; flex-direction: column; gap: 16px; }

.question-card {
    background: #12121f;
    border: 1px solid #1e1e2e;
    border-radius: var(--radius);
    overflow: hidden;
    transition: border-color var(--transition);
}
.question-card.active { border-color: #3a2060; }

.question-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    cursor: pointer;
    background: #0f0f1c;
}

.question-number {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #1c1c30;
    color: #888898;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
}

.question-preview {
    flex: 1;
    font-size: 14px;
    color: #aaaacc;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.question-card-body { padding: 20px; display: flex; flex-direction: column; gap: 16px; }

.type-tabs {
    display: flex;
    gap: 4px;
    background: #0d0d18;
    padding: 4px;
    border-radius: var(--radius-sm);
}
.type-tab {
    flex: 1;
    padding: 7px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    color: #55556a;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition);
    border: none;
    background: transparent;
}
.type-tab.active {
    background: #7c3aed;
    color: #fff;
}

.options-list { display: flex; flex-direction: column; gap: 8px; }

.option-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.option-letter {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}
.opt-a { background: #1e2d5a; color: #60a5fa; }
.opt-b { background: #2d1a20; color: #f87171; }
.opt-c { background: #1a2d20; color: #4ade80; }
.opt-d { background: #2d2800; color: #fbbf24; }
.opt-e { background: #2a1a2d; color: #c084fc; }
.opt-f { background: #1a2a28; color: #34d399; }

.option-input {
    flex: 1;
    background: #0d0d18;
    border: 1px solid #2a2a40;
    border-radius: 6px;
    padding: 8px 12px;
    color: #e8e8f0;
    font-size: 14px;
    transition: border-color var(--transition);
}
.option-input:focus { border-color: #7c3aed; }
.option-input.correct { border-color: #10b981; }

.correct-toggle {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #1c1c2c;
    cursor: pointer;
    transition: all var(--transition);
    flex-shrink: 0;
}
.correct-toggle.on { background: #10b981; }
.correct-toggle svg { width: 14px; height: 14px; }

.question-settings-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
}

.toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-size: 13px;
    color: #aaaacc;
}

.toggle {
    position: relative;
    width: 40px;
    height: 22px;
    flex-shrink: 0;
}
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-track {
    position: absolute;
    inset: 0;
    background: #2a2a40;
    border-radius: 100px;
    transition: background var(--transition);
    cursor: pointer;
}
.toggle input:checked + .toggle-track { background: #7c3aed; }
.toggle-track::after {
    content: '';
    position: absolute;
    left: 3px;
    top: 3px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    transition: transform var(--transition);
}
.toggle input:checked + .toggle-track::after { transform: translateX(18px); }

/* ── Quiz Builder Sidebar (settings panel) ────────────────────── */
.builder-sidebar {
    position: sticky;
    top: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ── Session / Host Screen ────────────────────────────────────── */
.session-screen {
    background: var(--bg);
    min-height: 100vh;
    color: var(--text);
    display: flex;
    flex-direction: column;
}

.session-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 40px;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
}

.session-logo {
    max-height: 48px;
    max-width: 160px;
    object-fit: contain;
}

.session-title {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.3px;
}

.session-code-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 16px;
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 4px;
    color: var(--accent-light);
}

/* Waiting screen */
.waiting-screen {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 40px;
    padding: 40px;
}

.waiting-qr {
    background: #fff;
    padding: 20px;
    border-radius: var(--radius-lg);
    box-shadow: 0 0 60px var(--accent-glow);
}

.waiting-info {
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.waiting-join-text {
    font-size: 16px;
    color: var(--text-muted);
}

.waiting-join-url {
    font-size: 22px;
    font-weight: 700;
    color: var(--accent-light);
}

.participants-ticker {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    max-width: 700px;
}

.participant-chip {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 100px;
    padding: 6px 14px;
    font-size: 14px;
    color: var(--text);
    animation: popIn .2s ease;
}

@keyframes popIn {
    from { transform: scale(.8); opacity: 0; }
    to   { transform: scale(1); opacity: 1; }
}

.participant-count {
    font-size: 48px;
    font-weight: 800;
    color: var(--accent-light);
    letter-spacing: -2px;
}

/* Question display (host) */
.host-question-screen {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 40px;
    gap: 32px;
}

.question-progress {
    display: flex;
    align-items: center;
    gap: 16px;
}

.progress-bar {
    flex: 1;
    height: 4px;
    background: var(--surface2);
    border-radius: 2px;
    overflow: hidden;
}

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

.progress-label {
    font-size: 14px;
    color: var(--text-muted);
    white-space: nowrap;
}

.timer-ring {
    position: relative;
    width: 80px;
    height: 80px;
    flex-shrink: 0;
}

.timer-ring svg { transform: rotate(-90deg); }
.timer-track { fill: none; stroke: var(--surface2); stroke-width: 4; }
.timer-fill  {
    fill: none;
    stroke: var(--accent);
    stroke-width: 4;
    stroke-linecap: round;
    transition: stroke-dashoffset .9s linear, stroke .3s;
}
.timer-ring-number {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 800;
    color: var(--text);
}

.question-text {
    font-size: clamp(22px, 3.5vw, 40px);
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.5px;
    line-height: 1.3;
    text-align: center;
    max-width: 900px;
    margin: 0 auto;
}

.options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    max-width: 900px;
    margin: 0 auto;
    width: 100%;
}

.option-btn {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 24px;
    border-radius: var(--radius);
    font-size: 17px;
    font-weight: 600;
    color: #fff;
    border: none;
    cursor: pointer;
    transition: all var(--transition);
    text-align: left;
    position: relative;
    overflow: hidden;
}
.option-btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0);
    transition: background var(--transition);
}
.option-btn:hover::after { background: rgba(255,255,255,.06); }

.option-btn-a { background: #2563eb; }
.option-btn-b { background: #dc2626; }
.option-btn-c { background: #16a34a; }
.option-btn-d { background: #d97706; }

.option-btn.correct-reveal {
    ring: 3px solid #4ade80;
    box-shadow: 0 0 0 3px #4ade80, inset 0 0 0 3px rgba(74,222,128,.2);
}
.option-btn.wrong-reveal { opacity: .45; }

.option-label-box {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: rgba(255,255,255,.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 800;
    flex-shrink: 0;
}

.answer-counter {
    text-align: center;
    font-size: 15px;
    color: var(--text-muted);
}

/* Results bar chart */
.results-bar-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
}
.results-bar-label { font-size: 14px; color: var(--text-muted); width: 24px; }
.results-bar-track {
    flex: 1;
    height: 8px;
    background: var(--surface2);
    border-radius: 4px;
    overflow: hidden;
}
.results-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width .5s ease;
}
.results-bar-count { font-size: 14px; color: var(--text-muted); width: 24px; text-align: right; }

/* Leaderboard */
.leaderboard { display: flex; flex-direction: column; gap: 8px; max-width: 600px; margin: 0 auto; width: 100%; }

.lb-row {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    transition: all var(--transition);
}
.lb-row.top1 { background: rgba(251,191,36,.08); border-color: rgba(251,191,36,.3); }
.lb-row.top2 { background: rgba(148,163,184,.06); border-color: rgba(148,163,184,.2); }
.lb-row.top3 { background: rgba(249,115,22,.06); border-color: rgba(249,115,22,.2); }

.lb-rank {
    font-size: 16px;
    font-weight: 800;
    width: 28px;
    text-align: center;
    color: var(--text-muted);
}
.lb-row.top1 .lb-rank { color: #fbbf24; }
.lb-row.top2 .lb-rank { color: #94a3b8; }
.lb-row.top3 .lb-rank { color: #f97316; }

.lb-name { flex: 1; font-size: 16px; font-weight: 600; color: var(--text); }
.lb-score { font-size: 18px; font-weight: 800; color: var(--accent-light); }

/* Host controls bar */
.host-controls {
    padding: 20px 40px;
    background: var(--surface);
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.host-controls .btn-primary {
    background: var(--accent);
    font-size: 16px;
    padding: 12px 28px;
}
.host-controls .btn-primary:hover {
    background: var(--accent-light);
    box-shadow: 0 0 24px var(--accent-glow);
}

/* ── Player Screen ────────────────────────────────────────────── */
.player-screen {
    background: var(--bg);
    min-height: 100vh;
    color: var(--text);
    display: flex;
    flex-direction: column;
    max-width: 540px;
    margin: 0 auto;
    padding: 0 0 env(safe-area-inset-bottom);
}

.player-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.player-score {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}
.player-score-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; }
.player-score-value { font-size: 22px; font-weight: 800; color: var(--accent-light); }

.player-name { font-size: 15px; font-weight: 600; color: var(--text); }

.player-content { flex: 1; display: flex; flex-direction: column; padding: 24px 20px; gap: 24px; }

.player-question { font-size: clamp(18px, 5vw, 26px); font-weight: 700; line-height: 1.35; color: var(--text); }

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

.player-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border-radius: var(--radius);
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    border: none;
    cursor: pointer;
    transition: all var(--transition);
    text-align: left;
    width: 100%;
}
.player-option:active { transform: scale(.97); }
.player-option.selected { box-shadow: 0 0 0 3px rgba(255,255,255,.4); transform: scale(1.01); }
.player-option.correct-reveal  { box-shadow: 0 0 0 3px #4ade80; }
.player-option.wrong-reveal    { opacity: .4; }
.player-option.selected.wrong-reveal { opacity: .7; box-shadow: 0 0 0 3px #f87171; }
.player-option.disabled { cursor: not-allowed; }

.player-option-a { background: #2563eb; }
.player-option-b { background: #dc2626; }
.player-option-c { background: #16a34a; }
.player-option-d { background: #d97706; }
.player-option-e { background: #7c3aed; }

/* Timer bar (player) */
.timer-bar-wrap {
    width: 100%;
    height: 6px;
    background: var(--surface2);
    border-radius: 3px;
    overflow: hidden;
}
.timer-bar-fill {
    height: 100%;
    border-radius: 3px;
    background: var(--accent);
    transition: width .9s linear, background .3s;
}
.timer-bar-fill.urgent { background: #f87171; }

.timer-label {
    font-size: 13px;
    color: var(--text-muted);
    text-align: right;
}

/* Booster button */
.booster-zone {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 18px;
}

.booster-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 700;
    background: #1a1040;
    color: #c084fc;
    border: 1px solid #3a1e60;
    cursor: pointer;
    transition: all var(--transition);
    flex-shrink: 0;
}
.booster-btn:hover { background: #2a1860; box-shadow: 0 0 16px rgba(192,132,252,.3); }
.booster-btn.active {
    background: #7c3aed;
    color: #fff;
    border-color: transparent;
    box-shadow: 0 0 20px rgba(124,58,237,.5);
}

.booster-description { font-size: 13px; color: var(--text-muted); line-height: 1.4; }

/* Result feedback */
.answer-result {
    text-align: center;
    padding: 20px;
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.answer-result.correct { background: rgba(16,185,129,.1); border: 1px solid rgba(16,185,129,.3); }
.answer-result.wrong   { background: rgba(239,68,68,.1);  border: 1px solid rgba(239,68,68,.3); }

.result-emoji { font-size: 32px; }
.result-label { font-size: 18px; font-weight: 700; }
.result-points { font-size: 28px; font-weight: 800; color: var(--accent-light); }
.answer-result.correct .result-label { color: #34d399; }
.answer-result.wrong   .result-label { color: #f87171; }

/* Waiting for next */
.waiting-next {
    text-align: center;
    color: var(--text-muted);
    font-size: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}
.pulse-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent);
    animation: pulse 1.2s infinite;
}
@keyframes pulse {
    0%,100% { opacity: .3; transform: scale(.8); }
    50% { opacity: 1; transform: scale(1.2); }
}

/* ── Join / Login page ────────────────────────────────────────── */
.center-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: #09090f;
}

.auth-card {
    background: #12121f;
    border: 1px solid #1e1e2e;
    border-radius: var(--radius-lg);
    padding: 40px;
    width: 100%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.auth-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}
.auth-logo-icon {
    width: 40px;
    height: 40px;
    background: #7c3aed;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.auth-logo-text { font-size: 18px; font-weight: 800; color: #e8e8f0; letter-spacing: -0.3px; }
.auth-title { font-size: 22px; font-weight: 700; color: #e8e8f0; letter-spacing: -0.4px; }
.auth-sub   { font-size: 14px; color: #55556a; }
.auth-form  { display: flex; flex-direction: column; gap: 16px; }
.auth-error { background: #1a0808; border: 1px solid #3a1010; color: #f87171; border-radius: var(--radius-sm); padding: 10px 14px; font-size: 14px; display: none; }
.auth-error.show { display: block; }

/* ── Toast ────────────────────────────────────────────────────── */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.toast {
    background: #1c1c2c;
    border: 1px solid #2a2a40;
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    font-size: 14px;
    color: #e8e8f0;
    max-width: 300px;
    animation: slideUp .2s ease;
    box-shadow: 0 4px 20px rgba(0,0,0,.4);
}
.toast.success { border-color: #1a3a28; color: #4ade80; background: #0c1e14; }
.toast.error   { border-color: #3a1010; color: #f87171; background: #1a0808; }

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

/* ── Modals ───────────────────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.7);
    backdrop-filter: blur(4px);
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }

.modal {
    background: #12121f;
    border: 1px solid #2a2a40;
    border-radius: var(--radius-lg);
    padding: 32px;
    width: 100%;
    max-width: 560px;
    max-height: 80vh;
    overflow-y: auto;
    transform: scale(.95);
    transition: transform .2s;
}
.modal-overlay.open .modal { transform: scale(1); }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.modal-title { font-size: 20px; font-weight: 700; color: #e8e8f0; }

/* ── Utility ──────────────────────────────────────────────────── */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-24 { gap: 24px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.w-full { width: 100%; }
.text-center { text-align: center; }
.text-muted { color: #55556a; font-size: 14px; }
.font-mono { font-family: 'JetBrains Mono', monospace; }
.hidden { display: none !important; }

/* ── Scrollbar ────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #2a2a40; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #3a3a55; }

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 900px) {
    .admin-layout { grid-template-columns: 1fr; }
    .sidebar { display: none; }
    .admin-content { padding: 24px 20px; }
    .builder-layout { grid-template-columns: 1fr; }
    .options-grid { grid-template-columns: 1fr; }
    .question-settings-row { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
    .host-question-screen { padding: 20px; }
    .question-settings-row { grid-template-columns: 1fr; }
}

/* ── SF Symbols icon system ───────────────────────────────────── */
.sf-icon {
    display: inline-block;
    width:  var(--icon-size, 20px);
    height: var(--icon-size, 20px);
    background-color: currentColor;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
    -webkit-mask-size: contain;
    mask-size: contain;
    flex-shrink: 0;
    vertical-align: middle;
}

/* Convenience size modifiers */
.sf-icon-sm { --icon-size: 14px; }
.sf-icon-md { --icon-size: 18px; }
.sf-icon-lg { --icon-size: 24px; }
.sf-icon-xl { --icon-size: 32px; }
}
