
:root {
    --neon-cyan: #00f3ff;
    --neon-red: #ff003c;
    --neon-amber: #fcee0a;
    --neon-green: #0aff0a;
    --bg-dark: #050505;
    --bg-panel: #0a0a0a;
    --horror-red: #8b0000;
    --ghost-white: #e8e8e8;
    --crt-scanline: rgba(18, 16, 16, 0.5);
    --border-glow: 0 0 10px rgba(0, 243, 255, 0.5);
}
/* Drag and Drop */
.draggable-item {
    cursor: grab;
    transition: transform 0.1s, box-shadow 0.1s;
}
.draggable-item:active {
    cursor: grabbing;
}
.dragging {
    opacity: 0.5;
    transform: scale(0.95);
}
.drag-over {
    border-color: var(--neon-cyan) !important;
    background: rgba(6, 182, 212, 0.1);
}

/* Minimap */
#minimap-canvas {
    image-rendering: pixelated;
}

/* Split Input Layout */
.chat-mode #choices-container {
    display: none;
}
/* Custom Scrollbar */
.custom-scrollbar::-webkit-scrollbar {
    width: 8px;
}
.custom-scrollbar::-webkit-scrollbar-track {
    background: #0f172a;
}
.custom-scrollbar::-webkit-scrollbar-thumb {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 4px;
}
.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #334155;
}

/* Horror Overlay Effects */
.scanlines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    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;
    z-index: 999;
    pointer-events: none;
    opacity: 0.6;
}
.scan-line {
    position: absolute;
    top: -10%;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(transparent, rgba(6, 182, 212, 0.1), transparent);
    animation: scan 8s linear infinite;
    pointer-events: none;
}

.static-noise {
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    opacity: 0.03;
    pointer-events: none;
    animation: static-flicker 0.15s infinite;
}

@keyframes static-flicker {
    0%, 100% { opacity: 0.03; }
    50% { opacity: 0.06; }
}

.corruption {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, transparent 0%, rgba(139, 0, 0, 0.2) 100%);
    pointer-events: none;
    mix-blend-mode: multiply;
}

.blood-vignette {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, transparent 40%, rgba(139, 0, 0, 0.4) 100%);
    pointer-events: none;
    mix-blend-mode: multiply;
    animation: blood-pulse 4s ease-in-out infinite;
}

@keyframes blood-pulse {
    0%, 100% { opacity: 0; }
    50% { opacity: 1; }
}
/* Scanline Animation */
@keyframes scan {
    0% { transform: translateY(-100vh); }
    100% { transform: translateY(100vh); }
}
.animate-scan {
    animation: scan 6s linear infinite;
}

/* Glitch Effect */
@keyframes glitch {
    0% { transform: translate(0); }
    20% { transform: translate(-2px, 2px); }
    40% { transform: translate(-2px, -2px); }
    60% { transform: translate(2px, 2px); }
    80% { transform: translate(2px, -2px); }
    100% { transform: translate(0); }
}
.glitch-text {
    animation: glitch 0.3s cubic-bezier(.25, .46, .45, .94) both infinite;
    color: var(--neon-red);
}

/* Text Shadow for Terminal Feel */
.terminal-glow {
    text-shadow: 0 0 5px rgba(6, 182, 212, 0.5), 0 0 10px rgba(6, 182, 212, 0.3);
}

.terminal-glow-red {
    text-shadow: 0 0 5px rgba(239, 68, 68, 0.5);
}

/* Typewriter Cursor */
.typewriter-cursor::after {
    content: '▋';
    animation: blink 1s step-start infinite;
    color: var(--neon-cyan);
}

@keyframes blink {
    50% { opacity: 0; }
}

/* Button Hover Effects */
.btn-terminal {
    transition: all 0.1s ease;
    position: relative;
    overflow: hidden;
    background: rgba(0, 243, 255, 0.05);
    border: 1px solid rgba(0, 243, 255, 0.3);
    clip-path: polygon(
        10px 0, 100% 0, 
        100% calc(100% - 10px), calc(100% - 10px) 100%, 
        0 100%, 0 10px
    );
}

