/* START OF FILE text/css */
:root {
    --void: #050505;
    --steel: #c0c5ce;
    --border: rgba(255, 255, 255, 0.15);
    --accent: #ffffff;
    --alert: #ff2a2a;
    --tech: #4fffa8; /* Neon Green */
    --int-color: #00d2ff; /* Blue for INT */
    --vit-color: #ff9d00; /* Orange for VIT */
    --mnd-color: #d600ff; /* Purple for MND */
    --glass: rgba(10, 10, 12, 0.94);
    --font-mono: 'JetBrains Mono', monospace;
    --font-ui: 'Noto Sans JP', sans-serif;
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; outline: none; user-select: none; }
body { 
    background: var(--void); color: var(--steel); font-family: var(--font-ui);
    height: 100vh; overflow: hidden; -webkit-font-smoothing: antialiased;
}

/* VFX */
#neuralCanvas { position: fixed; inset: 0; z-index: -1; opacity: 0.2; transition: opacity 2s; }
.vfx-crt { position: fixed; inset: 0; pointer-events: none; z-index: 9000; background: linear-gradient(rgba(18,16,16,0) 50%, rgba(0,0,0,0.02) 50%); background-size: 100% 3px; }
.vfx-grain { position: fixed; inset: 0; pointer-events: none; z-index: 8999; opacity: 0.03; background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }

