/* ================================================================ */
/* SYSTÈME SÉCURISÉ - STYLES ULTRA-OPTIMISÉS MOBILE - styles.css */
/* ================================================================ */

/* Reset et base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Courier New', 'Monaco', 'Lucida Console', monospace;
    background: #0a0a0a;
    color: #00ff41;
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
    min-height: 100vh;
    /* Optimisation mobile */
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

/* Arrière-plan Matrix */
.matrix-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    background: radial-gradient(
        circle at center, 
        rgba(0, 255, 65, 0.03) 0%, 
        rgba(0, 0, 0, 0.8) 100%
    );
}

/* Container principal - Optimisé mobile */
.terminal-container {
    max-width: 1000px;
    margin: 20px auto;
    background: rgba(0, 0, 0, 0.9);
    border: 1px solid #00ff41;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 
        0 0 30px rgba(0, 255, 65, 0.3),
        inset 0 0 20px rgba(0, 255, 65, 0.1);
    backdrop-filter: blur(10px);
    /* Optimisation mobile */
    min-height: calc(100vh - 40px);
}

/* Header du terminal */
.terminal-header {
    background: rgba(0, 50, 0, 0.8);
    padding: 12px 15px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid #00ff41;
    background-image: linear-gradient(90deg, 
        rgba(0, 255, 65, 0.1) 0%, 
        transparent 50%, 
        rgba(0, 255, 65, 0.1) 100%);
    /* Optimisation mobile */
    min-height: 48px;
}

.terminal-buttons {
    display: flex;
    gap: 10px;
    margin-right: 15px;
}

