/* HIGH CONTRAST PALETTE */
:root {
    --bg-color: #000000;
    --accent: #39FF14;
    /* Stark Neon Green */
    --accent-dim: rgba(57, 255, 20, 0.15);
    --text-main: #FFFFFF;
    --alert: #FF003C;
    --font-mono: 'Courier New', Courier, monospace;
}

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

body {
    background-color: var(--bg-color);
    color: var(--accent);
    font-family: var(--font-mono);
    height: 100vh;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* SUBTLE CRT FLICKER */
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.25) 50%);
    background-size: 100% 2px;
    z-index: 999;
    pointer-events: none;
}

/* --- VISUAL BOOT SEQUENCE --- */
#boot-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-color);
    z-index: 100;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.reticle-container {
    position: relative;
    width: 300px;
    height: 300px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 40px;
}

.ring {
    position: absolute;
    border-radius: 50%;
    border: 2px solid transparent;
}

.outer-ring {
    width: 100%;
    height: 100%;
    border-top: 2px solid var(--accent);
    border-bottom: 2px solid var(--accent);
    animation: spin 4s linear infinite;
}

.middle-ring {
    width: 80%;
    height: 80%;
    border-left: 2px dashed var(--accent);
    border-right: 2px dashed var(--accent);
    animation: spin-reverse 6s linear infinite;
}

.inner-target {
    width: 20%;
    height: 20%;
    border: 1px solid var(--accent);
    background-color: var(--accent-dim);
    animation: pulse 1.5s infinite;
}

.crosshair-h,
.crosshair-v {
    position: absolute;
    background-color: var(--accent);
    opacity: 0.5;
}

.crosshair-h {
    width: 120%;
    height: 1px;
}

.crosshair-v {
    width: 1px;
    height: 120%;
}

.boot-loader-container {
    width: 400px;
    text-align: center;
}

.progress-track {
    width: 100%;
    height: 10px;
    border: 1px solid var(--accent);
    margin: 15px 0;
    padding: 2px;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background-color: var(--accent);
    transition: width 0.3s ease-out;
}

.boot-status {
    font-size: 14px;
    letter-spacing: 2px;
    text-transform: uppercase;
    animation: blink 1s infinite step-end;
}

@keyframes spin {
    100% {
        transform: rotate(360deg);
    }
}

@keyframes spin-reverse {
    100% {
        transform: rotate(-360deg);
    }
}

@keyframes pulse {

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

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

/* SCREEN FLASH TRANSITION */
#flash-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--accent);
    z-index: 200;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease-out;
}

/* --- HIGH CONTRAST CHAT UI --- */
#terminal-container {
    width: 100%;
    height: 100%;
    max-width: 1200px;
    background: var(--bg-color);
    display: flex;
    flex-direction: column;
    display: none;
    /* Hidden until boot finishes */
    border: 2px solid var(--accent);
    position: relative;
}

header {
    border-bottom: 2px solid var(--accent);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--accent-dim);
}

.header-title {
    font-weight: bold;
    font-size: 1.2rem;
    color: var(--text-main);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.header-controls {
    display: flex;
    gap: 20px;
    align-items: center;
}

.telemetry {
    display: flex;
    gap: 15px;
    font-size: 12px;
    font-weight: bold;
}

.status-ok {
    color: var(--accent);
}

.status-alert {
    color: var(--alert);
    animation: blink 1s infinite;
}

#report-btn-header {
    background: transparent;
    border: 1px solid var(--alert);
    color: var(--alert);
    padding: 4px 10px;
    font-size: 12px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.2s;
}

#report-btn-header:hover {
    background: var(--alert);
    color: var(--bg-color);
}

#chat-log {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

#chat-log::-webkit-scrollbar {
    width: 10px;
    border-left: 1px solid var(--accent);
}

#chat-log::-webkit-scrollbar-thumb {
    background: var(--accent);
}

.msg {
    max-width: 85%;
    line-height: 1.6;
    padding: 12px 15px;
    word-wrap: break-word;
    font-size: 15px;
    border-radius: 0;
}

.msg.user {
    align-self: flex-end;
    color: var(--text-main);
    border: 1px solid var(--text-main);
}

.msg.rio {
    align-self: flex-start;
    color: var(--accent);
    border: 1px solid var(--accent);
    background: var(--accent-dim);
}

.msg.system-msg {
    align-self: center;
    color: var(--alert);
    border: 1px dashed var(--alert);
    background: rgba(255, 0, 60, 0.1);
    font-size: 13px;
}

#input-box {
    display: flex;
    padding: 15px;
    border-top: 2px solid var(--accent);
    background: var(--bg-color);
    align-items: center;
}

.prompt-symbol {
    color: var(--accent);
    font-weight: bold;
    font-size: 1.2rem;
    margin-right: 15px;
    animation: blink 1s infinite step-end;
}

input[type="text"] {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-main);
    font-family: var(--font-mono);
    font-size: 16px;
    outline: none;
}

button.tx-btn {
    background: var(--accent);
    border: none;
    color: var(--bg-color);
    font-family: var(--font-mono);
    font-weight: bold;
    padding: 10px 25px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: background 0.1s;
}

button.tx-btn:hover {
    background: var(--text-main);
    color: var(--bg-color);
}

/* --- REPORT MODAL --- */
#report-modal {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 400px;
    background: var(--bg-color);
    border: 2px solid var(--alert);
    padding: 20px;
    z-index: 500;
    box-shadow: 0 0 30px rgba(255, 0, 60, 0.3);
    flex-direction: column;
    gap: 15px;
}

#report-modal h3 {
    color: var(--alert);
    text-transform: uppercase;
    border-bottom: 1px solid var(--alert);
    padding-bottom: 10px;
}

.modal-input {
    background: transparent;
    border: 1px solid var(--accent);
    color: var(--text-main);
    font-family: var(--font-mono);
    padding: 10px;
    width: 100%;
    outline: none;
}

.modal-input:focus {
    border-color: var(--text-main);
}

textarea.modal-input {
    resize: vertical;
    min-height: 80px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.btn-cancel {
    background: transparent;
    border: 1px solid var(--text-main);
    color: var(--text-main);
    padding: 8px 15px;
    cursor: pointer;
    font-family: var(--font-mono);
}

.btn-cancel:hover {
    background: var(--text-main);
    color: var(--bg-color);
}

.btn-submit {
    background: var(--alert);
    border: 1px solid var(--alert);
    color: var(--bg-color);
    padding: 8px 15px;
    cursor: pointer;
    font-family: var(--font-mono);
    font-weight: bold;
}

.btn-submit:hover {
    background: var(--text-main);
    border-color: var(--text-main);
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

/* ========================================= */
/* MOBILE RESPONSIVENESS (MEDIA QUERIES)     */
/* ========================================= */
@media (max-width: 768px) {

    /* Shrink the boot reticle */
    .reticle-container {
        width: 200px;
        height: 200px;
    }

    .boot-loader-container {
        width: 90%;
    }

    /* Stack the header and shrink text */
    header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        padding: 10px;
    }

    .header-title {
        font-size: 1rem;
    }

    .header-controls {
        width: 100%;
        justify-content: space-between;
    }

    /* Adjust chat margins for mobile */
    .msg {
        max-width: 95%;
        font-size: 14px;
        padding: 10px;
    }

    /* Adjust input area */
    #input-box {
        padding: 10px;
    }

    input[type="text"] {
        font-size: 14px;
    }

    button.tx-btn {
        padding: 8px 15px;
        font-size: 12px;
    }

    /* Fix the Report Modal from overflowing */
    #report-modal {
        width: 90%;
        padding: 15px;
    }
}