@import url('https://fonts.googleapis.com/css2?family=VT323&family=IBM+Plex+Mono:wght@700&display=swap');

:root {
    --green: #33ff33;
    --red: #ff3333;
    --yellow: #ffff00;
    --magenta: #ff00ff;
    --white: #ffffff;
    --cyan: #00ffff;
    --bg-dark: #050505;
    --bg-screen: #0a0a0a;
    --bezel-color: #1a1a1a;
    --beige: #d4c5a9;
    --beige-dark: #8b7355;
    --beige-light: #e8dcc8;
}

* { margin: 0; padding: 0; box-sizing: border-box; user-select: none; }

body {
    background-color: #000;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: 'VT323', monospace;
    overflow: hidden;
}

.monitor-wrapper {
    perspective: 1000px;
    transform-style: preserve-3d;
}

.monitor-casing {
    background: linear-gradient(135deg, var(--beige-light), var(--beige) 40%, var(--beige-dark));
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 0 50px rgba(0,0,0,0.8), inset 0 0 20px rgba(0,0,0,0.5);
    position: relative;
    width: auto;
    display: inline-block;
}

.evidence-tag {
    position: absolute; top: -15px; right: 20px;
    background: var(--red); color: #000;
    padding: 5px 15px; font-family: 'IBM Plex Mono', monospace;
    font-weight: bold; font-size: 12px; transform: rotate(2deg);
    box-shadow: 0 2px 5px rgba(0,0,0,0.5); z-index: 10;
}

.damage-mark { position: absolute; background: rgba(0,0,0,0.4); border-radius: 50%; pointer-events: none; }
.damage-1 { top: 20px; left: 20px; width: 40px; height: 40px; box-shadow: inset 2px 2px 5px rgba(0,0,0,0.8); }
.damage-2 { bottom: 50px; right: 30px; width: 20px; height: 60px; transform: rotate(15deg); box-shadow: inset 1px 1px 3px rgba(0,0,0,0.8); }

.bezel-branding {
    position: absolute; bottom: 15px; left: 0; width: 100%;
    display: flex; justify-content: center; align-items: center; gap: 15px; z-index: 200;
}

.brand-logo {
    font-family: 'IBM Plex Mono', sans-serif; font-weight: bold; color: #444; font-size: 14px; letter-spacing: 2px;
}

.led-indicator {
    width: 8px; height: 8px; background-color: #300; border-radius: 50%; box-shadow: inset 0 0 2px #000;
}

.led-indicator.on {
    background-color: #f00; box-shadow: 0 0 8px #f00; animation: pulse 2s infinite;
}

.crt-housing {
    background: #111; padding: 20px; border-radius: 4px; border: 1px solid #333;
    box-shadow: inset 0 0 40px #000; display: flex; justify-content: center; align-items: center;
}

.screen-surface {
    width: 800px; height: 600px; background: var(--bg-screen); position: relative; overflow: hidden; border: 2px solid #000;
}

.scanlines {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%);
    background-size: 100% 4px; pointer-events: none; z-index: 900;
}

.curvature {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: radial-gradient(circle, rgba(0,0,0,0) 60%, rgba(0,0,0,0.4) 100%);
    pointer-events: none; z-index: 901;
}

.crt-glow {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: radial-gradient(circle, rgba(51, 255, 51, 0.08) 0%, transparent 80%);
    pointer-events: none; z-index: 899; animation: pulseGlow 4s infinite;
}

.crt-flicker {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(51, 255, 51, 0.02); opacity: 0; pointer-events: none; z-index: 902;
    animation: flicker 0.15s infinite;
}

.interface-layer {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    display: flex; flex-direction: column; color: var(--green); text-shadow: 0 0 4px var(--green);
    z-index: 50;
}

#bootLayer { justify-content: center; align-items: center; background: var(--bg-screen); z-index: 100; }
.boot-container { text-align: center; width: 400px; }
.boot-logo { font-size: 32px; margin-bottom: 30px; letter-spacing: 4px; }
.boot-loader-box { border: 2px solid var(--green); height: 30px; padding: 4px; margin-bottom: 15px; }
.boot-bar { height: 100%; width: 0%; background: var(--green); box-shadow: 0 0 10px var(--green); }
.boot-text { font-size: 18px; min-height: 25px; }

#storyLayer { background: var(--bg-screen); padding: 60px; z-index: 80; }
.story-header { font-size: 32px; border-bottom: 2px solid var(--green); margin-bottom: 20px; padding-bottom: 10px; text-align: center; }
.story-body { font-size: 24px; line-height: 1.6; flex-grow: 1; overflow-y: auto; text-align: left; }
.story-footer { text-align: center; font-size: 18px; animation: blink 1s infinite; margin-top: 20px; }