.btn-close, .btn-minimize, .btn-maximize {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 1px solid #333;
    cursor: pointer;
    transition: all 0.2s ease;
    /* Touch-friendly */
    min-width: 24px;
    min-height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-close { 
    background: #ff5f56; 
}
.btn-close:hover, .btn-close:active { 
    background: #ff7f76; 
    transform: scale(1.1); 
}

.btn-minimize { 
    background: #ffbd2e; 
}
.btn-minimize:hover, .btn-minimize:active { 
    background: #ffcd4e; 
    transform: scale(1.1); 
}

.btn-maximize { 
    background: #27ca3f; 
}
.btn-maximize:hover, .btn-maximize:active { 
    background: #47ea5f; 
    transform: scale(1.1); 
}

.terminal-title {
    color: #00ff41;
    font-weight: bold;
    font-size: 0.9em;
    text-shadow: 0 0 5px rgba(0, 255, 65, 0.5);
    /* Mobile responsive */
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

/* Corps du terminal - Optimisé mobile */
.terminal-body {
    padding: 15px;
    min-height: 400px;
    font-family: 'Courier New', monospace;
    width: 100%;
    box-sizing: border-box;
}

/* Séquence de boot */
.boot-sequence {
    color: #00ff41;
}

.boot-line {
    opacity: 0;
    margin: 8px 0;
    transition: opacity 0.5s ease;
    position: relative;
    font-size: 0.9em;
}

.boot-line::before {
    content: '> ';
    color: #00ff41;
    font-weight: bold;
}

/* Écran d'accueil - Mobile first */
.welcome-screen {
    text-align: center;
    padding: 20px 10px;
}

.ascii-art {
    font-size: 0.7em;
    color: #00ff41;
    margin: 15px 0;
    line-height: 1.0;
    text-shadow: 0 0 10px #00ff41;
    font-family: 'Courier New', monospace;
    white-space: pre;
    letter-spacing: 0;
    word-spacing: 0;
    filter: drop-shadow(0 0 5px rgba(0, 255, 65, 0.7));
    overflow-x: auto;
    /* Mobile responsive */
    max-width: 100%;
    transform-origin: center;
}

.system-info {
    margin: 20px 0;
    padding: 15px;
    background: rgba(255, 0, 0, 0.1);
    border: 1px solid #ff0000;
    border-radius: 5px;
    backdrop-filter: blur(5px);
}

.system-info p {
    color: #ff6666;
    margin: 6px 0;
    font-weight: bold;
    text-shadow: 0 0 5px rgba(255, 102, 102, 0.5);
    font-size: 0.9em;
}

.access-prompt {
    margin: 30px 0;
}

.access-prompt p {
    color: #ffff00;
    margin: 12px 0;
    text-shadow: 0 0 5px rgba(255, 255, 0, 0.5);
    font-size: 0.95em;
    line-height: 1.4;
}

/* Bouton d'accès - Touch optimized */
.access-btn {
    background: linear-gradient(45deg, #00ff41, #00cc33);
    color: #000;
    border: none;
    padding: 18px 35px;
    font-size: 1.1em;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    margin-top: 20px;
    transition: all 0.3s ease;
    text-transform: uppercase;
    box-shadow: 0 4px 15px rgba(0, 255, 65, 0.3);
    position: relative;
    overflow: hidden;
    /* Touch-friendly */
    min-height: 56px;
    min-width: 200px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.access-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.5s;
}

.access-btn:hover, .access-btn:active {
    background: linear-gradient(45deg, #ffff00, #ff6600);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 255, 65, 0.5);
}

.access-btn:hover::before, .access-btn:active::before {
    left: 100%;
}

/* Container des défis */
.challenge-container {
    animation: slideIn 0.8s ease-out;
    width: 100%;
    box-sizing: border-box;
}

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

/* Header des défis - Mobile responsive */
.challenge-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid #00ff41;
    margin-bottom: 20px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(0, 255, 65, 0.1) 50%, 
        transparent 100%);
    flex-wrap: wrap;
    gap: 10px;
}

.challenge-title {
    color: #ffff00;
    font-size: 1.2em;
    font-weight: bold;
    text-shadow: 0 0 10px rgba(255, 255, 0, 0.5);
    flex: 1;
    min-width: 200px;
}

.challenge-progress {
    color: #00ffff;
    font-size: 0.9em;
    text-shadow: 0 0 5px rgba(0, 255, 255, 0.5);
    white-space: nowrap;
}

/* Contenu des défis */
.challenge-content, .challenge-input {
    margin: 20px 0;
    width: 100%;
    box-sizing: border-box;
}

.challenge-content {
    min-height: 150px;
}

.challenge-description h3 {
    color: #ffff00;
    margin-bottom: 15px;
    text-align: center;
    font-size: 1.3em;
    text-shadow: 0 0 10px rgba(255, 255, 0, 0.7);
    line-height: 1.3;
}

.challenge-description p {
    color: #ffffff;
    margin: 12px 0;
    line-height: 1.5;
    font-size: 0.95em;
}

.challenge-description ul, .challenge-description ol {
    margin: 15px 0;
    padding-left: 20px;
}

.challenge-description li {
    margin: 8px 0;
    line-height: 1.4;
}

/* Zones d'information - Mobile optimized */
.hint {
    color: #00ffff !important;
    font-style: italic;
    background: rgba(0, 255, 255, 0.1);
    padding: 12px;
    border-left: 4px solid #00ffff;
    border-radius: 5px;
    margin: 15px 0;
    backdrop-filter: blur(5px);
    box-shadow: 0 2px 10px rgba(0, 255, 255, 0.2);
    font-size: 0.9em;
}

.warning {
    color: #ff6600 !important;
    background: rgba(255, 102, 0, 0.1);
    padding: 12px;
    border-left: 4px solid #ff6600;
    border-radius: 5px;
    margin: 15px 0;
    backdrop-filter: blur(5px);
    box-shadow: 0 2px 10px rgba(255, 102, 0, 0.2);
    font-size: 0.9em;
}

/* Zones d'affichage des défis - Mobile responsive */
.sequence-display, .encrypted-block, .coordinates-display, 
.binary-display, .equation-system, .final-formula {
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid #ff6600;
    padding: 15px;
    margin: 15px 0;
    font-family: 'Courier New', monospace;
    font-size: 1.1em;
    color: #ff6600;
    text-align: center;
    border-radius: 8px;
    letter-spacing: 1px;
    width: 100%;
    box-sizing: border-box;
    backdrop-filter: blur(10px);
    box-shadow: 
        0 0 20px rgba(255, 102, 0, 0.3),
        inset 0 0 20px rgba(255, 102, 0, 0.1);
    text-shadow: 0 0 5px rgba(255, 102, 0, 0.7);
    /* Mobile responsive */
    overflow-x: auto;
    white-space: nowrap;
}

/* CORRECTION SPÉCIFIQUE POUR L'AFFICHAGE BINAIRE */
.binary-display {
    letter-spacing: 2px;
    word-spacing: 8px;
    font-family: 'Courier New', monospace;
    line-height: 1.3;
    white-space: nowrap; /* Garde tout sur une ligne pour desktop */
    overflow-x: auto; /* Scroll horizontal si nécessaire */
}

.coordinates-display {
    border-color: #ffff00;
    color: #ffff00;
    box-shadow: 
        0 0 20px rgba(255, 255, 0, 0.3),
        inset 0 0 20px rgba(255, 255, 0, 0.1);
    text-shadow: 0 0 5px rgba(255, 255, 0, 0.7);
}

.equation-system {
    line-height: 1.6;
    text-align: left;
    white-space: pre-line;
}

.final-formula {
    border-color: #ffd700;
    color: #ffd700;
    font-weight: bold;
    box-shadow: 
        0 0 20px rgba(255, 215, 0, 0.3),
        inset 0 0 20px rgba(255, 215, 0, 0.1);
    text-shadow: 0 0 5px rgba(255, 215, 0, 0.7);
    line-height: 1.4;
}

/* Zone d'input - Touch optimized */
.challenge-input {
    background: rgba(0, 20, 0, 0.5);
    border: 2px solid #00ff41;
    padding: 20px;
    border-radius: 8px;
    width: 100%;
    box-sizing: border-box;
    margin: 20px 0;
    backdrop-filter: blur(10px);
    box-shadow: 
        0 0 15px rgba(0, 255, 65, 0.3),
        inset 0 0 15px rgba(0, 255, 65, 0.1);
}

.input-line {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    width: 100%;
    gap: 10px;
    flex-wrap: wrap;
}

.prompt {
    color: #00ff41;
    font-weight: bold;
    white-space: nowrap;
    flex-shrink: 0;
    text-shadow: 0 0 5px rgba(0, 255, 65, 0.7);
    font-size: 0.9em;
}

#userInput {
    flex: 1;
    background: transparent;
    border: none;
    color: #00ff41;
    font-family: 'Courier New', monospace;
    font-size: 1.1em;
    outline: none;
    padding: 12px 15px;
    border-bottom: 2px dotted #00ff41;
    min-width: 0;
    text-shadow: 0 0 3px rgba(0, 255, 65, 0.5);
    transition: all 0.3s ease;
    /* Touch-friendly */
    min-height: 48px;
    border-radius: 4px;
    -webkit-appearance: none;
}

#userInput:focus {
    border-bottom: 2px solid #00ff41;
    box-shadow: 0 2px 10px rgba(0, 255, 65, 0.3);
    background: rgba(0, 255, 65, 0.05);
}

