/* ═══════════════════════════════════════
   BitCoin del Saber v4.0 — Estilos
   ═══════════════════════════════════════ */

:root {
    --bg-primary: #0a0e1a;
    --bg-secondary: #111827;
    --bg-card: rgba(17, 24, 39, 0.85);
    --bg-glass: rgba(255, 255, 255, 0.05);
    --text-primary: #e5e7eb;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    --accent-cyan: #06b6d4;
    --accent-purple: #8b5cf6;
    --accent-gold: #f59e0b;
    --accent-green: #10b981;
    --accent-red: #ef4444;
    --accent-pink: #ec4899;
    --border-color: rgba(255, 255, 255, 0.08);
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    --glow-cyan: 0 0 20px rgba(6, 182, 212, 0.3);
    --glow-gold: 0 0 20px rgba(245, 158, 11, 0.3);
    --glow-green: 0 0 15px rgba(16, 185, 129, 0.3);
    --glow-red: 0 0 15px rgba(239, 68, 68, 0.3);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; }
body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

/* ── Title Screen ── */
#title-screen {
    position: fixed; inset: 0; z-index: 1000;
    display: none; place-items: center;
    background: radial-gradient(ellipse at center, #1a1a3e 0%, #0a0e1a 70%);
}
#title-screen.active { display: grid; }
.title-content { text-align: center; }
.title-brain {
    width: 120px; height: 120px;
    animation: float 3s ease-in-out infinite, glow-pulse 2s ease-in-out infinite;
    filter: drop-shadow(0 0 30px rgba(6, 182, 212, 0.5));
}
.title-name {
    font-size: 2.5rem; font-weight: 800; margin: 1rem 0 0.25rem;
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
}
.title-tagline { color: var(--text-secondary); font-size: 1.1rem; margin-bottom: 2rem; }
.title-buttons { display: flex; flex-direction: column; align-items: center; gap: 0.7rem; }
.btn-play, .btn-multiplayer {
    border: none; color: white; padding: 0.9rem 2.8rem; font-size: 1.2rem; font-weight: 700;
    border-radius: 50px; cursor: pointer; width: 260px;
    transition: transform 0.2s, box-shadow 0.2s;
}
.btn-play {
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
    box-shadow: 0 0 30px rgba(6, 182, 212, 0.4);
}
.btn-play:hover { transform: scale(1.05); box-shadow: 0 0 40px rgba(6, 182, 212, 0.6); }
.btn-play:active { transform: scale(0.98); }
.title-version { color: var(--text-muted); font-size: 0.8rem; margin-top: 1.5rem; }

/* ── Game Container ── */
.game-container {
    height: 100vh; display: flex; flex-direction: column;
    max-width: 1400px; margin: 0 auto;
}

/* ── HUD ── */
.hud {
    padding: 0.5rem 1rem;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}
