/* ═══════════════════════════════════════════════════════════════════════════
   KRIMINIS v11.0 — UPGRADE STYLESHEET
   Improvements #2, #7, #8, #9, #10, #11, #12
   ═══════════════════════════════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════════════════════════════════
   #12 — ACCESSIBILITY
   ═══════════════════════════════════════════════════════════════════════════ */

/* Skip to content link */
.skip-to-content {
    position: fixed;
    top: -100%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    padding: 12px 28px;
    background: var(--neon-cyan);
    color: var(--bg-primary);
    font-family: var(--font-display);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 1px;
    border: none;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    text-decoration: none;
    transition: top 0.3s ease;
}
.skip-to-content:focus {
    top: 0;
    outline: 3px solid var(--neon-gold);
    outline-offset: 2px;
}

/* Global focus-visible ring (replaces browser defaults) */
*:focus-visible {
    outline: 2px solid var(--neon-cyan);
    outline-offset: 3px;
    border-radius: 2px;
}
/* Remove for mouse clicks */
*:focus:not(:focus-visible) {
    outline: none;
}

/* Better contrast for muted text on dark */
.a11y-enhanced .section-desc,
.a11y-enhanced .text-muted,
.a11y-enhanced .setting-desc,
.a11y-enhanced .footer-desc {
    color: #a0a0b8;
}

/* Screen reader only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Reduced motion: disable ALL animations */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    .ambient-orb, .crt-scanlines, .crt-flicker, .film-grain,
    .rain-overlay, .scroll-indicator, .node-pulse,
    .section-transition-overlay, .onboarding-spotlight {
        display: none !important;
    }
}

/* High contrast mode support */
@media (forced-colors: active) {
    .btn, .nexus-node, .category-card, .theory-card {
        border: 2px solid ButtonText;
    }
    .progress-bar, .xp-bar-fill {
        background: Highlight;
    }
}

/* Minimum tap target size for mobile */
@media (max-width: 768px) {
    .nexus-filter, .map-filter, .nexus-tab,
    .interrogation-option, .profiler-option,
    .story-choice, .btn, button {
        min-height: 44px;
        min-width: 44px;
    }
}


/* ═══════════════════════════════════════════════════════════════════════════
   #2 — INLINE STYLE REPLACEMENTS
   All CSS classes that replace template literal inline styles
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Generic Layout Helpers ── */
.v11-center-text { text-align: center; }
.v11-flex { display: flex; }
.v11-flex-col { display: flex; flex-direction: column; }
.v11-flex-center { display: flex; align-items: center; justify-content: center; }
.v11-flex-between { display: flex; justify-content: space-between; }
.v11-flex-wrap { flex-wrap: wrap; }
.v11-flex-1 { flex: 1; }
.v11-gap-8 { gap: 8px; }
.v11-gap-10 { gap: 10px; }
.v11-gap-15 { gap: 15px; }
.v11-gap-20 { gap: 20px; }
.v11-gap-30 { gap: 30px; }
.v11-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.v11-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.v11-grid-auto { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 15px; }
.v11-w-full { width: 100%; }
.v11-ml-auto { margin-left: auto; }

/* ── Section Label ── */
.v11-section-label {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-muted);
    letter-spacing: 2px;
    margin-bottom: 10px;
}

/* ── Stat Cards (used in profiles, interrogation, expedient) ── */
.v11-stat-card {
    background: rgba(0, 0, 0, 0.2);
    padding: 12px;
    border-radius: var(--radius-sm);
    text-align: center;
}
.v11-stat-card--lg {
    padding: 15px;
}
.v11-stat-value {
    font-family: var(--font-display);
    font-size: 1.2rem;
    margin: 5px 0;
}
.v11-stat-value--lg { font-size: 1.3rem; }
.v11-stat-value--xl { font-size: 2rem; }
.v11-stat-label {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
}
.v11-stat-icon { font-size: 1.4rem; }

