html, body { height: 100%; }
body {
    margin: 0;
    display: flex;
    flex-direction: column;
    background: #000;
    color: #00ff00;
    font-family: "Courier New", monospace;
    background-image: repeating-linear-gradient(
            to bottom,
            rgba(0,255,0,0.05) 0 2px,
            transparent 2px 4px
    );
}
#screen {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
    white-space: pre-wrap;
    line-height: 1.35;
    transition: transform 0.03s;
}
#input-line {
    display: flex;
    align-items: center;
    padding: 1rem;
    border-top: 1px solid rgba(0,255,0,0.2);
}
.prompt::after { content: ">"; margin-right: .5rem; }
#cmd {
    flex: 1;
    background: none;
    border: none;
    color: inherit;
    font-family: inherit;
    font-size: 1rem;
    outline: none;
}
/* Liens dans le terminal : gras, pas soulignés */
#screen a {
    color: inherit;
    /*font-weight: bold;*/
    text-decoration: none;
}

/* Optionnel : petit feedback visuel au survol/focus */
#screen a:hover,
#screen a:focus {
    font-weight: bold;
    text-decoration: none;
    filter: brightness(1.3);
    outline: none;
}



body.ambre {
    color: #ffbf00;
    background-image: repeating-linear-gradient(
            to bottom,
            rgba(255,191,0,0.05) 0 2px,
            transparent 2px 4px
    );
}

/* --- Effets glitch --- */
#screen {
    position: relative;            /* nécessaire pour les pseudo-éléments */
}

/* 2 couches superposées pour simuler décalage RGB + lignes corrompues */
#screen::before,
#screen::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0;
    mix-blend-mode: screen;
}

/* Lignes horizontales qui se décalent */
#screen::before {
    background: repeating-linear-gradient(
            to bottom,
            rgba(255, 0, 0, 0.08) 0 2px,
            rgba(0, 255, 255, 0.08) 2px 4px
    );
    clip-path: inset(0 0 0 0);
}

/* “BRUIT” + décalage latéral */
#screen::after {
    background: repeating-linear-gradient(
            90deg,
            rgba(0,0,0,0) 0 3px,
            rgba(255,255,255,0.04) 3px 4px
    );
    filter: hue-rotate(20deg) saturate(1.5);
    transform: translate(0,0);
}

/* Classe activée par JS pendant un burst */
body.glitch-active #screen {
    animation: crt-glitch-jitter 120ms steps(2,end) infinite;
}

body.glitch-active #screen::before {
    opacity: .35;
    animation: crt-scanshift 60ms steps(2,end) infinite;
}

body.glitch-active #screen::after {
    opacity: .22;
    animation: crt-rgbsplit 80ms steps(2,end) infinite;
}

/* Keyframes */
@keyframes crt-glitch-jitter {
    0%   { transform: translate(0,0) skew(0deg); }
    20%  { transform: translate(-2px,1px) skewX(1deg); }
    40%  { transform: translate(2px,-1px) skewY(-1deg); }
    60%  { transform: translate(-1px,2px); }
    80%  { transform: translate(1px,-2px) skew(-0.5deg); }
    100% { transform: translate(0,0); }
}

@keyframes crt-scanshift {
    0%   { clip-path: inset(0 0 60% 0); }
    50%  { clip-path: inset(40% 0 0 0); }
    100% { clip-path: inset(0 0 0 0); }
}

@keyframes crt-rgbsplit {
    0%   { transform: translate(0,0); }
    33%  { transform: translate(-2px,0); }
    66%  { transform: translate(2px,0); }
    100% { transform: translate(0,0); }
}