.hud-main {
    display: flex; align-items: center; justify-content: center; gap: 1rem;
}
.hud-bits { display: flex; align-items: center; gap: 0.3rem; }
.hud-icon { font-size: 1.5rem; }
.hud-value {
    font-size: 1.8rem; font-weight: 800;
    background: linear-gradient(135deg, var(--accent-gold), #fbbf24);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
}
.hud-label { color: var(--text-muted); font-size: 0.8rem; }
.hud-value-sm { color: var(--accent-cyan); font-size: 0.9rem; font-weight: 600; }
.hud-secondary {
    display: flex; justify-content: center; gap: 0.6rem; margin-top: 0.3rem; flex-wrap: wrap;
}
.hud-badge {
    padding: 0.15rem 0.5rem; border-radius: 20px; font-size: 0.75rem; font-weight: 600;
    background: var(--bg-glass); border: 1px solid var(--border-color);
}
.hud-badge.streak.on-fire { background: rgba(245, 158, 11, 0.2); border-color: var(--accent-gold); animation: fire-glow 0.5s ease-in-out infinite alternate; }
.hud-badge.level { background: rgba(139, 92, 246, 0.15); border-color: rgba(139, 92, 246, 0.3); }

/* ── Fiebre ── */
.fiebre-indicator {
    display: none; text-align: center; padding: 0.4rem;
    background: linear-gradient(90deg, var(--accent-red), var(--accent-gold), var(--accent-red));
    background-size: 200% 100%;
    animation: shimmer 1s linear infinite;
    font-weight: 700; font-size: 0.9rem; color: white;
}
.fiebre-indicator.active { display: block; }
body.fiebre { animation: fiebre-bg 1s ease-in-out infinite alternate; }

/* ── Main Layout ── */
.main-layout {
    flex: 1; display: flex; overflow: hidden;
}
.play-zone {
    flex: 1; display: flex; flex-direction: column; align-items: center;
    padding: 1rem; overflow-y: auto;
    background: radial-gradient(ellipse at 50% 30%, rgba(6, 182, 212, 0.05) 0%, transparent 70%);
}

/* ── Brain ── */
.brain-container {
    position: relative; margin-bottom: 1rem;
}
.brain-clickable {
    cursor: pointer; transition: transform 0.1s;
    position: relative;
}
.brain-clickable:active { transform: scale(0.92); }
.brain-img {
    width: 140px; height: 140px; object-fit: contain;
    filter: drop-shadow(0 0 20px rgba(6, 182, 212, 0.4));
    animation: float 4s ease-in-out infinite;
}
.encounter-area {
    position: absolute; inset: -50px; pointer-events: none;
}
.encounter {
    position: absolute; width: 40px; height: 40px; pointer-events: all; cursor: pointer;
    transition: left 0.1s, top 0.1s;
}
.encounter img { width: 100%; height: 100%; object-fit: contain; }
.encounter.dying { animation: encounter-die 0.3s forwards; }

/* ── Trivia Zone ── */
.trivia-zone { width: 100%; max-width: 500px; }
.trivia-start-btn {
    width: 100%; padding: 1rem 1.5rem; border: 2px solid var(--accent-cyan);
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.15), rgba(139, 92, 246, 0.15));
    color: var(--accent-cyan); font-size: 1.15rem; font-weight: 700;
    border-radius: var(--radius); cursor: pointer;
    transition: all 0.3s; letter-spacing: 0.5px;
}
.trivia-start-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.25), rgba(139, 92, 246, 0.25));
    box-shadow: var(--glow-cyan);
}
.trivia-start-btn:disabled { opacity: 0.5; cursor: default; }
.trivia-start-btn.ready { animation: trivia-pulse 2s ease-in-out infinite; }
.trivia-start-btn.bonus {
    border-color: var(--accent-gold);
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(236, 72, 153, 0.2));
    color: var(--accent-gold); animation: bonus-glow 1s ease-in-out infinite alternate;
}

/* ── Trivia Card ── */
.trivia-card {
    display: none; margin-top: 0.75rem;
    background: var(--bg-card); border: 1px solid var(--border-color);
    border-radius: var(--radius); padding: 1.25rem; box-shadow: var(--shadow);
    backdrop-filter: blur(10px);
}
.trivia-card.active { display: block; animation: slide-up 0.3s ease-out; }
.trivia-card.result-correct { border-color: var(--accent-green); box-shadow: var(--glow-green); }
.trivia-card.result-wrong { border-color: var(--accent-red); box-shadow: var(--glow-red); animation: shake 0.4s ease-in-out; }

.trivia-category {
    display: inline-block; padding: 0.2rem 0.75rem; border-radius: 20px;
    font-size: 0.8rem; font-weight: 600; color: white; margin-bottom: 0.75rem;
}
.trivia-question {
    font-size: 1.1rem; font-weight: 600; margin-bottom: 1rem;
    line-height: 1.4;
}
.trivia-options { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; margin-bottom: 1rem; }
.trivia-option {
    display: flex; align-items: center; gap: 0.5rem;
    padding: 0.75rem; border: 2px solid var(--border-color);
    background: var(--bg-glass); color: var(--text-primary);
    border-radius: var(--radius-sm); cursor: pointer;
    font-size: 0.9rem; text-align: left;
    transition: all 0.2s;
}
.trivia-option:hover:not(:disabled) { border-color: var(--accent-cyan); background: rgba(6, 182, 212, 0.1); }
.opt-letter {
    display: flex; align-items: center; justify-content: center;
    width: 28px; height: 28px; border-radius: 50%;
    background: var(--bg-glass); font-weight: 700; font-size: 0.85rem;
    flex-shrink: 0; border: 1px solid var(--border-color);
}
.opt-text { flex: 1; }
.trivia-option.correct { border-color: var(--accent-green) !important; background: rgba(16, 185, 129, 0.15) !important; }
.trivia-option.correct .opt-letter { background: var(--accent-green); color: white; }
.trivia-option.wrong { border-color: var(--accent-red) !important; background: rgba(239, 68, 68, 0.15) !important; }
.trivia-option.wrong .opt-letter { background: var(--accent-red); color: white; }
.trivia-option:disabled { cursor: default; opacity: 0.7; }

