/* --- game.css (Marvel Multiverse RPG Version) --- */
/* Adapted for Marvel Theme from a "Real Life / GoT" base */
/* Focus: Heroic, Tech, Cosmic aesthetics */

/* --- Root Variables (Marvel Theme) --- */
:root {
    /* Core Palette - Heroic, Tech, Cosmic */
    --marvel-bg-deep: #0c101c; /* Deep space blue/purple-black */
    --marvel-bg-primary: #141a2d; /* Dark metallic blue or tech panel */
    --marvel-bg-secondary: #1f2a40; /* Slightly lighter, muted blue/gray */
    --marvel-bg-content: #2c3a58; /* Interface panel, off-black */
    --marvel-bg-input: #101420; /* Dark, slightly transparent input */
    --marvel-bg-hover: rgba(70, 130, 250, 0.15); /* Electric blue/energy highlight */
    --marvel-bg-selected: rgba(80, 150, 255, 0.25); /* Selection highlight */
    --marvel-bg-gradient-header: linear-gradient(to bottom, rgba(20, 26, 45, 0.98), rgba(20, 26, 45, 0.85));
    --marvel-bg-gradient-footer: linear-gradient(to top, rgba(12, 16, 28, 0.95), rgba(12, 16, 28, 0.8));
    --marvel-bg-gradient-sidebar: linear-gradient(170deg, var(--marvel-bg-secondary), #303c5c);

    /* Text Palette */
    --marvel-text-primary: #e0e8ff; /* Crisp light cyan/white */
    --marvel-text-secondary: #a0b0d0; /* Medium tech gray/blue */
    --marvel-text-muted: #7080a0; /* Darker muted gray */
    --marvel-text-link: #60a5fa; /* Electric/Stark Tower blue */
    --marvel-text-link-hover: #90c8ff; /* Brighter version */
    --marvel-text-highlight: #facc15; /* Stark Gold/Energy yellow */
    --marvel-text-error: #ff4d4d; /* Danger Red */
    --marvel-text-success: #42f5b0; /* Success Green/Tech Green */

    /* Accents (Hero/Tech Influenced) */
    --marvel-accent-red: #e62429; /* Spider-Man/Iron Man Red */
    --marvel-accent-red-hover: #ff474c;
    --marvel-accent-blue: #007bff; /* Captain America Blue */
    --marvel-accent-blue-hover: #3395ff;
    --marvel-accent-gold: #f8c000; /* Iron Man Gold / Thor's Lightning */
    --marvel-accent-gold-hover: #ffd733;
    --marvel-accent-green: #28a745; /* Hulk Green */
    --marvel-accent-green-hover: #34c759;
    --marvel-accent-purple: #8a2be2; /* Cosmic Power Purple */
    --marvel-accent-purple-hover: #9d4edd;
    --marvel-accent-silver: #c0c0c0; /* Tech Silver/Chrome */
    --marvel-accent-cyan: #00e0e0; /* Energy/Hologram Cyan */

    /* Borders */
    --marvel-border-primary: #303f60; /* Dark tech panel edges */
    --marvel-border-secondary: #4a5a80; /* Lighter tech panel edges */
    --marvel-border-accent: var(--marvel-accent-cyan); /* Focus highlight border */
    --marvel-border-modal: var(--marvel-border-secondary); /* Border for modal components */

    /* Scrollbar */
    --marvel-scroll-track: rgba(12, 16, 28, 0.7); /* Dark transparent track */
    --marvel-scroll-thumb: #3a4a6b;
    --marvel-scroll-thumb-hover: #506680;

    /* Shadows */
    --shadow-color-base-marvel: rgba(0, 10, 30, 0.6); /* Dark blue tint shadow */
    --shadow-color-highlight-marvel: rgba(0, 224, 224, 0.4); /* Cyan glow for focus */
    --shadow-sm-marvel: 0 2px 4px var(--shadow-color-base-marvel);
    --shadow-md-marvel: 0 5px 12px var(--shadow-color-base-marvel);
    --shadow-lg-marvel: 0 10px 30px var(--shadow-color-base-marvel);
    --shadow-inset-marvel: inset 0 1px 4px rgba(0,0,0,0.5);
    --shadow-focus-marvel: 0 0 0 3px var(--shadow-color-highlight-marvel);
    --shadow-text-marvel: 0 1px 3px rgba(0, 0, 0, 0.7);

    /* Fonts */
    --font-primary-text-marvel: 'Roboto', 'Open Sans', sans-serif; /* Clean and modern */
    --font-ui-marvel: 'Lato', 'Helvetica Neue', Helvetica, Arial, sans-serif; /* Slightly more stylized UI */
    --font-title-marvel: 'Bebas Neue', 'Impact', sans-serif; /* Heroic title font */
    --font-accent-marvel: 'Orbitron', sans-serif; /* Futuristic/Tech accent font */

    /* Sizes */
    --header-height-marvel: 65px;
    --footer-height-marvel: auto; /* Let content define height, min 70px */
    --min-footer-height-marvel: 70px;
    --sidebar-width-marvel: 300px;
    --utility-sidebar-width-marvel: 280px;
    --container-padding-marvel: 1.5rem; /* ~24px */

    /* Animations & Radius */
    --transition-fast-marvel: 0.2s ease-out;
    --transition-med-marvel: 0.3s ease-out;
    --transition-smooth-marvel: 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    --transition-bounce-marvel: 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);

    --radius-sm-marvel: 4px; /* Slightly sharper edges for tech look */
    --radius-md-marvel: 8px;
    --radius-lg-marvel: 12px;
    --radius-xl-marvel: 16px;
    --radius-full-marvel: 50%;

    /* Z-Index */
    --z-base: 1;
    --z-content: 10;
    --z-sticky: 100;
    --z-modal-backdrop: 990;
    --z-sidebar: 995; /* Mobile sidebar */
    --z-modal: 1000;
    --z-overlay: 1050; /* Loading/Error */
    --z-header: 500;
    --z-footer: 500;

    /* Hero Health (Durability) Colors */
    --marvel-health-good: var(--marvel-accent-green);
    --marvel-health-medium: var(--marvel-accent-gold);
    --marvel-health-low: var(--marvel-accent-red);

    /* Message Backgrounds */
    --marvel-msg-ai-bg: rgba(31, 42, 64, 0.9); /* Slightly transparent blue/gray panel */
    --marvel-msg-user-bg: rgba(44, 58, 88, 0.92); /* Darker, hero-themed panel */
    --marvel-msg-sys-bg: rgba(12, 16, 28, 0.75); /* Neutral, very dark info panel */

    /* Tech BG Pattern */
    --bg-tech-pattern-marvel: url("data:image/svg+xml,%3Csvg width='52' height='26' viewBox='0 0 52 26' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill-rule='evenodd'%3E%3Cg fill='%231a2338' fill-opacity='0.2'%3E%3Cpath d='M10 10c0-2.21-1.79-4-4-4-3.314 0-6-2.686-6-6h2c0 2.21 1.79 4 4 4 3.314 0 6 2.686 6 6 0 2.21 1.79 4 4 4 3.314 0 6 2.686 6 6 0 2.21 1.79 4 4 4v2c-3.314 0-6-2.686-6-6 0-2.21-1.79-4-4-4-3.314 0-6-2.686-6-6zm25.464-1.95l8.486 8.486-1.414 1.414-8.486-8.486 1.414-1.414z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");

    /* Comm Network Colors */
    --comm-bg-main: var(--marvel-bg-content);
    --comm-text-primary: var(--marvel-text-primary);
    --comm-text-secondary: var(--marvel-text-secondary);
    --comm-border-light: var(--marvel-border-primary);
    --comm-selected-bg: var(--marvel-accent-blue-hover);
    --comm-selected-text: #fff;
    --comm-button-primary-bg: var(--marvel-accent-blue);
    --comm-button-primary-text: #fff;
    --comm-unread-text: var(--marvel-accent-cyan);
    --comm-unread-bg-hover: rgba(0, 224, 224, 0.1);
}


