/* Import fonts */
@import url('https://fonts.googleapis.com/css2?family=DM+Mono:ital,wght@0,300;0,400;0,500;1,300;1,400;1,500&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Ubuntu+Mono:ital,wght@0,400;0,700;1,400;1,700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    border-radius: 0 !important;
}

:root {
    /* Text colors */
    --text-0: oklch(95% 0 0);
    --text-1: oklch(95% 0 0);
    --text-2: oklch(85% 0 0);
    --text-3: oklch(75% 0 0);
    --text-4: oklch(60% 0 0);
    --text-5: oklch(40% 0 0);

    /* Background colors */
    --bg-1: oklch(31% 0 0);
    --bg-2: oklch(27% 0 0);
    --bg-3: oklch(23% 0 0);
    --bg-4: hsl(0, 0%, 7%);
    --hover: oklch(54% 0 0 / 0.1);
    --active: hsl(0, 0%, 29%);
    --active-2: oklch(54% 0 0 / 0.3);

    /* Accent colors */
    --accent-1: hsl(133, 50%, 48%);
    --accent-2: hsl(133, 50%, 43%);
    --accent-3: hsl(133, 50%, 38%);
    --accent-4: hsl(133, 50%, 35%);
    --accent-5: hsl(133, 50%, 30%);

    /* Border colors */
    --border-light: var(--hover);
    --border: var(--active);
    --border-hover: var(--accent-2);
    --button-border: hsl(220, 0%, 100%, 0.1);

    /* Gap and spacing */
    --gap: 14px;
    --border-thickness: 1px;
    --border-hover-transition: 0.2s ease;
}

body {
    font-family: 'Ubuntu Mono', monospace;
    background: var(--bg-4);
    color: var(--text-3);
    overflow: hidden;
    height: 100vh;
    font-size: 14px;
    line-height: 1.4;
    font-weight: 400;
    position: relative;
}

/* Effet de vignettage sur l'arrière-plan */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(
        ellipse at center,
        transparent 0%,
        transparent 40%,
        rgba(0, 0, 0, 0.2) 70%,
        rgba(0, 0, 0, 0.5) 100%
    );
    pointer-events: none;
    z-index: 25;
    transition: opacity 0.5s ease;
    opacity: 0;
}

/* Activer les effets CRT après le clic sur power */
body.crt-mode::before {
    opacity: 1;
}

/* Effet de scintillement CRT pour le body */
body.crt-mode {
    animation: crt-flicker 0.15s infinite;
}

/* Effet de scanlines pour le body */
body.crt-mode::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 0, 0, 0.15) 2px,
        rgba(0, 0, 0, 0.15) 4px
    );
    pointer-events: none;
    z-index: 26;
    animation: scanlines 0.1s infinite;
}

@keyframes crt-flicker {
    0% { opacity: 1; }
    50% { opacity: 0.95; }
    100% { opacity: 1; }
}

@keyframes scanlines {
    0% { transform: translateY(0); }
    100% { transform: translateY(4px); }
}

/* Effet de glitch pour l'arrière-plan en mode erreur */
body.error-mode {
    background: var(--bg-4);
    animation: background-glitch 0.2s infinite;
}

/* Scanlines pour l'arrière-plan en mode erreur */
body.error-mode::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        linear-gradient(90deg, transparent 0%, rgba(255, 0, 0, 0.05) 50%, transparent 100%),
        linear-gradient(0deg, transparent 0%, rgba(0, 255, 255, 0.03) 50%, transparent 100%);
    background-size: 200px 100%, 100% 4px;
    animation: background-scanlines 0.1s infinite;
    pointer-events: none;
    z-index: 30;
}

@keyframes background-glitch {
    0% {
        background: var(--bg-4);
        filter: hue-rotate(0deg) brightness(1);
    }
    10% {
        background: var(--bg-4);
        filter: hue-rotate(5deg) brightness(1.1);
    }
    20% {
        background: var(--bg-4);
        filter: hue-rotate(-3deg) brightness(0.9);
    }
    30% {
        background: var(--bg-4);
        filter: hue-rotate(2deg) brightness(1.05);
    }
    40% {
        background: var(--bg-4);
        filter: hue-rotate(-1deg) brightness(0.95);
    }
    50% {
        background: var(--bg-4);
        filter: hue-rotate(3deg) brightness(1.02);
    }
    60% {
        background: var(--bg-4);
        filter: hue-rotate(-2deg) brightness(0.98);
    }
    70% {
        background: var(--bg-4);
        filter: hue-rotate(1deg) brightness(1.01);
    }
    80% {
        background: var(--bg-4);
        filter: hue-rotate(-0.5deg) brightness(0.99);
    }
    90% {
        background: var(--bg-4);
        filter: hue-rotate(0.5deg) brightness(1.005);
    }
    100% {
        background: var(--bg-4);
        filter: hue-rotate(0deg) brightness(1);
    }
}