/* Color utilities for stat values */
.v11-c-green { color: var(--neon-green); }
.v11-c-cyan { color: var(--neon-cyan); }
.v11-c-gold { color: var(--neon-gold); }
.v11-c-magenta { color: var(--neon-magenta); }
.v11-c-purple { color: var(--neon-purple); }
.v11-c-orange { color: var(--neon-orange); }
.v11-c-red { color: var(--neon-red); }
.v11-c-muted { color: var(--text-muted); }
.v11-c-light { color: var(--text-light); }

/* ── Progress Bars ── */
.v11-progress-wrapper {
    margin-bottom: 20px;
}
.v11-progress-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}
.v11-progress-track {
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
}
.v11-progress-track--lg { height: 10px; border-radius: 5px; }
.v11-progress-fill {
    height: 100%;
    transition: width 1s ease;
    border-radius: inherit;
}

/* ── Modal/Profile Layout ── */
.v11-modal-avatar {
    font-size: 4rem;
    margin-bottom: 10px;
}
.v11-modal-name-input {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--neon-cyan);
    color: var(--text-light);
    padding: 10px;
    font-family: var(--font-display);
    text-align: center;
    width: 220px;
    border-radius: var(--radius-sm);
    font-size: 1rem;
}
.v11-modal-rank {
    margin-top: 12px;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--neon-cyan);
}

/* ── Avatar Selector ── */
.v11-avatar-btn {
    font-size: 1.4rem;
    padding: 8px;
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.3s ease;
    line-height: 1;
}
.v11-avatar-btn:hover {
    border-color: var(--neon-cyan);
    background: rgba(0, 255, 255, 0.1);
    transform: scale(1.15);
}
.v11-avatar-btn.selected {
    background: rgba(0, 255, 255, 0.2);
    border-color: var(--neon-cyan);
    box-shadow: 0 0 12px rgba(0, 255, 255, 0.3);
}

/* ── Expedient Modal ── */
.v11-expedient-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 215, 0, 0.2);
}
.v11-expedient-avatar { font-size: 4rem; }
.v11-expedient-name {
    font-family: var(--font-display);
    font-size: 1.4rem;
    color: var(--text-light);
}
.v11-expedient-rank {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--neon-gold);
}
.v11-expedient-meta {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ── Profile Block (criminological profile inside expedient) ── */
.v11-profile-block {
    background: rgba(0, 0, 0, 0.2);
    padding: 20px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    border-left: 3px solid var(--text-muted);
}
.v11-profile-block--typed {
    border-left-width: 3px;
    border-left-style: solid;
}
.v11-profile-type {
    font-family: var(--font-display);
    font-size: 0.85rem;
    margin-bottom: 8px;
}
.v11-profile-desc {
    color: var(--text-muted);
    font-size: 0.85rem;
}
.v11-profile-traits {
    margin-top: 10px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.v11-profile-trait-badge {
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
}

/* ── Achievement Grid (inside expedient) ── */
.v11-achievement-cell {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    font-size: 1.2rem;
    cursor: default;
    transition: transform 0.2s, box-shadow 0.2s;
}
.v11-achievement-cell:hover {
    transform: scale(1.15);
}
.v11-achievement-cell--locked {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    opacity: 0.3;
}
.v11-achievement-cell--unlocked {
    background: rgba(255, 215, 0, 0.15);
    border: 1px solid var(--neon-gold);
    opacity: 1;
    box-shadow: 0 0 8px rgba(255, 215, 0, 0.1);
}

/* ── Expedient Footer Stamp ── */
.v11-stamp {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}
.v11-stamp-title {
    font-family: var(--font-display);
    font-size: 0.7rem;
    color: var(--text-muted);
    letter-spacing: 5px;
}
.v11-stamp-id {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    color: var(--text-muted);
    margin-top: 5px;
}

/* ── Interrogation ── */
.v11-interrogation-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}
.v11-char-card {
    background: var(--bg-card);
    padding: 25px;
    border-radius: var(--radius-md);
    cursor: pointer;
    text-align: center;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}
.v11-char-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}
.v11-char-card:focus-visible {
    outline: 2px solid var(--neon-cyan);
    outline-offset: 2px;
}
.v11-char-card__icon { font-size: 3.5rem; margin-bottom: 10px; }
.v11-char-card__name { font-family: var(--font-display); font-size: 1rem; }
.v11-char-card__sub { font-family: var(--font-mono); font-size: 0.7rem; color: var(--text-muted); margin-top: 5px; }

