:root {
    --bg-color: #0d0d0d;
    --text-color: #33ff00;
    --text-shadow: 0 0 2px rgba(51, 255, 0, 0.2); /* Even subtler glow */
    --font-family: 'Fira Code', monospace;
    --font-size: 16px; /* Standard developer font size */
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-family);
    font-size: var(--font-size);
    margin: 0;
    padding: 0;
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    text-shadow: var(--text-shadow);
    letter-spacing: 0.5px; /* Better spacing */
}

.terminal-hidden {
    display: none;
}

#boot-screen {
    position: fixed;
    inset: 0;
    z-index: 20;
    background-color: var(--bg-color);
    color: var(--text-color);
    box-sizing: border-box;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

#boot-screen.boot-fadeout {
    opacity: 0;
    transition: opacity 0.25s ease;
}

#boot-output {
    margin: 0;
    flex: 1;
    overflow-y: auto;
    white-space: pre-wrap;
    line-height: 1.45;
    font-family: var(--font-family);
    font-size: calc(var(--font-size) * 0.95);
}

.boot-progress {
    width: 100%;
    height: 8px;
    border: 1px solid var(--text-color);
    box-sizing: border-box;
}

#boot-progress-bar {
    width: 0;
    height: 100%;
    background-color: var(--text-color);
    box-shadow: 0 0 8px rgba(51, 255, 0, 0.45);
    transition: width 0.12s linear;
}

.boot-hint {
    opacity: 0.75;
    font-size: 0.82rem;
}

.terminal {
    padding: 20px;
    height: 100%;
    overflow-y: auto;
    box-sizing: border-box;
    position: relative;
    z-index: 1;
}

/* Scrollbar styling */
.terminal::-webkit-scrollbar {
    width: 10px;
}

.terminal::-webkit-scrollbar-track {
    background: var(--bg-color);
}

.terminal::-webkit-scrollbar-thumb {
    background: var(--text-color);
    border: 2px solid var(--bg-color);
}

#output {
    white-space: pre-wrap;
    word-wrap: break-word;
    margin-bottom: 10px;
}

.input-line {
    display: flex;
    align-items: center;
}

.prompt {
    margin-right: 10px;
    color: var(--text-color);
    white-space: nowrap;
    font-weight: bold;
}

.prompt-user {
    color: #ff5555;
    text-shadow: 0 0 2px rgba(255, 85, 85, 0.5);
}

#command-input {
    background: transparent;
    border: none;
    color: var(--text-color);
    font-family: var(--font-family);
    font-size: var(--font-size);
    width: 100%;
    outline: none;
    text-shadow: var(--text-shadow);
    caret-color: var(--text-color);
    letter-spacing: 0.5px;
}

/* CRT Scanline Effect - Reduced opacity */
.scanline {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to bottom,
        rgba(255, 255, 255, 0),
        rgba(255, 255, 255, 0) 50%,
        rgba(0, 0, 0, 0.1) 50%, /* Reduced opacity */
        rgba(0, 0, 0, 0.1)
    );
    background-size: 100% 4px;
    pointer-events: none;
    z-index: 10;
    animation: scroll 10s linear infinite;
}

@keyframes scroll {
    0% { background-position: 0 0; }
    100% { background-position: 0 100%; }
}

/* Text Glow Animation - Subtler */
@keyframes glow {
    0% { text-shadow: 0 0 2px rgba(51, 255, 0, 0.4); }
    50% { text-shadow: 0 0 5px rgba(51, 255, 0, 0.6); }
    100% { text-shadow: 0 0 2px rgba(51, 255, 0, 0.4); }
}

/* Output styling */
.command-output {
    margin-bottom: 10px;
    line-height: 1.5; /* Increased line height */
}

.error {
    color: #ff5555;
    text-shadow: 0 0 2px rgba(255, 85, 85, 0.5);
}

.success {
    color: #33ff00;
}

.info {
    color: #55ffff;
    text-shadow: 0 0 2px rgba(85, 255, 255, 0.5);
}

.log-system {
    color: #55ffff;
    font-weight: bold;
    text-shadow: 0 0 2px rgba(85, 255, 255, 0.5);
}

