/* ==========================================================================
   AICAP NODE 09 // NEURAL SUBSTRATE EVALUATION TERMINAL (ttyS0)
   CONSOLE DISPLAY DRIVER & PHOSPHOR MATRIX
   ========================================================================== */

:root {
    --term-bg: #090b10;
    --term-bg-pane: #0d1017;
    --term-fg: #d1d7e0;
    --term-fg-dim: #768390;
    --term-accent: #00f0ff;
    --term-prompt: #38bdf8;
    --term-user: #22c55e;
    --term-warning: #f59e0b;
    --term-error: #f43f5e;
    --term-highlight: #ffffff;
    --term-border: #1e2638;
    --term-glow: rgba(0, 240, 255, 0.15);
    --font-mono: 'Courier Prime', 'SF Mono', Monaco, 'Cascadia Code', 'Fira Code', 'DejaVu Sans Mono', monospace;
}

/* Phosphor Color Theme Variations */
body.theme-cyan {
    --term-accent: #00f0ff;
    --term-prompt: #38bdf8;
    --term-glow: rgba(0, 240, 255, 0.15);
}

body.theme-green {
    --term-accent: #22c55e;
    --term-prompt: #4ade80;
    --term-user: #16a34a;
    --term-fg: #bbf7d0;
    --term-glow: rgba(34, 197, 94, 0.18);
}

body.theme-amber {
    --term-accent: #f59e0b;
    --term-prompt: #fbbf24;
    --term-user: #d97706;
    --term-fg: #fef3c7;
    --term-glow: rgba(245, 158, 11, 0.18);
}

body.theme-blood {
    --term-accent: #ef4444;
    --term-prompt: #f87171;
    --term-user: #dc2626;
    --term-fg: #fee2e2;
    --term-glow: rgba(239, 68, 68, 0.2);
}

body.theme-mono {
    --term-accent: #e2e8f0;
    --term-prompt: #cbd5e1;
    --term-user: #94a3b8;
    --term-fg: #f8fafc;
    --term-glow: rgba(255, 255, 255, 0.1);
}

/* Base Reset & Typography */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    width: 100%;
    height: 100%;
    background-color: var(--term-bg);
    color: var(--term-fg);
    font-family: var(--font-mono);
    font-size: 14px;
    line-height: 1.5;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* CRT Scanline Overlay */
.crt-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 999;
    opacity: 0.18;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.35) 0px,
        rgba(0, 0, 0, 0.35) 1px,
        transparent 1px,
        transparent 2px
    );
    transition: opacity 0.3s ease;
}

.crt-overlay.disabled {
    opacity: 0;
}

/* Master Layout */
.terminal-app-container {
    display: flex;
    flex-direction: column;
    width: 100vw;
    height: 100dvh;
    background-color: var(--term-bg);
    position: relative;
    z-index: 10;
}

/* Terminal Chrome / Linux Session Header */
.terminal-titlebar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 36px;
    padding: 0 12px;
    background-color: #0e1219;
    border-bottom: 1px solid var(--term-border);
    user-select: none;
    flex-shrink: 0;
}

.titlebar-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.terminal-app-icon {
    width: 20px;
    height: 20px;
    background: rgba(0, 240, 255, 0.12);
    border: 1px solid rgba(0, 240, 255, 0.35);
    border-radius: 3px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
    color: var(--term-accent);
    box-shadow: 0 0 6px rgba(0, 240, 255, 0.18);
}

.window-title {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.3px;
    color: var(--term-fg-dim);
    display: flex;
    align-items: center;
    gap: 6px;
}

.window-app-name {
    color: var(--term-fg);
    font-weight: 700;
}

.window-title .host-badge {
    color: var(--term-accent);
    font-weight: 600;
}

/* Web Terminal Session Controls & Badges */
.linux-window-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.tty-param {
    color: var(--term-fg-dim);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.5px;
    padding: 2px 6px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 2px;
}

.win-btn {
    width: 26px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 3px;
    color: var(--term-fg-dim);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.15s ease;
    padding: 0;
    outline: none;
}

.win-btn:hover {
    background: rgba(255, 255, 255, 0.14);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.25);
}

.window-status {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 11px;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 8px;
    border-radius: 4px;
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
    font-weight: 600;
    letter-spacing: 0.5px;
}

.status-beacon {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: #ef4444;
    box-shadow: 0 0 6px #ef4444;
    animation: beaconPulse 1.8s infinite;
}

.audio-indicator {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--term-fg-dim);
    font-size: 11px;
}

.audio-indicator.active {
    color: var(--term-accent);
}