#userInput::placeholder {
    color: #666;
    font-style: italic;
    font-size: 0.95em;
}

/* Bouton submit - Touch optimized */
.submit-terminal-btn {
    background: linear-gradient(45deg, #00ff41, #00cc33);
    color: #000;
    border: none;
    padding: 16px 25px;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    font-weight: bold;
    transition: all 0.3s ease;
    width: 100%;
    margin-top: 15px;
    box-shadow: 0 4px 15px rgba(0, 255, 65, 0.3);
    position: relative;
    overflow: hidden;
    /* Touch-friendly */
    min-height: 56px;
    font-size: 1.1em;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.submit-terminal-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.5s;
}

.submit-terminal-btn:hover, .submit-terminal-btn:active {
    background: linear-gradient(45deg, #ffff00, #ff6600);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 255, 65, 0.5);
}

.submit-terminal-btn:hover::before, .submit-terminal-btn:active::before {
    left: 100%;
}

.submit-terminal-btn:disabled {
    background: #333;
    color: #666;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Output du terminal - Mobile optimized */
.terminal-output {
    max-height: 250px;
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.3);
    padding: 12px;
    border-radius: 5px;
    margin-top: 15px;
    border: 1px solid rgba(0, 255, 65, 0.2);
    backdrop-filter: blur(5px);
    /* Mobile scrolling */
    -webkit-overflow-scrolling: touch;
}

.terminal-output::-webkit-scrollbar {
    width: 6px;
}

.terminal-output::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.5);
    border-radius: 3px;
}