/* Interrogation Room */
.v11-interrog-room { max-width: 800px; margin: 0 auto; }
.v11-interrog-header {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    border: 1px solid;
}
.v11-interrog-header__icon { font-size: 2.5rem; }
.v11-interrog-header__name { font-family: var(--font-display); }
.v11-interrog-header__sub { font-family: var(--font-mono); font-size: 0.7rem; color: var(--text-muted); }
.v11-interrog-header__score { font-family: var(--font-mono); font-size: 0.7rem; color: var(--neon-gold); }
.v11-interrog-header__insights { font-family: var(--font-mono); font-size: 0.7rem; color: var(--text-muted); }

.v11-interrog-body {
    background: var(--bg-card);
    border: 1px solid;
    border-top: none;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    padding: 25px;
    min-height: 300px;
}
.v11-interrog-intro { color: var(--text-muted); font-style: italic; margin-bottom: 20px; }

.v11-dialogue {
    margin-bottom: 20px;
    animation: v11-fadeIn 0.5s ease;
}
.v11-dialogue__speaker {
    font-family: var(--font-display);
    font-size: 0.8rem;
    margin-bottom: 8px;
}
.v11-dialogue__text {
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--text-light);
}

/* Interrogation Options */
.v11-interrog-option {
    display: block;
    width: 100%;
    text-align: left;
    padding: 15px 20px;
    margin-bottom: 8px;
    background: rgba(0, 255, 255, 0.05);
    border: 1px solid rgba(0, 255, 255, 0.2);
    border-radius: var(--radius-sm);
    color: var(--text-light);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: var(--font-body);
}
.v11-interrog-option:hover, .v11-interrog-option:focus-visible {
    border-color: var(--neon-cyan);
    background: rgba(0, 255, 255, 0.12);
    transform: translateX(4px);
}
.v11-interrog-option__prompt {
    color: var(--neon-cyan);
    margin-right: 8px;
}

/* Interrogation Ending */
.v11-interrog-ending {
    margin-top: 25px;
    padding: 25px;
    border: 2px solid;
    border-radius: var(--radius-md);
    animation: v11-fadeIn 0.5s ease;
}
.v11-interrog-ending--full { background: rgba(0, 255, 136, 0.08); border-color: var(--neon-green); }
.v11-interrog-ending--partial { background: rgba(255, 215, 0, 0.08); border-color: var(--neon-gold); }
.v11-interrog-ending__title {
    font-family: var(--font-display);
    font-size: 1.1rem;
    margin-bottom: 10px;
}
.v11-interrog-ending__desc {
    color: var(--text-muted);
    line-height: 1.7;
    margin-bottom: 15px;
}

/* ── File Modal (Nexus Expedientes) ── */
.v11-file-layout {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 30px;
}
@media (max-width: 768px) {
    .v11-file-layout { grid-template-columns: 1fr; }
}
.v11-file-avatar { font-size: 5rem; margin-bottom: 15px; }
.v11-file-alias { font-family: var(--font-display); }
.v11-file-section-title {
    color: var(--neon-cyan);
    margin-bottom: 10px;
    font-size: 0.9rem;
}
.v11-file-quote {
    font-style: italic;
    color: var(--text-muted);
    margin-bottom: 10px;
}