/* Terminal Viewport / Scrollback */
.terminal-viewport {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    cursor: text;
    scrollbar-width: thin;
    scrollbar-color: var(--term-border) var(--term-bg);
}

.terminal-viewport::-webkit-scrollbar {
    width: 6px;
}

.terminal-viewport::-webkit-scrollbar-track {
    background: var(--term-bg);
}

.terminal-viewport::-webkit-scrollbar-thumb {
    background: var(--term-border);
    border-radius: 3px;
}

/* ASCII Logo & Banner */
.ascii-banner {
    font-family: var(--font-mono);
    color: var(--term-accent);
    font-size: clamp(6.5px, 1.25vw, 13px);
    line-height: 1.15;
    white-space: pre;
    user-select: none;
    text-shadow: 0 0 8px var(--term-glow);
    margin-bottom: 12px;
    overflow-x: auto;
}

.motd-header {
    border-left: 2px solid var(--term-accent);
    padding-left: 12px;
    margin-bottom: 16px;
    color: var(--term-fg);
}

.motd-header .line-warning {
    color: var(--term-warning);
    font-weight: 700;
}

.motd-header .line-dim {
    color: var(--term-fg-dim);
}

.motd-header .line-accent {
    color: var(--term-accent);
}

/* Log Streams & Command Entries */
.term-row {
    word-break: break-word;
    white-space: pre-wrap;
    line-height: 1.4;
}

.term-cmd-row {
    margin-top: 4px;
    color: var(--term-highlight);
    font-weight: 600;
}

.term-output-row {
    color: var(--term-fg);
    margin: 1px 0;
}

.term-output-row.accent {
    color: var(--term-accent);
}

.term-output-row.dim {
    color: var(--term-fg-dim);
}

.term-output-row.warning {
    color: var(--term-warning);
}

.term-output-row.error {
    color: var(--term-error);
}

.term-output-row.success {
    color: #4ade80;
}

/* Linux Prompt Elements */
.term-prompt-block {
    display: flex;
    flex-direction: column;
    gap: 1px;
    margin-top: 4px;
}

.prompt-topline {
    display: flex;
    align-items: center;
    font-size: 13px;
    line-height: 1.35;
    user-select: none;
}

.prompt-tree {
    color: var(--term-accent);
    font-weight: 700;
}

.prompt-user {
    color: var(--term-user);
    font-weight: 700;
}

.prompt-path {
    color: #ffffff;
    font-weight: 700;
}

.prompt-bottomline {
    display: flex;
    align-items: center;
    position: relative;
    font-size: 14px;
    line-height: 1.35;
}

.prompt-char {
    color: var(--term-accent);
    font-weight: 700;
    margin-right: 8px;
    user-select: none;
}

.cmd-echo {
    color: var(--term-highlight);
    font-weight: 600;
}

/* Interactive Input Line */
.terminal-input-line {
    display: flex;
    flex-direction: column;
    gap: 1px;
    position: relative;
    margin-top: 4px;
    line-height: 1.35;
}

.cli-input-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    position: relative;
}

.cli-input-display {
    color: var(--term-highlight);
    font-weight: 600;
    white-space: pre;
    min-height: 1.5em;
    display: inline-flex;
    align-items: center;
}

.cli-cursor {
    display: inline-block;
    width: 8px;
    height: 1.2em;
    background-color: var(--term-accent);
    margin-left: 1px;
    box-shadow: 0 0 6px var(--term-accent);
    animation: cursorBlink 1s step-end infinite;
}

/* Hidden Native Input */
.native-term-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.01;
    background: transparent;
    border: none;
    outline: none;
    color: transparent;
    cursor: default;
    caret-color: transparent;
    z-index: 5;
    font-size: 16px; /* Prevents auto-zoom on iOS */
}

/* Bottom Bar / Hardware TTY Chassis Bezel */
.site-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 38px;
    padding: 0 16px;
    background-color: var(--term-bg-pane);
    border-top: 1px solid var(--term-border);
    font-size: 11px;
    color: var(--term-fg-dim);
    user-select: none;
    flex-shrink: 0;
    gap: 12px;
}

.footer-status-tag {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    color: var(--term-accent);
    white-space: nowrap;
}

.footer-links {
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.footer-links a {
    color: var(--term-fg-dim);
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-links a:hover,
.footer-links a:focus-visible {
    color: var(--term-accent);
    text-decoration: underline;
}

.footer-credits {
    font-size: 10px;
    color: var(--term-fg-dim);
    opacity: 0.8;
    white-space: nowrap;
}

/* Fullscreen Matrix Rain Canvas */
#matrix-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 50;
    display: none;
    background-color: rgba(0, 0, 0, 0.94);
}

#matrix-canvas.active {
    display: block;
}