/* --- Base Styles --- */
html {
    box-sizing: border-box;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

*, *:before, *:after {
    box-sizing: inherit;
    margin: 0;
    padding: 0;
    border: 0;
    font-size: 100%;
    font: inherit;
    vertical-align: baseline;
}

body.marvel-theme {
    font-family: var(--font-ui-marvel);
    line-height: 1.6;
    color: var(--marvel-text-primary);
    background-color: var(--marvel-bg-deep);
    background-image: var(--bg-tech-pattern-marvel), linear-gradient(to bottom right, var(--marvel-bg-deep), #080a14);
    background-attachment: fixed, fixed;
    min-height: 100vh;
    overflow: hidden;
    display: flex;
    position: relative;
}

body.marvel-theme.modal-open {
    /* overflow: hidden; // Handled by modal logic now */
}

button { background: none; border: none; color: inherit; font: inherit; cursor: pointer; }
input, textarea, select { font-family: var(--font-ui-marvel); color: var(--marvel-text-primary); background-color: transparent; }
ul, ol { list-style: none; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--marvel-text-link); text-decoration: none; transition: color var(--transition-fast-marvel); }
a:hover { color: var(--marvel-text-link-hover); }
strong { font-weight: 700; color: var(--marvel-text-highlight); } /* Bolder for heroic emphasis */
em { font-style: italic; color: var(--marvel-text-secondary); }
h1, h2, h3, h4, h5, h6 { font-weight: 600; line-height: 1.3; margin-bottom: 0.75em; }

.marvel-theme h1,
.marvel-theme #game-title,
.marvel-theme h2,
.marvel-theme h3
{
    font-family: var(--font-title-marvel);
    color: var(--marvel-text-primary);
    letter-spacing: 1px; /* More spacing for impactful titles */
    text-shadow: var(--shadow-text-marvel);
}
.marvel-theme h2 { font-size: 1.75rem; } /* Larger H2 */
.marvel-theme h3 { font-size: 1.35rem; color: var(--marvel-text-secondary); font-family: var(--font-accent-marvel);}
.marvel-theme h4 {
    font-family: var(--font-ui-marvel);
    font-size: 0.8rem;
    font-weight: 700; /* Bolder h4 */
    text-transform: uppercase;
    letter-spacing: 1.3px;
    color: var(--marvel-text-secondary);
    margin-bottom: 0.8em;
    border-bottom: 1px solid var(--marvel-border-secondary);
    padding-bottom: 0.4rem;
}

/* --- Scrollbar Styling --- */
body.marvel-theme ::-webkit-scrollbar { width: 10px; height: 10px; } /* Slightly wider for easier click */
body.marvel-theme ::-webkit-scrollbar-track { background: var(--marvel-scroll-track); border-radius: 4px; }
body.marvel-theme ::-webkit-scrollbar-thumb { background: var(--marvel-scroll-thumb); border-radius: 4px; border: 1px solid var(--marvel-scroll-track); }
body.marvel-theme ::-webkit-scrollbar-thumb:hover { background: var(--marvel-scroll-thumb-hover); }
body.marvel-theme ::-webkit-scrollbar-corner { background: transparent; }
body.marvel-theme { scrollbar-width: thin; scrollbar-color: var(--marvel-scroll-thumb) var(--marvel-scroll-track); }

.scrollable-area {
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-gutter: stable both-edges;
    position: relative;
    z-index: 1;
}

/* --- Main Game Layout --- */
#game-screen { display: flex; flex-direction: column; height: 100vh; width: 100%; background-color: var(--marvel-bg-primary); }
#game-main-content {
    flex-grow: 1; display: grid;
    grid-template-columns: [sidebar-start] var(--sidebar-width-marvel) [sidebar-end chat-start] 1fr [chat-end utils-start] var(--utility-sidebar-width-marvel) [utils-end];
    gap: var(--container-padding-marvel);
    padding: var(--container-padding-marvel);
    padding-top: 0; overflow: hidden;
}

#character-sidebar, #utility-sidebar, #chat-area {
    max-height: calc(100vh - var(--header-height-marvel) - var(--min-footer-height-marvel) - var(--container-padding-marvel) * 1.5);
    min-height: 300px; overflow: hidden; display: flex; flex-direction: column;
    border-radius: var(--radius-md-marvel);
    border: 1px solid var(--marvel-border-primary);
}
#character-sidebar, #utility-sidebar { background: var(--marvel-bg-gradient-sidebar); box-shadow: var(--shadow-md-marvel); }
#chat-area { background-color: rgba(20, 26, 45, 0.9); border: 1px solid var(--marvel-border-secondary); box-shadow: var(--shadow-inset-marvel), var(--shadow-sm-marvel); display: flex; flex-direction: column; }

#character-sidebar .sidebar-content,
#utility-sidebar .sidebar-content {
    padding: calc(var(--container-padding-marvel) * 0.9);
    flex-grow: 1;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-gutter: stable both-edges;
}

/* Chat Log Area */
#chat-log.marvel-chat-log {
    flex-grow: 1;
    overflow-y: auto;
    overflow-x: hidden;
    scroll-behavior: smooth;
    padding: var(--container-padding-marvel);
    background-image: var(--bg-tech-pattern-marvel);
    position: relative;
    scrollbar-gutter: stable both-edges;
 }

/* --- Header --- */
#game-header {
    height: var(--header-height-marvel); flex-shrink: 0; display: flex; align-items: center;
    padding: 0 var(--container-padding-marvel); background: var(--marvel-bg-primary);
    border-bottom: 1px solid var(--marvel-border-primary);
    position: relative; z-index: var(--z-header); box-shadow: 0 3px 10px rgba(0,0,0,0.4);
}
.game-header-content { width: 100%; max-width: 2560px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
#game-title { font-size: 1.8rem; font-weight: 700; font-family: var(--font-title-marvel); color: var(--marvel-text-primary); white-space: nowrap; display: flex; align-items: center; gap: 0.7rem; margin: 0; cursor: default; transition: color var(--transition-med-marvel); }
#game-title:hover { color: var(--marvel-accent-gold); text-shadow: 0 0 10px var(--marvel-accent-gold); }
#game-title::before {
    content: '🌌'; /* Cosmic/Marvel icon */
    font-size: 1.6em; display: inline-block; transition: transform var(--transition-smooth-marvel), filter var(--transition-med-marvel);
    filter: saturate(150%);
}
#game-title:hover::before { transform: scale(1.15) rotate(-7deg); filter: saturate(200%) drop-shadow(0 0 5px var(--marvel-accent-cyan)); }
.header-info-cluster { display: flex; align-items: center; gap: 1.3rem; position: absolute; left: 50%; transform: translateX(-50%); }
.header-info-block { display: flex; align-items: center; gap: 0.5rem; color: var(--marvel-text-secondary); font-size: 0.85rem; background-color: rgba(0,0,0,0.25); padding: 0.4rem 1rem; border-radius: var(--radius-md-marvel); border: 1px solid var(--marvel-border-primary); cursor: default; transition: background-color var(--transition-fast-marvel), border-color var(--transition-fast-marvel); }
.header-info-block:hover { background-color: var(--marvel-bg-content); border-color: var(--marvel-border-secondary); }
.header-info-block .info-icon-emoji { opacity: 0.7; font-size: 1.15em; }
.header-info-block .info-value { color: var(--marvel-text-primary); font-weight: 600; }
#game-header .controls { display: flex; align-items: center; gap: 0.7rem; }
#exit-game-btn { width: 38px; height: 38px; padding: 0; font-size: 1.3rem; border-radius: var(--radius-sm-marvel); line-height: 1; background: none; border: none; transition: color var(--transition-med-marvel), background-color var(--transition-med-marvel), box-shadow var(--transition-med-marvel); color: var(--marvel-text-secondary); }
#exit-game-btn:hover { background-color: rgba(230, 36, 41, 0.2); color: var(--marvel-accent-red); box-shadow: 0 0 10px rgba(230, 36, 41, 0.5); }
#exit-game-btn:active { background-color: rgba(230, 36, 41, 0.35); box-shadow: inset 0 1px 3px rgba(0,0,0,0.5); }
.mobile-toggle-button { display: none; }


/* --- Footer / Input Area --- */
#input-area {
    flex-shrink: 0; padding: calc(var(--container-padding-marvel) / 1.5) var(--container-padding-marvel);
    background: var(--marvel-bg-gradient-footer); border-top: 1px solid var(--marvel-border-primary);
    position: relative; z-index: var(--z-footer); backdrop-filter: blur(5px); min-height: var(--min-footer-height-marvel);
}
.input-container { display: flex; align-items: flex-end; gap: 0.7rem; max-width: 2560px; margin: 0 auto; }
#player-input {
    flex-grow: 1; background-color: var(--marvel-bg-input); color: var(--marvel-text-primary);
    border: 1px solid var(--marvel-border-primary); border-radius: var(--radius-md-marvel); padding: 0.75rem 1.1rem;
    font-family: var(--font-primary-text-marvel); font-size: 1.05rem; line-height: 1.55; resize: none;
    min-height: 48px; max-height: 190px; overflow-y: auto;
    transition: border-color var(--transition-fast-marvel), box-shadow var(--transition-fast-marvel), background-color var(--transition-fast-marvel);
    box-shadow: var(--shadow-inset-marvel); scrollbar-gutter: stable both-edges;
}
#player-input:focus { outline: none; border-color: var(--marvel-border-accent); box-shadow: var(--shadow-focus-marvel), var(--shadow-inset-marvel); background-color: #1a1e2c; }
#player-input::placeholder { color: var(--marvel-text-muted); font-style: italic; opacity: 0.8; }
#send-button {
    flex-shrink: 0; height: 48px; width: 48px; font-size: 1.7rem;
    padding: 0; line-height: 1; border-radius: var(--radius-md-marvel);
}
#send-button .btn-icon-emoji { line-height: 1; display: block; text-align: center; transition: transform 0.2s ease-in-out;}
#send-button:hover:not(:disabled) .btn-icon-emoji {transform: scale(1.1) rotate(-5deg);}


/* --- Character Sidebar (Left) - Marvel Adaptation --- */
#character-sidebar .sidebar-content { display: flex; flex-direction: column; gap: 1.6rem; } /* Increased gap */
#hero-profile-top { display: flex; flex-direction: column; align-items: center; gap: 0.9rem; padding-bottom: 1.2rem; border-bottom: 1px solid var(--marvel-border-primary); }
#hero-avatar-area { /* Larger Avatar */
    width: 100px; height: 100px; border-radius: var(--radius-full-marvel); overflow: hidden;
    border: 3px solid var(--marvel-border-secondary);
    background-color: var(--marvel-bg-deep); box-shadow: var(--shadow-inset-marvel);
    transition: border-color var(--transition-med-marvel), transform var(--transition-smooth-marvel);
}
#hero-avatar-area:hover { border-color: var(--marvel-text-link); transform: scale(1.08); box-shadow: 0 0 12px var(--marvel-accent-cyan); }
#hero-avatar { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s var(--transition-smooth-marvel); }
#hero-avatar-area:hover #hero-avatar { transform: scale(1.12); }
#secret-identity-name.sidebar-char-name { font-family: var(--font-title-marvel); font-size: 1.5rem; font-weight: 700; color: var(--marvel-text-primary); text-align: center; word-break: break-word; line-height: 1.25; text-shadow: 0 0 8px var(--marvel-accent-cyan); }

