/* Legal Matrix Styles - Corregido y Mejorado
 * 
 * Z-Index System:
 * 10000: Custom cursor
 * 2100: Notifications
 * 2000: Header (always on top)
 * 1502: Neo Message modal
 * 1501: Glitch/Hack modals
 * 1500: Bullet Time/Blue Pill screens
 * 1499: Tutorial modal
 * 100-102: Code viewer and controls
 * 90: Reality selector
 * 60: Utilia watermark
 * 50: Progress indicator (low to not interfere)
 * 10: Main container
 * 1: Matrix rain background
 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --matrix-green: #00ff41;
    --matrix-dark-green: #003d0f;
    --matrix-red: #ff0040;
    --matrix-blue: #0066ff;
    --matrix-black: #000000;
    --matrix-dark: #0a0a0a;
    --glow-size: 20px;
}

body {
    font-family: 'Orbitron', monospace;
    background: var(--matrix-black);
    color: var(--matrix-green);
    overflow-x: hidden;
    position: relative;
    min-height: 100vh;
    min-height: 100dvh; /* Dynamic viewport height for mobile */
}

/* Custom Cursor - Desktop Only */
.custom-cursor {
    position: fixed !important;
    width: 20px !important;
    height: 20px !important;
    background: var(--matrix-green) !important;
    border-radius: 50% !important;
    pointer-events: none !important;
    z-index: 99999 !important;
    box-shadow: 0 0 20px var(--matrix-green), 0 0 40px var(--matrix-green) !important;
    mix-blend-mode: screen !important;
    transition: all 0.1s ease !important;
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: translate(-50%, -50%) !important;
    top: 0 !important;
    left: 0 !important;
    will-change: transform, background !important;
}

#matrix-cursor {
    position: fixed !important;
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    z-index: 99999 !important;
}

/* Hide custom cursor on mobile */
@media (max-width: 768px) {
    .custom-cursor, #matrix-cursor {
        display: none !important;
        opacity: 0 !important;
        visibility: hidden !important;
    }
    
    body, * {
        cursor: auto !important;
    }
}

/* Desktop cursor styles */
@media (min-width: 769px) {
    body.cursor-active {
        cursor: none !important;
    }
    
    body.cursor-active *, 
    body.cursor-active a, 
    body.cursor-active button, 
    body.cursor-active .pill, 
    body.cursor-active .reality-card, 
    body.cursor-active .matrix-btn,
    body.cursor-active .hack-btn,
    body.cursor-active .bullet-btn {
        cursor: none !important;
    }
}

@keyframes cursor-glow {
    0% { box-shadow: 0 0 10px var(--matrix-green); }
    100% { box-shadow: 0 0 30px var(--matrix-green), 0 0 40px var(--matrix-green); }
}

/* Header */
.matrix-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 2000;
    background: linear-gradient(180deg, rgba(0,0,0,0.98) 0%, rgba(0,0,0,0.9) 100%);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--matrix-green);
    padding: 1rem 0;
    height: 80px;
}

.matrix-nav {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.back-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--matrix-green);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border: 1px solid var(--matrix-green);
    border-radius: 20px;
    transition: all 0.3s ease;
    font-family: 'Courier Prime', monospace;
}

.back-btn:hover {
    background: var(--matrix-green);
    color: var(--matrix-black);
    box-shadow: 0 0 20px var(--matrix-green);
    transform: scale(1.05);
}

.logo-matrix {
    font-size: 1.5rem;
    font-weight: 900;
    text-align: center;
}

.system-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: 'Courier Prime', monospace;
    font-size: 0.9rem;
}