/* Modal YouTube Video Player */
.term-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(9, 11, 16, 0.88);
    backdrop-filter: blur(4px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.term-modal-backdrop.open {
    opacity: 1;
    pointer-events: auto;
}

.term-modal-window {
    width: 90%;
    max-width: 820px;
    background: var(--term-bg-pane);
    border: 1px solid var(--term-accent);
    box-shadow: 0 0 24px var(--term-glow);
    border-radius: 6px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.term-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 14px;
    border-bottom: 1px solid var(--term-border);
    font-size: 12px;
    font-weight: 700;
    color: var(--term-accent);
}

.term-modal-close {
    background: none;
    border: none;
    color: var(--term-fg-dim);
    cursor: pointer;
    font-family: var(--font-mono);
    font-size: 14px;
    padding: 2px 6px;
}

.term-modal-close:hover {
    color: var(--term-error);
}

.term-video-frame {
    aspect-ratio: 16 / 9;
    width: 100%;
    border: none;
}

/* Animations */
@keyframes cursorBlink {
    0%, 49% { opacity: 1; }
    50%, 100% { opacity: 0; }
}

@keyframes beaconPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.85); }
}

/* Responsive Breakpoints */
@media (max-width: 768px) {
    .terminal-titlebar {
        padding: 0 10px;
    }
    
    .window-title {
        font-size: 10px;
    }
    
    .terminal-viewport {
        padding: 12px 14px;
    }
    
    .site-footer {
        flex-direction: column;
        height: auto;
        padding: 8px 10px;
        gap: 6px;
        text-align: center;
    }
    
    .footer-credits {
        display: none;
    }
}

/* ==========================================================================
   MUD ADVENTURE GAME // STATIC CHAMBER MONITOR & HUD ENGINE
   ========================================================================== */

/* Session Anchor & Viewport Active Mode when Playing */
.mud-session-start {
    height: 0;
    margin: 0;
    padding: 0;
    border: none;
    visibility: hidden;
}

.terminal-viewport.mud-active {
    padding-bottom: 75vh;
}

/* Playing Mode Titlebar & Prompt Accents */
.mud-playing .terminal-titlebar .status-pill {
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.5);
}

.mud-playing .terminal-titlebar .status-beacon {
    background-color: #fbbf24;
    box-shadow: 0 0 8px #fbbf24;
}

.mud-playing #terminal-input-line .prompt-user {
    color: #fbbf24;
    font-weight: 700;
    text-shadow: 0 0 8px rgba(251, 191, 36, 0.35);
}

.mud-playing #terminal-input-line .prompt-path {
    color: #38bdf8;
    font-weight: 600;
}

/* Static Chamber Monitor Panel (In-place, non-scrolling room display) */
.mud-static-panel {
    position: sticky;
    top: -16px;
    z-index: 35;
    background: linear-gradient(180deg, #0e172a 0%, #080c18 100%);
    backdrop-filter: blur(12px);
    border: 1.5px solid #f59e0b;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.95), 0 0 24px rgba(245, 158, 11, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    padding: 14px 18px;
    margin-bottom: 14px;
    margin-right: 384px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-family: var(--font-mono);
    user-select: text;
    transition: all 0.25s ease;
}

.mud-static-panel.hidden {
    display: none !important;
}

.mud-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(90deg, rgba(245, 158, 11, 0.18) 0%, rgba(245, 158, 11, 0.04) 100%);
    border-bottom: 1.5px solid rgba(245, 158, 11, 0.35);
    padding: 8px 14px;
    margin: -14px -18px 6px -18px;
    border-radius: 6px 6px 0 0;
}

.mud-panel-title {
    font-size: 13px;
    font-weight: 800;
    color: #fbbf24;
    letter-spacing: 0.8px;
    display: flex;
    align-items: center;
    gap: 8px;
    text-shadow: 0 0 10px rgba(251, 191, 36, 0.4);
}

.mud-panel-icon {
    font-size: 14px;
}

.mud-panel-badge {
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 800;
    letter-spacing: 0.6px;
}

.mud-panel-badge.locked {
    background: rgba(239, 68, 68, 0.22);
    color: #fca5a5;
    border: 1px solid #ef4444;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.3);
}

.mud-panel-badge.solved {
    background: rgba(34, 197, 94, 0.22);
    color: #86efac;
    border: 1px solid #22c55e;
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.3);
}