.info-block { background-color: rgba(12, 16, 28, 0.2); border: 1px solid var(--marvel-border-primary); border-radius: var(--radius-md-marvel); padding: 1rem 1.2rem; box-shadow: var(--shadow-sm-marvel); transition: background-color var(--transition-fast-marvel); position: relative; }
.info-block .block-title {
    margin: -1rem -1.2rem 1.1rem -1.2rem; padding: 0.7rem 1.2rem;
    background-color: rgba(255, 255, 255, 0.05); /* Lighter highlight */
    border-bottom: 1px solid var(--marvel-border-primary);
    border-top-left-radius: var(--radius-md-marvel); border-top-right-radius: var(--radius-md-marvel);
    color: var(--marvel-text-secondary); font-size: 0.75rem; font-weight: 700; /* Bolder */
    letter-spacing: 1.4px; display: flex; align-items: center; gap: 0.6rem;
}
.info-block .block-title .info-icon-emoji { opacity: 0.8; font-size: 1.1em; line-height: 1; color: var(--marvel-accent-cyan); }
.info-block.hero-power-stats.restructured-stats { padding: 0; background-color: transparent; border: none; box-shadow: none; }
.info-block.restructured-stats .block-title { margin: 0 0 0.9rem 0; padding: 0.7rem 1.2rem; background-color: rgba(255, 255, 255, 0.05); border: 1px solid var(--marvel-border-primary); border-radius: var(--radius-md-marvel); text-align: center; border-bottom: 1px solid var(--marvel-border-primary); }
.info-block.restructured-stats .core-stats-content { padding: 1rem 1.2rem; border: 1px solid var(--marvel-border-primary); border-radius: var(--radius-md-marvel); background-color: rgba(12, 16, 28, 0.2); box-shadow: var(--shadow-sm-marvel); }
.info-block.restructured-stats .core-stats-content .info-pair { display: flex; justify-content: space-between; align-items: baseline; gap: 0.8rem; margin-bottom: 0.8rem; font-size: 0.9rem; flex-wrap: wrap; } /* Larger font */
.info-block.restructured-stats .core-stats-content .info-pair .info-label { flex-shrink: 0; }
.info-block.restructured-stats .core-stats-content .info-pair .info-value { flex-grow: 1; text-align: right; word-break: break-word; }
#hero-mental-stability.info-value, #hero-moral-compass.info-value { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 160px; cursor: help; display: inline-block; vertical-align: baseline; }
.info-block.restructured-stats .core-stats-content #hero-durability-bar.info-value { width: 100%; } /* Ensure it takes full width */
.info-block.restructured-stats .core-stats-content .info-pair:last-child { margin-bottom: 0; }
.info-pair { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 0.8rem; font-size: 0.9rem; font-family: var(--font-ui-marvel); gap: 0.9rem; flex-wrap: wrap; }
.info-pair:last-child { margin-bottom: 0; }
.info-label { display: inline-flex; align-items: center; gap: 0.6rem; color: var(--marvel-text-secondary); flex-shrink: 0; }
.info-icon-emoji { opacity: 0.8; font-size: 1.1em; line-height: 1; display: inline-block; width: 1.25em; text-align: center; color: var(--marvel-accent-cyan);}
.info-value { color: var(--marvel-text-primary); font-weight: 600; text-align: right; word-break: break-word; flex-grow: 1; }
.info-value.truncate-with-tooltip { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; cursor: help; vertical-align: baseline; max-width: 100%; }
.info-value.skills-list { font-style: normal; font-size: 0.85rem; color: var(--marvel-text-muted); cursor: help; border-bottom: 1px dotted var(--marvel-text-muted); padding-bottom: 1px; display: block; text-align: left; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; max-width: 100%; }
.list-like-pair .info-value { text-align: left; font-weight: 500; }
.info-pair .currency-value-wrapper { display: flex; align-items: baseline; gap: 0.25rem; justify-content: flex-end;}
.info-value.balance-value { font-weight: 700; color: var(--marvel-accent-gold); }
.currency-label { color: var(--marvel-accent-gold); opacity: 0.8; font-size: 0.8em; font-weight: 500;}
.info-value.token-value { color: var(--marvel-accent-cyan); font-weight: 700; font-size: 1.1em; }
#hero-durability-bar { height: 12px; background-color: var(--marvel-bg-input); border-radius: var(--radius-full-marvel); overflow: hidden; border: 1px solid var(--marvel-border-primary); position: relative; display: block; }
.health-bar-fill { height: 100%; border-radius: var(--radius-full-marvel); transition: width var(--transition-smooth-marvel), background-color var(--transition-smooth-marvel); position: absolute; top: 0; left: 0; background-size: 250% auto; animation: gradient-shift-marvel 2.5s linear infinite; }
@keyframes gradient-shift-marvel { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }
.health-bar-fill.health-good { background-image: linear-gradient(90deg, var(--marvel-health-good), #58e08c, var(--marvel-health-good)); }
.health-bar-fill.health-medium { background-image: linear-gradient(90deg, var(--marvel-health-medium), #fccd6c, var(--marvel-health-medium)); }
.health-bar-fill.health-low { background-image: linear-gradient(90deg, var(--marvel-health-low), #ff7070, var(--marvel-health-low)); }
.health-bar-text { display: none; } #hero-durability-bar[title] { cursor: help; }
#hero-moral-compass.info-value, #hero-mental-stability.info-value { background-color: rgba(12, 16, 28, 0.25); padding: 0.2rem 0.6rem; border-radius: var(--radius-sm-marvel); font-size: 0.85rem; border: 1px solid var(--marvel-border-primary); line-height: 1.35; }
#hero-resources-display.info-value { color: var(--marvel-accent-cyan); font-weight: 700; font-size: 1.1em; }
.info-value.token-value.error-flash { animation: flash-red-marvel 0.5s 3 ease-in-out; }
@keyframes flash-red-marvel { 0%, 100% { color: var(--marvel-accent-cyan); transform: scale(1); } 50% { color: var(--marvel-accent-red); transform: scale(1.12); } }

/* Chat Area - Marvel Adaptation */
#chat-log.marvel-chat-log { position: relative; padding: 1.2rem; overflow-y: auto; scrollbar-gutter: stable both-edges; background-image: var(--bg-tech-pattern-marvel); }
.message { margin-bottom: 1.3rem; display: flex; align-items: flex-start; gap: 0.9rem; max-width: 90%; position: relative; opacity: 1; transition: opacity 0.5s ease-in-out; }
.message[data-is-command="true"] { display: none !important; }
.message.new-message { animation: fade-in-up-marvel 0.5s var(--transition-smooth-marvel); }
@keyframes fade-in-up-marvel { from { opacity: 0; transform: translateY(15px); } to { opacity: 1; transform: translateY(0); } }
.message-avatar { width: 40px; height: 40px; border-radius: var(--radius-full-marvel); overflow: hidden; flex-shrink: 0; margin-top: 3px; border: 2px solid var(--marvel-border-primary); box-shadow: var(--shadow-md-marvel); background-color: var(--marvel-bg-deep); transition: transform var(--transition-med-marvel), box-shadow var(--transition-med-marvel); }
.message-avatar:hover { transform: scale(1.12); box-shadow: 0 0 12px var(--marvel-accent-cyan); }
.message-avatar img { width: 100%; height: 100%; object-fit: cover; }
.message-content { padding: 0.8rem 1.2rem; padding-bottom: 1.7rem; border-radius: var(--radius-lg-marvel); flex-grow: 1; position: relative; border: 1px solid transparent; box-shadow: var(--shadow-md-marvel); transition: background-color var(--transition-med-marvel); min-width: 0; }
.character-name { font-weight: 700; font-size: 0.85rem; margin-bottom: 0.35rem; font-family: var(--font-ui-marvel); letter-spacing: 0.5px; text-transform: uppercase; }
.message-text { font-family: var(--font-primary-text-marvel); font-size: 1rem; color: var(--marvel-text-primary); word-wrap: break-word; white-space: pre-wrap; line-height: 1.75; }
.message-text strong { color: var(--marvel-text-highlight); }
.message-text em { color: var(--marvel-text-secondary); }
.message-text .color-tag { display: inline; font-weight: 700; }
.timestamp { font-size: 0.7rem; font-family: var(--font-ui-marvel); color: var(--marvel-text-muted); position: absolute; bottom: 0.5rem; right: 0.9rem; opacity: 0.8; }
.user-message { margin-left: auto; flex-direction: row-reverse; }
.user-message .message-content { background-color: var(--marvel-msg-user-bg); border-color: var(--marvel-border-accent); border-radius: var(--radius-lg-marvel) var(--radius-sm-marvel) var(--radius-lg-marvel) var(--radius-lg-marvel); }
.user-message .character-name { text-align: right; color: var(--marvel-accent-blue); }
.user-message .message-avatar { border-color: var(--marvel-accent-blue); box-shadow: 0 0 8px var(--marvel-accent-blue);}
.ai-message .message-content { background-color: var(--marvel-msg-ai-bg); border-color: var(--marvel-border-primary); border-radius: var(--radius-sm-marvel) var(--radius-lg-marvel) var(--radius-lg-marvel) var(--radius-lg-marvel); }
.ai-message .character-name { color: var(--marvel-text-secondary); }
.ai-message .message-avatar { border-color: var(--marvel-border-secondary); filter: hue-rotate(180deg) brightness(0.9); }
.system-message { flex-direction: column; align-items: center; width: 100%; max-width: 88%; margin: 1.2rem auto; gap: 0; padding: 0.7rem 1.1rem; border-radius: var(--radius-md-marvel); background-color: var(--marvel-msg-sys-bg); border: 1px solid var(--marvel-border-primary); text-align: center; color: var(--marvel-text-secondary); font-style: italic; font-size: 0.85rem; box-shadow: none; opacity: 0.85; }
.system-message p { margin: 0; }
.system-message .color-tag { font-weight: 600; }
.system-message [color=red], .system-message [color="#ff4d4d"] { color: var(--marvel-text-error) !important; opacity: 1;}
.system-message [color=orange] { color: var(--marvel-accent-gold) !important; opacity: 0.95;}
.system-message [color=gray], .system-message [color=#CCCCCC] { color: var(--marvel-text-muted) !important; }
.message.thinking { max-width: 100%; justify-content: center; }
.message.thinking .message-content { background: transparent; border: none; box-shadow: none; padding: 0; }
.message.thinking .message-text { text-align: center; }
.message.thinking i { font-style: normal; color: var(--marvel-text-muted); font-size: 0.9rem; display: inline-block; letter-spacing: 1px; animation: pulse-fade-marvel 1.8s infinite ease-in-out; }
@keyframes pulse-fade-marvel { 0%, 100% { opacity: 0.5; } 50% { opacity: 0.9; transform: scale(1.03); } }

/* --- Utility Sidebar (Right) - Marvel Adaptation --- */
#utility-sidebar .sidebar-content { padding-top: 1.2rem; display: flex; flex-direction: column; gap: 2rem; }
.sidebar-title-right { font-family: var(--font-title-marvel); font-size: 1.5rem; font-weight: 700; color: var(--marvel-text-secondary); text-align: center; border-bottom: 1px solid var(--marvel-border-primary); padding-bottom: 0.8rem; margin: 0; margin-bottom: 1.4rem; text-shadow: 0 0 5px var(--marvel-accent-cyan);}
.utility-widget-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 0.8rem; }
.utility-widget {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.5rem; padding: 0.9rem 0.5rem; min-height: 100px; border-radius: var(--radius-md-marvel); background-color: rgba(12, 16, 28, 0.3); border: 1px solid var(--marvel-border-primary); text-align: center; color: var(--marvel-text-secondary); cursor: pointer; transition: all var(--transition-med-marvel); position: relative; overflow: hidden; box-shadow: var(--shadow-sm-marvel);
}
.utility-widget:hover:not(:disabled) { background-color: var(--marvel-bg-hover); border-color: var(--marvel-border-accent); transform: translateY(-3px); color: var(--marvel-text-primary); box-shadow: 0 0 15px var(--marvel-border-accent), var(--shadow-md-marvel); }
.utility-widget::before { display: none; }
.utility-widget:active:not(:disabled) { transform: translateY(0px) scale(1); box-shadow: var(--shadow-sm-marvel); }
.utility-widget:disabled { opacity: 0.45; cursor: not-allowed; transform: none; background-color: rgba(12,16,28,0.1); border-color: var(--marvel-border-primary); box-shadow: none; filter: grayscale(80%); }
.widget-icon-emoji { font-size: 2rem; line-height: 1; filter: saturate(120%); transition: transform 0.4s var(--transition-smooth-marvel), filter var(--transition-med-marvel); color: var(--marvel-accent-cyan); text-shadow: 0 0 8px var(--marvel-accent-cyan); }
.utility-widget:hover:not(:disabled) .widget-icon-emoji { transform: scale(1.15) rotate(-5deg); filter: saturate(150%) drop-shadow(0 0 10px var(--marvel-accent-cyan)); }
.widget-label { font-size: 0.75rem; font-weight: 700; display: block; line-height: 1.25; font-family: var(--font-ui-marvel); text-transform: uppercase; letter-spacing: 0.9px; }
.widget-status { font-size: 0.7rem; font-style: italic; opacity: 0.7; margin-top: 3px; display: block; color: var(--marvel-text-muted); }
.widget-status:empty { display: none; }
.utility-block.dynamic-info { border: 1px solid var(--marvel-border-primary); border-radius: var(--radius-md-marvel); padding: 0; background: rgba(12, 16, 28, 0.3); box-shadow: var(--shadow-inset-marvel); }
.utility-block-title {
    font-size: 1.2rem; color: var(--marvel-text-secondary); font-family: var(--font-ui-marvel); font-weight: 700;
    padding: 0.8rem 1.1rem; border-bottom: 1px solid var(--marvel-border-primary);
    display: flex; align-items: center; gap: 0.6rem; margin: 0;
}
.utility-block-title .info-icon-emoji { font-size: 1.25em; opacity: 0.8; color: var(--marvel-accent-gold); }
#interdimensional-feed-list { /* Renamed from news-feed-list-rl */
    list-style: none; padding: 0.5rem 1.1rem 0.9rem 1.1rem; margin: 0;
    display: flex; flex-direction: column; gap: 0.6rem;
}
#interdimensional-feed-list li {
    display: block;
    padding: 0.5rem 0.3rem; font-size: 0.88rem; line-height: 1.45;
    border: none; transition: background-color var(--transition-fast-marvel);
    border-radius: var(--radius-sm-marvel);
    color: var(--marvel-text-secondary);
    max-height: 4.8em; /* Approx 3 lines */
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
}
#interdimensional-feed-list li:hover { background-color: var(--marvel-bg-hover); color:var(--marvel-text-primary); }
#interdimensional-feed-list li.placeholder-text { color: var(--marvel-text-muted); font-style: italic; text-align: center; padding: 1.2rem; font-size: 0.85rem; cursor: default; }


/* --- Overlays & Modals - Marvel Adaptation --- */
.status-overlay, .modal-overlay.marvel-modal {
    position: fixed; inset: 0; z-index: var(--z-overlay); display: flex;
    align-items: center; justify-content: center; padding: 1.3rem;
    background-color: rgba(8, 10, 20, 0.9); backdrop-filter: blur(6px) brightness(0.7);
    opacity: 0; visibility: hidden;
    transition: opacity var(--transition-med-marvel), visibility 0s var(--transition-med-marvel);
}
.status-overlay.visible, .modal-overlay.marvel-modal.visible,
.status-overlay[style*="display: flex"], .modal-overlay.marvel-modal[style*="display: flex"]
{ opacity: 1; visibility: visible; transition: opacity var(--transition-med-marvel) ease-in-out, visibility 0s 0s; }

.overlay-content, .modal-overlay.marvel-modal .modal-content {
    background-color: var(--marvel-bg-primary); border-radius: var(--radius-lg-marvel);
    border: 1px solid var(--marvel-border-primary); box-shadow: var(--shadow-lg-marvel), 0 0 25px rgba(0, 224, 224, 0.1); /* Added glow */
    max-width: 94%; max-height: 90vh; display: flex; flex-direction: column;
    opacity: 0; transform: scale(0.96) translateY(10px);
    transition: transform var(--transition-med-marvel) ease-out, opacity var(--transition-med-marvel) ease-out;
    overflow: hidden;
}
.status-overlay.visible .overlay-content, .modal-overlay.marvel-modal.visible .modal-content,
.status-overlay[style*="display: flex"] .overlay-content, .modal-overlay.marvel-modal[style*="display: flex"] .modal-content
{ opacity: 1; transform: scale(1) translateY(0); }

.overlay-content { padding: 2.2rem 2.7rem; text-align: center; max-width: 550px; position: relative; }
.overlay-content::before, .overlay-content::after { display: none; }

@keyframes spin-marvel { 100% { transform: rotate(360deg); } }
.spinner { width: 48px; height: 48px; margin: 0 auto 1.3rem auto; border: 4px solid var(--marvel-border-secondary); border-top-color: var(--marvel-accent-cyan); border-radius: var(--radius-full-marvel); animation: spin-marvel 0.9s linear infinite; }
#loading-message { font-size: 1.05rem; color: var(--marvel-text-secondary); font-family: var(--font-ui-marvel); }
#error-overlay .overlay-title { color: var(--marvel-text-error); font-size: 1.6rem; margin-bottom: 1.1rem; font-family: var(--font-title-marvel); text-shadow: 0 0 8px var(--marvel-text-error); }
#error-message.error-message { color: var(--marvel-text-secondary); margin-bottom: 1.9rem; font-size: 1rem; }
.error-actions { display: flex; justify-content: center; gap: 1.1rem; }

.creation-form-container.hero-creation-form { /* Target specifically .hero-creation-form for Marvel */
    padding: 2rem 2.4rem; max-width: 520px; width: 100%;
}
.hero-creation-form h2 { font-size: 1.9rem; margin-bottom: 0.6rem; font-family: var(--font-title-marvel); text-align: center; text-shadow: 0 0 10px var(--marvel-accent-gold); }
.hero-creation-form > p { font-size: 0.95rem; color: var(--marvel-text-secondary); margin-bottom: 1.6rem; line-height: 1.65; text-align: center; }
.hero-creation-form .form-group { margin-bottom: 1.2rem; }
.hero-creation-form label { display: block; margin-bottom: 0.55rem; color: var(--marvel-text-secondary); font-weight: 700; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.7px; }
.hero-creation-form input[type="text"], .hero-creation-form select { width: 100%; padding: 0.7rem 1rem; background-color: var(--marvel-bg-input); border: 1px solid var(--marvel-border-primary); border-radius: var(--radius-md-marvel); color: var(--marvel-text-primary); font-size: 1rem; box-shadow: var(--shadow-inset-marvel); transition: border-color var(--transition-fast-marvel), box-shadow var(--transition-fast-marvel); scrollbar-width: thin; scrollbar-color: var(--marvel-scroll-thumb) var(--marvel-scroll-track); }
.hero-creation-form input[type="text"]:focus, .hero-creation-form select:focus { outline: none; border-color: var(--marvel-border-accent); box-shadow: var(--shadow-focus-marvel), var(--shadow-inset-marvel); }
.hero-creation-form select { appearance: none; -webkit-appearance: none; padding-right: 2.5rem; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23a0b0d0'%3E%3Cpath fill-rule='evenodd' d='M8 11.5a.5.5 0 0 1-.354-.146l-4-4a.5.5 0 0 1 .708-.708L8 10.293l3.646-3.647a.5.5 0 0 1 .708.708l-4 4A.5.5 0 0 1 8 11.5z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 0.8rem center; background-size: 16px; cursor: pointer; }
.hero-creation-form .help-text { font-size: 0.85rem; text-align: center; color: var(--marvel-text-muted); margin-top: 1.3rem; padding: 0.8rem; background: rgba(0,0,0,0.2); border-radius: var(--radius-md-marvel); border: 1px dashed var(--marvel-border-secondary); }
.hero-creation-form button[type="submit"] { display: block; width: 100%; margin-top: 1.9rem; }

/* Modals - Marvel Adaptation */
.marvel-modal .modal-content { max-width: 800px; width: 100%; background-color: var(--marvel-bg-content); /* Use slightly lighter content bg for modals */ }
.marvel-modal .modal-content.wide-modal { max-width: 1000px; } /* For Comm Network etc. */
.marvel-modal .modal-header { display: flex; align-items: center; gap: 0.9rem; padding: 1rem 1.4rem; border-bottom: 1px solid var(--marvel-border-primary); flex-shrink: 0; background: var(--marvel-bg-secondary); border-top-left-radius: inherit; border-top-right-radius: inherit; position: relative; }
.marvel-modal h2 { margin: 0; flex-grow: 1; font-size: 1.4rem; line-height: 1.35; word-break: break-word; font-family: var(--font-title-marvel); text-shadow: 0 0 6px var(--marvel-text-link);}
.modal-title-icon { font-size: 1.3em; line-height: 1; opacity: 0.9; flex-shrink: 0; filter: saturate(120%); color: var(--marvel-accent-cyan); }
.marvel-modal .modal-close-btn { position: absolute; top: 8px; right: 8px; width: 32px; height: 32px; border-radius: var(--radius-full-marvel); font-size: 1.8rem; line-height: 32px; text-align: center; color: var(--marvel-text-secondary); background: rgba(255, 255, 255, 0.06); border: 1px solid var(--marvel-border-primary); cursor: pointer; z-index: 15; transition: all var(--transition-fast-marvel); box-shadow: var(--shadow-sm-marvel); opacity: 0.8; }
.marvel-modal .modal-close-btn:hover { background-color: rgba(230, 36, 41, 0.25); color: var(--marvel-text-error); transform: scale(1.12); border-color: var(--marvel-text-error); box-shadow: var(--shadow-md-marvel); opacity: 1; }
.marvel-modal .modal-close-btn:active { transform: scale(0.96); background-color: rgba(230, 36, 41, 0.4); }
.marvel-modal .modal-body { padding: 1.4rem; overflow: hidden; flex-grow: 1; position: relative; display: flex; flex-direction: column; }
.marvel-modal .modal-tabs { display: flex; flex-wrap: wrap; margin: -1.4rem -1.4rem 1.4rem -1.4rem; padding: 0 0.9rem; border-bottom: 1px solid var(--marvel-border-primary); background: var(--marvel-bg-secondary); position: sticky; top: 0; z-index: var(--z-sticky); backdrop-filter: blur(4px); box-shadow: 0 2px 6px rgba(0,0,0,0.3); }
.marvel-modal .tab-button { padding: 0.85rem 1.1rem; font-family: var(--font-ui-marvel); font-weight: 600; font-size: 0.9rem; color: var(--marvel-text-secondary); border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color var(--transition-fast-marvel), border-color var(--transition-fast-marvel), background-color var(--transition-fast-marvel); position: relative; background: transparent; }
.marvel-modal .tab-button:hover { color: var(--marvel-text-primary); background-color: var(--marvel-bg-hover); }
.marvel-modal .tab-button.active { color: var(--marvel-accent-cyan); border-bottom-color: var(--marvel-accent-cyan); background-color: transparent; font-weight: 700; text-shadow: 0 0 5px var(--marvel-accent-cyan); }
.marvel-modal .tab-content { display: none; flex-grow: 1; overflow: hidden; padding-top: 0.5rem; }
.marvel-modal .tab-content.active { display: block; animation: fade-in-marvel 0.45s ease; }
@keyframes fade-in-marvel { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
.marvel-modal .tab-content.scrollable-area {
    max-height: calc(88vh - 190px); /* Adjusted for Marvel header/tabs */
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-gutter: stable both-edges;
}
.marvel-modal .tab-content h4 { font-family: var(--font-ui-marvel); font-size: 0.9rem; font-weight: 700; color: var(--marvel-text-secondary); margin-top: 0.9rem; margin-bottom: 0.8rem; text-transform: uppercase; letter-spacing: 1.1px; padding-bottom: 0.35rem; border-bottom: 1px solid var(--marvel-border-secondary); }
.marvel-modal .modal-styled-list { list-style: none; margin: 0 0 1.3rem 0; padding: 0; border: 1px solid var(--marvel-border-modal); border-radius: var(--radius-md-marvel); background-color: rgba(12, 16, 28, 0.15); overflow: hidden; }
.marvel-modal .scrollable-list-container {
    max-height: 42vh;
    overflow-y: auto;
    scrollbar-gutter: stable both-edges;
    border: 1px solid var(--marvel-border-modal);
    border-radius: var(--radius-md-marvel);
    background-color: rgba(12, 16, 28, 0.15);
    padding: 0.6rem;
}
.marvel-modal .modal-styled-list li { display: flex; align-items: center; gap: 0.8rem; padding: 0.75rem 1rem; border-bottom: 1px solid var(--marvel-border-modal); transition: background-color var(--transition-fast-marvel), transform var(--transition-fast-marvel), border-left-color var(--transition-fast-marvel); font-size: 0.95rem; position: relative; border-left: 3px solid transparent; }
.marvel-modal .modal-styled-list li:last-child { border-bottom: none; }
.marvel-modal .modal-styled-list li.selectable { cursor: pointer; }
.marvel-modal .modal-styled-list li.selectable:hover { background-color: var(--marvel-bg-hover); border-left-color: var(--marvel-accent-blue); transform: translateX(3px); }
.marvel-modal .modal-styled-list li.selected { background-color: var(--marvel-bg-selected); border-left-color: var(--marvel-accent-gold); font-weight: 600; transform: translateX(0); }
.marvel-modal .placeholder-text { color: var(--marvel-text-muted); font-style: italic; text-align: center; padding: 1.9rem 1.1rem; border: none !important; background: transparent !important; font-size: 0.9rem; border-left: none !important; display: block !important; width: 100% !important; }
.item-display-name { flex-grow: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.inv-qty, .gadget-qty { /* Combined */
    font-size: 0.8rem; color: var(--marvel-text-muted); margin-left: auto; padding: 0.15rem 0.45rem;
    background: var(--marvel-bg-input); border-radius: var(--radius-sm-marvel);
    border: 1px solid var(--marvel-border-primary); flex-shrink: 0;
}
.modal-item-actions { margin-top: 1.3rem; padding: 0.9rem; background-color: rgba(0, 0, 0, 0.3); border-radius: var(--radius-md-marvel); border: 1px solid var(--marvel-border-secondary); display: flex; flex-wrap: wrap; gap: 0.8rem; align-items: center; box-shadow: var(--shadow-inset-marvel); justify-content: center; }
.modal-item-actions .btn { margin: 0; }
.modal-message { padding: 0.7rem 1rem; margin-top: 0.9rem; border-radius: var(--radius-md-marvel); font-size: 0.9rem; text-align: center; font-weight: 600; display: none; border: 1px solid transparent; word-wrap: break-word; overflow-wrap: break-word; }
.modal-message.info { background-color: rgba(0, 224, 224, 0.12); border-color: rgba(0, 224, 224, 0.35); color: var(--marvel-accent-cyan); }
.modal-message.success { background-color: rgba(66, 245, 176, 0.12); border-color: rgba(66, 245, 176, 0.35); color: var(--marvel-text-success); }
.modal-message.error { background-color: rgba(255, 77, 77, 0.12); border-color: rgba(255, 77, 77, 0.35); color: var(--marvel-text-error); }
.modal-help-text { font-size: 0.8rem; color: var(--marvel-text-muted); margin-top: 1.3rem; padding-top: 0.9rem; border-top: 1px dashed var(--marvel-border-secondary); line-height: 1.55; text-align: center; font-style: italic; }
.modal-help-text strong { color: var(--marvel-accent-gold); font-style: normal; }

/* Marvel Specific Modal Item Rendering & Icons */
.marvel-modal .modal-styled-list li.item-readable::after { content: "👁️"; margin-left: 7px; font-size: 1em; opacity: 0.7; color: var(--marvel-text-link); cursor: pointer; flex-shrink: 0; pointer-events: all; line-height: 1; }
.marvel-modal .modal-styled-list li.item-readable:hover::after { opacity: 1; text-shadow: 0 0 5px var(--marvel-text-link-hover); }
.marvel-modal .modal-styled-list li[data-item-type]::before {
    font-family: initial; /* To render emoji properly */ font-size: 1.1em; margin-right: 0.6rem; opacity: 0.85;
    flex-shrink: 0; width: 1.3em; text-align: center; line-height: 1; content: '📦'; /* Default for Misc */
}
/* Gadgets & Specialized Items Icons in Modals */
li[data-item-type="Blaster"]::before, li[data-item-type="Weapon"]::before { content: '🔫'; }
li[data-item-type="CommDevice"]::before, li[data-item-type="Communicator"]::before { content: '📡'; }
li[data-item-type="ArmorPart"]::before, li[data-item-type="PowerSuit"]::before, li[data-item-type="Suit"]::before { content: '🤖'; }
li[data-item-type="EnergyCell"]::before, li[data-item-type="EnergyCube"]::before { content: '🔋'; }
li[data-item-type="CosmicArtifact"]::before, li[data-item-type="Amulet"]::before, li[data-item-type="PowerGem"]::before { content: '🔮'; }
li[data-item-type="MysticalTome"]::before, li[data-item-type="Journal"]::before, li[data-item-type="Schematics"]::before, li[data-item-type="Blueprint"]::before { content: '📜'; }
li[data-item-type="DataChip"]::before, li[data-item-type="DataDrive"]::before { content: '💾'; }
/* Other entity icons */
li[data-item-type="Contact"]::before, li[data-item-type="Ally"]::before, li[data-item-type="Enemy"]::before { content: '👤'; }
li[data-item-type="Hero"]::before {content: '🦸';} li[data-item-type="Villain"]::before {content: '🦹';}
li[data-item-type="SecretIdentity"]::before {content: '🕵️';}
li[data-item-type="Affiliation"]::before, li[data-item-type="Faction"]::before { content: '🛡️';}
li[data-item-type="Lair"]::before, li[data-item-type="Base"]::before { content: '🕳️';}
li[data-item-type="City"]::before, li[data-item-type="Location"]::before {content: '🏙️';} li[data-item-type="Planet"]::before {content: '🪐';}
li[data-item-type="ActiveMission"]::before {content: '🎯';} li[data-item-type="CompletedMission"]::before {content: '✅';}
li[data-item-type="CommMsg_Unread"]::before { content: '📧'; } li[data-item-type="CommMsg_Read"]::before { content: '📨'; }


.item-condition-damaged { opacity: 0.7; filter: saturate(60%) brightness(0.9); }
.item-condition-critical { opacity: 0.5; filter: grayscale(50%) brightness(0.8); text-decoration: line-through dashed var(--marvel-text-error) 2px; }
.item-condition-destroyed { opacity: 0.3; filter: grayscale(90%) brightness(0.7); text-decoration: line-through solid var(--marvel-text-error) 2px; color: var(--marvel-text-muted) !important; }

#classified-intel-display.prose-styles {
    font-family: var(--font-primary-text-marvel); line-height: 1.8; color: var(--marvel-text-primary);
    background-color: rgba(0,0,0,0.25); border: 1px solid var(--marvel-border-modal);
    border-radius: var(--radius-md-marvel); padding: 1.4rem 1.9rem;
    font-size: 1rem; flex-grow: 1; max-height: 75vh;
    overflow-y: auto; scrollbar-gutter: stable both-edges;
    word-wrap: break-word; overflow-wrap: break-word; padding-bottom: 1.1rem;
}

/* Map Modal Specific Styles (Marvel) */
#strategic-map-modal .modal-body { overflow: hidden; display: flex; flex-direction: column; height: 100%; }
#map-current-location-marvel { flex-shrink: 0; text-align: center; color: var(--marvel-accent-cyan); text-shadow: 0 0 4px var(--marvel-accent-cyan); }
#strategic-map-overview-container,
#strategic-map-detail-container {
    flex-grow: 1; overflow-y: auto; overflow-x: hidden; scrollbar-gutter: stable both-edges;
    padding: 6px; max-height: calc(88vh - 200px);
 }
#map-location-list-marvel li { border-left-width: 3px; padding: 0.65rem 0.85rem; font-weight: 600; background-color: rgba(255, 255, 255, 0.04); border-bottom: 1px solid var(--marvel-border-modal); }
#map-location-list-marvel li.selectable:hover { background-color: var(--marvel-bg-hover); border-left-color: var(--marvel-accent-blue); color: var(--marvel-text-primary); }
#map-location-list-marvel li.selected { background-color: var(--marvel-bg-selected); border-left-color: var(--marvel-accent-gold); font-weight: 700; }
#strategic-map-detail-title { font-family: var(--font-title-marvel); color: var(--marvel-accent-gold); text-shadow: 0 0 8px var(--marvel-accent-gold); flex-shrink: 0; text-align: center;}
#strategic-map-detail-content { padding: 1.1rem; background-color: rgba(0, 0, 0, 0.15); border: 1px solid var(--marvel-border-secondary); border-radius: var(--radius-md-marvel); min-height: 110px; flex-grow: 1; }


/* --- Buttons (Unified Styles - Marvel Adaptation) --- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.6rem; padding: 0.65rem 1.2rem; font-size: 0.9rem; font-family: var(--font-ui-marvel); font-weight: 700; border-radius: var(--radius-md-marvel); border: 1px solid transparent; cursor: pointer; line-height: 1.45; text-align: center; text-transform: uppercase; letter-spacing: 1px; transition: all var(--transition-med-marvel); user-select: none; box-shadow: var(--shadow-sm-marvel), inset 0 1px 0 rgba(255,255,255,0.06); position: relative; }
.btn:focus { outline: none; }
.btn:focus-visible { box-shadow: var(--shadow-focus-marvel), var(--shadow-sm-marvel), 0 0 10px var(--marvel-accent-cyan); /* Added glow */}
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; box-shadow: none !important; filter: grayscale(70%); }
.btn .btn-icon-emoji { font-size: 1.15em; line-height: 1; }
.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }
.btn-primary { background: linear-gradient(to bottom, var(--marvel-accent-red), #c4181d); color: #fff; border-color: rgba(180, 24, 29, 0.7); text-shadow: 0 1px 2px rgba(0,0,0,0.4); }
.btn-primary:hover:not(:disabled) { background: linear-gradient(to bottom, var(--marvel-accent-red-hover), var(--marvel-accent-red)); transform: translateY(-2px) scale(1.02); box-shadow: var(--shadow-md-marvel), 0 0 8px var(--marvel-accent-red); border-color: rgba(180, 24, 29, 1); }
.btn-primary:active:not(:disabled) { transform: translateY(0) scale(1); box-shadow: var(--shadow-sm-marvel); }
.btn-secondary { background-color: var(--marvel-bg-secondary); color: var(--marvel-text-secondary); border-color: var(--marvel-border-primary); }
.btn-secondary:hover:not(:disabled) { background-color: var(--marvel-bg-content); border-color: var(--marvel-border-secondary); color: var(--marvel-text-primary); box-shadow: var(--shadow-md-marvel); }
.btn-danger { background: linear-gradient(to bottom, #cc0000, #a00000); color: #fff; border-color: #600; text-shadow: 0 1px 2px rgba(0,0,0,0.4); }
.btn-danger:hover:not(:disabled) { background: linear-gradient(to bottom, #ff3333, #cc0000); transform: translateY(-2px) scale(1.02); box-shadow: var(--shadow-md-marvel), 0 0 8px #ff3333; }
.btn-accent, .btn-info { background: linear-gradient(to bottom, var(--marvel-accent-blue), #005fcc); color: #fff; border-color: #004c99; text-shadow: 0 1px 2px rgba(0,0,0,0.3); }
.btn-accent:hover:not(:disabled), .btn-info:hover:not(:disabled) { background: linear-gradient(to bottom, var(--marvel-accent-blue-hover), var(--marvel-accent-blue)); transform: translateY(-2px) scale(1.02); box-shadow: var(--shadow-md-marvel), 0 0 8px var(--marvel-accent-blue); }
.btn-small { padding: 0.5rem 1rem; font-size: 0.8rem; gap: 0.5rem;}
.btn-large { padding: 0.85rem 1.7rem; font-size: 1rem; letter-spacing: 1.2px;}


/* --- Comm Network Modal (Marvel Version) --- */
#comm-network-modal .modal-content {
    max-width: 1100px; /* Wider for comms */
    height: calc(100vh - 80px); max-height:800px;
}
#comm-network-modal .modal-header {
    padding: 0.9rem 1.2rem;
    background-color: var(--marvel-bg-primary);
    border-bottom: 1px solid var(--marvel-border-secondary);
}
#comm-network-modal .modal-header h2 {
    font-size: 1.2rem; color: var(--marvel-text-primary);
}
#comm-network-modal .modal-body.comm-details {
    padding: 0;
    background-color: var(--marvel-bg-secondary);
    height: 100%;
    display: flex;
    overflow: hidden;
}

.comm-inbox-pane {
    width: 330px; /* Wider inbox */
    min-width: 250px;
    flex-shrink: 0;
    background-color: var(--marvel-bg-secondary);
    border-right: 1px solid var(--marvel-border-primary);
    padding: 0.9rem;
    display: flex;
    flex-direction: column;
    color: var(--marvel-text-primary);
    overflow-y: auto;
    scrollbar-gutter: stable;
}
.comm-inbox-pane h4 {
    color: var(--marvel-text-primary);
    font-size: 0.95rem;
    margin-bottom: 0.9rem;
    padding-bottom: 0.6rem;
    border-bottom: 1px solid var(--marvel-border-primary);
    font-family: var(--font-ui-marvel);
    text-transform: none;
    letter-spacing: normal;
    flex-shrink: 0;
    display:flex; align-items:center; justify-content:space-between;
}
.comm-inbox-pane h4 #unread-comm-count {
    font-size: 0.85em; background-color: var(--marvel-accent-cyan); color: var(--marvel-bg-deep);
    padding: 0.15em 0.6em; border-radius: 12px; font-weight:700;
}

#encrypted-messages-list { /* Renamed from email-inbox-list-rl */
    list-style: none; margin: 0; padding: 0; border: none;
    background: none; display: flex; flex-direction: column;
    gap: 4px; flex-grow: 1;
}
#encrypted-messages-list li {
    background-color: var(--marvel-bg-input);
    border: 1px solid var(--marvel-border-primary);
    border-left: 4px solid transparent;
    padding: 0.7rem 1rem;
    border-radius: var(--radius-sm-marvel);
    color: var(--marvel-text-secondary);
    transition: background-color 0.15s ease, border-color 0.15s ease;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    cursor: pointer;
    overflow: hidden;
}
#encrypted-messages-list li:hover {
    background-color: var(--marvel-bg-hover);
    border-left-color: var(--marvel-text-link);
}
#encrypted-messages-list li.selected {
    background-color: var(--comm-selected-bg) !important;
    border-color: var(--comm-selected-bg) !important; /* Same color for subtle selection */
    border-left-color: var(--marvel-accent-gold) !important;
}
#encrypted-messages-list li.selected .comm-subject,
#encrypted-messages-list li.selected .comm-sender,
#encrypted-messages-list li.selected .comm-date {
    color: var(--comm-selected-text) !important;
}
#encrypted-messages-list li .comm-subject {
    font-weight: 600; /* Slightly bolder subject */
    color: var(--marvel-text-primary);
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}
#encrypted-messages-list li.unread-message .comm-subject { /* Updated from unread-email */
    font-weight: 700;
    color: var(--comm-unread-text); /* Bright cyan for unread */
}
#encrypted-messages-list li .comm-sender,
#encrypted-messages-list li .comm-date {
    font-size: 0.8rem;
    color: var(--marvel-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}