#gameLayer { z-index: 50; background: var(--bg-screen); }
.hud-bar {
    height: 50px; background: rgba(0,0,0,0.9); display: flex; justify-content: space-between; align-items: center;
    padding: 0 20px; font-size: 20px; border-bottom: 2px solid var(--green); width: 100%;
}
.hud-left, .hud-right { display: flex; gap: 20px; }
canvas { display: block; image-rendering: pixelated; margin: 0 auto; margin-top: 10px; }

.dialogue-box {
    position: absolute; bottom: 20px; left: 20px; right: 20px; background: rgba(0,0,0,0.95);
    border: 3px solid var(--green); padding: 20px; min-height: 140px; z-index: 150;
    box-shadow: 0 0 20px var(--green);
}
.speaker-name { font-weight: bold; margin-bottom: 10px; font-size: 20px; color: var(--cyan); text-shadow: 0 0 5px var(--cyan); }
.dialogue-text { font-size: 24px; line-height: 1.4; }
.dialogue-prompt { position: absolute; bottom: 15px; right: 20px; font-size: 16px; animation: blink 1s infinite; }

.mood-watching { border-color: var(--white); color: var(--white); }
.mood-danger { border-color: var(--red); color: var(--red); }
.mood-corrupted { border-color: var(--magenta); color: var(--magenta); }

.interact-prompt {
    position: absolute; bottom: 180px; left: 50%; transform: translateX(-50%);
    background: rgba(0,0,0,0.9); border: 2px solid var(--green); color: var(--green);
    padding: 8px 15px; animation: bounce 1s infinite; z-index: 140; font-size: 18px;
}

.inventory-screen {
    position: absolute; top: 50px; left: 50px; right: 50px; bottom: 50px;
    background: rgba(0,0,0,0.95); border: 4px solid var(--green); z-index: 200;
    display: flex; flex-direction: column; padding: 30px;
}
.inv-title { text-align: center; color: var(--green); font-size: 32px; border-bottom: 2px solid var(--green); margin-bottom: 20px; }
.inv-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; flex: 1; align-content: start; }
.inv-item { border: 1px solid var(--green); padding: 15px; text-align: center; color: var(--green); cursor: pointer; }
.inv-item:hover { background: rgba(51, 255, 51, 0.2); }
.inv-desc { border-top: 2px solid var(--green); padding-top: 15px; color: #fff; text-align: center; height: 60px; font-size: 20px; }
.inv-footer { text-align: center; font-size: 16px; color: var(--green); margin-top: 15px; }

.hidden { display: none !important; }

@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }
@keyframes bounce { 50% { transform: translate(-50%, -5px); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.6; } }
@keyframes pulseGlow { 0%, 100% { opacity: 1; } 50% { opacity: 0.7; } }
@keyframes flicker { 0% { opacity: 0.01; } 50% { opacity: 0.05; } 100% { opacity: 0.01; } }

@keyframes shake {
    0% { transform: translate(1px, 1px) rotate(0deg); }
    10% { transform: translate(-1px, -2px) rotate(-1deg); }
    20% { transform: translate(-3px, 0px) rotate(1deg); }
    30% { transform: translate(3px, 2px) rotate(0deg); }
    40% { transform: translate(1px, -1px) rotate(1deg); }
    50% { transform: translate(-1px, 2px) rotate(-1deg); }
    60% { transform: translate(-3px, 1px) rotate(0deg); }
    70% { transform: translate(3px, 1px) rotate(-1deg); }
    80% { transform: translate(-1px, -1px) rotate(1deg); }
    90% { transform: translate(1px, 2px) rotate(0deg); }
    100% { transform: translate(1px, -2px) rotate(-1deg); }
}

.shake-effect { animation: shake 0.5s; animation-iteration-count: infinite; }
.danger-flash { animation: flashRed 0.5s; }
@keyframes flashRed { 0%, 100% { box-shadow: inset 0 0 0 0 rgba(255, 0, 0, 0); } 50% { box-shadow: inset 0 0 100px 50px rgba(255, 0, 0, 0.5); } }

body.theme-1994 { --green: #33ff33; }
body.theme-2026 { --green: #ff3333; --red: #ff0000; }
body.theme-shelter { --green: #ffcc00; }
body.theme-cortex { --green: #ff00ff; }