.terminal-output::-webkit-scrollbar-thumb {
    background: rgba(0, 255, 65, 0.5);
    border-radius: 3px;
}

.terminal-output::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 255, 65, 0.7);
}

.output-line {
    margin: 6px 0;
    font-family: 'Courier New', monospace;
    font-size: 0.85em;
    line-height: 1.3;
    word-wrap: break-word;
}

.output-line.command {
    color: #ffffff;
    text-shadow: 0 0 3px rgba(255, 255, 255, 0.5);
}

.output-line.success {
    color: #00ff41;
    text-shadow: 0 0 5px rgba(0, 255, 65, 0.7);
}

.output-line.error {
    color: #ff0000;
    text-shadow: 0 0 5px rgba(255, 0, 0, 0.7);
}

.output-line.warning {
    color: #ff6600;
    text-shadow: 0 0 5px rgba(255, 102, 0, 0.7);
}

.output-line.normal {
    color: #cccccc;
}

/* Animation de chargement - Mobile responsive */
.loading-animation {
    text-align: center;
    padding: 30px 15px;
}

.loading-text {
    color: #00ffff;
    margin-bottom: 15px;
    font-size: 1.1em;
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.7);
    line-height: 1.3;
}

.loading-bar {
    width: min(280px, 90%);
    height: 18px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid #00ff41;
    border-radius: 10px;
    margin: 15px auto;
    overflow: hidden;
}