#encrypted-messages-list li.selected .comm-sender,
#encrypted-messages-list li.selected .comm-date {
    color: var(--comm-selected-text) !important;
    opacity: 0.9;
}
/* Item icons for messages handled by getItemIconMarvel via JS renderer */

.comm-view-pane {
    flex-grow: 1;
    padding: 1.3rem;
    background-color: var(--comm-bg-main); /* Can be themed specifically for messages */
    color: var(--comm-text-primary);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    scrollbar-gutter: stable;
    font-family: var(--font-primary-text-marvel);
}

#comm-subject-display {
    font-size: 1.5rem;
    font-weight: 600; /* Bolder subject display */
    color: var(--comm-text-primary);
    margin-bottom: 0.6rem;
    padding-bottom: 0.9rem;
    border-bottom: 1px solid var(--comm-border-light);
    line-height: 1.35;
    flex-shrink: 0;
}
#comm-sender-display {
    font-size: 0.95rem;
    color: var(--comm-text-secondary);
    margin-bottom: 1.6rem;
    flex-shrink: 0;
}
#comm-message-body-display.prose-styles {
    font-size: 1.05rem;
    line-height: 1.7;
    color: var(--comm-text-primary);
    word-wrap: break-word;
    background-color: transparent;
    border: none;
    padding: 0.6rem 0.3rem;
    flex-grow: 1;
    overflow-y: auto;
    scrollbar-gutter: stable;
    min-height: 160px;
}
#comm-message-body-display .placeholder-text {
    color: var(--comm-text-secondary);
    font-style: normal;
    text-align: left;
    padding: 1.1rem 0;
    font-size:1rem;
}
.comm-reply-area { /* Renamed from email-reply-area */
    margin-top: 1.6rem;
    padding-top: 1.1rem;
    border-top: 1px solid var(--comm-border-light);
    flex-shrink: 0;
}
#comm-reply-input { /* Renamed from email-reply-input-rl */
    width: 100%;
    padding: 0.85rem 1.1rem;
    margin-bottom: 0.8rem;
    border: 1px solid var(--comm-border-light);
    border-radius: var(--radius-md-marvel); /* More pronounced radius */
    background-color: var(--marvel-bg-input);
    color: var(--marvel-text-primary);
    font-family: var(--font-primary-text-marvel);
    font-size: 1rem;
    min-height: 85px;
    max-height: 220px;
    resize: vertical;
    box-shadow: var(--shadow-inset-marvel);
}
#comm-reply-input:focus {
    border-color: var(--marvel-accent-cyan);
    box-shadow: 0 0 0 2px var(--marvel-accent-cyan), var(--shadow-inset-marvel);
    outline: none;
}
#comm-send-reply-btn.btn-primary { /* Renamed from email-send-reply-btn-rl */
    background: var(--comm-button-primary-bg);
    color: var(--comm-button-primary-text);
    border-color: transparent;
    font-weight: 600; /* Bolder button */
    padding: 0.65rem 1.6rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.95rem;
    border-radius: var(--radius-md-marvel);
    box-shadow: 0 2px 3px rgba(0,0,0,0.2);
}
#comm-send-reply-btn.btn-primary:hover {
    background: var(--marvel-accent-blue-hover);
    box-shadow: 0 3px 5px rgba(0,0,0,0.25);
}