.trivia-timer { height: 6px; background: var(--bg-glass); border-radius: 3px; overflow: hidden; }
.trivia-timer-bar {
    height: 100%; background: linear-gradient(90deg, var(--accent-cyan), var(--accent-green));
    border-radius: 3px; transition: width 0.05s linear;
}
.trivia-timer-bar.urgent { background: linear-gradient(90deg, var(--accent-red), var(--accent-gold)); animation: timer-flash 0.5s ease-in-out infinite; }

.trivia-streak-display { text-align: center; margin-top: 0.5rem; font-size: 0.85rem; color: var(--accent-gold); }
.trivia-result {
    text-align: center; padding: 1rem 0 0; font-size: 1.1rem; font-weight: 700;
    animation: result-pop 0.4s ease-out;
}
.trivia-result.correct { color: var(--accent-green); }
.trivia-result.wrong { color: var(--accent-red); }
.result-icon { font-size: 2rem; display: block; margin-bottom: 0.25rem; }
.result-reward { display: block; font-size: 1.3rem; color: var(--accent-gold); }
.result-reward.small { font-size: 0.9rem; color: var(--text-muted); }
.result-streak { display: block; font-size: 0.9rem; color: var(--accent-gold); margin-top: 0.25rem; }
.result-text { display: block; }

/* ── Side Panel ── */
.side-panel {
    width: 380px; display: flex; flex-direction: column;
    background: var(--bg-secondary); border-left: 1px solid var(--border-color);
    flex-shrink: 0;
}
.tab-nav {
    display: flex; padding: 0.5rem; gap: 0.25rem;
    border-bottom: 1px solid var(--border-color); flex-wrap: wrap; justify-content: center;
}
.tab-btn {
    background: none; border: none; color: var(--text-muted);
    font-size: 1.1rem; padding: 0.4rem 0.5rem; cursor: pointer;
    border-radius: var(--radius-sm); transition: all 0.2s;
}
.tab-btn:hover { background: var(--bg-glass); color: var(--text-primary); }
.tab-btn.active { background: rgba(6, 182, 212, 0.15); color: var(--accent-cyan); }
.tab-panels { flex: 1; overflow-y: auto; padding: 0.75rem; }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ── Generators ── */
.gen-row {
    display: flex; align-items: center; gap: 0.6rem;
    padding: 0.6rem; margin-bottom: 0.4rem;
    background: var(--bg-glass); border: 1px solid var(--border-color);
    border-radius: var(--radius-sm); transition: all 0.2s;
}
.gen-row.affordable { border-color: rgba(6, 182, 212, 0.3); }
.gen-icon { font-size: 1.5rem; }
.gen-info { flex: 1; min-width: 0; }
.gen-name { font-weight: 600; font-size: 0.85rem; }
.gen-count { color: var(--accent-cyan); }
.gen-prod { font-size: 0.75rem; color: var(--accent-green); }
.gen-next { font-size: 0.7rem; color: var(--text-muted); }
.gen-actions { display: flex; gap: 0.3rem; flex-shrink: 0; }

/* ── Buttons ── */
.btn-buy {
    padding: 0.35rem 0.6rem; border: 1px solid var(--accent-cyan);
    background: rgba(6, 182, 212, 0.1); color: var(--accent-cyan);
    border-radius: var(--radius-sm); cursor: pointer; font-size: 0.75rem;
    font-weight: 600; transition: all 0.2s; white-space: nowrap;
}
.btn-buy:hover:not(.disabled) { background: rgba(6, 182, 212, 0.25); }
.btn-buy.disabled { opacity: 0.4; cursor: default; border-color: var(--text-muted); color: var(--text-muted); }
.btn-buy-max {
    padding: 0.35rem 0.5rem; border: 1px solid var(--accent-purple);
    background: rgba(139, 92, 246, 0.1); color: var(--accent-purple);
    border-radius: var(--radius-sm); cursor: pointer; font-size: 0.7rem;
    font-weight: 700; transition: all 0.2s;
}
.btn-buy-max:hover { background: rgba(139, 92, 246, 0.25); }

