:root {
    --bg-color: #0d1117;
    --text-color: #58a6ff;
    /* GitHub Blue/Greenish terminal look */
    --prompt-color: #7ee787;
    --error-color: #ff7b72;
    --glow-color: rgba(88, 166, 255, 0.5);
    --font-stack: 'Fira Code', 'Courier New', monospace;
    --terminal-bg: rgba(13, 17, 23, 0.85);
    /* Default opacity */
}

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

body,
html {
    height: 100%;
    width: 100%;
    overflow: hidden;
    /* Prevent scroll on body, scroll inside terminal */
    background-color: transparent;
    /* Allow video to show through */
    font-family: var(--font-stack);
    color: var(--text-color);
    font-size: 16px;
    text-shadow: none;
    /* Removed default blur for clarity */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* CRT Scanline Effect */
body::before {
    content: " ";
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(to bottom,
            rgba(18, 16, 16, 0) 50%,
            rgba(0, 0, 0, 0.25) 50%);
    background-size: 100% 4px;
    z-index: 10;
    pointer-events: none;
    /* Let clicks pass through */
}

/* Background Video Styling */
#bg-video {
    position: fixed;
    top: 50%;
    left: 50%;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    z-index: -2;
    transform: translate(-50%, -50%);
    object-fit: cover;
}

#video-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    /* Darkens the video */
    z-index: -1;
}

/* UI Controls Optimized */
#ui-controls {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 100;
    background: rgba(13, 17, 23, 0.4);
    /* More transparent */
    padding: 6px 12px;
    border-radius: 30px;
    /* Pill shape */
    border: 1px solid rgba(88, 166, 255, 0.3);
    backdrop-filter: blur(4px);
    transition: all 0.3s ease;
}

#ui-controls:hover {
    background: rgba(13, 17, 23, 0.8);
    border-color: var(--text-color);
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.5);
}

.control-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.control-group label {
    font-size: 10px;
    letter-spacing: 1.5px;
    font-weight: bold;
    color: rgba(255, 255, 255, 0.7);
}

/* Refined Slider */
input[type=range] {
    -webkit-appearance: none;
    appearance: none;
    width: 80px;
    /* Compact */
    background: transparent;
}

input[type=range]:focus {
    outline: none;
}

/* Slider Track */
input[type=range]::-webkit-slider-runnable-track {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    border: none;
}

/* Slider Thumb */
input[type=range]::-webkit-slider-thumb {
    height: 12px;
    width: 12px;
    border-radius: 50%;
    background: var(--text-color);
    border: none;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    margin-top: -4px;
    box-shadow: 0 0 8px var(--text-color);
    transition: transform 0.2s ease;
}

input[type=range]::-webkit-slider-thumb:hover {
    transform: scale(1.3);
    background: #fff;
    box-shadow: 0 0 12px #fff;
}

/* Mute Button */
#mute-btn {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid #555;
    color: #888;
    padding: 6px 14px;
    cursor: pointer;
    font-family: var(--font-stack);
    font-size: 12px;
    text-transform: uppercase;
    border-radius: 4px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    letter-spacing: 1px;
}

#mute-btn:hover {
    border-color: var(--text-color);
    color: var(--text-color);
}

/* Active State (Sound ON) */
#mute-btn.active {
    background: rgba(88, 166, 255, 0.2);
    border-color: var(--text-color);
    color: #fff;
    box-shadow: 0 0 15px var(--glow-color), inset 0 0 5px var(--glow-color);
    text-shadow: 0 0 5px var(--glow-color);
}

/* Terminal Container */
.container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    padding: 20px;
}

/* Terminal Window */
#terminal {
    width: 100%;
    max-width: 900px;
    height: 80vh;
    background-color: var(--terminal-bg);
    border: 1px solid var(--text-color);
    border-radius: 10px;
    padding: 20px;
    overflow-y: auto;
    /* Scrollable */
    box-shadow: 0 0 20px var(--glow-color);
    backdrop-filter: blur(5px);
    transition: background-color 0.3s ease;
    display: flex;
    flex-direction: column;
    z-index: 20;
    /* Keep terminal ABOVE scanlines */
    position: relative;
}

/* Custom Scrollbar */
#terminal::-webkit-scrollbar {
    width: 10px;
}

#terminal::-webkit-scrollbar-track {
    background: transparent;
}

#terminal::-webkit-scrollbar-thumb {
    background: var(--text-color);
    border-radius: 5px;
}

/* Body */
.terminal-body {
    flex-grow: 1;
    font-size: 18px;
    /* Slightly larger like image */
}

/* Input Area */
.input-line {
    display: flex;
    align-items: center;
    margin-top: 10px;
}

.prompt {
    color: var(--prompt-color);
    margin-right: 10px;
    white-space: nowrap;
    text-shadow: none;
    /* No glow */
    font-weight: normal;
    /* Normal text */
}

#command-input {
    background: transparent;
    border: none;
    color: var(--text-color);
    font-family: var(--font-stack);
    font-size: 16px;
    flex-grow: 1;
    outline: none;
    caret-color: var(--text-color);
    /* The cursor itself */
}

/* Output Styling */
.output-line {
    margin-bottom: 5px;
    line-height: 1.5;
    white-space: pre-wrap;
    /* Preserve formatting */
}

.command-echo {
    color: #fff;
    /* font-weight: bold; Removed to prevent inconsistent prompt rendering */
    margin-bottom: 5px;
}

/* Mobile Responsiveness */
@media (max-width: 600px) {
    #ui-controls {
        top: 10px;
        right: 10px;
        flex-direction: column;
        gap: 10px;
    }

    #terminal {
        height: 90vh;
        width: 100%;
    }
}

/* Blinking Dots Animation - Global */
@keyframes blinkOps {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }

    100% {
        opacity: 1;
    }
}

.blink-dots {
    animation: blinkOps 1s infinite;
}