/* Boot */
#bootLayer { 
    position: fixed; inset: 0; z-index: 99999; background: var(--void); 
    display: flex; align-items: center; justify-content: center; 
    transition: opacity 0.8s var(--ease-out), visibility 0.8s;
}
.boot-inner { text-align: center; width: 320px; }
.primordial-logo { width: 60px; height: 60px; margin: 0 auto 20px; position: relative; }
.logo-ring { position: absolute; inset: 0; border: 2px solid #333; border-radius: 50%; animation: spin 4s linear infinite; border-top-color: var(--tech); }
.logo-core { position: absolute; inset: 22px; background: #fff; border-radius: 50%; animation: pulse 2s infinite; }
.kaz-zen-title { font-family: var(--font-mono); font-size: 3.5rem; font-weight: 900; letter-spacing: -0.05em; margin-bottom: 20px; color: #fff; }
.loading-bar-frame { width: 100%; height: 2px; background: #222; overflow: hidden; position: relative; }
#loadingFill { 
    position: absolute; left: 0; top: 0; height: 100%; width: 100%; background: var(--tech); 
    transform: translateX(-100%); animation: load-anim 2.5s cubic-bezier(0.2, 0, 0, 1) forwards; 
}
@keyframes load-anim { 0% { transform: translateX(-100%); } 100% { transform: translateX(0%); } }
@keyframes spin { 100% { transform: rotate(360deg); } }
@keyframes pulse { 0%, 100% { transform: scale(0.8); opacity: 0.5; } 50% { transform: scale(1); opacity: 1; } }

/* Layout */
.app-container { display: flex; height: 100vh; padding: 8px; gap: 8px; opacity: 0; transition: opacity 1s; }
.app-container.active { opacity: 1; }
.side-panel { width: 320px; display: flex; flex-direction: column; border: 1px solid var(--border); background: var(--glass); backdrop-filter: blur(20px); }
.main-display { flex: 1; display: flex; flex-direction: column; gap: 8px; position: relative; }

/* Headers */
.panel-header { padding: 10px 15px; border-bottom: 1px solid var(--border); font-size: 0.65rem; font-weight: 700; color: #777; letter-spacing: 0.1em; display: flex; justify-content: space-between; }
.status-ok { color: var(--tech); text-shadow: 0 0 5px rgba(79,255,168,0.4); }
.mono { font-family: var(--font-mono); }
.mono-label { font-family: var(--font-mono); font-size: 0.7rem; color: #888; margin-bottom: 5px; }

/* Bio & Stats */
.bio-tank-module { padding: 15px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.tank-header { font-size: 0.6rem; color: #666; margin-bottom: 8px; text-align: center; }
.tank-outer { height: 80px; width: 30px; border: 1px solid var(--border); position: relative; margin: 0 auto; background: rgba(0,0,0,0.3); overflow: hidden; }
#hydrationFill { position: absolute; bottom: 0; width: 100%; background: #fff; transition: height 1s var(--ease-out); box-shadow: 0 0 15px rgba(255,255,255,0.4); }
.tank-glare { position: absolute; top:0; left:3px; width:2px; height:100%; background: rgba(255,255,255,0.1); }
.tank-marks { position: absolute; right: -40px; top: 0; height: 100%; display: flex; flex-direction: column; justify-content: space-between; font-size: 0.5rem; color: #555; }
.tank-ctrl { display: flex; gap: 5px; margin-top: 10px; justify-content: center; }
.t-btn { background: none; border: 1px solid var(--border); color: #888; padding: 5px 10px; cursor: pointer; font-family: var(--font-mono); font-size: 0.6rem; transition: 0.2s; border-radius: 2px; }
.t-btn:hover { border-color: #fff; color: #fff; background: rgba(255,255,255,0.05); }

/* RPG Stats */
.stats-module { padding: 15px; border-bottom: 1px solid var(--border); }
.stat-row { margin-bottom: 10px; }
.stat-row:last-child { margin-bottom: 0; }
.stat-label { font-size: 0.7rem; color: #aaa; display: flex; justify-content: space-between; margin-bottom: 3px; }
.stat-track { height: 4px; background: #222; border-radius: 2px; overflow: hidden; }
.stat-fill { height: 100%; width: 0%; transition: width 1s ease; }
.color-int { background: var(--int-color); box-shadow: 0 0 8px var(--int-color); }
.color-vit { background: var(--vit-color); box-shadow: 0 0 8px var(--vit-color); }
.color-mnd { background: var(--mnd-color); box-shadow: 0 0 8px var(--mnd-color); }

/* Protocol */
.protocol-scroll { flex: 1; overflow-y: auto; scrollbar-width: none; mask-image: linear-gradient(to bottom, black 90%, transparent); padding: 0; }
.p-item { padding: 12px 15px; border-bottom: 1px solid rgba(255,255,255,0.03); transition: 0.3s; opacity: 0.4; display: flex; gap: 10px; align-items: center; }
.p-item.active { opacity: 1; background: rgba(79, 255, 168, 0.05); border-left: 3px solid var(--tech); padding-left: 12px; }
.p-item.done { opacity: 0.15; }
.p-time { font-size: 0.7rem; color: var(--tech); width: 40px; flex-shrink: 0; font-family: var(--font-mono); }
.p-task { font-size: 0.85rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Cockpit */
.top-nav { height: 44px; border: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; padding: 0 15px; background: var(--glass); }
.clock { font-size: 1.6rem; font-weight: 300; letter-spacing: 0.05em; color: #e0e0e0; }
.t-btn-sm { background: none; border: 1px solid var(--border); color: #666; padding: 2px 6px; cursor: pointer; font-family: var(--font-mono); font-size: 0.6rem; margin-left: 5px; }
.t-btn-sm:hover { color: #fff; border-color: #fff; }

.chamber { flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: center; position: relative; border: 1px solid var(--border); overflow: hidden; background: rgba(10,10,10,0.4); }
#activeTaskName { font-size: 4.5vw; font-weight: 900; line-height: 1.1; text-align: center; color: #fff; z-index: 10; max-width: 90%; font-family: var(--font-ui); }
.tag { font-size: 0.65rem; color: var(--tech); border: 1px solid var(--tech); padding: 3px 8px; display: inline-block; margin-bottom: 15px; font-weight: 700; letter-spacing: 0.1em; }
.time-range { font-size: 1.4rem; color: #666; margin-top: 10px; }
.science-text { margin-top: 15px; font-size: 0.75rem; color: var(--steel); background: rgba(0,0,0,0.5); padding: 5px 15px; border-left: 2px solid var(--tech); max-width: 80%; text-align: center; }

.viz-layer { position: absolute; bottom: 0; left: 0; right: 0; height: 35%; opacity: 0.3; pointer-events: none; z-index: 5; }
#vizCanvas { width: 100%; height: 100%; }
.ring-system { width: 50vh; height: 50vh; position: absolute; z-index: 0; opacity: 0.05; pointer-events: none; }
.ring-track { fill: none; stroke: #444; stroke-width: 0.5; }
.ring-fill { fill: none; stroke: #fff; stroke-width: 1.5; stroke-dasharray: 301.6; stroke-dashoffset: 301.6; transition: 1s linear; }

/* Buttons & Matrix */
.tactical-matrix { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; height: 55px; }
.m-btn { background: rgba(20,20,20,0.6); border: 1px solid var(--border); color: #999; cursor: pointer; transition: 0.2s; font-family: var(--font-mono); font-size: 0.65rem; font-weight: 700; display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden; }
.m-btn:hover { background: #fff; color: #000; border-color: #fff; }
.m-btn.primary { border-color: #fff; color: #fff; font-weight: 900; background: rgba(255,255,255,0.06); }

/* Doomsday & Intel */
.card { border: 1px solid var(--border); padding: 12px; margin-bottom: 8px; background: rgba(255,255,255,0.01); }
.card-label { font-size: 0.6rem; color: #666; display: flex; justify-content: space-between; border-bottom: 1px solid #333; margin-bottom: 8px; padding-bottom: 4px; }

/* Doomsday Specific */
.doomsday-card { cursor: pointer; transition: 0.3s; border-color: rgba(255, 42, 42, 0.3); }
.doomsday-card:hover { border-color: var(--alert); background: rgba(255, 42, 42, 0.05); }
.target-name { font-size: 0.8rem; color: #fff; font-weight: 700; margin-bottom: 5px; }
.countdown { font-size: 1.4rem; color: var(--alert); letter-spacing: 0.05em; font-weight: 700; text-shadow: 0 0 10px rgba(255, 42, 42, 0.4); }
.progress-line { height: 2px; background: #222; margin-top: 5px; }
#countdownBar { height: 100%; width: 100%; background: var(--alert); transition: width 1s linear; }

.fatigue-track { height: 3px; background: #222; margin-top: 8px; }
#fatigueBar { height: 100%; background: var(--tech); width: 0%; box-shadow: 0 0 8px var(--tech); }

.intel-matrix { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; }
.intel-cell { border: 1px solid var(--border); padding: 8px; text-align: center; }
.intel-cell span { font-size: 0.5rem; color: #666; display: block; }
.intel-cell .val { font-size: 1rem; font-weight: 700; margin-top: 2px; font-family: var(--font-mono); }

.terminal-log { height: 100px; font-size: 0.6rem; color: #666; opacity: 1; overflow: hidden; display: flex; flex-direction: column-reverse; line-height: 1.5; font-family: var(--font-mono); }

/* Modals */
.modal-overlay { position: fixed; inset: 0; z-index: 20000; background: rgba(0,0,0,0.85); display: none; align-items: center; justify-content: center; backdrop-filter: blur(8px); }
.modal-card { background: #0b0b0e; border: 1px solid #444; padding: 25px; width: 92%; max-width: 450px; box-shadow: 0 20px 50px rgba(0,0,0,0.8); }
.modal-card h3 { border-bottom: 1px solid #333; padding-bottom: 10px; margin-bottom: 15px; font-size: 0.9rem; color: #fff; letter-spacing: 0.05em; }
.modal-input { width: 100%; background: #111; border: 1px solid #333; color: #fff; padding: 10px; font-family: var(--font-mono); margin-bottom: 15px; font-size: 1rem; }

.btn-stack { display: grid; gap: 8px; }
.m-btn.warning { border-color: var(--alert); color: var(--alert); }
.m-btn.warning:hover { background: var(--alert); color: #000; }

textarea { width: 100%; height: 150px; background: #000; border: 1px solid #333; color: #fff; padding: 10px; font-family: var(--font-ui); font-size: 0.9rem; resize: none; margin-bottom: 10px; }
.btn-full { width: 100%; background: #fff; color: #000; border: none; padding: 12px; font-weight: 900; cursor: pointer; font-family: var(--font-mono); font-size: 0.8rem; }
.history-scroll { max-height: 250px; overflow-y: auto; font-size: 0.7rem; color: #888; }
.hist-item { padding: 8px 0; border-bottom: 1px solid #222; display: flex; justify-content: space-between; }

/* Input & Alerts */
#paletteInput { width: 100%; background: none; border: none; border-bottom: 1px solid #fff; color: #fff; padding: 10px; font-size: 1.5rem; font-family: var(--font-mono); }
#interventionOverlay { position: fixed; inset: 0; z-index: 50000; background: rgba(0,0,0,0.96); display: none; flex-direction: column; align-items: center; justify-content: center; border: 10px solid var(--alert); }
.blood-text { color: var(--alert); font-size: 8vw; font-weight: 900; text-shadow: 0 0 30px var(--alert); margin-bottom: 20px; font-family: var(--font-ui); }
.blink-hint { animation: blink 1s infinite; margin-top: 30px; font-size: 0.9rem; color: #fff; }
@keyframes blink { 50% { opacity: 0; } }

.toast { position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%) translateY(20px); background: #fff; color: #000; padding: 8px 20px; font-weight: 700; font-size: 0.7rem; opacity: 0; transition: 0.4s; pointer-events: none; z-index: 50000; border-radius: 2px; }
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }

.pulse-dot { width: 6px; height: 6px; background: var(--tech); border-radius: 50%; margin-right: 10px; box-shadow: 0 0 10px var(--tech); }
.glitched { position: relative; color: #fff; }
.glitched::before, .glitched::after { content: attr(data-text); position: absolute; inset: 0; background: #050505; }
.glitched::before { left: 2px; text-shadow: -1px 0 #ff00c1; animation: glitch-1 2s infinite linear alternate-reverse; }
.glitched::after { left: -2px; text-shadow: 1px 0 #00fff9; animation: glitch-2 3s infinite linear alternate-reverse; }
@keyframes glitch-1 { 0% { clip-path: inset(20% 0 80% 0); } 20% { clip-path: inset(60% 0 10% 0); } 100% { clip-path: inset(10% 0 50% 0); } }
@keyframes glitch-2 { 0% { clip-path: inset(10% 0 60% 0); } 20% { clip-path: inset(80% 0 5% 0); } 100% { clip-path: inset(30% 0 20% 0); } }