.loading-progress {
    height: 100%;
    background: linear-gradient(90deg, #00ff41, #ffff00);
    width: 0%;
    border-radius: 10px;
    animation: loadingProgress 2s ease-in-out forwards;
    box-shadow: 0 0 10px rgba(0, 255, 65, 0.5);
}

@keyframes loadingProgress {
    0% { width: 0%; }
    100% { width: 100%; }
}

.loading-dots {
    color: #00ff41;
    font-size: 1.8em;
    text-shadow: 0 0 10px rgba(0, 255, 65, 0.7);
}

.loading-dots span {
    animation: loadingDots 1.5s infinite;
}

.loading-dots span:nth-child(1) { animation-delay: 0s; }
.loading-dots span:nth-child(2) { animation-delay: 0.5s; }
.loading-dots span:nth-child(3) { animation-delay: 1s; }

@keyframes loadingDots {
    0%, 80%, 100% { opacity: 0; }
    40% { opacity: 1; }
}

/* Boîtes d'information - Mobile optimized */
.crypto-info, .geo-tip, .binary-helper, .math-warning, 
.investigation-tips, .format-help, .final-warning {
    background: rgba(0, 50, 100, 0.2);
    border: 1px solid #0088ff;
    padding: 12px;
    margin: 15px 0;
    border-radius: 5px;
    color: #88ccff;
    backdrop-filter: blur(5px);
    box-shadow: 0 2px 10px rgba(0, 136, 255, 0.2);
    font-size: 0.85em;
    line-height: 1.4;
}

.investigation-tips ul {
    margin: 8px 0 8px 15px;
}

.investigation-tips li {
    margin: 6px 0;
}

/* Accès refusé */
.access-denied {
    text-align: center;
    padding: 30px 15px;
    color: #ff0000;
    background: rgba(255, 0, 0, 0.1);
    border: 2px solid #ff0000;
    border-radius: 10px;
    backdrop-filter: blur(10px);
    box-shadow: 0 0 20px rgba(255, 0, 0, 0.3);
}

.access-denied h3 {
    font-size: 1.8em;
    margin-bottom: 15px;
    text-shadow: 0 0 10px rgba(255, 0, 0, 0.7);
    line-height: 1.2;
}

/* Classe utilitaire */
.hidden {
    display: none !important;
}

/* ================================================================ */
/* RESPONSIVE DESIGN ULTRA-OPTIMISÉ */
/* ================================================================ */

/* Tablettes et petits ordinateurs portables */
@media (max-width: 1024px) {
    .terminal-container {
        margin: 15px;
        max-width: calc(100% - 30px);
    }
    
    .ascii-art {
        font-size: 0.6em;
    }
}

/* Tablettes portrait */
@media (max-width: 768px) {
    .terminal-container {
        margin: 10px;
        max-width: calc(100% - 20px);
        border-radius: 6px;
    }
    
    .terminal-body {
        padding: 12px;
    }
    
    .ascii-art {
        font-size: 0.5em;
        margin: 10px 0;
    }
    
    .challenge-header {
        flex-direction: column;
        text-align: center;
        gap: 8px;
        padding: 12px 0;
    }
    
    .challenge-title {
        font-size: 1.1em;
        min-width: auto;
    }
    
    .input-line {
        flex-direction: column;
        gap: 8px;
        align-items: stretch;
    }
    
    .prompt {
        text-align: center;
        font-size: 0.85em;
    }
    
    #userInput {
        width: 100%;
        text-align: center;
        font-size: 1em;
    }
    
    .submit-terminal-btn {
        width: 100%;
        padding: 14px 20px;
        font-size: 1em;
    }
    
    .challenge-input {
        padding: 15px;
    }
    
    .sequence-display, .encrypted-block, .coordinates-display,
    .binary-display, .equation-system, .final-formula {
        font-size: 1em;
        padding: 12px;
        letter-spacing: 0.5px;
    }
    
    .binary-display {
        letter-spacing: 1px;
        word-spacing: 4px;
        line-height: 1.4;
        white-space: pre-wrap; /* Permet le retour à la ligne sur tablette */
    }
    
    .loading-bar {
        width: 220px;
    }
    
    .terminal-output {
        max-height: 200px;
    }
    
    /* Matrix mode économique sur tablette */
    .matrix-bg {
        opacity: 0.7;
    }
}

