:root {
    /* Palette */
    --bg-color: #121212;
    --text-main: #e0e0e0;
    --text-user: #ff6b6b;
    /* Soft Red */
    --text-dim: #888888;
    --text-success: #50fa7b;
    /* Soft Green */
    --text-error: #ff5555;
    --highlight: #f1fa8c;
    /* Soft Yellow */
    --hud-bg: #1a1a1a;
    --hud-border: #333;
    --font-stack: 'Fira Code', monospace;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: var(--font-stack);
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    font-size: 16px;
    line-height: 1.6;
}

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

/* --- WARNING OVERLAY --- */
.warning-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: warningFlash 0.5s infinite;
}

.warning-overlay.hidden {
    display: none;
}

.warning-content {
    text-align: center;
    padding: 40px;
    border: 4px solid var(--text-error);
    background: rgba(255, 85, 85, 0.1);
    box-shadow: 0 0 50px rgba(255, 85, 85, 0.8);
}

.warning-icon {
    font-size: 5rem;
    margin-bottom: 20px;
    animation: pulse 1s infinite;
}

.warning-text {
    font-size: 2rem;
    color: var(--text-error);
    font-weight: bold;
    text-shadow: 0 0 20px var(--text-error);
    margin-bottom: 10px;
}

.warning-subtext {
    font-size: 1.5rem;
    color: var(--text-error);
    text-shadow: 0 0 10px var(--text-error);
}

@keyframes warningFlash {

    0%,
    100% {
        background: rgba(0, 0, 0, 0.95);
        border-color: var(--text-error);
    }

    50% {
        background: rgba(255, 0, 0, 0.3);
        border-color: #fff;
    }
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.2);
    }
}

/* --- HUB SCREEN --- */
#hub-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-color);
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.hub-title {
    font-size: 2.5rem;
    color: var(--text-error);
    margin-bottom: 10px;
    text-shadow: 0 0 10px rgba(255, 85, 85, 0.5);
    letter-spacing: 5px;
}

.hub-subtitle {
    color: var(--text-dim);
    margin-bottom: 40px;
    font-size: 0.9rem;
}

.mission-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    width: 100%;
    max-width: 1000px;
    max-height: 70vh;
    overflow-y: auto;
    padding: 10px;
}

.mission-card {
    background: #1a1a1a;
    border: 1px solid #333;
    padding: 20px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.mission-card:hover:not(.locked) {
    border-color: var(--text-user);
    transform: translateY(-2px);
    background: #222;
}

.mission-card.locked {
    opacity: 0.5;
    cursor: not-allowed;
    border-style: dashed;
}

.mission-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-weight: bold;
    color: var(--text-main);
}

.mission-desc {
    font-size: 0.85rem;
    color: var(--text-dim);
}

.status-badge {
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 2px;
    background: #333;
}

.status-open {
    color: var(--text-success);
    border: 1px solid var(--text-success);
}

.status-locked {
    color: var(--text-dim);
}

.status-done {
    background: var(--text-success);
    color: #000;
}

#ghost-avatar {
    position: absolute;
    right: 40px;
    top: 40px;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid var(--text-success);
    object-fit: cover;
    box-shadow: 0 0 20px rgba(80, 250, 123, 0.3);
    z-index: 15;
}

/* --- TERMINAL SCREEN --- */
#terminal {
    display: none;
    /* Hidden initially */
    flex: 1;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    z-index: 1;
    max-width: 1000px;
    margin: 0 auto;
    width: 100%;
    padding: 20px;
    padding-top: 60px;
    /* Space for HUD */
}

/* HUD Styling */
#hud {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 40px;
    background: var(--hud-bg);
    border-bottom: 1px solid var(--hud-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    font-size: 0.8rem;
    color: var(--text-dim);
    z-index: 20;
}

#hud span {
    margin-right: 20px;
}

#hud-target {
    color: var(--text-error);
    font-weight: bold;
}

#hud-user {
    color: var(--text-success);
}

#hud-objective {
    color: var(--highlight);
}

#back-btn {
    position: absolute;
    top: 50px;
    right: 20px;
    background: #333;
    color: #fff;
    border: none;
    padding: 5px 10px;
    cursor: pointer;
    font-family: var(--font-stack);
    font-size: 0.8rem;
    z-index: 20;
    opacity: 0.5;
}

#back-btn:hover {
    background: var(--text-error);
    opacity: 1;
}

#output {
    flex: 1;
    overflow-y: auto;
    padding-bottom: 10px;
}

/* Scrollbar */
#output::-webkit-scrollbar {
    width: 6px;
}

#output::-webkit-scrollbar-track {
    background: #111;
}

#output::-webkit-scrollbar-thumb {
    background: #444;
}

.input-area {
    display: flex;
    align-items: center;
    padding-top: 10px;
    border-top: 1px solid #333;
}

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

#command-input {
    background: transparent;
    border: none;
    color: var(--text-user);
    font-family: var(--font-stack);
    font-size: 16px;
    flex: 1;
    outline: none;
    caret-color: var(--text-user);
    font-weight: bold;
}

/* Log Colors */
.log-entry {
    margin-bottom: 4px;
}

.log-user {
    color: var(--text-user);
    font-weight: bold;
}

.log-system {
    color: var(--text-main);
}

.log-error {
    color: var(--text-error);
}

.log-success {
    color: var(--text-success);
}

.log-info {
    color: var(--text-dim);
    font-style: italic;
}

.typing-cursor::after {
    content: '█';
    animation: blink 1s step-end infinite;
    color: var(--text-user);
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

.input-locked #command-input {
    opacity: 0.5;
    pointer-events: none;
}

/* Profile Card Styling */
.profile-card {
    border: 2px solid var(--text-error);
    padding: 15px;
    margin: 10px 0;
    background: rgba(255, 85, 85, 0.1);
    font-family: var(--font-stack);
    color: var(--text-error);
    text-shadow: 0 0 5px rgba(255, 85, 85, 0.5);
}