/* Stat Bar */
.v11-stat-bar { margin-bottom: 8px; }
.v11-stat-bar__header {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 3px;
}
.v11-stat-bar__track {
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
}
.v11-stat-bar__fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ── Compare Slot Content ── */
.v11-compare-content {
    text-align: center;
    padding: 20px;
}
.v11-compare-icon { font-size: 4rem; margin-bottom: 10px; }
.v11-compare-name { font-family: var(--font-display); }
.v11-compare-media { color: var(--text-muted); font-size: 0.8rem; }
.v11-compare-stats { margin-top: 20px; }

/* ── Story End Screen ── */
.v11-story-end {
    text-align: center;
    padding: 50px 20px;
}
.v11-story-end__title {
    font-family: var(--font-display);
    color: var(--neon-purple);
    margin-bottom: 20px;
    font-size: 1.8rem;
}
.v11-story-end__subtitle {
    color: var(--text-muted);
    margin-bottom: 30px;
}
.v11-story-end__stats {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 30px;
}


/* ═══════════════════════════════════════════════════════════════════════════
   #7 — ONBOARDING SYSTEM
   ═══════════════════════════════════════════════════════════════════════════ */

.onboarding-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.4s ease;
}
.onboarding-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* Dark backdrop with hole cut-out */
.onboarding-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.82);
    z-index: 10001;
    transition: opacity 0.4s;
}

/* Spotlight cutout ring */
.onboarding-spotlight {
    position: absolute;
    z-index: 10002;
    border-radius: var(--radius-md);
    box-shadow:
        0 0 0 4px var(--neon-cyan),
        0 0 0 9999px rgba(0, 0, 0, 0.82),
        0 0 30px rgba(0, 255, 255, 0.3),
        inset 0 0 20px rgba(0, 255, 255, 0.05);
    transition: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    pointer-events: none;
}
.onboarding-spotlight::before {
    content: '';
    position: absolute;
    inset: -8px;
    border: 1px dashed rgba(0, 255, 255, 0.3);
    border-radius: inherit;
    animation: v11-spotlight-pulse 2s ease-in-out infinite;
}

/* Tooltip card */
.onboarding-tooltip {
    position: absolute;
    z-index: 10003;
    width: 360px;
    max-width: calc(100vw - 40px);
    background: linear-gradient(135deg, rgba(12, 12, 20, 0.98), rgba(20, 20, 35, 0.98));
    border: 1px solid var(--neon-cyan);
    border-radius: var(--radius-lg);
    padding: 28px;
    box-shadow:
        0 0 40px rgba(0, 255, 255, 0.15),
        0 20px 60px rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(20px);
    transform: translateY(10px);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    pointer-events: auto;
}
.onboarding-overlay.active .onboarding-tooltip {
    transform: translateY(0);
    opacity: 1;
}

.onboarding-tooltip__step {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--neon-cyan);
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-bottom: 8px;
}
.onboarding-tooltip__title {
    font-family: var(--font-display);
    font-size: 1.15rem;
    color: var(--text-light);
    margin-bottom: 10px;
    line-height: 1.3;
}
.onboarding-tooltip__desc {
    font-family: var(--font-body);
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 20px;
}

.onboarding-tooltip__progress {
    display: flex;
    gap: 4px;
    margin-bottom: 18px;
}
.onboarding-tooltip__dot {
    width: 24px;
    height: 3px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.1);
    transition: all 0.3s;
}
.onboarding-tooltip__dot.active {
    background: var(--neon-cyan);
    box-shadow: 0 0 6px rgba(0, 255, 255, 0.4);
}
.onboarding-tooltip__dot.done {
    background: var(--neon-green);
}

.onboarding-tooltip__actions {
    display: flex;
    gap: 10px;
    justify-content: space-between;
    align-items: center;
}
.onboarding-btn {
    padding: 10px 22px;
    border-radius: var(--radius-sm);
    font-family: var(--font-display);
    font-size: 0.75rem;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}