/* --- Interdimensional Viewport Modal (Adaptation of Stream View) --- */
#stream-view-modal-marvel .modal-content { /* Assuming new HTML ID for Marvel stream modal */
    max-width: 1300px; /* Large for cosmic viewport */
    height: calc(100vh - 70px);
    max-height: 850px;
}
#stream-view-modal-marvel .modal-body.stream-details { /* Keep class name, re-theme */
    display: grid;
    grid-template-columns: 2.5fr 1.5fr; /* Viewport, Info/Comms area */
    grid-template-rows: auto 1fr; /* Header/Status, Content */
    gap: 1.2rem;
    padding: 1.2rem;
    height: 100%;
    background-color: var(--marvel-bg-deep); /* Deep space for background */
}
#stream-view-modal-marvel .modal-header {
    grid-column: 1 / -1;
    background-color: var(--marvel-bg-primary);
    border-bottom-color: var(--marvel-border-primary);
}
#stream-view-modal-marvel .modal-header h2 { color: var(--marvel-text-primary); text-shadow: 0 0 8px var(--marvel-accent-cyan);}

.stream-video-area { /* This can be a star map, energy signature display etc. */
    grid-column: 1 / 2;
    grid-row: 2 / 3;
    background-color: #05080F; /* Darker than bg-deep */
    border: 1px solid var(--marvel-border-secondary);
    border-radius: var(--radius-md-marvel);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    color: var(--marvel-text-muted);
    font-size: 1.6rem;
    background-image: linear-gradient(rgba(10,20,40,0.1) 1px, transparent 1px), linear-gradient(90deg, rgba(10,20,40,0.1) 1px, transparent 1px);
    background-size: 20px 20px; /* Subtle grid */
}
.stream-comments { /* For logs, incoming data streams, text comms */
    grid-column: 2 / 3;
    grid-row: 2 / 3;
    background-color: var(--marvel-bg-secondary); /* Slightly lighter than primary */
    border: 1px solid var(--marvel-border-primary);
    border-radius: var(--radius-md-marvel);
    padding: 0.9rem;
    display: flex;
    flex-direction: column-reverse;
    overflow-y: auto;
    scrollbar-gutter: stable;
    font-family: 'Courier New', Courier, monospace; /* Techy font */
}
.stream-comment {
    padding: 0.45rem 0;
    margin-bottom: 0.35rem;
    color: var(--marvel-text-primary);
    font-size: 0.9rem;
    line-height: 1.45;
    word-break: break-word;
    border-bottom: 1px solid rgba(74, 90, 128, 0.3); /* Fainter separator */
}
.stream-comment:last-child { border-bottom: none; }
.stream-comment strong { /* Source identifier */
    color: var(--marvel-accent-cyan);
    margin-right: 0.5em;
}
.stream-status-text {
    grid-column: 1 / -1;
    grid-row: 1 / 2;
    text-align: center;
    padding: 0.6rem;
    font-size: 0.95rem;
    color: var(--marvel-text-secondary);
    background-color: var(--marvel-bg-primary);
    text-shadow: 0 0 5px var(--marvel-accent-gold);
}