/* ── Upgrades ── */
.upgrade-row {
    display: flex; align-items: center; gap: 0.6rem;
    padding: 0.6rem; margin-bottom: 0.4rem;
    background: var(--bg-glass); border: 1px solid var(--border-color);
    border-radius: var(--radius-sm); transition: all 0.2s;
}
.upgrade-row.affordable { border-color: rgba(245, 158, 11, 0.3); }
.upgrade-icon { font-size: 1.3rem; }
.upgrade-info { flex: 1; }
.upgrade-name { font-weight: 600; font-size: 0.85rem; }
.upgrade-desc { font-size: 0.75rem; color: var(--text-secondary); }

/* ── Missions ── */
.mission-row {
    display: flex; align-items: center; gap: 0.6rem;
    padding: 0.6rem; margin-bottom: 0.4rem;
    background: var(--bg-glass); border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
}
.mission-row.completed { border-color: rgba(16, 185, 129, 0.3); }
.mission-row.claimed { opacity: 0.5; }
.mission-icon { font-size: 1.3rem; }
.mission-info { flex: 1; }
.mission-desc { font-size: 0.85rem; font-weight: 500; }
.mission-progress { display: flex; align-items: center; gap: 0.5rem; margin-top: 0.25rem; }
.progress-bar { flex: 1; height: 6px; background: var(--bg-glass); border-radius: 3px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--accent-green); border-radius: 3px; transition: width 0.3s; }
.mission-progress span { font-size: 0.7rem; color: var(--text-muted); white-space: nowrap; }
.btn-claim {
    padding: 0.3rem 0.6rem; border: 1px solid var(--accent-green);
    background: rgba(16, 185, 129, 0.15); color: var(--accent-green);
    border-radius: var(--radius-sm); cursor: pointer; font-size: 0.75rem;
    font-weight: 700; transition: all 0.2s;
}
.btn-claim:hover { background: rgba(16, 185, 129, 0.3); }
.reward-pending { font-size: 0.75rem; color: var(--text-muted); }

/* ── Achievements ── */
.ach-category {
    font-size: 0.8rem; font-weight: 700; color: var(--accent-purple);
    text-transform: uppercase; letter-spacing: 1px; margin: 0.8rem 0 0.3rem;
}
.ach-row {
    display: flex; align-items: center; padding: 0.5rem;
    margin-bottom: 0.3rem; background: var(--bg-glass);
    border: 1px solid var(--border-color); border-radius: var(--radius-sm);
}
.ach-row.locked { opacity: 0.5; }
.ach-row.unlocked { border-color: rgba(245, 158, 11, 0.3); }
.ach-info { flex: 1; }
.ach-name { font-weight: 600; font-size: 0.85rem; }
.ach-desc { font-size: 0.7rem; color: var(--text-secondary); }
.ach-reward { font-size: 0.8rem; font-weight: 700; color: var(--accent-gold); }

/* ── Prestige ── */
.prestige-header { text-align: center; padding: 1rem 0; }
.prestige-neurons { font-size: 1.5rem; font-weight: 700; color: var(--accent-purple); }
.prestige-gain { font-size: 0.9rem; color: var(--accent-gold); margin: 0.5rem 0; }
.btn-prestige {
    padding: 0.75rem 2rem; border: 2px solid var(--accent-purple);
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(236, 72, 153, 0.2));
    color: var(--accent-purple); font-size: 1.1rem; font-weight: 700;
    border-radius: 50px; cursor: pointer; transition: all 0.3s;
}
.btn-prestige:hover:not(.disabled) { box-shadow: 0 0 25px rgba(139, 92, 246, 0.4); transform: scale(1.03); }
.btn-prestige.disabled { opacity: 0.4; cursor: default; }
.prestige-info { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.5rem; }
.prestige-upgrade {
    display: flex; align-items: center; gap: 0.6rem;
    padding: 0.6rem; margin-bottom: 0.4rem;
    background: var(--bg-glass); border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
}
.prestige-upgrade.owned { border-color: rgba(139, 92, 246, 0.3); background: rgba(139, 92, 246, 0.05); }
.prestige-upgrade.affordable { border-color: rgba(139, 92, 246, 0.4); }
.pu-icon { font-size: 1.5rem; }
.pu-info { flex: 1; }
.pu-name { font-weight: 600; font-size: 0.85rem; }
.pu-desc { font-size: 0.75rem; color: var(--text-secondary); }