@keyframes background-scanlines {
    0% { 
        transform: translateY(0);
        opacity: 0.3;
    }
    50% {
        opacity: 0.7;
    }
    100% { 
        transform: translateY(4px);
        opacity: 0.3;
    }
}

@keyframes background-corruption {
    0% { opacity: 0; }
    50% { opacity: 1; }
    100% { opacity: 0; }
}

/* S'assurer que le contenu est au-dessus du vignettage */
.container {
    width: 100%;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    z-index: 10;
    background: var(--bg-4);
}

/* Bouton de démarrage */
.power-button-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
}

.power-button {
    background: none;
    border: none;
    padding: 0;
    box-shadow: none;
    cursor: pointer;
    border-radius: 0;
    transition: none;
}

.power-button:hover, .power-button:active {
    background: none;
    border: none;
    box-shadow: none;
    transform: none;
}

.power-icon {
    width: 150px;
    height: 150px;
    filter: none;
    transition: none;
}

/* Écran de chargement */
.loading-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 20;
}



.loading-content {
    text-align: center;
    max-width: 700px;
    padding: calc(var(--gap) * 2);
    background: var(--bg-3);
    border: var(--border-thickness) solid var(--border);
    box-shadow: none;
    transition: transform 0.1s ease;
    position: relative;
}



.loading-content h2 {
    font-size: 1.8em;
    margin-bottom: calc(var(--gap) * 2);
    color: var(--text-1);
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-family: 'DM Mono', monospace;
}

.loading-bar {
    width: 100%;
    height: 20px;
    background: var(--bg-2);
    border: var(--border-thickness) solid var(--border);
    border-radius: 0;
    overflow: hidden;
    margin: var(--gap) 0;
    box-shadow: none;
}

.loading-progress {
    height: 100%;
    background: var(--accent-2);
    width: 0%;
    transition: width 0.3s ease, background 0.5s ease;
    border-right: var(--border-thickness) solid var(--border);
}

.loading-progress.error-mode {
    background: #ff0000 !important;
    animation: error-pulse 0.5s infinite alternate;
}

@keyframes error-pulse {
    0% { background: #ff0000; }
    100% { background: #cc0000; }
}

.loading-text {
    font-size: 1em;
    margin-top: var(--gap);
    color: var(--text-4);
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-family: 'DM Mono', monospace;
}

/* ASCII Loader */
.ascii-loader {
    /* margin-bottom: calc(var(--gap) * 2); */
    max-width: 100%;
    overflow: hidden;
}

.ascii-art {
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.0;
    color: var(--accent-2);
    white-space: pre;
    margin: 0;
    padding: 0;
    text-align: center;
    overflow: hidden;
    background: none;
    transition: color 0.5s ease;
}

.ascii-art.error-mode {
    color: #ff0000 !important;
    animation: ascii-error-pulse 0.5s infinite alternate, ascii-glitch 0.3s infinite;
    position: relative;
}

@keyframes ascii-error-pulse {
    0% { color: #ff0000; }
    100% { color: #cc0000; }
}

@keyframes ascii-glitch {
    0% {
        transform: translate(0) skew(0deg);
        text-shadow: 0 0 0 #ff0000;
    }
    20% {
        transform: translate(-2px, 1px) skew(-0.5deg);
        text-shadow: 2px 0 0 #00ffff, -2px 0 0 #ff00ff;
    }
    40% {
        transform: translate(2px, -1px) skew(0.5deg);
        text-shadow: -2px 0 0 #00ffff, 2px 0 0 #ff00ff;
    }
    60% {
        transform: translate(-1px, 0px) skew(-0.3deg);
        text-shadow: 1px 0 0 #00ffff, -1px 0 0 #ff00ff;
    }
    80% {
        transform: translate(1px, 1px) skew(0.3deg);
        text-shadow: -1px 0 0 #00ffff, 1px 0 0 #ff00ff;
    }
    100% {
        transform: translate(0) skew(0deg);
        text-shadow: 0 0 0 #ff0000;
    }
}

/* Effet de scanlines pour l'ASCII art */
.ascii-art.error-mode::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        transparent 0%,
        rgba(255, 0, 0, 0.1) 50%,
        transparent 100%
    );
    background-size: 100% 4px;
    animation: scanlines 0.2s infinite;
    pointer-events: none;
    z-index: 1;
}

@keyframes scanlines {
    0% { transform: translateY(0); }
    100% { transform: translateY(4px); }
}

/* Effet de corruption de caractères */
.ascii-art.error-mode::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        90deg,
        transparent,
        transparent 2px,
        rgba(255, 0, 0, 0.1) 2px,
        rgba(255, 0, 0, 0.1) 4px
    );
    animation: corruption 0.1s infinite;
    pointer-events: none;
    z-index: 2;
}