/* Operational Records Modal Grid Style (Adaptation of Business Modal) */
.operational-records-grid { /* Renamed class, assuming in HTML */
    display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.1rem; margin-bottom: 1.6rem;
}
.info-block-ops { /* Renamed from info-block-biz */
    background-color: var(--marvel-bg-content); padding: 0.9rem 1.1rem;
    border-radius: var(--radius-md-marvel); border: 1px solid var(--marvel-border-secondary);
    box-shadow: var(--shadow-sm-marvel);
}
.info-block-ops h4 {
    font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.9px;
    color: var(--marvel-text-muted); margin-bottom: 0.35rem;
    border-bottom: none; padding-bottom:0;
}
.info-block-ops p { font-size: 1.1rem; font-weight: 600; color: var(--marvel-text-primary); word-break: break-word; }
#record-management-actions { /* Renamed */
    margin-top:1.1rem; padding-top:1.1rem;
    border-top: 1px dashed var(--marvel-border-secondary);
}
#record-management-actions .placeholder-text { font-size: 0.9rem; text-align:center; }
#record-agency-name[title] { cursor:help; } /* Renamed */

/* General Modal Scrollbar theming for Marvel modals */
.marvel-modal ::-webkit-scrollbar { width: 9px; height: 9px; }
.marvel-modal ::-webkit-scrollbar-track { background: rgba(12,16,28,0.2); }
.marvel-modal ::-webkit-scrollbar-thumb { background: var(--marvel-scroll-thumb-hover); border-radius: 4px; }
.marvel-modal {
    scrollbar-width: thin;
    scrollbar-color: var(--marvel-scroll-thumb-hover) rgba(12,16,28,0.2);
}

