@import url('https://fonts.googleapis.com/css2?family=Share+Tech+Mono&display=swap');

/* =========================================
   1. CORE & ATMOSPHERE
   ========================================= */
body {
    background-color: #020202;
    color: #00ff41; 
    font-family: 'Share Tech Mono', monospace;
    margin: 0;
    overflow: hidden; 
    user-select: none; 
    text-shadow: 0 0 4px rgba(0, 255, 65, 0.4);
}
.hidden { display: none !important; }

/* CRT EFFECTS */
.scanlines {
    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%, rgba(0,0,0,0.1));
    background-size: 100% 4px; pointer-events: none; z-index: 999;
}
.screen-flicker {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 255, 65, 0.02); pointer-events: none; z-index: 998;
    animation: flicker 0.15s infinite;
}
@keyframes flicker { 0% { opacity: 0.02; } 5% { opacity: 0.05; } 10% { opacity: 0.02; } }

/* =========================================
   2. SCREENS & UI
   ========================================= */
#boot-screen, #menu-screen { height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; }
#boot-text { text-align: left; width: 350px; font-size: 18px; line-height: 1.5; white-space: pre-wrap; }
.glitch-title { font-size: 48px; margin-bottom: 30px; letter-spacing: 5px; text-shadow: 2px 2px #000; }
input { background: transparent; border: none; border-bottom: 2px solid #00ff41; color: #00ff41; font-family: inherit; font-size: 20px; text-align: center; outline: none; padding: 5px; width: 250px; }
.menu-buttons button { margin: 10px 0; width: 300px; }

/* GAME LAYOUT */
.main-interface { display: flex; height: 100vh; width: 100vw; }
.monitor { flex: 7; background: #000500; padding: 25px; border-right: 2px solid #333; display: flex; flex-direction: column; overflow-y: auto; overflow-x: hidden; box-shadow: inset 0 0 50px rgba(0,0,0,0.8); align-items: flex-start; }
#code-display { white-space: pre-wrap; word-break: break-word; font-size: 15px; line-height: 1.5; color: #0f0; opacity: 0.9; margin: 0; display: inline; tab-size: 4; text-align: left; }
#cursor { animation: blink 1s infinite; font-weight: bold; color: #00ff41; display: inline-block; }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

/* CONTROLS & HUD */
.controls { flex: 3; background: #080808; display: flex; flex-direction: column; padding: 20px; gap: 15px; border-left: 1px solid #111; }
.hud-panel, .action-deck { background: #0e0e0e; border: 1px solid #333; padding: 15px; }
.hud-panel h2 { margin: 0 0 10px 0; font-size: 28px; color: #00ff41; border-bottom: 1px solid #333; padding-bottom: 5px; }
.top-bar { display: flex; justify-content: space-between; font-size: 12px; color: #666; margin-bottom: 10px; }
.exit-btn { cursor: pointer; transition: 0.2s; } .exit-btn:hover { color: red; }
.stat-row { display: flex; justify-content: space-between; font-size: 14px; margin-bottom: 5px; }
.heat-container { margin-bottom: 15px; }
.progress-bar { background: #111; height: 8px; border: 1px solid #333; position: relative; }
.trace-bar-bg { background: #200000; }
.info-module { border: 1px solid #222; background: #050505; padding: 8px; margin-top: 5px; }
.module-header { font-size: 10px; color: #555; border-bottom: 1px solid #222; margin-bottom: 4px; }
#inventory-list { padding: 0; margin: 0; list-style: none; font-size: 11px; max-height: 60px; overflow-y: auto; }

/* BUTTONS */
button { background: #000; font-family: 'Share Tech Mono', monospace; font-size: 16px; padding: 12px; width: 100%; border: 1px solid #444; color: #aaa; cursor: pointer; text-transform: uppercase; letter-spacing: 1px; transition: 0.2s; }
button:hover { color: #fff; border-color: #fff; background: #111; box-shadow: 0 0 10px rgba(255,255,255,0.1); }
button:disabled { border-color: #222; color: #333; cursor: not-allowed; box-shadow: none; }
#hack-btn { border: 2px solid #00ff41; color: #00ff41; font-weight: bold; font-size: 18px; padding: 18px; }
#hack-btn:hover { background: #00ff41; color: black; box-shadow: 0 0 20px rgba(0,255,65,0.5); }
.panic-btn { border-color: red !important; color: red !important; animation: pulse-red 0.5s infinite; }
@keyframes pulse-red { 0%{opacity:1;} 50%{opacity:0.5;} 100%{opacity:1;} }
.active-mission { border-color: #d400ff !important; color: #d400ff !important; box-shadow: 0 0 10px #d400ff; }
.network-links { display: flex; flex-direction: column; gap: 8px; }
.mini-btn { font-size: 12px; color: #555; cursor: pointer; transition: 0.2s; }
.mini-btn:hover { color: #00ff41; text-decoration: underline; }

/* INBOX */
#inbox-btn { position: relative; }
#msg-count { background: red; color: white; padding: 2px 6px; font-size: 10px; border-radius: 50%; position: absolute; top: 10px; right: 10px; }
#message-list { max-height: 150px; overflow-y: auto; border: 1px solid #222; padding: 5px; }
.msg-item { padding: 8px; border-bottom: 1px solid #222; cursor: pointer; display: flex; justify-content: space-between; font-size: 13px; color: #666; }
.msg-item:hover { background: #111; color: #fff; }
.msg-item.unread { color: #00ff41; font-weight: bold; }

/* PROGRESS & TRACE */
.progress-container { margin-top: 10px; }
#progress-fill { background: #00ff41; height: 100%; width: 0%; box-shadow: 0 0 10px #00ff41; }
#trace-fill { background: red; height: 100%; width: 0%; }
#status-text { margin: 5px 0 0 0; font-size: 12px; color: #666; text-align: right; }
.blink-text { color: red; animation: blink-red 0.2s infinite; text-align: center; font-size: 12px; font-weight: bold; margin-bottom: 5px; }
@keyframes blink-red { 0% { opacity: 1; } 50% { opacity: 0.3; } }
.shake-screen { animation: shake 0.5s cubic-bezier(.36,.07,.19,.97) both; }
@keyframes shake { 0% { transform: translate(1px, 1px); } 10% { transform: translate(-1px, -2px); } 100% { transform: translate(1px, -2px); } }

/* MODALS */
.modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.95); display: flex; justify-content: center; align-items: center; z-index: 2000; }
.modal-content { border: 2px solid #00ff41; background: black; padding: 25px; width: 400px; box-shadow: 0 0 30px rgba(0, 255, 65, 0.1); }
.modal-content h3 { margin-top: 0; border-bottom: 1px solid #333; padding-bottom: 10px; }
.close-btn { margin-top: 10px; width: 100%; border-color: #555; color: #555; }
.close-btn:hover { border-color: #fff; color: #fff; }
.shop-item, .job-item { display: flex; justify-content: space-between; padding: 10px; border: 1px solid #333; margin-bottom: 10px; cursor: pointer; transition: 0.2s; }
.shop-item:hover, .job-item:hover { background: #111; border-color: #555; }
.job-btn { width: auto; padding: 5px 10px; font-size: 12px; margin: 0; }

/* SCROLLBAR */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #000; }
::-webkit-scrollbar-thumb { background: #222; }
::-webkit-scrollbar-thumb:hover { background: #00ff41; }

/* =========================================
   8. INTRO SEQUENCE (THE COMIC BOX)
   ========================================= */
#intro-layer {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    background: #000; z-index: 6000;
    display: flex; justify-content: center; align-items: center;
}

/* Base Comic Panel Style (Yellow Box) */
.comic-panel {
    background-color: #fcee0a; /* Cyber Yellow */
    border: 4px solid black;
    padding: 30px;
    width: 400px;
    box-shadow: 15px 15px 0px #000;
    transform: rotate(-2deg); 
    transition: all 0.3s ease;
    text-align: center;
}

#intro-text {
    font-family: 'Share Tech Mono', monospace;
    color: black; 
    font-size: 24px;
    font-weight: bold;
    text-transform: uppercase;
    line-height: 1.4;
    min-height: 60px;
    text-shadow: none;
}

.intro-hint {
    margin-top: 20px; font-size: 12px; color: #333;
    text-align: right; animation: blink-black 1s infinite;
}

/* === PHASE 1: SPEECH MODE (Normal Box) === */
.comic-panel.speech-mode {
    transform: rotate(0deg); 
    width: 500px;
}
.comic-panel.speech-mode .intro-hint { display: none; }
.comic-panel.speech-mode #intro-text {
    animation: textFade 3.5s forwards;
}

/* === ANIMATIONS === */
@keyframes slamIn {
    0% { transform: scale(3) rotate(10deg); opacity: 0; }
    100% { transform: scale(1) rotate(-2deg); opacity: 1; }
}

@keyframes textFade {
    0% { opacity: 0; }
    20% { opacity: 1; }
    80% { opacity: 1; }
    100% { opacity: 0; }
}

@keyframes blink-black {
    0%, 100% { opacity: 1; } 50% { opacity: 0.3; }
}

/* =========================================
   9. MANUAL BUBBLE (UPDATED)
   ========================================= */
.comic-bubble { 
    position: absolute; 
    bottom: 50px; 
    right: 0; 
    width: 300px; 
    background-color: #fcee0a; 
    border: 3px solid black; 
    padding: 20px; 
    color: black; 
    z-index: 5000; 
    box-shadow: 10px 10px 0px rgba(0,0,0,1); 
    font-weight: bold; 
    text-shadow: none; 
    text-align: left;
    font-size: 13px;
    line-height: 1.4;
    cursor: pointer;
    animation: popIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); 
}

.comic-bubble::after { 
    content: ''; position: absolute; bottom: -15px; right: 60px; 
    width: 0; height: 0; 
    border-left: 15px solid transparent; 
    border-right: 15px solid transparent; 
    border-top: 15px solid black; 
}
.comic-bubble::before { 
    content: ''; position: absolute; bottom: -9px; right: 63px; 
    width: 0; height: 0; 
    border-left: 12px solid transparent; 
    border-right: 12px solid transparent; 
    border-top: 12px solid #fcee0a; 
    z-index: 1; 
}

@keyframes popIn { 
    0% { transform: scale(0.5) translateY(20px); opacity: 0; } 
    100% { transform: scale(1) translateY(0); opacity: 1; } 
}