@keyframes corruption {
    0% { opacity: 0; }
    50% { opacity: 1; }
    100% { opacity: 0; }
}

/* Contenu principal */
.main-content {
    text-align: center;
    max-width: 800px;
    padding: calc(var(--gap) * 2);
    background: var(--bg-3);
    border: var(--border-thickness) solid var(--border);
    border-radius: 0;
    box-shadow: none;
}

.main-content h1 {
    font-size: 2.5em;
    margin-bottom: var(--gap);
    color: var(--text-1);
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-family: 'DM Mono', monospace;
}

.main-content p {
    font-size: 1.2em;
    color: var(--text-4);
    font-weight: 400;
    margin-bottom: calc(var(--gap) / 2);
    font-family: 'DM Mono', monospace;
}

/* Classes utilitaires */
.hidden {
    display: none !important;
}

/* Responsive */
@media (max-width: 768px) {
    .power-icon {
        width: 35px;
        height: 35px;
    }
    
    .loading-content h2 {
        font-size: 1.5em;
    }
    
    .main-content h1 {
        font-size: 2em;
    }
    
    .main-content p {
        font-size: 1em;
    }
}

/* Error Stack */
.error-stack {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-4);
    color: #ff0000;
    font-family: 'DM Mono', monospace;
    font-size: 12px;
    line-height: 1.2;
    padding: 20px;
    overflow-y: auto;
    z-index: 30;
    border: var(--border-thickness) solid #ff0000;
    box-shadow: 0 0 20px rgba(255, 0, 0, 0.3);
    animation: error-window-shake 0.1s infinite;
}

@keyframes error-window-shake {
    0% {
        transform: translate(0, 0);
    }
    10% {
        transform: translate(-1px, -1px);
    }
    20% {
        transform: translate(1px, 1px);
    }
    30% {
        transform: translate(-1px, 1px);
    }
    40% {
        transform: translate(1px, -1px);
    }
    50% {
        transform: translate(-0.5px, -0.5px);
    }
    60% {
        transform: translate(0.5px, 0.5px);
    }
    70% {
        transform: translate(-0.5px, 0.5px);
    }
    80% {
        transform: translate(0.5px, -0.5px);
    }
    90% {
        transform: translate(-0.3px, -0.3px);
    }
    100% {
        transform: translate(0, 0);
    }
}
.error-line {
    color: #ff0000;
    margin-bottom: 2px;
    font-family: 'DM Mono', monospace;
    font-size: 11px;
    text-shadow: 0 0 5px rgba(255, 0, 0, 0.5);
    animation: error-fade-in 0.1s ease-in;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@keyframes error-fade-in {
    0% { opacity: 0; transform: translateX(-10px); }
    100% { opacity: 1; transform: translateX(0); }
}

/* Fake Terminal */
.fake-terminal {
    background: #181c1f;
    border: var(--border-thickness) solid var(--border);
    color: #b8e994;
    font-family: 'Ubuntu Mono', monospace;
    font-size: 1em;
    width: 60%;
    margin: 40px auto;
    padding: 0;
    min-height: 400px;
    max-height: 80vh;
    box-sizing: border-box;
    box-shadow: none;
    display: flex;
    flex-direction: column;
}
.terminal-header {
    background: #23272e;
    color: #7ed957;
    padding: 8px 16px;
    font-weight: bold;
    font-size: 1em;
    border-bottom: 1px solid var(--border);
}
.terminal-body {
    flex: 1;
    padding: 18px 16px 0 16px;
    overflow-y: auto;
    font-size: 1em;
    font-family: inherit;
    color: #b8e994;
}
.terminal-input-line {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: #23272e;
    border-top: 1px solid var(--border);
}
.terminal-prompt {
    color: #7ed957;
    margin-right: 8px;
    font-weight: bold;
    font-family: inherit;
}
#terminalInput {
    background: transparent;
    border: none;
    color: #b8e994;
    font-family: inherit;
    font-size: 1em;
    outline: none;
    width: 100%;
} 