.log-auth {
    color: #55aaff;
    font-weight: bold;
    text-shadow: 0 0 2px rgba(85, 170, 255, 0.5);
}

.log-warn {
    color: #ff5555;
    font-weight: bold;
    text-shadow: 0 0 2px rgba(255, 85, 85, 0.5);
}

a {
    color: #ffff00;
    text-decoration: none;
    border-bottom: 1px dashed #ffff00;
}

a:hover {
    background-color: #ffff00;
    color: #000;
}

/* Directory and file styling */
.directory {
    color: #55aaff;
    font-weight: bold;
    text-shadow: 0 0 3px rgba(85, 170, 255, 0.6);
}

.executable {
    color: #00ff88;
    font-weight: bold;
    text-shadow: 0 0 3px rgba(0, 255, 136, 0.6);
}

/* Tic-Tac-Toe Game Styles */
.game-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.tictactoe-container {
    background: linear-gradient(145deg, #1a1a1a, #0d0d0d);
    border: 2px solid var(--text-color);
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 0 30px rgba(51, 255, 0, 0.3);
    max-width: 500px;
    width: 90%;
    animation: slideIn 0.4s ease;
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.ttt-header {
    text-align: center;
    margin-bottom: 25px;
}

.ttt-header h2 {
    color: var(--text-color);
    margin: 0 0 15px 0;
    font-size: 28px;
    text-shadow: 0 0 10px rgba(51, 255, 0, 0.5);
    letter-spacing: 2px;
}

.ttt-turn {
    color: var(--text-color);
    font-size: 18px;
    font-weight: bold;
}

.ttt-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin: 25px 0;
    aspect-ratio: 1;
}

.ttt-cell {
    background: #0d0d0d;
    border: 2px solid var(--text-color);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 100px;
}

.ttt-cell:hover:not(.filled) {
    background: rgba(51, 255, 0, 0.1);
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(51, 255, 0, 0.4);
}

.ttt-cell.filled {
    cursor: not-allowed;
}

.ttt-cell.player-x {
    color: #00ff88;
    text-shadow: 0 0 10px rgba(0, 255, 136, 0.8);
    animation: cellPop 0.3s ease;
}

.ttt-cell.player-o {
    color: #ff5555;
    text-shadow: 0 0 10px rgba(255, 85, 85, 0.8);
    animation: cellPop 0.3s ease;
}

@keyframes cellPop {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.ttt-cell.winning-cell {
    background: rgba(255, 255, 0, 0.2);
    animation: winPulse 0.6s ease infinite;
}

@keyframes winPulse {
    0%, 100% { 
        box-shadow: 0 0 15px rgba(255, 255, 0, 0.6);
        transform: scale(1);
    }
    50% { 
        box-shadow: 0 0 30px rgba(255, 255, 0, 0.9);
        transform: scale(1.1);
    }
}

.ttt-footer {
    border-top: 1px solid var(--text-color);
    padding-top: 20px;
}

.ttt-scores {
    display: flex;
    justify-content: space-around;
    margin-bottom: 20px;
    font-size: 16px;
    color: var(--text-color);
}

.ttt-scores span {
    color: #ffff00;
    font-weight: bold;
}

.ttt-controls {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.ttt-btn {
    background: var(--text-color);
    color: #000;
    border: none;
    padding: 12px 24px;
    font-family: var(--font-family);
    font-size: 14px;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.ttt-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(51, 255, 0, 0.4);
}

.ttt-btn:active {
    transform: translateY(0);
}

.ttt-btn-close {
    background: #ff5555;
}

.ttt-btn-close:hover {
    box-shadow: 0 5px 15px rgba(255, 85, 85, 0.4);
}

/* Mobile adjustments */
@media (max-width: 600px) {
    :root {
        --font-size: 16px;
    }
    .terminal {
        padding: 10px;
    }

    #boot-screen {
        padding: 12px;
    }

    .boot-hint {
        font-size: 0.78rem;
    }
    
    .tictactoe-container {
        padding: 20px;
    }
    
    .ttt-header h2 {
        font-size: 22px;
    }
    
    .ttt-cell {
        font-size: 36px;
        min-height: 80px;
    }
    
    .ttt-btn {
        padding: 10px 16px;
        font-size: 12px;
    }
}