/* Smartphones */
@media (max-width: 480px) {
    body {
        font-size: 14px;
    }
    
    .terminal-container {
        margin: 5px;
        max-width: calc(100% - 10px);
        border-radius: 4px;
        min-height: calc(100vh - 10px);
    }
    
    .terminal-header {
        padding: 8px 10px;
        min-height: 44px;
    }
    
    .terminal-buttons {
        gap: 8px;
    }
    
    .btn-close, .btn-minimize, .btn-maximize {
        width: 20px;
        height: 20px;
        min-width: 20px;
        min-height: 20px;
    }
    
    .terminal-title {
        font-size: 0.8em;
    }
    
    .terminal-body {
        padding: 10px;
    }
    
    .ascii-art {
        font-size: 0.35em;
        margin: 8px 0;
        transform: scale(0.9);
    }
    
    .welcome-screen {
        padding: 15px 8px;
    }
    
    .system-info {
        margin: 15px 0;
        padding: 12px;
    }
    
    .system-info p {
        font-size: 0.85em;
        margin: 4px 0;
    }
    
    .access-prompt {
        margin: 20px 0;
    }
    
    .access-prompt p {
        font-size: 0.9em;
        margin: 10px 0;
    }
    
    .access-btn {
        padding: 16px 30px;
        font-size: 1em;
        min-width: 180px;
    }
    
    .challenge-header {
        padding: 10px 0;
    }
    
    .challenge-title {
        font-size: 1em;
    }
    
    .challenge-progress {
        font-size: 0.8em;
    }
    
    .challenge-description h3 {
        font-size: 1.1em;
        margin-bottom: 12px;
    }
    
    .challenge-description p {
        font-size: 0.9em;
        margin: 10px 0;
    }
    
    .challenge-description ul, .challenge-description ol {
        padding-left: 15px;
        margin: 12px 0;
    }
    
    .challenge-description li {
        margin: 6px 0;
        font-size: 0.85em;
    }
    
    .sequence-display, .encrypted-block, .coordinates-display,
    .binary-display, .equation-system, .final-formula {
        font-size: 0.9em;
        padding: 10px;
        margin: 12px 0;
        letter-spacing: 0px;
    }
    
    .binary-display {
        letter-spacing: 1px;
        word-spacing: 2px;
        font-size: 0.8em;
        white-space: pre-wrap; /* Permet le retour à la ligne sur mobile */
        word-break: break-all;
        line-height: 1.6;
        text-align: center;
    }
    
    .equation-system {
        font-size: 0.85em;
        line-height: 1.5;
    }
    
    .final-formula {
        font-size: 0.8em;
        line-height: 1.3;
    }
    
    .challenge-input {
        padding: 12px;
        margin: 15px 0;
    }
    
    .input-line {
        gap: 6px;
    }
    
    .prompt {
        font-size: 0.8em;
    }
    
    #userInput {
        font-size: 0.95em;
        padding: 10px 12px;
        min-height: 44px;
    }
    
    .submit-terminal-btn {
        padding: 12px 20px;
        font-size: 0.95em;
        min-height: 48px;
        margin-top: 10px;
    }
    
    .terminal-output {
        max-height: 150px;
        padding: 10px;
    }
    
    .output-line {
        font-size: 0.8em;
        margin: 4px 0;
    }
    
    .loading-animation {
        padding: 20px 10px;
    }
    
    .loading-text {
        font-size: 1em;
        margin-bottom: 12px;
    }
    
    .loading-bar {
        width: 180px;
        height: 16px;
    }
    
    .loading-dots {
        font-size: 1.5em;
    }
    
    .hint, .warning {
        padding: 10px;
        margin: 12px 0;
        font-size: 0.85em;
    }
    
    .crypto-info, .geo-tip, .binary-helper, .math-warning, 
    .investigation-tips, .format-help, .final-warning {
        padding: 10px;
        margin: 12px 0;
        font-size: 0.8em;
    }
    
    .investigation-tips ul {
        margin: 6px 0 6px 12px;
    }
    
    .investigation-tips li {
        margin: 4px 0;
    }
    
    /* Matrix mode ultra-économique sur mobile */
    .matrix-bg {
        opacity: 0.4;
        filter: blur(1px);
    }
}

/* Très petits écrans */
@media (max-width: 360px) {
    .ascii-art {
        font-size: 0.3em;
        transform: scale(0.8);
    }
    
    .access-btn {
        padding: 14px 25px;
        min-width: 160px;
        font-size: 0.9em;
    }
    
    .binary-display {
        font-size: 0.7em;
        line-height: 1.6;
    }
    
    .loading-bar {
        width: 150px;
    }
    
    /* Matrix désactivée sur très petits écrans */
    .matrix-bg {
        display: none;
    }
}

