/* Terminal CSS - Sonar T2 (Site P-G: White Room)
   Color Scheme: Dark Purple, Black, White, and Red */

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

html, body {
    width: 100%;
    height: 100%;
    background-color: #040108;
    color: #e0d8f0;
    font-family: 'Courier New', Courier, monospace;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Stage container: scaled 1.65x centered around laptop screen */
.terminal-stage {
    position: relative;
    width: 100%;
    max-width: 95vh;
    max-height: 95vw;
    aspect-ratio: 1 / 1;
    background-color: #06020c;
    transform: scale(1.65);
    transform-origin: 54.87% 59.76%;
    user-select: none;
}

/* Laptop Chassis Frame (Foreground Overlay in Front of Single Screen) */
.computer-background-frame {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    z-index: 50;
    pointer-events: none;
    filter: drop-shadow(0 0 30px rgba(123, 44, 191, 0.25));
}

/* Minimalist Audio Mute Control Button (Positioned over chassis) */
.mute-button {
    position: absolute;
    top: 78.4%;
    right: 21.8%;
    z-index: 60;
    background: rgba(22, 6, 36, 0.75);
    border: 1px solid rgba(181, 23, 158, 0.35);
    color: #e0aaff;
    font-family: 'Courier New', Courier, monospace;
    font-size: clamp(0.24rem, 0.36vw, 0.32rem);
    padding: 2px 6px;
    border-radius: 2px;
    cursor: pointer;
    letter-spacing: 0.4px;
    transition: all 0.2s ease;
    user-select: none;
    opacity: 0.75;
}

.mute-button:hover {
    background: rgba(45, 10, 75, 0.95);
    color: #ffffff;
    border-color: rgba(255, 23, 68, 0.7);
    box-shadow: 0 0 8px rgba(255, 23, 68, 0.4);
    opacity: 1;
}

.mute-button.muted {
    border-color: rgba(255, 23, 68, 0.4);
    color: rgba(255, 23, 68, 0.65);
    background: rgba(30, 4, 12, 0.7);
}

/* Single Interactive Terminal Screen Cutout */
.screen-panel {
    position: absolute;
    z-index: 10;
    background: #08020e;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border-radius: 4px;
    transition: background 0.4s ease;
}

.screen-main-terminal {
    left: 26.61%;
    top: 41.82%;
    width: 56.51%;
    height: 35.89%;
    padding: 1.8% 2.4%;
    border: 1px solid rgba(157, 78, 221, 0.3);
    box-shadow: inset 0 0 25px rgba(123, 44, 191, 0.3), 0 0 15px rgba(181, 23, 158, 0.15);
}

/* Hardware Laptop Notch */
.laptop-notch {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 13%;
    height: 9px;
    background: #000000;
    border-bottom-left-radius: 4px;
    border-bottom-right-radius: 4px;
    z-index: 25;
    pointer-events: none;
    border-bottom: 1px solid rgba(60, 9, 108, 0.4);
}

/* Powered off terminal state */
.screen-panel.terminal-shutdown {
    background: #000000 !important;
}

.screen-panel.terminal-shutdown * {
    display: none !important;
    opacity: 0 !important;
}

.terminal-stage.terminal-shutdown .mute-button {
    opacity: 0.1 !important;
    pointer-events: none !important;
    cursor: default !important;
}

/* Deep Purple / Dark Scanline Effect */
.scanlines {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    background: linear-gradient(
        rgba(26, 6, 44, 0) 50%,
        rgba(3, 0, 8, 0.5) 50%
    );
    background-size: 100% 3px;
    z-index: 20;
    opacity: 0.7;
}

/* CRT Flicker Animation */
.crt-flicker {
    animation: flicker 0.18s infinite alternate;
}

@keyframes flicker {
    0% { opacity: 0.97; }
    100% { opacity: 1; }
}

/* Terminal Header */
.terminal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px dashed rgba(181, 23, 158, 0.45);
    padding-bottom: 1.2%;
    margin-bottom: 1.6%;
    font-size: clamp(0.36rem, 0.52vw, 0.48rem);
    letter-spacing: 0.6px;
    color: #e0d8f0;
}

.status-indicator {
    display: inline-block;
    width: 5px;
    height: 5px;
    background-color: #ff1744;
    border-radius: 50%;
    box-shadow: 0 0 6px #ff1744, 0 0 10px rgba(255, 23, 68, 0.8);
    margin-right: 4px;
    animation: pulseRed 1.8s infinite;
}

@keyframes pulseRed {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.35; transform: scale(0.8); }
}

.infection-tag {
    color: #ff1744;
    margin-left: 6px;
    font-weight: bold;
    text-shadow: 0 0 5px rgba(255, 23, 68, 0.6);
}

#clockDisplay {
    color: #ffffff;
    letter-spacing: 0.8px;
    font-weight: bold;
}

/* Output Console */
.terminal-output {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    font-size: clamp(0.34rem, 0.50vw, 0.45rem);
    line-height: 1.35;
    margin-bottom: 1.6%;
    padding-right: 3px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}




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

.terminal-output::-webkit-scrollbar-thumb {
    background: #5e17eb;
    border-radius: 1px;
}

