/* Reset Universal */
* {
    box-sizing: border-box;
    /* CRÍTICO: Impede o browser de tentar 'ancorar' o scroll quando o conteúdo muda */
    overflow-anchor: none;
}

body {
    background-color: #000;
    color: #fff;
    font-family: monospace;
    margin: 0;
    
    /* SEGURANÇA UNIVERSAL PARA IPHONE/ANDROID/PC */
    padding-top: env(safe-area-inset-top);
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
    padding-bottom: env(safe-area-inset-bottom);
    
    display: flex;
    justify-content: center;
    align-items: flex-start;
    
    /* 100dvh garante que o site ocupa o ecrã todo sem saltos no telemóvel */
    min-height: 100dvh; 
    overflow-y: scroll;

    /* CORREÇÃO CRÍTICA PARA CHROME MOBILE */
    /* Impede o efeito 'elástico' que bloqueia a deteção de scroll */
    overscroll-behavior-y: none;
}

#console {
    max-width: 750px;
    width: 90%;
    
    padding-top: 20px; 
    padding-bottom: 50px; 
    
    font-size: 12px;
    line-height: 1.4;
    white-space: pre-wrap;
    word-break: break-word;
    text-align: left;
}

.cursor {
    display: inline-block;
    background-color: gray;
    width: 2px;
    height: 1em;
    vertical-align: text-bottom;
    animation: blink 1s step-end infinite;
}

/* Cursor estático enquanto escreve */
.cursor.typing {
    animation: none;
    opacity: 1; 
}

@keyframes blink {
    50% { opacity: 0; }
}

a { 
    color: #0bc;
    text-decoration: none;
    cursor: pointer;
}

a:hover {
    text-decoration: underline;
}

#a { color: #0f0; }
#b { color: #ff0096; }
#c { color: #0bc; }