/* 
 * THEME DEFINITIONS 
 * Aesthetic: High-Contrast Terminal / Cassette Futurism
 */
:root {
    --bg-color: #101012;       /* Deep Space Black */
    --primary-color: #39ff14;  /* Fluorescent Green / Terminal Green */
    --border-color: #333333;   /* Dark Grey for structural borders */
    --dim-color: #2d4f28;      /* Dimmed green for inactive elements */
    --shadow-offset: 4px;      /* Hard shadow distance */
    
    --font-heading: 'Space Mono', monospace;
    --font-body: 'Consolas', 'Monaco', 'Courier New', monospace;
}

/* RESET & BASE */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-color);
    color: var(--primary-color);
    font-family: var(--font-body);
    height: 100vh;
    width: 100vw;
    overflow: hidden; /* Prevent scrolling */
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: default;
    user-select: none;
}

/* BACKGROUND OSCILLOSCOPE */
.oscilloscope {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    opacity: 0.3; /* Subtle blending */
}

/* CRT OVERLAY EFFECTS */
.crt-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 100;
    background: 
        linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), 
        linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
    background-size: 100% 2px, 3px 100%;
    pointer-events: none; /* Allow clicks to pass through */
}

/* Add a scanning bar animation */
.crt-overlay::after {
    content: " ";
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: rgba(18, 16, 16, 0.1);
    opacity: 0;
    z-index: 2;
    background-color: rgba(57, 255, 20, 0.05);
    animation: scanline 8s linear infinite;
    pointer-events: none;
}

@keyframes scanline {
    0% { transform: translateY(-100%); opacity: 0.5; }
    50% { opacity: 0.2; }
    100% { transform: translateY(100%); opacity: 0.5; }
}

/* LAYOUT & UTILITIES */
.terminal-layout {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 700px;
    padding: 20px;
}

.hidden {
    display: none !important;
}

/* WINDOW COMPONENT */
.window-container {
    background-color: var(--bg-color);
    border: 2px solid var(--primary-color);
    box-shadow: var(--shadow-offset) var(--shadow-offset) 0px var(--dim-color);
    padding: 4px;
    margin-bottom: 20px;
    min-height: 300px;
    display: flex;
    flex-direction: column;
    /* Sharp corners */
    border-radius: 0; 
}

.window-header {
    background-color: var(--primary-color);
    color: var(--bg-color);
    padding: 4px 8px;
    font-family: var(--font-heading);
    font-weight: 700;
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-transform: uppercase;
    margin-bottom: 16px;
}

.window-controls .control-box {
    border: 1px solid var(--bg-color);
    display: inline-block;
    width: 16px;
    height: 16px;
    line-height: 14px;
    text-align: center;
    font-size: 10px;
    margin-left: 4px;
}

.window-body {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.center-content {
    justify-content: center;
    align-items: center;
    text-align: center;
}

.vertical-stack {
    flex-direction: column;
    gap: 24px;
}

/* TYPOGRAPHY */
h1 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    line-height: 1.4;
    text-transform: uppercase;
    text-shadow: 0 0 5px rgba(57, 255, 20, 0.5);
    white-space: nowrap; /* Prevent wrapping per requirement */
}

/* BUTTONS / KEYS */
.key-cap {
    display: inline-block;
    background: transparent;
    color: var(--primary-color);
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: bold;
    border: 2px solid var(--primary-color);
    padding: 4px 12px;
    margin: 0 8px;
    cursor: pointer;
    box-shadow: 4px 4px 0px var(--dim-color);
    transition: all 0.1s steps(2);
    text-transform: uppercase;
}

.key-cap:hover, .key-cap:active {
    background-color: var(--primary-color);
    color: var(--bg-color);
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0px var(--dim-color);
}

/* TERMINAL SPECIFIC */
.terminal-body {
    justify-content: space-between;
    font-family: var(--font-body);
}

.console-output {
    text-align: left;
    height: 180px;
    overflow-y: hidden; /* Auto-scroll handled by JS logic visually */
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    margin-bottom: 20px;
    border: 1px dashed var(--dim-color); /* Decorative dashed border */
    padding: 10px;
}

.log-line {
    margin-bottom: 4px;
    display: block;
    word-break: break-all;
}

.typing-cursor::after {
    content: '█';
    animation: blink 1s step-end infinite;
    margin-left: 4px;
}

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

/* PROGRESS BAR */
.progress-section {
    width: 100%;
}

.progress-label {
    display: flex;
    justify-content: space-between;
    font-family: var(--font-heading);
    font-size: 0.8rem;
    margin-bottom: 8px;
}

.progress-track {
    width: 100%;
    height: 24px;
    border: 2px solid var(--primary-color);
    padding: 2px;
    box-shadow: 2px 2px 0px var(--dim-color);
}

.progress-fill {
    height: 100%;
    width: 0%;
    background-color: var(--primary-color);
    /* No transition on width to allow JS strictly controlled frame updates */
}

/* FINAL SCREEN */
.final-title {
    font-size: 2.5rem;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 10px;
}

.author-credit {
    font-family: var(--font-body);
    font-size: 0.9rem;
    opacity: 0.8;
    margin-top: auto;
    align-self: flex-end; /* Right corner */
}