/* ── Stats ── */
.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; margin-bottom: 0.75rem; }
.stat-card {
    padding: 0.6rem; text-align: center;
    background: var(--bg-glass); border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
}
.stat-card.correct { border-color: rgba(16, 185, 129, 0.3); }
.stat-card.wrong { border-color: rgba(239, 68, 68, 0.3); }
.stat-card.fire { border-color: rgba(245, 158, 11, 0.3); }
.stat-value { font-size: 1.2rem; font-weight: 700; color: var(--accent-cyan); }
.stat-label { font-size: 0.7rem; color: var(--text-muted); }
.stat-cat-row {
    display: flex; justify-content: space-between; padding: 0.35rem 0;
    border-bottom: 1px solid var(--border-color); font-size: 0.8rem;
}
.stat-time { font-size: 0.85rem; color: var(--text-secondary); text-align: center; padding: 0.5rem; }

/* ── Boosts ── */
.boost-row {
    display: flex; align-items: center; gap: 0.6rem;
    padding: 0.6rem; margin-bottom: 0.4rem;
    background: var(--bg-glass); border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
}
.boost-row.affordable { border-color: rgba(236, 72, 153, 0.3); }
.boost-icon { font-size: 1.3rem; }
.boost-info { flex: 1; }
.boost-name { font-weight: 600; font-size: 0.85rem; }
.boost-desc { font-size: 0.75rem; color: var(--text-secondary); }
.boost-active {
    padding: 0.4rem 0.6rem; margin-bottom: 0.3rem;
    background: rgba(16, 185, 129, 0.1); border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: var(--radius-sm); font-size: 0.8rem;
}

/* ── Settings ── */
.setting-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 0.6rem; margin-bottom: 0.4rem;
    background: var(--bg-glass); border-radius: var(--radius-sm);
}
.btn-toggle {
    padding: 0.3rem 1rem; border: 1px solid; border-radius: 20px;
    cursor: pointer; font-weight: 700; font-size: 0.8rem;
}
.btn-toggle.on { background: rgba(16, 185, 129, 0.2); border-color: var(--accent-green); color: var(--accent-green); }
.btn-toggle.off { background: rgba(239, 68, 68, 0.1); border-color: var(--accent-red); color: var(--accent-red); }
.setting-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.5rem 0; }
.btn-action {
    flex: 1; min-width: 120px; padding: 0.5rem; border: 1px solid var(--border-color);
    background: var(--bg-glass); color: var(--text-primary); border-radius: var(--radius-sm);
    cursor: pointer; font-size: 0.85rem; transition: all 0.2s;
}
.btn-action:hover { border-color: var(--accent-cyan); }
.btn-action.danger { border-color: var(--accent-red); color: var(--accent-red); }
.btn-action.danger:hover { background: rgba(239, 68, 68, 0.15); }
#import-area { margin-top: 0.5rem; }
#import-text {
    width: 100%; padding: 0.5rem; background: var(--bg-glass);
    border: 1px solid var(--border-color); color: var(--text-primary);
    border-radius: var(--radius-sm); resize: vertical; font-family: monospace;
    margin-bottom: 0.5rem;
}
.game-version { text-align: center; color: var(--text-muted); font-size: 0.7rem; margin-top: 1rem; }

/* ── Sections ── */
.section-title {
    font-size: 0.9rem; font-weight: 700; color: var(--text-primary);
    margin: 0.75rem 0 0.5rem; padding-bottom: 0.25rem;
    border-bottom: 1px solid var(--border-color);
}
.section-subtitle { font-size: 0.8rem; font-weight: 600; color: var(--text-secondary); margin: 0.5rem 0 0.3rem; }
.empty-msg { text-align: center; color: var(--text-muted); padding: 2rem 1rem; font-size: 0.9rem; }

/* ── Overlays ── */
.overlay {
    position: fixed; inset: 0; z-index: 900;
    display: none; place-items: center;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}
.overlay.active { display: grid; }