.log-line {
    margin-bottom: 2px;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-wrap: anywhere;
    word-break: break-all;
}

/* Log Colors matching dark purple, black, white and red */
.log-system { color: #e0d8f0; }
.log-alert {
    color: #ff1744;
    text-shadow: 0 0 5px rgba(255, 23, 68, 0.7);
    font-weight: bold;
}
.log-warning {
    color: #ff5252;
    text-shadow: 0 0 4px rgba(255, 82, 82, 0.55);
    font-weight: bold;
}
.log-user {
    color: #ffffff;
    font-weight: bold;
    text-shadow: 0 0 3px rgba(255, 255, 255, 0.5);
}
.log-info {
    color: #c77dff;
    text-shadow: 0 0 4px rgba(199, 125, 255, 0.4);
}

/* Biological Memory Glitch Style */
.log-corrupted {
    color: #ff0055;
    font-weight: bold;
    opacity: 0.95;
    font-style: normal;
    letter-spacing: normal;
    display: inline;
    text-shadow: 0 0 4px rgba(255, 0, 85, 0.7);
    transition: color 0.1s ease;
}

/* Clickable Links in Terminal Output */
.t2-link {
    color: #ff3366 !important;
    text-decoration: underline !important;
    text-decoration-style: dotted !important;
    text-shadow: 0 0 6px rgba(255, 51, 102, 0.6) !important;
    cursor: pointer !important;
    font-weight: bold !important;
    transition: all 0.2s ease !important;
    word-break: break-all !important;
}

.t2-link:hover {
    color: #ffffff !important;
    background: rgba(255, 23, 68, 0.4) !important;
    text-decoration: underline !important;
    text-shadow: 0 0 10px #ff1744, 0 0 20px #9d4edd !important;
}

/* Interactive Command Line */
.command-line {
    display: flex;
    align-items: center;
    background: rgba(22, 6, 36, 0.85);
    border: 1px solid rgba(157, 78, 221, 0.45);
    padding: 1% 1.8%;
    border-radius: 3px;
    box-shadow: inset 0 0 8px rgba(123, 44, 191, 0.2);
}

.prompt-symbol {
    color: #c77dff;
    font-weight: bold;
    font-size: clamp(0.34rem, 0.50vw, 0.45rem);
    margin-right: 4px;
    user-select: none;
    text-shadow: 0 0 5px rgba(199, 125, 255, 0.6);
}

.terminal-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #ffffff;
    font-family: 'Courier New', Courier, monospace;
    font-size: clamp(0.34rem, 0.50vw, 0.45rem);
    caret-color: #ff1744;
}

.terminal-input:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

/* Unified Crash Screens */
.parasite-overrun-screen,
.containment-breach-screen,
.tnd-overdose-screen,
.power-fault-screen,
.system-error-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #08010d;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    z-index: 100;
    padding: 10px;
}

.parasite-overrun-text,
.containment-breach-text,
.tnd-overdose-text,
.power-fault-text,
.system-error-text {
    font-family: 'Courier New', Courier, monospace;
    font-size: clamp(0.38rem, 0.58vw, 0.52rem);
    font-weight: bold;
    color: #ff1744;
    text-shadow: 0 0 10px rgba(255, 23, 68, 0.9), 0 0 20px rgba(181, 23, 158, 0.7);
    letter-spacing: 0.8px;
    line-height: 1.4;
    animation: parasiteBlink 0.9s infinite alternate;
}

@keyframes parasiteBlink {
    0% { opacity: 1; }
    49% { opacity: 1; }
    50% { opacity: 0.1; }
    100% { opacity: 0.1; }
}



@media (min-width: 768px) {
    .only_on_small {
        display: none;
    }
}



/* Mobile Responsive Layout (< 768px) */
@media (max-width: 768px) {
    html, body {
        overflow-y: auto;
        overflow-x: hidden;
    }

    .terminal-stage {
        transform: none !important;
        max-width: 100vw !important;
        max-height: none !important;
        width: 100vw !important;
        height: 100vh !important;
        aspect-ratio: auto !important;
        display: flex !important;
        flex-direction: column !important;
        padding: 12px !important;
        background-color: #040108 !important;
    }

    /* Disable computer frame image on mobile */
    .computer-background-frame {
        display: none !important;
    }

    .laptop-notch {
        display: none !important;
    }

    /* Big Screen (Single interactive terminal filling full mobile viewport) */
    .screen-main-terminal {
        position: relative !important;
        left: 0 !important;
        top: 0 !important;
        width: 100% !important;
        height: 100% !important;
        flex: 1 !important;
        border: 1px solid rgba(157, 78, 221, 0.5) !important;
        box-shadow: 0 0 15px rgba(123, 44, 191, 0.3) !important;
        padding: 12px !important;
        border-radius: 4px !important;
    }

    /* Mute button on mobile */
    .mute-button {
        position: absolute !important;
        top: 18px !important;
        right: 18px !important;
        z-index: 100 !important;
    }

    /* Mobile font sizes for readable display */
    .terminal-header {
        font-size: 0.82rem !important;
    }

    .terminal-output {
        font-size: 0.86rem !important;
        line-height: 1.38 !important;
    }

    .prompt-symbol, .terminal-input {
        font-size: 0.86rem !important;
    }
}