.btn-terminal::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--neon-cyan);
    opacity: 0;
    transition: opacity 0.2s;
}

.btn-terminal:hover {
    background: rgba(0, 243, 255, 0.15);
    border-color: var(--neon-cyan);
    box-shadow: 0 0 15px rgba(0, 243, 255, 0.2);
    text-shadow: 0 0 8px var(--neon-cyan);
}

.btn-terminal:hover::before {
    opacity: 1;
}
/* Dynamic AI Colors - Enhanced Glow */
.ai-friendly { 
    color: #0aff0a; 
    text-shadow: 0 0 10px #0aff0a;
} 
.ai-ambiguous { 
    color: #fcee0a; 
    text-shadow: 0 0 10px #fcee0a;
} 
.ai-sinister { 
    color: #ff6600; 
    text-shadow: 0 0 10px #ff6600;
} 
.ai-malicious { 
    color: #ff003c; 
    text-shadow: 0 0 15px #ff003c, 2px 0 5px rgba(255,0,60,0.5); 
} 
/* Text Types */
.dialogue-text { color: #67e8f9; }
.description-text { color: #cbd5e1; }
.system-text { color: #94a3b8; font-style: italic; }
.warning-text { color: #fca5a5; }
.secret-text { color: #7c3aed; }

/* Achievement Unlocked Animation */
@keyframes achievement-pop {
    0% { transform: translateX(100%); opacity: 0; }
    10% { transform: translateX(0); opacity: 1; }
    90% { transform: translateX(0); opacity: 1; }
    100% { transform: translateX(100%); opacity: 0; }
}

.achievement-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, #1e1b4b, #312e81);
    border: 2px solid #8b5cf6;
    padding: 1rem 1.5rem;
    z-index: 100;
    animation: achievement-pop 4s ease-in-out forwards;
    box-shadow: 0 0 30px rgba(139, 92, 246, 0.5);
}
/* Enhanced Horror Text Effects */
@keyframes text-shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-2px) rotate(-1deg); }
    75% { transform: translateX(2px) rotate(1deg); }
}

.shaking-text {
    animation: text-shake 0.1s infinite;
    color: #ef4444;
    display: inline-block;
}

@keyframes text-glitch {
    0% { transform: translate(0); filter: hue-rotate(0deg); }
    20% { transform: translate(-3px, 3px); filter: hue-rotate(90deg); }
    40% { transform: translate(-3px, -3px); filter: hue-rotate(180deg); }
    60% { transform: translate(3px, 3px); filter: hue-rotate(270deg); }
    80% { transform: translate(3px, -3px); filter: hue-rotate(360deg); }
    100% { transform: translate(0); filter: hue-rotate(0deg); }
}

.glitching-text {
    animation: text-glitch 0.3s infinite;
    display: inline-block;
}

@keyframes text-invert {
    0% { filter: invert(0); }
    50% { filter: invert(1); }
    100% { filter: invert(0); }
}

.inverted-text {
    animation: text-invert 0.2s ease-in-out;
}

@keyframes text-shrink {
    0% { font-size: 1em; }
    50% { font-size: 0.5em; opacity: 0.5; }
    100% { font-size: 1em; }
}

.shrinking-text {
    animation: text-shrink 2s infinite;
}

.typo-swap {
    color: transparent;
    text-shadow: 0 0 5px rgba(255,255,255,0.5);
    font-family: monospace;
}

/* Accessibility Improvements */
.high-contrast {
    filter: contrast(1.5);
}
.reduced-motion * {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
}

/* Custom Focus for better navigation */
*:focus-visible {
    outline: 2px solid var(--neon-cyan);
    outline-offset: 4px;
    box-shadow: 0 0 10px rgba(6, 182, 212, 0.3);
}

/* Autocomplete List */
.autocomplete-item {
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 1px solid #1e293b;
    color: #94a3b8;
    display: flex;
    justify-content: space-between;
}
.autocomplete-item:hover, .autocomplete-item.active {
    background: #1e293b;
    color: #22d3ee;
}
@keyframes backward-type {
    0% { clip-path: inset(0 0 0 0); }
    100% { clip-path: inset(0 0 100% 0); }
}

.reversed-text {
    transform: scaleX(-1);
    filter: blur(0.5px);
}

/* Subliminal Message */
@keyframes subliminal-flash {
    0%, 95%, 100% { opacity: 0; }
    96%, 99% { opacity: 1; }
}

.subliminal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    font-weight: bold;
    color: red;
    text-shadow: 0 0 20px red;
    z-index: 60;
    pointer-events: none;
    animation: subliminal-flash 10s linear infinite;
    text-transform: uppercase;
}