/* ── Modal ── */
.modal {
    background: var(--bg-secondary); border: 1px solid var(--border-color);
    border-radius: var(--radius); padding: 2rem; text-align: center;
    max-width: 400px; width: 90%; box-shadow: var(--shadow);
    animation: modal-pop 0.3s ease-out;
}
.modal-icon { font-size: 3rem; margin-bottom: 0.5rem; }
.modal-title { font-size: 1.3rem; font-weight: 700; margin-bottom: 0.5rem; }
.modal-text { color: var(--text-secondary); margin-bottom: 1rem; line-height: 1.6; }
.modal-reward { font-size: 1.2rem; font-weight: 700; color: var(--accent-gold); margin-bottom: 1rem; }
.btn-modal {
    padding: 0.6rem 2rem; border: 2px solid var(--accent-cyan);
    background: rgba(6, 182, 212, 0.15); color: var(--accent-cyan);
    border-radius: 50px; cursor: pointer; font-weight: 700; font-size: 1rem;
    transition: all 0.2s;
}
.btn-modal:hover { background: rgba(6, 182, 212, 0.3); }
.modal-choices { display: flex; flex-direction: column; gap: 0.5rem; }
.btn-choice {
    padding: 0.75rem; border: 1px solid var(--accent-purple);
    background: rgba(139, 92, 246, 0.1); color: var(--text-primary);
    border-radius: var(--radius-sm); cursor: pointer; font-size: 0.9rem;
    transition: all 0.2s;
}
.btn-choice:hover { background: rgba(139, 92, 246, 0.25); }

/* ── Rompebits ── */
.rb-arena { position: relative; width: 100%; height: 300px; max-width: 500px; margin: 1rem auto; }
.rb-title { text-align: center; font-size: 1.5rem; font-weight: 700; color: var(--accent-gold); }
.rb-node {
    position: absolute; width: 40px; height: 40px; font-size: 1.5rem;
    display: grid; place-items: center; cursor: pointer;
    opacity: 0; transition: opacity 0.2s, transform 0.3s;
    animation: node-pulse 1s ease-in-out infinite;
}
.rb-node.visible { opacity: 1; }
.rb-node.caught { transform: scale(1.5); opacity: 0; font-size: 0.8rem; color: var(--accent-gold); }
.rb-node.expired { opacity: 0; transform: scale(0.5); }
.rb-result { text-align: center; padding: 2rem; }
.rb-score { font-size: 1.2rem; margin: 0.5rem 0; }
.rb-bonus { font-size: 1.5rem; font-weight: 700; color: var(--accent-gold); }
.rb-cdd { font-size: 1rem; color: var(--accent-purple); margin-top: 0.25rem; }

/* ── Notifications ── */
.notifications { position: fixed; top: 1rem; right: 1rem; z-index: 950; display: flex; flex-direction: column; gap: 0.5rem; }
.notification {
    padding: 0.75rem 1rem; border-radius: var(--radius-sm);
    background: var(--bg-secondary); border: 1px solid var(--border-color);
    box-shadow: var(--shadow); transform: translateX(120%);
    transition: transform 0.3s ease-out; max-width: 300px;
}
.notification.show { transform: translateX(0); }
.notification.event { border-color: rgba(245, 158, 11, 0.4); }
.notification.streak { border-color: rgba(245, 158, 11, 0.5); background: rgba(245, 158, 11, 0.1); }
.notification.mission { border-color: rgba(16, 185, 129, 0.4); }
.notification.prestige { border-color: rgba(139, 92, 246, 0.4); }
.notif-title { font-weight: 700; font-size: 0.85rem; }
.notif-msg { font-size: 0.8rem; color: var(--text-secondary); }

/* ── Click Float ── */
.click-float {
    position: fixed; pointer-events: none; z-index: 800;
    font-weight: 700; font-size: 1.1rem; color: var(--accent-gold);
    animation: float-up 1s ease-out forwards;
    text-shadow: 0 0 10px rgba(245, 158, 11, 0.5);
}
.click-float.combo { color: var(--accent-purple); font-size: 1.3rem; }

.floating-text {
    position: fixed; pointer-events: none; z-index: 800;
    font-weight: 700; font-size: 1.3rem; color: var(--accent-gold);
    animation: float-up 1.5s ease-out forwards;
    text-shadow: 0 0 15px rgba(245, 158, 11, 0.5);
}

/* ── Particles Canvas ── */
.particles-canvas {
    position: fixed; inset: 0; z-index: 700; pointer-events: none;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.15); }

/* ═══════════════════════════════════════
   Multiplayer Mode
   ═══════════════════════════════════════ */

/* Title screen multiplayer button */
.btn-multiplayer {
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-pink));
    box-shadow: 0 0 25px rgba(139, 92, 246, 0.4);
}
.btn-multiplayer:hover { transform: scale(1.05); box-shadow: 0 0 35px rgba(139, 92, 246, 0.6); }
.btn-multiplayer:active { transform: scale(0.98); }

/* Overlay */
.multiplayer-overlay { z-index: 1010; }
.multiplayer-overlay.active { display: grid; }