/* Orientation paysage sur mobile */
@media (max-height: 500px) and (orientation: landscape) {
    .terminal-container {
        margin: 5px auto;
        max-height: calc(100vh - 10px);
        overflow-y: auto;
    }
    
    .ascii-art {
        font-size: 0.4em;
        margin: 5px 0;
    }
    
    .welcome-screen {
        padding: 10px;
    }
    
    .system-info {
        margin: 10px 0;
        padding: 8px;
    }
    
    .access-prompt {
        margin: 15px 0;
    }
    
    .terminal-output {
        max-height: 120px;
    }
    
    .loading-animation {
        padding: 15px;
    }
    
    /* Matrix encore plus réduite en landscape */
    .matrix-bg {
        opacity: 0.3;
    }
}

/* Mode sombre forcé pour mobile */
@media (prefers-color-scheme: dark) {
    body {
        background: #000000;
    }
    
    .terminal-container {
        background: rgba(0, 0, 0, 0.95);
    }
}

/* ================================================================ */
/* STYLES POUR DÉFI BINAIRE ESTHÉTIQUE */
/* ================================================================ */

.binary-display-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 25px 0;
    padding: 20px;
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid #ff6600;
    border-radius: 10px;
    backdrop-filter: blur(10px);
}

.binary-byte {
    background: rgba(255, 102, 0, 0.1);
    border: 1px solid #ff6600;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
}

.binary-byte:hover {
    background: rgba(255, 102, 0, 0.2);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(255, 102, 0, 0.3);
}

.byte-label {
    color: #00ffff;
    font-size: 0.8em;
    margin-bottom: 8px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.byte-value {
    color: #ff6600;
    font-size: 1.4em;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    margin: 10px 0;
    letter-spacing: 2px;
    text-shadow: 0 0 5px rgba(255, 102, 0, 0.7);
    word-spacing: 3px;
}

.byte-decimal {
    color: #ffff00;
    font-size: 0.9em;
    margin-top: 8px;
    font-weight: bold;
    background: rgba(255, 255, 0, 0.1);
    padding: 3px 8px;
    border-radius: 4px;
    display: inline-block;
}

.binary-arrow {
    text-align: center;
    color: #00ff41;
    font-size: 1.2em;
    font-weight: bold;
    margin: 20px 0;
    animation: pulse-arrow 2s ease-in-out infinite;
    text-shadow: 0 0 10px #00ff41;
}

@keyframes pulse-arrow {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.05); }
}

.ascii-preview {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 25px 0;
    padding: 20px;
    background: rgba(0, 255, 65, 0.1);
    border: 2px solid #00ff41;
    border-radius: 10px;
}

.ascii-char {
    width: 50px;
    height: 50px;
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid #00ff41;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5em;
    font-weight: bold;
    color: #00ff41;
    text-shadow: 0 0 10px #00ff41;
    animation: mystery-glow 3s ease-in-out infinite;
}

@keyframes mystery-glow {
    0%, 100% { 
        box-shadow: 0 0 10px rgba(0, 255, 65, 0.3);
        border-color: #00ff41;
    }
    50% { 
        box-shadow: 0 0 20px rgba(0, 255, 65, 0.6);
        border-color: #ffff00;
    }
}

/* ================================================================ */
/* RESPONSIVE POUR MOBILE */
/* ================================================================ */

@media (max-width: 768px) {
    .binary-display-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
        padding: 15px;
    }
    
    .binary-byte {
        padding: 12px;
    }
    
    .byte-value {
        font-size: 1.2em;
        letter-spacing: 1px;
    }
    
    .ascii-preview {
        gap: 10px;
        padding: 15px;
    }
    
    .ascii-char {
        width: 40px;
        height: 40px;
        font-size: 1.2em;
    }
}

@media (max-width: 480px) {
    .binary-display-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .byte-value {
        font-size: 1em;
        letter-spacing: 1px;
        word-spacing: 2px;
    }
    
    .ascii-preview {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .ascii-char {
        width: 35px;
        height: 35px;
        font-size: 1em;
    }
}