/* Inventory Item */
.inventory-item {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 4px;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    color: #94a3b8;
    transition: all 0.2s;
    cursor: pointer;
}

.inventory-item:hover {
    border-color: #06b6d4;
    color: #06b6d4;
    box-shadow: 0 0 10px rgba(6, 182, 212, 0.2);
}

/* Body Horror States */
body.sanity-critical {
    animation: background-pulse-red 2s ease-in-out infinite;
}

@keyframes background-pulse-red {
    0%, 100% { background-color: #030712; }
    50% { background-color: #1a0a0a; }
}

body.sanity-low .scanlines {
    opacity: 0.8;
}

body.sanity-low .scan-line {
    animation-duration: 3s;
    background: linear-gradient(transparent, rgba(239, 68, 68, 0.2), transparent);
}

/* Sanitize for readability */
.sanitized-text {
    filter: none !important;
    animation: none !important;
    transform: none !important;
}

/* Focus Styles for Accessibility */
*:focus-visible {
    outline: 2px solid #06b6d4;
    outline-offset: 2px;
}

/* Screen Reader Only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
/* Glitch Visual Overlay */
.glitch-overlay {
    background: rgba(255, 0, 0, 0.05);
    mix-blend-mode: overlay;
}
body {
    font-family: 'JetBrains Mono', monospace;
    background-color: #000;
    background-image: 
        linear-gradient(rgba(0, 243, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 243, 255, 0.03) 1px, transparent 1px);
    background-size: 40px 40px;
    overflow: hidden;
    text-shadow: 0 0 2px rgba(0, 243, 255, 0.5);
}

/* CRT Overlay 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.25) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
    z-index: 100;
    background-size: 100% 2px, 3px 100%;
    pointer-events: none;
}

body::after {
    content: " ";
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: rgba(18, 16, 16, 0.1);
    opacity: 0;
    z-index: 100;
    pointer-events: none;
    animation: flicker 0.15s infinite;
}

@keyframes flicker {
    0% { opacity: 0.027906; }
    5% { opacity: 0.048532; }
    10% { opacity: 0.012593; }
    15% { opacity: 0.077503; }
    20% { opacity: 0.014346; }
    25% { opacity: 0.040571; }
    30% { opacity: 0.039567; }
    35% { opacity: 0.070489; }
    40% { opacity: 0.023046; }
    45% { opacity: 0.052374; }
    50% { opacity: 0.016788; }
    55% { opacity: 0.033015; }
    60% { opacity: 0.059508; }
    65% { opacity: 0.017069; }
    70% { opacity: 0.032931; }
    75% { opacity: 0.068036; }
    80% { opacity: 0.025836; }
    85% { opacity: 0.016788; }
    90% { opacity: 0.046736; }
    95% { opacity: 0.057595; }
    100% { opacity: 0.038236; }
}
h1, h2, h3, .brand-font {
    font-family: 'Orbitron', sans-serif;
}