.onboarding-btn--primary {
    background: var(--gradient-cyber);
    color: var(--bg-primary);
    font-weight: 700;
}
.onboarding-btn--primary:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.3);
}
.onboarding-btn--ghost {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid rgba(255, 255, 255, 0.1);
}
.onboarding-btn--ghost:hover {
    color: var(--text-light);
    border-color: rgba(255, 255, 255, 0.3);
}

/* Welcome Modal */
.onboarding-welcome {
    position: fixed;
    inset: 0;
    z-index: 10010;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.9);
    opacity: 0;
    transition: opacity 0.5s ease;
}
.onboarding-welcome.active { opacity: 1; }

.onboarding-welcome__card {
    max-width: 500px;
    width: calc(100% - 40px);
    background: linear-gradient(160deg, rgba(10, 10, 20, 0.98), rgba(18, 18, 30, 0.98));
    border: 1px solid rgba(0, 255, 255, 0.3);
    border-radius: var(--radius-lg);
    padding: 50px 40px;
    text-align: center;
    box-shadow: 0 0 80px rgba(0, 255, 255, 0.08);
    transform: scale(0.9);
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.onboarding-welcome.active .onboarding-welcome__card {
    transform: scale(1);
}
.onboarding-welcome__icon {
    font-size: 3.5rem;
    margin-bottom: 20px;
    display: block;
}
.onboarding-welcome__title {
    font-family: var(--font-display);
    font-size: 1.6rem;
    color: var(--text-light);
    margin-bottom: 10px;
}
.onboarding-welcome__subtitle {
    font-family: var(--font-body);
    color: var(--text-muted);
    font-size: 1rem;
    margin-bottom: 30px;
    line-height: 1.5;
}
.onboarding-welcome__actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
}


/* ═══════════════════════════════════════════════════════════════════════════
   #8 — SECTION TRANSITIONS
   ═══════════════════════════════════════════════════════════════════════════ */

/* Transition overlay that sweeps between sections */
.section-transition-overlay {
    position: fixed;
    inset: 0;
    z-index: 9998;
    pointer-events: none;
    opacity: 0;
}
.section-transition-overlay.active {
    opacity: 1;
}