/* Panel base */
.mp-panel {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 2rem;
    text-align: center;
    max-width: 550px; width: 92%;
    box-shadow: var(--shadow);
    animation: modal-pop 0.3s ease-out;
    max-height: 90vh; overflow-y: auto;
}
.mp-title {
    font-size: 1.8rem; font-weight: 800; margin-bottom: 0.3rem;
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-pink));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
}
.mp-subtitle { color: var(--text-secondary); margin-bottom: 1.5rem; }

/* Player count buttons */
.mp-player-count { margin-bottom: 1.2rem; }
.mp-player-count label { display: block; color: var(--text-secondary); margin-bottom: 0.5rem; font-weight: 600; }
.mp-count-btns { display: flex; justify-content: center; gap: 0.5rem; }
.mp-count-btn {
    width: 50px; height: 50px; border-radius: 50%;
    border: 2px solid var(--border-color);
    background: var(--bg-glass); color: var(--text-primary);
    font-size: 1.3rem; font-weight: 700; cursor: pointer;
    transition: all 0.2s;
}
.mp-count-btn:hover { border-color: var(--accent-purple); }
.mp-count-btn.active {
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-pink));
    border-color: var(--accent-purple);
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.4);
}

/* Name inputs */
.mp-names { margin-bottom: 1.5rem; }
.mp-name-row {
    display: flex; align-items: center; gap: 0.5rem;
    margin-bottom: 0.5rem; justify-content: center;
}
.mp-name-label { font-weight: 700; width: 50px; text-align: right; }
.mp-name-input {
    background: var(--bg-glass); border: 1px solid var(--border-color);
    color: var(--text-primary); padding: 0.5rem 0.8rem;
    border-radius: var(--radius-sm); font-size: 1rem; width: 200px;
    outline: none; transition: border-color 0.2s;
}
.mp-name-input:focus { border-color: var(--accent-cyan); }

/* Buttons */
.mp-btn-start {
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
    border: none; color: white; padding: 0.9rem 2.5rem; font-size: 1.2rem; font-weight: 700;
    border-radius: 50px; cursor: pointer;
    box-shadow: 0 0 25px rgba(6, 182, 212, 0.3);
    transition: transform 0.2s, box-shadow 0.2s;
    margin-top: 0.5rem;
}
.mp-btn-start:hover { transform: scale(1.05); box-shadow: 0 0 35px rgba(6, 182, 212, 0.5); }
.mp-btn-start:active { transform: scale(0.98); }
.mp-btn-back {
    display: block; margin: 0.8rem auto 0;
    background: none; border: 1px solid var(--border-color); color: var(--text-secondary);
    padding: 0.5rem 1.5rem; border-radius: 50px; cursor: pointer; font-size: 0.9rem;
    transition: all 0.2s;
}
.mp-btn-back:hover { border-color: var(--text-secondary); color: var(--text-primary); }