.status-dot {
    width: 10px;
    height: 10px;
    background: var(--matrix-green);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

/* Matrix Rain Effect */
.matrix-rain {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    height: 100dvh; /* Dynamic viewport height for mobile */
    z-index: 1;
    pointer-events: none;
    overflow: hidden;
    background: var(--matrix-black);
}

.rain-column {
    position: absolute;
    top: -100%;
    font-family: 'Courier Prime', monospace;
    font-size: 14px;
    line-height: 1.2;
    white-space: pre;
    color: var(--matrix-green);
    text-shadow: 0 0 5px var(--matrix-green);
    animation: rain-fall linear infinite;
}

.rain-column.bright {
    color: #ffffff;
    text-shadow: 0 0 10px var(--matrix-green);
}

@keyframes rain-fall {
    0% { transform: translateY(-100vh); }
    100% { transform: translateY(100vh); }
}

/* Glitch Effect */
.glitch {
    position: relative;
    display: inline-block;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.glitch::before {
    animation: glitch-1 2s infinite;
    color: var(--matrix-red);
    z-index: -1;
}

.glitch::after {
    animation: glitch-2 2s infinite;
    color: var(--matrix-blue);
    z-index: -2;
}

@keyframes glitch-1 {
    0%, 100% { transform: translate(0); }
    20% { transform: translate(-2px, 2px); }
    40% { transform: translate(-2px, -2px); }
    60% { transform: translate(2px, 2px); }
    80% { transform: translate(2px, -2px); }
}

@keyframes glitch-2 {
    0%, 100% { transform: translate(0); }
    20% { transform: translate(2px, 2px); }
    40% { transform: translate(2px, -2px); }
    60% { transform: translate(-2px, 2px); }
    80% { transform: translate(-2px, -2px); }
}

/* Main Container */
.matrix-container {
    position: relative;
    z-index: 10;
    min-height: 100vh;
    min-height: 100dvh; /* Dynamic viewport height for mobile */
}

/* Stage 1: Welcome Screen */
.welcome-screen {
    display: none;
    min-height: 100vh;
    min-height: 100dvh; /* Dynamic viewport height for mobile */
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 100px 2rem 2rem;
}

.welcome-screen.active {
    display: flex;
}

.welcome-content {
    max-width: 900px;
    width: 100%;
}

.matrix-title {
    font-size: 4rem;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.main-title {
    font-size: 5rem;
    background: linear-gradient(45deg, var(--matrix-green), #ffffff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.matrix-subtitle {
    font-size: 1.5rem;
    margin-bottom: 3rem;
    opacity: 0.8;
    font-family: 'Courier Prime', monospace;
}

/* Pills */
.choice-container {
    margin-top: 3rem;
}

.morpheus-quote {
    max-width: 600px;
    margin: 0 auto 3rem;
    font-family: 'Courier Prime', monospace;
    font-style: italic;
    opacity: 0.9;
}

.morpheus-quote p {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.morpheus-quote span {
    font-size: 1rem;
    opacity: 0.7;
    display: block;
}

.pill-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 3rem;
    margin-bottom: 3rem;
}

.pill {
    position: relative;
    width: 200px;
    height: 80px;
    border-radius: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid;
    background: rgba(0,0,0,0.8);
    text-align: center;
    padding: 1rem;
}

.red-pill {
    border-color: var(--matrix-red);
    color: var(--matrix-red);
}

.blue-pill {
    border-color: var(--matrix-blue);
    color: var(--matrix-blue);
}

.pill:hover {
    transform: scale(1.1) rotateY(10deg);
    box-shadow: 0 0 30px currentColor;
}

.pill-glow {
    position: absolute;
    inset: -5px;
    border-radius: inherit;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
    filter: blur(10px);
}

.pill:hover .pill-glow {
    opacity: 0.7;
}

.pill-glow.red {
    background: var(--matrix-red);
}

.pill-glow.blue {
    background: var(--matrix-blue);
}

.pill span {
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}

.pill small {
    font-size: 0.8rem;
    opacity: 0.8;
    font-family: 'Courier Prime', monospace;
}

.vs-text {
    font-size: 2rem;
    font-weight: 900;
    color: #ffffff;
    text-shadow: 0 0 10px var(--matrix-green);
    animation: vs-glow 2s infinite alternate;
}

@keyframes vs-glow {
    0% { text-shadow: 0 0 10px var(--matrix-green); }
    100% { text-shadow: 0 0 20px var(--matrix-green), 0 0 30px var(--matrix-green); }
}

/* Utilia Credits */
.utilia-credit {
    margin-top: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    font-family: 'Courier Prime', monospace;
    font-size: 0.9rem;
    opacity: 0.8;
    color: var(--matrix-green);
}

.utilia-credit a {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.utilia-logo-footer {
    height: 24px;
    width: auto;
    filter: brightness(1.2) saturate(1.1);
    transition: all 0.3s ease;
}

.utilia-logo-footer:hover {
    filter: brightness(1.5) saturate(1.4);
    transform: scale(1.1);
}

/* Stage 2: Matrix Tutorial */
.matrix-tutorial {
    display: none;
    position: fixed;
    inset: 0;
    align-items: center;
    justify-content: center;
    padding: 100px 2rem 2rem;
    text-align: center;
    z-index: 1499;
    background: rgba(0, 0, 0, 0.95);
    overflow-y: auto;
}

.matrix-tutorial.active {
    display: flex;
}

.tutorial-container {
    max-width: 900px;
    width: 95%;
    max-height: 85dvh;
    overflow-y: auto;
    background: rgba(0, 255, 65, 0.05);
    border: 2px solid var(--matrix-green);
    border-radius: 20px;
    padding: 3rem;
    position: relative;
    margin: auto;
    box-shadow: 0 0 50px rgba(0, 255, 65, 0.3);
}

.tutorial-text {
    margin: 2rem 0;
    font-family: 'Courier Prime', monospace;
    font-size: 1.2rem;
    line-height: 1.8;
}

.tutorial-text p {
    margin-bottom: 1rem;
}

.instructions {
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid var(--matrix-green);
    border-radius: 15px;
    padding: 2rem;
    margin: 2rem 0;
    text-align: left;
}

.instructions h4 {
    color: var(--matrix-green);
    font-size: 1.3rem;
    margin-bottom: 2rem;
    text-align: center;
    font-weight: 700;
}

/* NEW: Mission Goals Styling */
.mission-goals {
    display: grid;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.goal {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
    background: rgba(0, 255, 65, 0.05);
    border-radius: 10px;
    border-left: 3px solid var(--matrix-green);
    transition: all 0.3s ease;
}

.goal:hover {
    background: rgba(0, 255, 65, 0.1);
    transform: translateX(5px);
}

.goal-icon {
    font-size: 2rem;
    min-width: 50px;
    text-align: center;
}

.goal-text {
    font-family: 'Courier Prime', monospace;
    line-height: 1.6;
}

.goal-text strong {
    color: var(--matrix-green);
    font-size: 1.1rem;
    display: block;
    margin-bottom: 0.5rem;
}

.completion-hint {
    background: rgba(255, 193, 7, 0.1);
    border: 2px solid #ffc107;
    border-radius: 10px;
    padding: 1.5rem;
    margin-top: 2rem;
    text-align: center;
}

.completion-hint p {
    color: #ffc107;
    font-weight: 700;
    margin: 0;
}

/* Stage 3: Matrix Experience */
.matrix-experience {
    display: none;
    min-height: 100vh;
    min-height: 100dvh; /* Dynamic viewport height for mobile */
    padding: 100px 2rem 100px;
}

.matrix-experience.active {
    display: block;
}

/* Reality Selector */
.reality-selector {
    max-width: 1200px;
    margin: 0 auto 4rem;
    text-align: center;
}

.section-title {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    text-align: center;
}

.section-subtitle {
    font-size: 1.2rem;
    color: var(--matrix-green);
    opacity: 0.8;
    margin-bottom: 3rem;
    font-family: 'Courier Prime', monospace;
}

.realities-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.reality-card {
    background: rgba(0, 255, 65, 0.05);
    border: 1px solid var(--matrix-green);
    border-radius: 15px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.reality-card:hover {
    background: rgba(0, 255, 65, 0.1);
    transform: translateY(-10px);
    box-shadow: 0 10px 30px rgba(0, 255, 65, 0.3);
}

.reality-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    transition: left 0.5s ease;
}

.reality-card:hover::before {
    left: 100%;
}

.reality-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    filter: grayscale(100%);
    transition: filter 0.3s ease;
}

.reality-card:hover .reality-icon {
    filter: none;
}

.reality-card h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--matrix-green);
}

.reality-card p {
    opacity: 0.8;
    font-family: 'Courier Prime', monospace;
    margin-bottom: 1rem;
}

.reality-stats {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    font-size: 0.85rem;
    color: var(--matrix-green);
    opacity: 0.7;
}

.reality-stats span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Code Viewer */
.code-viewer {
    display: none;
    max-width: 1400px;
    margin: 0 auto;
    background: rgba(0,0,0,0.95);
    border: 1px solid var(--matrix-green);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    z-index: 100;
}

.code-viewer.active {
    display: block;
}

.viewer-header {
    background: var(--matrix-dark-green);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 101;
}

.viewer-title {
    font-family: 'Courier Prime', monospace;
    font-weight: 700;
}

.loading-bar {
    width: 200px;
    height: 4px;
    background: rgba(0,255,65,0.2);
    border-radius: 2px;
    overflow: hidden;
}

.loading-progress {
    height: 100%;
    background: var(--matrix-green);
    width: 0%;
    animation: loading 3s ease-in-out infinite;
}

@keyframes loading {
    0%, 100% { width: 0%; }
    50% { width: 100%; }
}

.close-viewer {
    background: transparent;
    border: 1px solid var(--matrix-green);
    color: var(--matrix-green);
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.close-viewer:hover {
    background: var(--matrix-green);
    color: var(--matrix-black);
    transform: rotate(90deg);
}

.code-content {
    padding: 2rem;
    font-family: 'Courier Prime', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
    height: 400px;
    overflow-y: auto;
    background: var(--matrix-black);
    scroll-behavior: smooth;
}

.loading-message {
    text-align: center;
    color: var(--matrix-green);
    font-size: 1.2rem;
    font-weight: 700;
    padding: 2rem;
    animation: pulse 1.5s infinite;
}

.code-line {
    margin-bottom: 0.5rem;
    padding: 0.5rem 1rem;
    border-left: 2px solid transparent;
    transition: all 0.3s ease;
    opacity: 0;
    animation: fadeInCode 0.5s ease forwards;
}

@keyframes fadeInCode {
    to {
        opacity: 1;
    }
}

.code-line:hover {
    border-left-color: var(--matrix-green);
    background: rgba(0,255,65,0.05);
}

.code-line.highlight {
    background: rgba(255,255,255,0.1);
    border-left-color: #ffffff;
}

.code-line.unlocked {
    background: rgba(0,255,65,0.1);
    border-left-color: var(--matrix-green);
    animation: unlock-glow 1s ease-out;
}

@keyframes unlock-glow {
    0% { box-shadow: 0 0 0 rgba(0,255,65,0.5); }
    50% { box-shadow: 0 0 20px rgba(0,255,65,0.5); }
    100% { box-shadow: 0 0 0 rgba(0,255,65,0.5); }
}

.law-number {
    color: var(--matrix-blue);
    font-weight: 700;
}

.law-text {
    color: var(--matrix-green);
}

.law-keyword {
    color: #ffffff;
    font-weight: 700;
}

.law-explanation {
    display: none;
    margin-top: 0.5rem;
    padding: 0.75rem;
    background: rgba(0, 255, 65, 0.1);
    border-radius: 5px;
    font-size: 0.85rem;
    color: #ffffff;
    border-left: 3px solid var(--matrix-green);
}

.law-explanation.visible {
    display: block;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.law-connections {
    margin-top: 0.5rem;
    padding: 0.5rem;
    background: rgba(0, 102, 255, 0.1);
    border-radius: 5px;
    font-size: 0.8rem;
    color: var(--matrix-blue);
    border-left: 3px solid var(--matrix-blue);
    display: none;
}

.law-connections.visible {
    display: block;
    animation: slideDown 0.3s ease-out;
}

/* Controls */
.controls {
    padding: 1.5rem 2rem;
    background: var(--matrix-dark);
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    position: relative;
    z-index: 102;
}

.matrix-btn {
    background: transparent;
    border: 1px solid var(--matrix-green);
    color: var(--matrix-green);
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Orbitron', monospace;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
    z-index: 103;
    min-width: 160px;
    justify-content: center;
}

.matrix-btn:hover {
    background: var(--matrix-green);
    color: var(--matrix-black);
    box-shadow: 0 0 20px var(--matrix-green);
    transform: scale(1.05);
}

.matrix-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.matrix-btn:disabled:hover {
    background: transparent;
    color: var(--matrix-green);
    transform: none;
    box-shadow: none;
}

.counter {
    font-size: 0.8rem;
    opacity: 0.8;
    font-family: 'Courier Prime', monospace;
    margin-left: 0.5rem;
}

/* Progress Indicator */
.progress-indicator {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: none;
    gap: 2rem;
    background: rgba(0, 0, 0, 0.9);
    padding: 1rem 2rem;
    border-radius: 50px;
    border: 1px solid var(--matrix-green);
    z-index: 50;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    opacity: 0.3;
    transition: all 0.3s ease;
}

.progress-step.active {
    opacity: 1;
}

.progress-step i {
    font-size: 1.5rem;
    color: var(--matrix-green);
}

.progress-step span {
    font-size: 0.8rem;
    font-family: 'Courier Prime', monospace;
}

/* Bullet Time Mode - CORREGIDO */
.bullet-time-mode {
    display: none !important;
    position: fixed !important;
    inset: 0 !important;
    background: rgba(0,0,0,0.98) !important;
    z-index: 1500 !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 100px 2rem 2rem !important;
    overflow-y: auto !important;
}

.bullet-time-mode.active {
    display: flex !important;
    animation: bulletTimeActivate 0.5s ease-out !important;
}

@keyframes bulletTimeActivate {
    0% { 
        background: rgba(0,0,0,0) !important;
        backdrop-filter: blur(0px) !important;
    }
    100% { 
        background: rgba(0,0,0,0.98) !important;
        backdrop-filter: blur(5px) !important;
    }
}

.time-distortion {
    text-align: center !important;
    animation: slow-motion 1s ease-in-out !important;
    background: rgba(0, 255, 65, 0.05) !important;
    padding: 3rem !important;
    border-radius: 20px !important;
    border: 2px solid var(--matrix-green) !important;
    box-shadow: 0 0 50px rgba(0, 255, 65, 0.3) !important;
    max-width: 600px !important;
    position: relative !important;
    z-index: 1501 !important;
}

.time-distortion h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    animation: zoom-in 1s ease-out;
    color: var(--matrix-green);
    text-shadow: 0 0 20px var(--matrix-green);
}

.bullet-time-explanation {
    font-family: 'Courier Prime', monospace;
    margin-bottom: 2rem;
    font-size: 1.1rem;
    line-height: 1.6;
    color: #ffffff;
}

.bullet-time-explanation strong {
    color: var(--matrix-green);
}

.bullet-time-timer {
    position: relative;
}

.bullet-time-timer span {
    font-size: 4rem !important;
    color: var(--matrix-green) !important;
    font-weight: 900 !important;
    text-shadow: 0 0 30px var(--matrix-green) !important;
    display: block !important;
    animation: timer-pulse 1s ease-in-out infinite !important;
}

@keyframes timer-pulse {
    0%, 100% { transform: scale(1) !important; }
    50% { transform: scale(1.1) !important; }
}

.timer-label {
    font-size: 1rem;
    color: #ffffff;
    margin-top: 0.5rem;
    font-family: 'Courier Prime', monospace;
}

@keyframes slow-motion {
    0% { filter: blur(5px) !important; transform: scale(0.8) !important; }
    100% { filter: blur(0px) !important; transform: scale(1) !important; }
}

@keyframes zoom-in {
    0% { transform: scale(0) rotate(180deg); opacity: 0; }
    100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

.legal-particles {
    position: absolute !important;
    width: 100% !important;
    height: 100% !important;
    pointer-events: none !important;
    top: 0 !important;
    left: 0 !important;
    z-index: 1 !important;
}

.particle {
    position: absolute !important;
    width: 4px !important;
    height: 4px !important;
    background: var(--matrix-green) !important;
    border-radius: 50% !important;
    animation: particle-float 8s linear infinite !important;
    box-shadow: 0 0 10px var(--matrix-green) !important;
}

@keyframes particle-float {
    0% { 
        transform: translateY(100vh) translateX(0) scale(0) !important; 
        opacity: 0 !important; 
    }
    10% { 
        opacity: 1 !important; 
        transform: scale(1) !important; 
    }
    90% { 
        opacity: 1 !important; 
    }
    100% { 
        transform: translateY(-10vh) translateX(200px) scale(0) !important; 
        opacity: 0 !important; 
    }
}

/* Glitch Detector */
.glitch-detector {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(255,0,64,0.15);
    z-index: 1501;
    align-items: center;
    justify-content: center;
    padding: 100px 2rem 2rem;
    animation: glitch-screen 0.5s ease-in-out;
    overflow-y: auto;
}

.glitch-detector.active {
    display: flex;
}

@keyframes glitch-screen {
    0%, 100% { background: rgba(255,0,64,0.1); }
    25% { background: rgba(255,0,64,0.3); }
    50% { background: rgba(0,102,255,0.2); }
    75% { background: rgba(255,0,64,0.3); }
}

.glitch-content {
    text-align: center;
    background: rgba(0,0,0,0.95);
    padding: 3rem;
    border-radius: 15px;
    border: 2px solid var(--matrix-red);
    max-width: 700px;
    width: 90%;
    animation: glitch-content-appear 0.5s ease-out;
}

@keyframes glitch-content-appear {
    0% { transform: scale(0.8); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.glitch-content h2 {
    font-size: 2.5rem;
    color: var(--matrix-red);
    margin-bottom: 2rem;
}

.glitch-analysis {
    background: rgba(255,0,64,0.1);
    padding: 2rem;
    border-radius: 10px;
    margin: 2rem 0;
}

.glitch-analysis p {
    margin-bottom: 1rem;
    font-family: 'Courier Prime', monospace;
}

.contradiction-found {
    margin: 1rem 0;
}

.contradiction-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 1rem;
    font-family: 'Courier Prime', monospace;
}

.law-ref {
    background: var(--matrix-dark);
    padding: 0.5rem 1rem;
    border-radius: 5px;
    border: 1px solid var(--matrix-green);
    color: var(--matrix-green);
}

.vs {
    color: var(--matrix-red);
    font-weight: 900;
    font-size: 1.5rem;
}

.contradiction-explanation {
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 10px;
    font-style: italic;
    color: #ffffff;
}

.glitch-hint {
    margin-top: 1rem;
    font-size: 1rem;
    color: var(--matrix-green);
    font-family: 'Courier Prime', monospace;
}

.glitch-hint span {
    font-weight: 700;
    color: #ffffff;
}

/* Hack Mode - CORREGIDO */
.hack-mode {
    display: none !important;
    position: fixed !important;
    inset: 0 !important;
    background: rgba(0,0,0,0.98) !important;
    z-index: 1501 !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 100px 2rem 2rem !important;
    overflow-y: auto !important;
}

.hack-mode.active {
    display: flex !important;
    animation: hackModeActivate 0.3s ease-out !important;
}

.hack-mode.closing {
    animation: hackModeDeactivate 0.3s ease-in;
}

@keyframes hackModeActivate {
    0% { opacity: 0 !important; }
    100% { opacity: 1 !important; }
}

@keyframes hackModeDeactivate {
    0% { opacity: 1; }
    100% { opacity: 0; }
}

.hack-content {
    text-align: center !important;
    max-width: 800px !important;
    width: 95% !important;
    background: rgba(0,0,0,0.95) !important;
    padding: 3rem !important;
    border-radius: 15px !important;
    border: 2px solid var(--matrix-green) !important;
    box-shadow: 0 0 50px rgba(0, 255, 65, 0.3) !important;
    animation: hackContentAppear 0.5s ease-out !important;
    position: relative !important;
    z-index: 1502 !important;
}

@keyframes hackContentAppear {
    0% { transform: scale(0.9) translateY(-20px) !important; opacity: 0 !important; }
    100% { transform: scale(1) translateY(0) !important; opacity: 1 !important; }
}

.hack-content h2 {
    font-size: 2.2rem;
    margin-bottom: 1rem;
    color: var(--matrix-green);
    text-shadow: 0 0 20px var(--matrix-green);
}

.hack-explanation {
    margin-bottom: 2rem;
    font-family: 'Courier Prime', monospace;
    font-size: 1.1rem;
    color: #ffffff;
}

.hack-explanation strong {
    color: var(--matrix-green);
}

.hack-terminal {
    background: var(--matrix-black);
    border: 2px solid var(--matrix-green);
    border-radius: 10px;
    padding: 2rem;
    font-family: 'Courier Prime', monospace;
    text-align: left;
    margin-bottom: 2rem;
    box-shadow: inset 0 0 20px rgba(0, 255, 65, 0.1);
}

.terminal-line {
    margin-bottom: 0.8rem;
    opacity: 0;
    animation: terminalType 0.6s ease forwards;
    font-size: 1rem;
}

.terminal-line:nth-child(1) { animation-delay: 0.2s; }
.terminal-line:nth-child(2) { animation-delay: 0.6s; }
.terminal-line:nth-child(3) { animation-delay: 1.0s; }
.terminal-line:nth-child(4) { animation-delay: 1.4s; }
.terminal-line:nth-child(5) { animation-delay: 1.8s; }

.terminal-line.success {
    color: var(--matrix-green);
    font-weight: 700;
    text-shadow: 0 0 10px var(--matrix-green);
}

.terminal-line.info {
    color: var(--matrix-blue);
}

@keyframes terminalType {
    to {
        opacity: 1;
    }
}

.hack-progress {
    font-size: 1.3rem;
    color: var(--matrix-green);
    margin-bottom: 2rem;
    font-family: 'Courier Prime', monospace;
}

.hack-progress span {
    font-weight: 700;
    color: #ffffff;
    font-size: 1.5rem;
}

.hack-result {
    background: rgba(0, 255, 65, 0.1);
    padding: 2rem;
    border-radius: 15px;
    margin-top: 2rem;
    border: 2px solid var(--matrix-green);
    animation: resultAppear 0.5s ease-out 2.5s both;
}

@keyframes resultAppear {
    0% { opacity: 0; transform: translateY(20px); }
    100% { opacity: 1; transform: translateY(0); }
}

.hack-result h3 {
    color: var(--matrix-green);
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.hack-result p {
    color: #ffffff;
    font-family: 'Courier Prime', monospace;
    font-size: 1rem;
    line-height: 1.6;
}

/* Contenido Hackeado - CORREGIDO */
.unlocked-article {
    border-left: 4px solid var(--matrix-green) !important;
    background: linear-gradient(90deg, rgba(0, 255, 65, 0.1), rgba(0, 255, 65, 0.05)) !important;
    padding: 20px !important;
    margin: 15px 0 !important;
    border-radius: 8px !important;
    color: var(--matrix-green) !important;
    font-family: 'Courier Prime', monospace !important;
    box-shadow: 0 4px 15px rgba(0, 255, 65, 0.3) !important;
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    position: relative !important;
    z-index: 100 !important;
    border: 1px solid rgba(0, 255, 65, 0.5) !important;
}

.hack-content {
    opacity: 1 !important;
    display: block !important;
    visibility: visible !important;
    position: relative !important;
}

.hack-separator {
    margin: 20px 0 !important;
    position: relative !important;
    z-index: 99 !important;
}

/* Explicaciones y Conexiones - CORREGIDO */
.law-explanation.visible,
.law-connections.visible {
    opacity: 1 !important;
    display: block !important;
    visibility: visible !important;
    position: relative !important;
    z-index: 98 !important;
}

.law-explanation {
    background: rgba(65, 105, 225, 0.1) !important;
    border-left: 4px solid #4169e1 !important;
    color: #ffffff !important;
    padding: 15px !important;
    margin-top: 12px !important;
    border-radius: 8px !important;
    font-size: 0.95em !important;
    box-shadow: 0 2px 8px rgba(65, 105, 225, 0.2) !important;
}

.law-connections {
    background: rgba(255, 165, 0, 0.1) !important;
    border-left: 4px solid #ffa500 !important;
    color: #ffa500 !important;
    padding: 15px !important;
    margin-top: 12px !important;
    border-radius: 8px !important;
    font-size: 0.9em !important;
    box-shadow: 0 2px 8px rgba(255, 165, 0, 0.2) !important;
}

/* Animaciones CORREGIDAS */
@keyframes fadeInUnlock {
    0% {
        opacity: 0 !important;
        transform: translateY(20px) scale(0.95) !important;
    }
    50% {
        opacity: 0.7 !important;
        transform: translateY(10px) scale(0.98) !important;
    }
    100% {
        opacity: 1 !important;
        transform: translateY(0) scale(1) !important;
    }
}

@keyframes glow-pulse {
    0%, 100% {
        box-shadow: 0 0 10px rgba(0, 255, 65, 0.3) !important;
        border-color: var(--matrix-green) !important;
    }
    50% {
        box-shadow: 0 0 25px rgba(0, 255, 65, 0.6) !important;
        border-color: rgba(0, 255, 65, 0.8) !important;
    }
}

/* Stage 4: Neo Message */
.neo-message {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.95);
    z-index: 1502;
    align-items: center;
    justify-content: center;
    padding: 100px 2rem 2rem;
    overflow-y: auto;
}

.neo-message.active {
    display: flex;
}

.message-container {
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    text-align: center;
    background: rgba(0,255,65,0.05);
    border: 1px solid var(--matrix-green);
    border-radius: 20px;
    padding: 3rem;
    position: relative;
}

.message-container::before {
    content: '';
    position: absolute;
    inset: -2px;
    background: linear-gradient(45deg, 
        transparent 0%, 
        var(--matrix-green) 25%, 
        transparent 50%, 
        var(--matrix-green) 75%, 
        transparent 100%);
    border-radius: inherit;
    z-index: -1;
    animation: border-breathing 4s ease-in-out infinite;
}

@keyframes border-breathing {
    0%, 100% { 
        opacity: 0.3; 
        transform: scale(1);
        filter: blur(1px);
    }
    50% { 
        opacity: 0.8; 
        transform: scale(1.02);
        filter: blur(0px);
    }
}

.close-neo {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: transparent;
    border: 1px solid var(--matrix-green);
    color: var(--matrix-green);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 1503;
}

.close-neo:hover {
    background: var(--matrix-green);
    color: var(--matrix-black);
    transform: rotate(90deg);
}

.avatar-container {
    position: relative;
    margin: 0 auto 2rem;
    width: 180px;
    height: 180px;
}

.neo-avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 4px solid var(--matrix-green);
    filter: sepia(100%) hue-rotate(90deg) saturate(200%) brightness(1.1);
    animation: avatar-glow 2s ease-in-out infinite alternate;
    box-shadow: 
        0 0 30px var(--matrix-green),
        inset 0 0 20px rgba(0, 255, 65, 0.2);
}

@keyframes avatar-glow {
    0% { box-shadow: 0 0 20px var(--matrix-green); }
    100% { box-shadow: 0 0 40px var(--matrix-green), 0 0 60px var(--matrix-green); }
}

.avatar-glow {
    position: absolute;
    inset: -10px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--matrix-green) 0%, transparent 70%);
    opacity: 0.3;
    animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% { transform: scale(0.9); opacity: 0.3; }
    50% { transform: scale(1.1); opacity: 0.7; }
}

.message-container h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--matrix-green);
}

.message-container h3 {
    font-size: 1.5rem;
    margin-bottom: 2rem;
    color: #ffffff;
}

.typewriter-container {
    position: relative;
    margin-bottom: 2rem;
}

.typewriter-text {
    font-family: 'Courier Prime', monospace;
    font-size: 1.1rem;
    line-height: 1.8;
    text-align: left;
    background: rgba(0,0,0,0.85);
    padding: 2rem;
    border-radius: 15px;
    border: 2px solid var(--matrix-green);
    color: #ffffff;
    text-shadow: 0 0 5px var(--matrix-green);
    min-height: 300px;
    max-height: 400px;
    overflow-y: auto;
    white-space: pre-wrap;
}

.cursor {
    position: absolute;
    bottom: 2rem;
    right: 2rem;
    color: var(--matrix-green);
    font-weight: 700;
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

.signature {
    text-align: right;
    margin-bottom: 2rem;
    font-style: italic;
    background: rgba(0, 255, 65, 0.1);
    padding: 1rem;
    border-radius: 10px;
    border-right: 3px solid var(--matrix-green);
}

.signature span {
    display: block;
    margin-bottom: 0.5rem;
    color: #ffffff;
    font-weight: 700;
    font-size: 1.1rem;
    text-shadow: 0 0 5px var(--matrix-green);
}

.signature small {
    opacity: 0.9;
    font-family: 'Courier Prime', monospace;
    color: var(--matrix-green);
    font-size: 0.95rem;
}

.neo-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.neo-btn {
    background: var(--matrix-green) !important;
    color: var(--matrix-black) !important;
    text-decoration: none;
}

.neo-btn:hover {
    background: #ffffff !important;
    color: var(--matrix-green) !important;
}

.exit-btn {
    background: var(--matrix-red) !important;
    border-color: var(--matrix-red) !important;
    color: #ffffff !important;
}

.exit-btn:hover {
    background: #ffffff !important;
    color: var(--matrix-red) !important;
    box-shadow: 0 0 30px var(--matrix-red) !important;
}

.powered-by-utilia {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: center;
    font-family: 'Courier Prime', monospace;
    font-size: 0.9rem;
    color: var(--matrix-green);
    opacity: 0.8;
}

.powered-by-utilia a {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.utilia-logo-mini {
    height: 16px;
    width: auto;
    filter: brightness(1.2) saturate(1.1);
    transition: all 0.3s ease;
}

.utilia-logo-mini:hover {
    filter: brightness(1.5) saturate(1.4);
    transform: scale(1.2);
}

/* Blue Pill Screen */
.blue-pill-screen {
    display: none;
    min-height: 100vh;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: linear-gradient(45deg, var(--matrix-blue), var(--matrix-black));
    padding: 100px 2rem 2rem;
    position: fixed;
    inset: 0;
    z-index: 1500;
}

.blue-pill-screen.active {
    display: flex;
}

.blue-content h2 {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: #ffffff;
}

.blue-content p {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    opacity: 0.8;
    line-height: 1.6;
}

.countdown {
    font-size: 5rem;
    font-weight: 900;
    color: var(--matrix-blue);
    text-shadow: 0 0 30px var(--matrix-blue);
    animation: countdown-pulse 1s ease-in-out infinite;
}

@keyframes countdown-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

/* Utilia Watermark */
.utilia-watermark-fixed {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(0, 0, 0, 0.9);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    border: 1px solid var(--matrix-green);
    z-index: 60;
    font-family: 'Courier Prime', monospace;
    font-size: 0.8rem;
    opacity: 0.7;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.utilia-watermark-fixed:hover {
    opacity: 1;
    transform: scale(1.05);
    box-shadow: 0 0 15px var(--matrix-green);
}

.utilia-watermark-fixed span {
    color: var(--matrix-green);
}

.utilia-logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.utilia-logo-small {
    height: 20px;
    width: auto;
    filter: brightness(1.2) saturate(1.1);
    transition: all 0.3s ease;
}

.utilia-logo-small:hover {
    filter: brightness(1.4) saturate(1.3);
    transform: scale(1.1);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--matrix-black);
}

::-webkit-scrollbar-thumb {
    background: var(--matrix-green);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #ffffff;
}

/* Responsive Design - IMPROVED */
@media (max-width: 768px) {
    .matrix-header {
        height: 60px;
        padding: 0.5rem 0;
    }
    
    .matrix-nav {
        padding: 0 1rem;
        gap: 0.5rem;
    }
    
    .logo-matrix {
        font-size: 1rem;
    }
    
    .matrix-title {
        font-size: 2rem;
    }
    
    .main-title {
        font-size: 2.5rem;
    }
    
    .welcome-screen {
        padding: 80px 1rem 2rem;
        min-height: 100dvh;
    }
    
    .matrix-experience {
        padding: 80px 1rem 80px;
        min-height: 100dvh;
    }
    
    .blue-pill-screen {
        padding: 80px 1rem 2rem;
    }
    
    /* Better modal positioning on mobile */
    .matrix-tutorial,
    .bullet-time-mode,
    .hack-mode,
    .glitch-detector,
    .neo-message {
        padding: 80px 1rem 1rem !important;
    }
    
    .time-distortion,
    .hack-content,
    .glitch-content,
    .message-container {
        width: 100% !important;
        max-width: 100% !important;
        padding: 1.5rem !important;
        margin: 0 !important;
        max-height: calc(100dvh - 100px) !important;
        overflow-y: auto !important;
    }
    
    .pill-container {
        flex-direction: column;
        gap: 1.5rem;
        width: 100%;
        padding: 0 1rem;
    }
    
    .pill {
        width: 100%;
        max-width: 280px;
        height: 100px;
        font-size: 1.1rem;
    }
    
    .pill small {
        font-size: 0.75rem;
    }
    
    .vs-text {
        font-size: 1.5rem;
        margin: 0.5rem 0;
    }
    
    .realities-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 0;
    }
    
    .reality-card {
        padding: 1.5rem;
    }
    
    .reality-icon {
        font-size: 2.5rem;
    }
    
    .controls {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
        padding: 1rem;
    }
    
    .matrix-btn {
        width: 100%;
        padding: 1rem;
        font-size: 0.9rem;
        justify-content: center;
        min-width: auto;
    }
    
    .matrix-btn .counter {
        font-size: 0.75rem;
    }
    
    .matrix-nav {
        padding: 0 1rem;
    }
    
    .back-btn span {
        display: none;
    }
    
    .contradiction-item {
        flex-direction: column;
        gap: 1rem;
    }
    
    .message-container {
        padding: 2rem 1.5rem;
        max-width: 95%;
    }
    
    .typewriter-text {
        font-size: 1rem;
        min-height: 250px;
        padding: 1.5rem;
    }
    
    .message-container h2 {
        font-size: 1.8rem;
    }
    
    .progress-indicator {
        bottom: auto;
        top: 75px;
        padding: 0.5rem 0.75rem;
        gap: 0.75rem;
        font-size: 0.7rem;
        background: rgba(0, 0, 0, 0.95);
    }
    
    .progress-step {
        gap: 0.25rem;
    }
    
    .progress-step i {
        font-size: 1.2rem;
    }
    
    .progress-step span {
        font-size: 0.7rem;
    }
    
    .viewer-header {
        padding: 1rem;
        flex-wrap: wrap;
        gap: 1rem;
    }
    
    .loading-bar {
        width: 100%;
        order: 3;
    }
    
    .matrix-btn {
        width: 100%;
        justify-content: center;
        min-width: auto;
    }
    
    .neo-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .bullet-time-mode.active {
        padding: 1rem !important;
    }
    
    .time-distortion {
        padding: 2rem 1.5rem !important;
    }
    
    .mission-goals {
        grid-template-columns: 1fr;
    }
    
    .goal {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }
    
    .goal-icon {
        font-size: 2.5rem;
    }
}

@media (max-width: 480px) {
    .matrix-header {
        height: 60px;
    }
    
    .matrix-title {
        font-size: 2rem;
    }
    
    .main-title {
        font-size: 2.5rem;
    }
    
    .welcome-screen {
        padding: 70px 1rem 2rem;
    }
    
    .matrix-experience {
        padding: 70px 1rem 70px;
    }
    
    .blue-pill-screen {
        padding: 70px 1rem 2rem;
    }
    
    .tutorial-container {
        padding: 1.5rem;
        width: 100%;
        max-width: 100%;
        margin: 0;
        max-height: calc(100dvh - 100px);
    }
    
    .tutorial-text {
        font-size: 1rem;
        line-height: 1.6;
    }
    
    .instructions {
        padding: 1rem;
    }
    
    .instructions {
        padding: 1.5rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .pill {
        width: 200px;
        height: 70px;
    }
    
    .code-content {
        font-size: 0.85rem;
        padding: 1rem;
        height: 400px;
        line-height: 1.5;
    }
    
    .code-line {
        padding: 0.75rem;
        margin-bottom: 0.5rem;
    }
    
    .law-explanation,
    .law-connections {
        font-size: 0.8rem;
        padding: 0.5rem;
        margin-top: 0.5rem;
    }
    
    .matrix-btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
    
    .logo-matrix {
        font-size: 1.2rem;
    }
    
    .system-status {
        display: none;
    }
    
    .avatar-container {
        width: 120px;
        height: 120px;
    }
    
    .progress-indicator {
        top: 65px;
        padding: 0.4rem 0.6rem;
        gap: 0.5rem;
        display: flex;
    }
    
    .utilia-watermark-fixed {
        font-size: 0.7rem;
        padding: 0.4rem 0.8rem;
        bottom: 0.5rem;
        right: 0.5rem;
    }
    
    .utilia-logo-small {
        height: 16px;
    }
    
    .hack-content {
        padding: 2rem 1.5rem !important;
    }
    
    .hack-terminal {
        padding: 1.5rem;
    }
    
    .time-distortion h2 {
        font-size: 2rem;
    }
}

/* Touch-friendly improvements */
@media (hover: none) {
    .pill {
        transition: transform 0.2s ease;
    }
    
    .pill:active {
        transform: scale(0.95);
    }
    
    .reality-card:active {
        transform: scale(0.98);
    }
    
    .matrix-btn:active {
        transform: scale(0.95);
    }
}

/* Animations */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* Success Flash Effect */
@keyframes success-flash {
    0% { background-color: rgba(0, 255, 65, 0); }
    50% { background-color: rgba(0, 255, 65, 0.2); }
    100% { background-color: rgba(0, 255, 65, 0); }
}

.flash-success {
    animation: success-flash 0.5s ease-out !important;
}

/* Matrix Scan Effect */
@keyframes matrix-scan {
    0% { 
        transform: translateY(-100%);
        opacity: 0;
    }
    50% { 
        opacity: 1;
    }
    100% { 
        transform: translateY(100%);
        opacity: 0;
    }
}

/* Z-Index Hierarchy - CORREGIDO */
.bullet-time-mode { z-index: 1500 !important; }
.hack-mode { z-index: 1501 !important; }
.time-distortion { z-index: 1501 !important; }
.hack-content { z-index: 1502 !important; }

/* Forzar Visibilidad de Elementos Críticos */
#bulletTimeMode.active,
#hackMode.active {
    display: flex !important;
    opacity: 1 !important;
    visibility: visible !important;
}

#bulletTimeCount {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* Asegurar que el contenido hackeado permanezca visible */
.unlocked-article,
.hack-content,
.law-explanation.visible,
.law-connections.visible {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    position: relative !important;
}

/* Prevenir que el contenido sea removido */
.unlocked-article::before {
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    pointer-events: none;
    z-index: -1;
}

/* Mejorar legibilidad del texto hackeado */
.unlocked-article * {
    pointer-events: none !important;
    user-select: text !important;
}

/* Asegurar que las animaciones se ejecuten */
.unlocked-article[style*="animation"] {
    animation-fill-mode: forwards !important;
    animation-play-state: running !important;
}

/* Additional Mobile Improvements */
@media (max-width: 768px) {
    /* Use dynamic viewport height */
    body, .matrix-container {
        min-height: 100dvh;
    }
    
    /* Disable custom cursor on mobile */
    body {
        cursor: auto !important;
    }
    
    .custom-cursor {
        display: none !important;
    }
    
    /* Better scroll on mobile */
    .matrix-experience,
    .welcome-screen {
        -webkit-overflow-scrolling: touch;
        overflow-y: auto;
        height: 100dvh;
    }
    
    /* Prevent horizontal scroll */
    body, html {
        overflow-x: hidden;
        width: 100%;
    }
    
    /* Progress indicator mobile optimization */
    .progress-indicator {
        position: fixed !important;
        top: 50% !important;
        right: 10px !important;
        transform: translateY(-50%) !important;
        bottom: auto !important;
        left: auto !important;
        flex-direction: column !important;
        gap: 0.5rem !important;
        background: rgba(0, 0, 0, 0.9) !important;
        padding: 1rem 0.5rem !important;
        border-radius: 15px !important;
        border: 1px solid var(--matrix-green) !important;
        backdrop-filter: blur(10px) !important;
        z-index: 1000 !important;
    }
    
    .progress-step {
        width: 8px !important;
        height: 8px !important;
        margin: 0 !important;
        border-radius: 50% !important;
    }
    
    .progress-step.active {
        background: var(--matrix-green) !important;
        box-shadow: 0 0 10px var(--matrix-green) !important;
    }
    
    .progress-step.completed {
        background: var(--matrix-green) !important;
    }
    
    /* Better touch feedback */
    .pill:active,
    .reality-card:active,
    .matrix-btn:active {
        transform: scale(0.95);
        opacity: 0.8;
    }
    
    /* Improve form controls */
    .form-input,
    .form-textarea,
    button {
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

/* Landscape mobile fixes */
@media (max-height: 600px) and (orientation: landscape) {
    body, .matrix-container {
        min-height: 100dvh;
    }
    
    .matrix-header {
        height: 50px;
    }
    
    .welcome-screen,
    .matrix-experience {
        padding-top: 60px;
        height: 100dvh;
    }
    
    .matrix-tutorial,
    .bullet-time-mode,
    .hack-mode,
    .glitch-detector,
    .neo-message {
        padding: 60px 2rem 1rem !important;
    }
    
    .pill-container {
        flex-direction: row;
    }
    
    .pill {
        width: 200px;
        height: 60px;
    }
    
    /* Progress indicator in landscape */
    .progress-indicator {
        top: 50% !important;
        right: 5px !important;
        transform: translateY(-50%) !important;
        padding: 0.75rem 0.4rem !important;
        gap: 0.4rem !important;
    }
}