/* Glitch bars on section enter */
.section-glitch-bar {
    position: absolute;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--neon-cyan);
    opacity: 0;
    transform: scaleX(0);
    transform-origin: left;
}
.section-glitch-bar.animate {
    animation: v11-glitch-sweep 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

/* Section enter text flash */
.section-flash-label {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 9999;
    font-family: var(--font-display);
    font-size: clamp(1.2rem, 4vw, 2.5rem);
    color: var(--neon-cyan);
    text-transform: uppercase;
    letter-spacing: 8px;
    opacity: 0;
    pointer-events: none;
    text-shadow: 0 0 30px rgba(0, 255, 255, 0.5);
    white-space: nowrap;
}
.section-flash-label.animate {
    animation: v11-flash-text 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

/* Section content reveal (stagger children) */
.section.v11-entering .section-header {
    animation: v11-slide-up 0.6s ease forwards;
    animation-delay: 0.3s;
    opacity: 0;
}
.section.v11-entering .category-card,
.section.v11-entering .theory-card,
.section.v11-entering .episode-card,
.section.v11-entering .course-card,
.section.v11-entering .lab-station,
.section.v11-entering .minigame-card {
    opacity: 0;
    animation: v11-slide-up 0.5s ease forwards;
}
.section.v11-entering > *:nth-child(1) { animation-delay: 0.1s; }
.section.v11-entering > *:nth-child(2) { animation-delay: 0.2s; }
.section.v11-entering > *:nth-child(3) { animation-delay: 0.3s; }


/* ═══════════════════════════════════════════════════════════════════════════
   #9 — CASO COMPLETO (Unified Case Flow)
   ═══════════════════════════════════════════════════════════════════════════ */

.caso-completo-bar {
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    z-index: 190;
    background: linear-gradient(180deg, rgba(10, 10, 18, 0.96), rgba(10, 10, 18, 0.9));
    border-bottom: 1px solid rgba(0, 255, 255, 0.15);
    backdrop-filter: blur(12px);
    padding: 10px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    transform: translateY(-100%);
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
}
.caso-completo-bar.active { transform: translateY(0); }

.caso-completo-bar__label {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--neon-cyan);
    letter-spacing: 2px;
    white-space: nowrap;
}
.caso-completo-bar__steps {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
}
.caso-step {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    font-family: var(--font-display);
    font-size: 0.65rem;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    transition: all 0.3s;
    cursor: default;
    white-space: nowrap;
}
.caso-step.active {
    color: var(--neon-cyan);
    background: rgba(0, 255, 255, 0.08);
    border-color: rgba(0, 255, 255, 0.3);
    box-shadow: 0 0 12px rgba(0, 255, 255, 0.1);
}
.caso-step.done {
    color: var(--neon-green);
    border-color: rgba(0, 255, 136, 0.2);
}
.caso-step__icon { font-size: 0.9rem; }
.caso-step__connector {
    width: 20px;
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}
.caso-step__connector.done { background: var(--neon-green); }

.caso-completo-bar__close {
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    width: 30px;
    height: 30px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}
.caso-completo-bar__close:hover {
    color: var(--neon-red);
    border-color: var(--neon-red);
}

/* Caso Completo launch button */
.caso-launch-card {
    background: linear-gradient(135deg, rgba(0, 255, 255, 0.05), rgba(255, 0, 255, 0.05));
    border: 2px dashed rgba(0, 255, 255, 0.2);
    border-radius: var(--radius-lg);
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.4s ease;
    margin-top: 20px;
}
.caso-launch-card:hover {
    border-color: var(--neon-cyan);
    background: linear-gradient(135deg, rgba(0, 255, 255, 0.1), rgba(255, 0, 255, 0.1));
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(0, 255, 255, 0.12);
}
.caso-launch-card__icon { font-size: 2.5rem; margin-bottom: 12px; }
.caso-launch-card__title {
    font-family: var(--font-display);
    font-size: 1.1rem;
    color: var(--neon-cyan);
    margin-bottom: 6px;
}
.caso-launch-card__desc {
    color: var(--text-muted);
    font-size: 0.85rem;
}


/* ═══════════════════════════════════════════════════════════════════════════
   #10 — PROGRESS PANEL (floating skill tree widget)
   ═══════════════════════════════════════════════════════════════════════════ */

.progress-panel-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 195;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--bg-secondary), var(--bg-tertiary));
    border: 2px solid rgba(0, 255, 255, 0.3);
    color: var(--neon-cyan);
    font-size: 1.3rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5), 0 0 15px rgba(0, 255, 255, 0.1);
    transition: all 0.3s ease;
}
.progress-panel-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 25px rgba(0, 0, 0, 0.5), 0 0 25px rgba(0, 255, 255, 0.2);
}
/* XP ring around toggle */
.progress-panel-toggle__ring {
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 2px solid transparent;
    border-top-color: var(--neon-cyan);
    transition: transform 0.3s;
}

.progress-panel {
    position: fixed;
    bottom: 82px;
    right: 20px;
    z-index: 194;
    width: 320px;
    max-height: 70vh;
    background: linear-gradient(160deg, rgba(10, 10, 18, 0.98), rgba(16, 16, 28, 0.98));
    border: 1px solid rgba(0, 255, 255, 0.15);
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.7), 0 0 30px rgba(0, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    overflow: hidden;
    transform: translateY(20px) scale(0.95);
    opacity: 0;
    pointer-events: none;
    transition: all 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.progress-panel.open {
    transform: translateY(0) scale(1);
    opacity: 1;
    pointer-events: auto;
}

.progress-panel__header {
    padding: 18px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    gap: 12px;
}
.progress-panel__rank-icon { font-size: 1.6rem; }
.progress-panel__rank-info { flex: 1; }
.progress-panel__rank-name {
    font-family: var(--font-display);
    font-size: 0.85rem;
    color: var(--text-light);
}
.progress-panel__rank-level {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--neon-cyan);
}