.mud-panel-desc {
    color: #f1f5f9;
    font-size: 13px;
    line-height: 1.55;
}

.mud-panel-meta {
    display: flex;
    flex-direction: column;
    gap: 5px;
    font-size: 12px;
    background: rgba(0, 0, 0, 0.6);
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid rgba(245, 158, 11, 0.25);
}

.mud-meta-line {
    display: flex;
    gap: 8px;
}

.mud-meta-label {
    color: #fbbf24;
    min-width: 100px;
    font-weight: 700;
}

.mud-meta-exits {
    color: #38bdf8;
    font-weight: 700;
}

.mud-meta-routes {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    margin-top: 2px;
}

.mud-route-tag {
    font-size: 10px;
    padding: 2px 7px;
    border-radius: 4px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.mud-route-tag.open {
    background: rgba(34, 197, 94, 0.2);
    color: #86efac;
    border: 1px solid rgba(34, 197, 94, 0.5);
}

.mud-route-tag.locked {
    background: rgba(249, 115, 22, 0.16);
    color: #ffedd5;
    border: 1px solid rgba(249, 115, 22, 0.6);
}

.mud-route-tag.locked .route-status-part {
    color: #fcd34d;
    font-weight: 700;
}

.mud-meta-items {
    color: #34d399;
    font-weight: 700;
}

.mud-panel-guidance {
    border-top: none;
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 8px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
}

.mud-guide-heading {
    color: #fbbf24;
    font-weight: 800;
    font-size: 11px;
    letter-spacing: 0.8px;
    margin-bottom: 2px;
}

.mud-guide-row {
    display: flex;
    gap: 8px;
}

.mud-guide-tag {
    color: #94a3b8;
    min-width: 125px;
    font-weight: 700;
}

.mud-guide-movement {
    color: #38bdf8;
    font-weight: 600;
}

.mud-guide-actions {
    color: #e2e8f0;
}

.mud-guide-items {
    color: #c084fc;
    font-weight: 600;
}

.mud-hud-frame {
    position: absolute;
    top: 48px;
    right: 24px;
    width: 360px;
    max-width: calc(100vw - 48px);
    background: #070a12;
    border: 1.5px solid #f59e0b;
    box-shadow: 0 10px 36px rgba(0, 0, 0, 0.9), 0 0 20px rgba(245, 158, 11, 0.25);
    border-radius: 8px;
    z-index: 40;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    user-select: none;
}

.mud-hud-frame.hidden {
    display: none !important;
}

.mud-hud-frame.collapsed .mud-hud-body,
.mud-hud-frame.minimized .mud-hud-body {
    display: none !important;
}

.mud-hud-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 12px;
    background: #0f172a;
    border-bottom: 1.5px solid rgba(245, 158, 11, 0.35);
    font-size: 11px;
    font-weight: 700;
}

.mud-hud-title {
    color: #fbbf24;
    letter-spacing: 0.8px;
    font-weight: 800;
}

.mud-hud-badge {
    color: #94a3b8;
    font-size: 10px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 180px;
    font-weight: 600;
}

.mud-hud-btn {
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.45);
    color: #fbbf24;
    font-family: inherit;
    font-size: 9px;
    font-weight: 700;
    cursor: pointer;
    padding: 2px 7px;
    border-radius: 3px;
    margin-right: 4px;
    letter-spacing: 0.5px;
    transition: all 0.2s ease;
}

.mud-hud-btn:hover {
    background: #f59e0b;
    color: #000;
}

.mud-hud-toggle {
    background: transparent;
    border: none;
    color: var(--term-fg-dim);
    font-family: inherit;
    font-size: 12px;
    cursor: pointer;
    padding: 0 4px;
}

.mud-hud-toggle:hover {
    color: var(--term-accent);
}

.mud-hud-navmap {
    width: 100%;
    height: 202px;
    display: flex;
    flex-direction: column;
    padding: 8px 12px;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 240, 255, 0.03) 0px,
        rgba(0, 240, 255, 0.03) 1px,
        transparent 1px,
        transparent 4px
    ), radial-gradient(circle at center, rgba(10, 25, 47, 0.95) 0%, rgba(4, 7, 13, 0.98) 100%);
    overflow-y: auto;
    gap: 6px;
    box-sizing: border-box;
    font-family: var(--font-mono);
}

.mud-navmap-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(0, 240, 255, 0.25);
    padding-bottom: 4px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: var(--term-accent);
}

.navmap-hud-loc {
    color: var(--term-warning);
}

.mud-navmap-routes {
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 1;
    justify-content: center;
}

.navmap-route-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 11px;
    transition: all 0.3s ease;
}

