:root {
    --bg-color: #0d0101; /* Very dark red/black background */
    --text-color: #eeeeee; /* Off-white for overall text */
    --term-main: #eeeeee; /* Main terminal text color, off-white */
    --term-red: #cc2936; /* Deep blood red for specific highlights */
    --term-secondary: #800000; /* Darker red for less prominent elements */
    --term-dim: #5c0e0e; /* Dimmed red for subtle hints */
    --term-response-color: #999999; /* Distinct grey for system responses to contrast with white input */
    --sb-track-color: rgba(0,0,0,0);
    --sb-thumb-color: rgba(204, 0, 0, 0.5); /* Scrollbar thumb color */
    --sb-size: 8px;
}

* { 
    box-sizing: border-box; 
}

body, html {
    margin: 0; padding: 0; width: 100%; height: 100%;
    background-color: var(--bg-color);
    color: var(--text-color);
    overflow: hidden; /* Prevent body scroll, handling inside terminal */
}

#abomination-outer-container {
	width: 100%;
	height: auto;
}

#abomination-app-wrapper {
	position: relative;
}

#app {
	position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

#console {
    width: 100%;
    max-width: 1088px;
    aspect-ratio: 1 / 1;
    background-repeat: no-repeat;
    background-position: top left;
    background-size: contain;
    position: relative;
    margin: 0 auto; /* Center it */
}

/* -----------------------------------------
   FISHEYE / CRT EFFECT
   ----------------------------------------- */

#console-frame { 
    position: absolute; 
    top: 15.8%; 
    left: 12.5%; 
    width: 75%; 
    height: 56%; 
    display: flex;
    padding: 2% 0 2% 3%; 
    border-radius: 30px;             
    overflow: hidden;	
}

.fisheye-screen {
    --fisheye-curvature: 0.45;
    --fisheye-vignette: 0.7;
    --fisheye-highlight: 0.18;
}

.fisheye-screen-inner {
    position: relative;
    width: 100%;
    height: 100%;
    overflow-y: auto;
    transform-origin: center center;
    transform:
        perspective(900px)
        translateZ(calc(60px * var(--fisheye-curvature)))
        scale(1.01);
    
    /* Terminal Text Styling */
    font-family: "VT323", monospace;
    font-size: 1.5rem;
    color: var(--term-main); /* Main text color */
    text-shadow: 0 0 2px rgba(204, 41, 54, 0.5); /* Red text shadow */
    line-height: 1.2;
}

/* edge darkening + subtle glass highlight */
.fisheye-screen::before {
    content: "";
    position: absolute;
    inset: -8%;
    pointer-events: none;
    background:
        radial-gradient(
            circle at 50% 20%,
            rgba(255, 255, 255, var(--fisheye-highlight)) 0,
            transparent 50%
        );
    mix-blend-mode: screen;
    z-index: 10;
}

.fisheye-screen::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    border-radius: inherit;
    background:
        radial-gradient(
            circle at 50% 50%,
            transparent 55%,
            rgba(0, 0, 0, var(--fisheye-vignette)) 100%
        );
    z-index: 11;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: var(--sb-size);
}
::-webkit-scrollbar-track {
    background: var(--sb-track-color);
}
::-webkit-scrollbar-thumb {
    background: var(--sb-thumb-color);
    border-radius: 0;
}

/* Terminal Input Styling */
#input-line {
    display: flex;
    width: 100%;
    margin-top: 5px;
	padding-left: 10px;
}

#prompt-user { color: var(--term-red); margin-right: 2px; }
#prompt-symbol { color: var(--term-secondary); margin-right: 8px; }

#cmd-input {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
    margin: 0 !important;
    padding: 0 !important;
    width: auto !important;
    height: auto !important;
    line-height: inherit !important;
    
    color: inherit;
    font-family: inherit;
    font-size: inherit;
    flex-grow: 1;
    caret-color: var(--term-red);
    text-shadow: inherit;
}

/* Output Formatting */
#output {
    padding: 10px 17px 10px 13px; /* Top, Right, Bottom, Left */
}

.log-entry { margin-bottom: 2px; white-space: pre-wrap; word-wrap: break-word; }
.error-msg { color: var(--term-red); } /* Bright red for errors */
.sys-msg { color: var(--term-red); } /* System messages as primary red */
.response-msg { color: var(--term-response-color); } /* LLM responses */

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

#modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: 100;
    display: flex;
    justify-content: center;
    align-items: center;
}

#modal-content {
    background: #111;
    border: 2px solid #444;
    padding: 20px;
    max-width: 80%;
    max-height: 80%;
    overflow: auto;
    position: relative;
    color: #eee;
    font-family: "Courier New", monospace;
}

#close-modal {
    position: absolute;
    top: 5px;
    right: 10px;
    background: #c00;
    border: none;
    color: white;
    cursor: pointer;
    font-weight: bold;
}