.progress-panel__xp-bar {
    margin: 0 20px 16px;
}
.progress-panel__xp-track {
    height: 6px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 3px;
    overflow: hidden;
}
.progress-panel__xp-fill {
    height: 100%;
    background: var(--gradient-cyber);
    border-radius: 3px;
    transition: width 0.8s ease;
}
.progress-panel__xp-label {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    color: var(--text-muted);
    margin-top: 4px;
    text-align: right;
}

/* Skill Tree Grid */
.progress-panel__skills {
    padding: 0 20px 16px;
    overflow-y: auto;
    max-height: calc(70vh - 200px);
}
.skill-node {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}
.skill-node:last-child { border-bottom: none; }
.skill-node__icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-sm);
    flex-shrink: 0;
    transition: all 0.3s;
}
.skill-node--complete .skill-node__icon {
    background: rgba(0, 255, 136, 0.1);
    border-color: rgba(0, 255, 136, 0.3);
}
.skill-node__info { flex: 1; min-width: 0; }
.skill-node__name {
    font-family: var(--font-display);
    font-size: 0.7rem;
    color: var(--text-light);
    letter-spacing: 0.5px;
}
.skill-node__progress-track {
    height: 3px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 2px;
    margin-top: 5px;
    overflow: hidden;
}
.skill-node__progress-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.5s ease;
}
.skill-node__value {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    color: var(--text-muted);
    flex-shrink: 0;
}

/* Footer in panel */
.progress-panel__footer {
    padding: 12px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    text-align: center;
}
.progress-panel__btn {
    font-family: var(--font-display);
    font-size: 0.65rem;
    letter-spacing: 1px;
    padding: 8px 20px;
    border: 1px solid rgba(0, 255, 255, 0.2);
    background: rgba(0, 255, 255, 0.05);
    color: var(--neon-cyan);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.3s;
}
.progress-panel__btn:hover {
    background: rgba(0, 255, 255, 0.1);
    border-color: var(--neon-cyan);
}


/* ═══════════════════════════════════════════════════════════════════════════
   #11 — MICRO-ANIMATIONS
   ═══════════════════════════════════════════════════════════════════════════ */

/* Nexus nodes pulsing for new info */
.nexus-node.has-update .node-pulse {
    animation: v11-node-beacon 2s ease-in-out infinite;
}
.nexus-node.has-update .node-ring {
    animation: v11-ring-glow 2.5s ease-in-out infinite;
}

/* Theory cards: "page flip" effect on hover */
.theory-card {
    perspective: 800px;
    transform-style: preserve-3d;
}
.theory-card:hover {
    transform: rotateY(-3deg) rotateX(2deg) translateY(-4px);
    box-shadow: 8px 8px 30px rgba(0, 0, 0, 0.4), 0 0 15px rgba(0, 255, 255, 0.08);
}

/* Category cards: neon border sweep */
.category-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 2px;
    background: linear-gradient(var(--angle, 0deg), transparent 40%, var(--neon-cyan) 50%, transparent 60%);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    -webkit-mask-composite: xor;
    opacity: 0;
    transition: opacity 0.4s;
}
.category-card:hover::after {
    opacity: 1;
    animation: v11-border-sweep 2s linear infinite;
}

/* Episode cards: dramatic reveal */
.episode-card {
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.episode-card:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5), 0 0 20px rgba(153, 51, 255, 0.1);
}
.episode-card:hover .episode-number {
    text-shadow: 0 0 10px currentColor;
}