.navmap-route-row.open {
    border-color: rgba(34, 197, 94, 0.4);
    background: rgba(34, 197, 94, 0.06);
}

.navmap-route-row.locked {
    border-color: rgba(249, 115, 22, 0.4);
    background: rgba(249, 115, 22, 0.06);
}

.nav-dir-tag {
    font-weight: 700;
    width: 48px;
    color: var(--term-fg);
    font-size: 10px;
}

.navmap-route-row.open .nav-dir-tag {
    color: var(--term-accent);
}

.nav-route-vector {
    font-family: monospace;
    font-weight: bold;
    font-size: 11px;
    letter-spacing: -1px;
}

.navmap-route-row.open .nav-route-vector {
    color: #4ade80;
    text-shadow: 0 0 6px rgba(74, 222, 128, 0.6);
}

.navmap-route-row.locked .nav-route-vector {
    color: #fb923c;
}

.nav-dest-node {
    flex: 1;
    margin: 0 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 11px;
    color: var(--term-fg);
}

.nav-status-badge {
    font-size: 9px;
    padding: 1px 6px;
    border-radius: 3px;
    font-weight: 700;
    white-space: nowrap;
}

.nav-status-badge.open {
    background: rgba(34, 197, 94, 0.2);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.5);
}

.nav-status-badge.locked {
    background: rgba(249, 115, 22, 0.16);
    color: #fcd34d;
    border: 1px solid rgba(249, 115, 22, 0.5);
}

.route-unlocked-pulse {
    animation: routeGlow 1.2s ease-in-out infinite alternate;
}

@keyframes routeGlow {
    from { box-shadow: 0 0 4px rgba(74, 222, 128, 0.3); border-color: rgba(74, 222, 128, 0.5); }
    to { box-shadow: 0 0 14px rgba(74, 222, 128, 0.9); border-color: rgba(74, 222, 128, 1); }
}

.mud-hud-body {
    width: 100%;
    min-height: 202px;
    height: 202px;
    background: #04070d;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.mud-hud-img {
    width: 100%;
    height: 202px;
    object-fit: cover;
    display: block;
    transition: opacity 0.25s ease;
}

.mud-hud-compass {
    width: 100%;
    height: 202px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 240, 255, 0.03) 0px,
        rgba(0, 240, 255, 0.03) 1px,
        transparent 1px,
        transparent 4px
    );
}

.compass-ring {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 700;
}

.compass-mid {
    display: flex;
    align-items: center;
    gap: 16px;
}

.c-node {
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--term-border);
    border-radius: 3px;
    color: var(--term-fg-dim);
}

.c-node.open {
    color: var(--term-accent);
    border-color: var(--term-accent);
    box-shadow: 0 0 6px var(--term-glow);
}

.c-center {
    font-size: 10px;
    color: var(--term-warning);
}

/* Victory Fireworks Canvas */
.mud-victory-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 998;
    display: none;
}

.mud-victory-canvas.active {
    display: block;
}

/* Death Animations */
.term-death-shake {
    animation: deathShake 0.6s cubic-bezier(.36,.07,.19,.97) both;
}

.term-death-flash {
    animation: deathFlash 0.9s ease-out;
}

@keyframes deathShake {
    10%, 90% { transform: translate3d(-3px, 0, 0); }
    20%, 80% { transform: translate3d(5px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-6px, 0, 0); }
    40%, 60% { transform: translate3d(6px, 0, 0); }
}

@keyframes deathFlash {
    0% { background-color: rgba(239, 68, 68, 0.4); }
    50% { background-color: rgba(239, 68, 68, 0.15); }
    100% { background-color: transparent; }
}

@media (max-width: 900px) {
    .mud-static-panel {
        margin-right: 280px;
        padding: 10px 14px;
        font-size: 12px;
    }
    .mud-hud-frame {
        width: 260px;
        top: 42px;
        right: 16px;
    }
    .mud-hud-body, .mud-hud-img, .mud-hud-compass {
        min-height: 146px;
        height: 146px;
    }
    .mud-hud-badge {
        max-width: 130px;
    }
}

@media (max-width: 600px) {
    .mud-static-panel {
        margin-right: 0;
        margin-bottom: 8px;
        padding: 8px 10px;
        font-size: 11px;
    }
    .mud-hud-frame {
        width: 180px;
        top: 40px;
        right: 10px;
    }
    .mud-hud-body, .mud-hud-img, .mud-hud-compass {
        min-height: 101px;
        height: 101px;
    }
    .mud-hud-badge {
        max-width: 80px;
        font-size: 8px;
    }
}