/* --- MOBILE RESPONSIVENESS (Marvel Themed Adjustments) --- */
@media (max-width: 1200px) {
    :root { --sidebar-width-marvel: 260px; --utility-sidebar-width-marvel: 240px; --container-padding-marvel: 1.2rem; }
    .marvel-modal .modal-content { max-width: 92%; }
    .marvel-modal .modal-content.wide-modal { max-width: 96%; }
    .header-info-cluster { display: none; }
    #comm-network-modal .modal-body.comm-details { flex-direction: column; } /* Stack inbox and view */
    .comm-inbox-pane { width: 100%; max-height: 280px; overflow-y: auto; margin-bottom: 1.2rem; }
    .comm-view-pane { flex-grow: 1; }
    #stream-view-modal-marvel .modal-body.stream-details { grid-template-columns: 1fr; grid-template-rows: auto auto 1fr; } /* Stack for stream */
    .stream-video-area { grid-row: 2 / 3; min-height: 220px; }
    .stream-comments { grid-row: 3 / 4; }
}

@media (max-width: 768px) {
    :root { --header-height-marvel: 55px; --container-padding-marvel: 1rem; font-size: 15px; }
    #game-header .controls { gap: 0.6rem; }
    #exit-game-btn { width: 36px; height: 36px; font-size: 1.2rem; }
    #game-main-content { grid-template-columns: 1fr; padding: var(--container-padding-marvel); padding-top: 0.6rem; gap: 0.9rem; display: flex; flex-direction: column; }
    #chat-area { max-height: none; min-height: 55vh; flex-grow: 1; flex-shrink: 1; } /* More chat area */
    #character-sidebar, #utility-sidebar { position: fixed; top: 0; left: -100%; width: 90%; max-width: 320px; height: 100%; max-height: 100vh; z-index: var(--z-sidebar); transition: transform 0.35s var(--transition-smooth-marvel); border-radius: 0; border: none; box-shadow: var(--shadow-lg-marvel); overflow: hidden; padding: 0; }
    #character-sidebar .sidebar-content, #utility-sidebar .sidebar-content { height: 100%; overflow-y: auto; padding: var(--container-padding-marvel); scrollbar-gutter: stable both-edges; }
    #character-sidebar { border-right: 1px solid var(--marvel-border-primary); }
    #utility-sidebar { left: auto; right: -100%; border-left: 1px solid var(--marvel-border-primary); border-right: none; }
    #character-sidebar.mobile-visible, #utility-sidebar.mobile-visible { transform: translateX(0); }
    body.marvel-theme.sidebar-open::after { content: ''; position: fixed; inset: 0; background-color: rgba(8, 10, 20, 0.8); backdrop-filter: blur(5px); z-index: calc(var(--z-sidebar) - 1); opacity: 1; visibility: visible; transition: opacity 0.3s ease, visibility 0s 0s; pointer-events: auto; }
    body.marvel-theme:not(.sidebar-open)::after { opacity: 0; visibility: hidden; transition: opacity 0.3s ease, visibility 0s 0.3s; pointer-events: none; }
    #input-area { min-height: auto; padding: 0.65rem var(--container-padding-marvel);}
    #player-input { font-size: 1rem; padding: 0.65rem 0.9rem; min-height: 44px; max-height: 160px; }
    #send-button { height: 44px; width: 44px; font-size: 1.6rem; }
    .marvel-modal .modal-content { max-width: 95%; width: 95%; max-height: 92vh; }
    #comm-network-modal .modal-content { height: calc(100vh - 65px); max-height: none;}
    .mobile-toggle-button { display: inline-flex; width: 38px; height: 38px; padding: 0; font-size: 1.3rem; background: none; border: none; color: var(--marvel-text-secondary); transition: color 0.2s ease; border-radius: var(--radius-sm-marvel); align-items: center; justify-content: center; }
    .mobile-toggle-button:hover { color: var(--marvel-text-primary); background-color: rgba(255,255,255,0.08); }
    #game-title { font-size: 1.5rem; } #game-title::before { font-size: 1.35em; }
}