/* Buttons: subtle pulse on important actions */
.btn-primary {
    position: relative;
    overflow: hidden;
}
.btn-primary::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transform: translateX(-100%);
    transition: none;
}
.btn-primary:hover::after {
    animation: v11-btn-shimmer 0.8s ease forwards;
}

/* Achievement popup enhanced entrance */
.achievement-popup.show {
    animation: v11-achievement-enter 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* Stats bar counter animation */
.stats-bar .stat-value {
    transition: color 0.3s;
}
.stats-bar .stat-item:hover .stat-value {
    color: var(--neon-cyan);
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.3);
}

/* Interrogation option slide-in */
.v11-interrog-option {
    opacity: 0;
    transform: translateX(-15px);
    animation: v11-option-slide 0.4s ease forwards;
}
.v11-interrog-option:nth-child(2) { animation-delay: 0.08s; }
.v11-interrog-option:nth-child(3) { animation-delay: 0.16s; }
.v11-interrog-option:nth-child(4) { animation-delay: 0.24s; }

/* Smooth loading for sections */
.v11-lazy-section {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}
.v11-lazy-section.loaded {
    opacity: 1;
    transform: translateY(0);
}


/* ═══════════════════════════════════════════════════════════════════════════
   KEYFRAMES
   ═══════════════════════════════════════════════════════════════════════════ */

@keyframes v11-fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes v11-slide-up {
    from { opacity: 0; transform: translateY(25px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes v11-spotlight-pulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

@keyframes v11-glitch-sweep {
    0% { transform: scaleX(0); opacity: 1; }
    50% { transform: scaleX(1); opacity: 1; }
    100% { transform: scaleX(1); opacity: 0; }
}

@keyframes v11-flash-text {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(1.5); letter-spacing: 20px; }
    20% { opacity: 1; }
    50% { opacity: 1; transform: translate(-50%, -50%) scale(1); letter-spacing: 8px; }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(0.95); letter-spacing: 4px; }
}

@keyframes v11-border-sweep {
    to { --angle: 360deg; }
}
@property --angle {
    syntax: '<angle>';
    initial-value: 0deg;
    inherits: false;
}

@keyframes v11-btn-shimmer {
    to { transform: translateX(100%); }
}

@keyframes v11-node-beacon {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.3); }
}

@keyframes v11-ring-glow {
    0%, 100% { box-shadow: 0 0 5px rgba(0, 255, 255, 0.2); }
    50% { box-shadow: 0 0 20px rgba(0, 255, 255, 0.5); }
}

@keyframes v11-achievement-enter {
    0% { transform: translateX(120%) scale(0.8); opacity: 0; }
    60% { transform: translateX(-5%) scale(1.02); opacity: 1; }
    100% { transform: translateX(0) scale(1); opacity: 1; }
}

@keyframes v11-option-slide {
    to { opacity: 1; transform: translateX(0); }
}

@keyframes v11-xp-ring-rotate {
    to { transform: rotate(360deg); }
}


/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSIVE ADJUSTMENTS
   ═══════════════════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
    .caso-completo-bar {
        padding: 8px 12px;
        overflow-x: auto;
        gap: 8px;
    }
    .caso-step { padding: 5px 10px; font-size: 0.6rem; }
    .caso-step__connector { width: 10px; }
    .caso-completo-bar__label { display: none; }

    .progress-panel {
        right: 10px;
        width: calc(100vw - 20px);
        bottom: 72px;
    }
    .progress-panel-toggle {
        width: 46px;
        height: 46px;
        bottom: 15px;
        right: 15px;
    }

    .onboarding-tooltip {
        width: calc(100vw - 30px);
        padding: 22px;
    }

    .v11-file-layout {
        grid-template-columns: 1fr;
    }

    .v11-interrog-header {
        flex-wrap: wrap;
    }

    .v11-grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .v11-grid-3 { grid-template-columns: 1fr; }
    .v11-grid-2 { grid-template-columns: 1fr; }
}