/* Turn screen */
.mp-round-badge {
    display: inline-block;
    background: linear-gradient(135deg, var(--accent-gold), #f97316);
    color: #000; padding: 0.3rem 1rem; border-radius: 50px;
    font-weight: 700; font-size: 0.9rem; margin-bottom: 1rem;
}
.mp-turn-player {
    font-size: 2rem; font-weight: 800; margin-bottom: 0.5rem;
}
.mp-turn-hint { color: var(--text-secondary); margin-bottom: 1rem; }

/* Mini scoreboard */
.mp-mini-scores { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem; margin-bottom: 0.5rem; }
.mp-mini-score {
    background: var(--bg-glass); border: 1px solid var(--border-color);
    padding: 0.3rem 0.8rem; border-radius: var(--radius-sm); font-size: 0.85rem;
}
.mp-mini-score.current { border-color: var(--accent-cyan); background: rgba(6, 182, 212, 0.1); }

/* Active round HUD */
.mp-active-round { padding: 1rem; max-width: 600px; }
.mp-hud {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 0.5rem;
}
.mp-hud-player { font-weight: 700; font-size: 1.1rem; }
.mp-hud-timer {
    font-size: 1.4rem; font-weight: 800; color: var(--accent-cyan);
    transition: color 0.3s;
}
.mp-hud-timer.urgent { color: var(--accent-red); animation: pulse 0.5s ease-in-out infinite; }
.mp-hud-round { color: var(--text-muted); font-weight: 600; }
.mp-hud-stats {
    display: flex; justify-content: center; gap: 1rem; margin-bottom: 0.8rem;
    flex-wrap: wrap;
}
.mp-stat { font-weight: 600; font-size: 0.95rem; }
.mp-stat.score { color: var(--accent-gold); font-size: 1.1rem; }

/* Trivia card in multiplayer */
.mp-question-area { min-height: 200px; }
.mp-trivia-card {
    background: var(--bg-glass); border: 1px solid var(--border-color);
    border-radius: var(--radius); padding: 1rem; text-align: left;
    animation: modal-pop 0.2s ease-out;
}
.mp-trivia-cat {
    display: inline-block; padding: 0.2rem 0.8rem; border-radius: 50px;
    font-size: 0.8rem; font-weight: 700; color: white; margin-bottom: 0.8rem;
}
.mp-trivia-question {
    font-size: 1.1rem; font-weight: 600; margin-bottom: 1rem; line-height: 1.5;
}
.mp-trivia-options { display: flex; flex-direction: column; gap: 0.4rem; }
.mp-trivia-option {
    display: flex; align-items: center; gap: 0.6rem;
    background: var(--bg-glass); border: 1px solid var(--border-color);
    padding: 0.6rem 0.8rem; border-radius: var(--radius-sm);
    cursor: pointer; transition: all 0.15s; color: var(--text-primary);
    font-size: 0.95rem;
}
.mp-trivia-option:hover { border-color: var(--accent-cyan); background: rgba(6, 182, 212, 0.1); }
.mp-trivia-option.correct { border-color: var(--accent-green); background: rgba(16, 185, 129, 0.2); }
.mp-trivia-option.wrong { border-color: var(--accent-red); background: rgba(239, 68, 68, 0.2); }
.mp-trivia-option:disabled { cursor: default; pointer-events: none; }
.mp-opt-letter {
    font-weight: 700; color: var(--accent-cyan);
    width: 24px; text-align: center; flex-shrink: 0;
}
.mp-opt-text { flex: 1; }

/* Question timer */
.mp-trivia-timer {
    height: 4px; background: var(--bg-glass); border-radius: 2px;
    margin-top: 0.8rem; overflow: hidden;
}
.mp-trivia-timer-bar {
    height: 100%; width: 100%; background: var(--accent-cyan);
    border-radius: 2px; transition: width 0.05s linear;
}
.mp-trivia-timer-bar.urgent { background: var(--accent-red); }

/* Trivia result badge */
.mp-trivia-result {
    text-align: center; padding: 0.5rem; margin-top: 0.6rem;
    font-weight: 700; font-size: 1.1rem; border-radius: var(--radius-sm);
    animation: modal-pop 0.2s ease-out;
}
.mp-trivia-result.correct { color: var(--accent-green); }
.mp-trivia-result.wrong { color: var(--accent-red); }

/* Turn result */
.mp-turn-result { }
.mp-result-title { font-size: 1.5rem; font-weight: 800; margin-bottom: 1rem; }
.mp-result-stats { margin-bottom: 1rem; }
.mp-result-stat { font-size: 1rem; margin-bottom: 0.3rem; color: var(--text-secondary); }
.mp-result-stat.big { font-size: 1.5rem; font-weight: 800; color: var(--accent-gold); margin-bottom: 0.5rem; }

/* Final results */
.mp-final-title {
    font-size: 1.8rem; font-weight: 800; margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--accent-gold), #f97316);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
}
.mp-final-winner {
    font-size: 1.2rem; font-weight: 700; color: var(--accent-gold);
    margin-bottom: 1.2rem;
}
.mp-final-list { margin-bottom: 1rem; }
.mp-final-player {
    background: var(--bg-glass); border: 1px solid var(--border-color);
    border-radius: var(--radius-sm); padding: 0.8rem;
    margin-bottom: 0.5rem; text-align: left;
}
.mp-final-player.winner {
    border-color: var(--accent-gold);
    background: rgba(245, 158, 11, 0.1);
    box-shadow: var(--glow-gold);
}
.mp-final-rank { font-size: 1.2rem; font-weight: 800; }
.mp-final-name { font-weight: 700; font-size: 1.1rem; }
.mp-final-total { font-size: 1.3rem; font-weight: 800; color: var(--accent-gold); }
.mp-final-rounds { font-size: 0.85rem; color: var(--text-secondary); }
.mp-final-streak { font-size: 0.85rem; color: var(--text-muted); }
.mp-final-actions { display: flex; justify-content: center; gap: 0.5rem; flex-wrap: wrap; }