@media (max-width: 480px) {
    :root { font-size: 14px; }
    #game-main-content { padding: 0.7rem; gap: 0.7rem; }
    #input-area { padding: 0.5rem 0.7rem; }
    #player-input { font-size: 0.95rem; padding: 0.55rem 0.8rem; min-height: 40px; }
    #send-button { height: 40px; width: 40px; font-size: 1.5rem; }
    .message { gap: 0.6rem; }
    .message-avatar { width: 34px; height: 34px; border-width: 1.5px; }
    .message-content { padding: 0.6rem 0.9rem; padding-bottom: 1.5rem; font-size: 0.95rem; }
    #hero-avatar-area { width: 80px; height: 80px; border-width: 2.5px; }
    #secret-identity-name.sidebar-char-name { font-size: 1.3rem; }
    .info-pair { font-size: 0.88rem; }
    .utility-widget { min-height: 90px; padding: 0.65rem 0.35rem; }
    .widget-icon-emoji { font-size: 1.7rem; }
    .widget-label { font-size: 0.7rem; }
    .marvel-modal .modal-body { padding: 0.9rem; }
    .marvel-modal .modal-header { padding: 0.8rem 1.1rem; padding-right: 2.7rem; }
    .marvel-modal h2 { font-size: 1.2rem; }
    .marvel-modal .modal-close-btn { width: 30px; height: 30px; line-height: 30px; font-size: 1.6rem; top: 6px; right: 6px;}
    .marvel-modal .tab-content.scrollable-area, #strategic-map-overview-container, #strategic-map-detail-container, #classified-intel-display.prose-styles { max-height: calc(90vh - 160px); }
    .comm-inbox-pane { width:100%; max-height: 200px;}
    #comm-subject-display {font-size:1.3rem;}
    #comm-message-body-display.prose-styles {font-size:0.95rem;}
}

/* === ДОБАВЬТЕ ЭТОТ БЛОК СТИЛЕЙ В game.css === */

#vfx-container {
    position: fixed;
    inset: 0;
    z-index: 50; /* Этот слой НАД основным интерфейсом, но ПОД модальными окнами */
    pointer-events: none; /* Пропускает клики мыши насквозь */
    overflow: hidden;
}

#weather-container, .fullscreen-effect-layer {
    position: absolute;
    inset: 0;
}

/* Стили для частиц погоды */
.raindrop, .snowflake {
    position: absolute;
    pointer-events: none;
    will-change: transform;
}
.raindrop {
    width: 1.5px;
    height: 70px;
    background: linear-gradient(to bottom, rgba(173,216,230,0), rgba(173,216,230,0.5));
    animation: rain-fall 1s linear infinite;
}
.snowflake {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: white;
    box-shadow: 0 0 8px 2px white;
    animation: snow-fall 8s linear infinite;
}

@keyframes rain-fall {
    from { transform: translateY(-20vh); }
    to { transform: translateY(110vh); }
}

@keyframes snow-fall {
    0% { transform: translateY(-20vh) translateX(0vw) rotate(0deg); opacity: 1; }
    50% { transform: translateX(5vw); }
    100% { transform: translateY(110vh) translateX(-5vw) rotate(720deg); opacity: 0; }
}

/* Файл: got-game.css */
/* Вставьте этот код в самый конец файла */

/* ================== SLEEP ANIMATION (NEW) ================== */
#sleep-overlay {
    /* Плавное затемнение, дольше чем у обычного лоадера */
    transition: opacity 2s ease-in-out; 
    /* Очень тёмный, но не полностью черный фон */
    background-color: rgba(0, 0, 0, 0.96); 
    /* Убедимся, что он поверх других анимаций, но ниже модалок */
    z-index: var(--z-overlay); 
}

/* Убираем рамки и фон у контейнера внутри оверлея сна */
#sleep-overlay .overlay-content {
    background: none;
    border: none;
    box-shadow: none;
    color: var(--got-text-muted); /* Тусклый цвет для текста */
}

/* Стили для иконки и текста */
#sleep-animation-icon {
    font-size: 4rem; /* Большая иконка луны/солнца */
    animation: slow-pulse 4s ease-in-out infinite;
    margin-bottom: 1rem;
    color: var(--got-accent-blue); /* "Ночной" цвет */
}

#sleep-animation-text {
    font-size: 1rem;
    font-style: italic;
}

@keyframes slow-pulse {
    0% { transform: scale(1); opacity: 0.7; }
    50% { transform: scale(1.05); opacity: 1; }
    100% { transform: scale(1); opacity: 0.7; }
}
/* ============================================= */