:root {
    --bg-dark: #050505;
    --bg-panel: #111111;
    --border-color: #333;
    --text-primary: #e0e0e0;
    --text-secondary: #888;
    --accent-color: #d32f2f;
    /* SCP Red */
    --accent-glow: rgba(211, 47, 47, 0.4);
    --system-green: #00ff41;
    --scan-line-color: rgba(255, 255, 255, 0.03);

    --font-heading: 'Rajdhani', sans-serif;
    --font-mono: 'Share Tech Mono', monospace;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: var(--font-heading);
    height: 100vh;
    overflow: hidden;
    user-select: none;
}

/* Boot Screen */
#boot-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: var(--font-mono);
    color: var(--system-green);
    text-align: center;
    animation: fadeOutBoot 0.5s ease-out 2s forwards;
    /* Faster boot */
    pointer-events: none;
}

.boot-text p {
    margin: 10px 0;
    font-size: 1.2rem;
    text-shadow: 0 0 5px var(--system-green);
}

.blink {
    animation: blinker 1s linear infinite;
}

@keyframes blinker {
    50% {
        opacity: 0;
    }
}

@keyframes nukeShake {
    0% {
        transform: translate(0, 0) rotate(0deg);
    }

    10% {
        transform: translate(-10px, -10px) rotate(-1deg);
    }

    20% {
        transform: translate(10px, 10px) rotate(1deg);
    }

    30% {
        transform: translate(-10px, 10px) rotate(0deg);
    }

    40% {
        transform: translate(10px, -10px) rotate(1deg);
    }

    50% {
        transform: translate(-5px, -5px) rotate(-1deg);
    }

    60% {
        transform: translate(5px, 5px) rotate(0deg);
    }

    70% {
        transform: translate(-5px, 5px) rotate(1deg);
    }

    80% {
        transform: translate(5px, -5px) rotate(-1deg);
    }

    90% {
        transform: translate(0, 0) rotate(0deg);
    }

    100% {
        transform: translate(0, 0) rotate(0deg);
    }
}

.shaking {
    animation: nukeShake 0.5s ease-in-out;
}

@keyframes fadeOutBoot {
    to {
        opacity: 0;
        visibility: hidden;
    }
}

/* Interface Structure */
#interface-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    opacity: 0;
    animation: fadeInUI 1s ease-out 2.2s forwards;
}

@keyframes fadeInUI {
    to {
        opacity: 1;
    }
}

/* Header */
#main-header {
    height: 80px;
    background: var(--bg-panel);
    border-bottom: 2px solid var(--accent-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
    box-shadow: 0 2px 20px var(--accent-glow);
    z-index: 1000;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.scp-svg {
    width: 50px;
    height: 50px;
    color: var(--accent-color);
    animation: rotateLogo 20s linear infinite;
}

@keyframes rotateLogo {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.logo-area h1 {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.8rem;
    letter-spacing: 2px;
    line-height: 1;
}

.logo-area h2 {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--text-secondary);
    letter-spacing: 1px;
}

.header-controls {
    text-align: right;
    font-family: var(--font-mono);
}


/* Header Budget */
.budget-display {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-right: 2rem;
    display: inline-block;
}

#budget-amount {
    color: var(--system-green);
    font-weight: bold;
    text-shadow: 0 0 5px rgba(0, 255, 65, 0.3);
}

#clock {
    font-size: 1.2rem;
    color: var(--text-primary);
}

.status-indicator {
    font-size: 0.8rem;
    margin-top: 4px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
}

.status-indicator::before {
    content: '';
    display: block;
    width: 8px;
    height: 8px;
    background: var(--system-green);
    border-radius: 50%;
    box-shadow: 0 0 5px var(--system-green);
}

/* Main Content Layout */
#main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
    position: relative;
}

/* Sidebar */
#sidebar {
    width: 300px;
    background: var(--bg-panel);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 1rem;
    z-index: 500;
}

#sidebar h3 {
    color: var(--accent-color);
    font-family: var(--font-mono);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
    letter-spacing: 1px;
}

#sites-list {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 1rem;
}

.site-item {
    background: rgba(40, 40, 40, 0.4);
    border-left: 3px solid var(--text-secondary);
    padding: 10px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: var(--font-mono);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-item:hover {
    background: rgba(255, 255, 255, 0.1);
    border-left-color: var(--system-green);
}

.site-item.active {
    border-left-color: var(--accent-color);
    background: rgba(211, 47, 47, 0.1);
}

.delete-btn {
    background: none;
    border: none;
    color: #555;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0 5px;
}

.delete-btn:hover {
    color: var(--accent-color);
}

.empty-state {
    color: var(--text-secondary);
    font-style: italic;
    font-size: 0.9rem;
    text-align: center;
    margin-top: 2rem;
}

.custom-scroll::-webkit-scrollbar {
    width: 6px;
}

.custom-scroll::-webkit-scrollbar-track {
    background: #000;
}

.custom-scroll::-webkit-scrollbar-thumb {
    background: #333;
}

.controls-area {
    border-top: 1px solid var(--border-color);
    padding-top: 1rem;
    text-align: center;
}

.danger-btn {
    background: rgba(255, 0, 0, 0.1);
    border: 1px solid var(--accent-color);
    color: var(--accent-color);
    padding: 8px 16px;
    font-family: var(--font-mono);
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
}

.danger-btn:hover {
    background: var(--accent-color);
    color: white;
    box-shadow: 0 0 10px var(--accent-glow);
}

.instruction {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
    font-family: var(--font-mono);
}

/* Map Area */
#map-wrapper {
    flex: 1;
    position: relative;
    background: #060608;
    overflow: hidden;
}

#map-container {
    width: 100%;
    height: 100%;
}

svg {
    width: 100%;
    height: 100%;
}

/* Styles D3 */
.country {
    fill: #1a1a1a;
    stroke: #333;
    stroke-width: 0.5px;
    vector-effect: non-scaling-stroke;
    transition: fill 0.2s;
}

.country:hover {
    fill: #252525;
}

.country-glow {
    /* filter: drop-shadow(0 0 2px rgba(255, 255, 255, 0.1)); REMOVED PERF */
    stroke: rgba(255, 255, 255, 0.2);
}

.graticule {
    fill: none;
    stroke: rgba(255, 255, 255, 0.05);
    stroke-width: 0.5px;
}

/* Site Markers */
/* Larger Icons Logic in JS, but specific styles here */
.site-marker path.icon-shape {
    fill: var(--accent-color);
    stroke: #000;
    stroke-width: 0.5px;
    cursor: grab;
    /* filter: drop-shadow(0 0 2px var(--accent-color)); REMOVED PERF */
    transition: fill 0.2s;
}

/* Globe Glow */
.globe-glow {
    filter: blur(20px);
    mix-blend-mode: screen;
}

/* Scan Line Animation */
.scan-line {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: rgba(255, 255, 255, 0.05);
    /* box-shadow: 0 0 10px rgba(255, 255, 255, 0.2); REMOVED PERF */
    animation: scan 8s linear infinite;
    pointer-events: none;
    z-index: 401;
}

@keyframes scan {
    0% {
        transform: translateY(0);
        opacity: 0;
    }

    10% {
        opacity: 1;
    }

    90% {
        opacity: 1;
    }

    100% {
        transform: translateY(100vh);
        opacity: 0;
    }
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    /* backdrop-filter: blur(2px); REMOVED FOR PERFORMANCE */
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: var(--bg-panel);
    border: 1px solid var(--accent-color);
    box-shadow: 0 0 20px var(--accent-glow);
    width: 450px;
    padding: 2px;
}

.modal-header {
    background: rgba(211, 47, 47, 0.1);
    padding: 10px;
    border-bottom: 1px solid var(--accent-color);
}

.modal-header h3 {
    color: var(--accent-color);
    font-family: var(--font-mono);
    text-align: center;
    letter-spacing: 2px;
}

.modal-body {
    padding: 20px;
}

/* Modal Updates */
.modal-section {
    margin-bottom: 20px;
}

label {
    display: block;
    font-family: var(--font-mono);
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.icon-selector {
    display: flex;
    gap: 15px;
    margin-top: 10px;
    justify-content: center;
}

.icon-option {
    width: 60px;
    height: 60px;
    border: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-secondary);
}

.icon-option svg {
    width: 30px;
    height: 30px;
}

.icon-option:hover {
    border-color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.icon-option.selected {
    border-color: var(--accent-color);
    color: var(--accent-color);
    background: rgba(211, 47, 47, 0.1);
    box-shadow: 0 0 10px rgba(211, 47, 47, 0.2);
}

.cost-display {
    font-family: var(--font-mono);
    color: var(--text-secondary);
    font-size: 0.9rem;
    text-align: right;
    border-top: 1px dashed var(--border-color);
    padding-top: 10px;
}

.cost-value {
    color: var(--accent-color);
    font-weight: bold;
    margin-left: 10px;
}


input[type="text"] {
    width: 100%;
    background: #000;
    border: 1px solid var(--border-color);
    color: var(--system-green);
    font-family: var(--font-mono);
    font-size: 1.2rem;
    padding: 10px;
    outline: none;
    transition: border 0.3s;
}

input[type="text"]:focus {
    border-color: var(--system-green);
    box-shadow: 0 0 5px rgba(0, 255, 65, 0.3);
}

.modal-coords {
    margin-top: 15px;
    font-size: 0.8rem;
    font-family: var(--font-mono);
    color: var(--text-secondary);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 10px 20px 20px;
}

button {
    padding: 10px 20px;
    font-family: var(--font-mono);
    font-weight: bold;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

.primary-btn {
    background: var(--accent-color);
    color: white;
}

.primary-btn:hover {
    background: #b71c1c;
    box-shadow: 0 0 10px var(--accent-glow);
}

.secondary-btn {
    background: transparent;
    border: 1px solid var(--text-secondary);
    color: var(--text-secondary);
}

.secondary-btn:hover {
    border-color: var(--text-primary);
    color: var(--text-primary);
}

/* MISSION ANIMATIONS & MODAL */
@keyframes missionPulse {
    0% {
        r: 6px;
        stroke-opacity: 1;
        stroke-width: 1px;
    }

    50% {
        r: 25px;
        stroke-opacity: 0;
        stroke-width: 0px;
    }

    100% {
        r: 6px;
        stroke-opacity: 0;
        stroke-width: 0px;
    }
}

.mission-pulse-ring {
    fill: none;
    pointer-events: none;
    animation: missionPulse 2s infinite;
}

/* MISSION MODAL SPECIFIC */
.mission-detail-grid {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.mission-image-container {
    background: #000;
    border: 1px solid var(--border-color);
    display: flex;
    justify-content: center;
    align-items: center;
    height: 140px;
    width: 140px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.8);
}

.mission-image-placeholder {
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(45deg,
            #050505,
            #050505 10px,
            #111 10px,
            #111 20px);
    display: flex;
    justify-content: center;
    align-items: center;
    color: #333;
    font-size: 0.8rem;
    font-weight: bold;
    text-align: center;
    padding: 10px;
    border: 1px solid #333;
}

.mission-info-col {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mission-stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px dashed #333;
    padding-bottom: 4px;
}

.mission-stat-label {
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.mission-stat-value {
    color: var(--text-primary);
    font-weight: bold;
    font-family: var(--font-mono);
}

.tier-badge {
    padding: 2px 6px;
    border-radius: 2px;
    background: #333;
    color: #fff;
    font-size: 0.7rem;
    font-weight: bold;
    text-shadow: 0 0 2px black;
}

/* MISSION PROGRESS BAR */
.mission-progress-container {
    fill: #1a1a1a;
    stroke: #333;
    stroke-width: 1;
}

.mission-progress-bar {
    fill: var(--system-green);
    transition: width 0.2s linear;
}

.tool-controls {
    display: flex;
    align-items: center;
    gap: 5px;
}

.tool-btn {
    border-radius: 2px;
    cursor: pointer;
    font-family: var(--font-mono);
    opacity: 0.8;
    transition: all 0.2s;
}

.tool-btn:hover {
    opacity: 1;
}

.tool-btn.active {
    opacity: 1;
    font-weight: bold;
    box-shadow: 0 0 5px var(--system-green);
}

/* INFO BUTTON */
.info-btn {
    background: none;
    border: 1px solid var(--text-secondary);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.7rem;
    padding: 2px 6px;
    font-family: var(--font-mono);
    transition: all 0.2s;
}

.info-btn:hover {
    color: var(--system-green);
    border-color: var(--system-green);
    box-shadow: 0 0 5px rgba(0, 255, 65, 0.3);
}

.adjust-btn {
    background: #333;
    border: 1px solid #555;
    color: #fff;
    width: 25px;
    height: 25px;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 2px;
}

.adjust-btn:hover {
    background: var(--accent-color);
    border-color: var(--accent-color);
}

/* =========================================
   DANGER SYSTEM
   ========================================= */

.danger-display {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-right: 20px;
    font-family: var(--font-mono);
}

.danger-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.danger-bar-container {
    width: 120px;
    height: 12px;
    background: #222;
    border: 1px solid #444;
    position: relative;
    overflow: hidden;
}

.danger-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #00ff00, #ffff00, #ff8800, #ff0000);
    transition: width 0.3s ease;
    position: relative;
}

.danger-bar-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(-45deg,
            transparent,
            transparent 3px,
            rgba(0, 0, 0, 0.2) 3px,
            rgba(0, 0, 0, 0.2) 6px);
}

.danger-value {
    font-size: 0.9rem;
    font-weight: bold;
    color: var(--system-green);
    min-width: 40px;
    text-align: right;
}

.danger-value.warning {
    color: #ffcc00;
}

.danger-value.critical {
    color: #ff4444;
    animation: dangerPulse 0.5s infinite;
}

@keyframes dangerPulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

/* Danger Flash Overlay */
.danger-flash-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 8000;
    background: transparent;
    transition: background 0.5s ease;
}

.danger-flash-overlay.active {
    animation: redFlash 2s infinite;
}

@keyframes redFlash {

    0%,
    100% {
        background: rgba(255, 0, 0, 0);
    }

    50% {
        background: rgba(255, 0, 0, 0.15);
    }
}

/* Game Over Screen */
.game-over-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: fadeInGameOver 1s ease-out;
}

.game-over-screen.hidden {
    display: none;
}

@keyframes fadeInGameOver {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.game-over-content {
    text-align: center;
    max-width: 600px;
    padding: 40px;
    border: 2px solid #ff0000;
    background: rgba(50, 0, 0, 0.8);
    box-shadow: 0 0 50px rgba(255, 0, 0, 0.5);
}

.game-over-icon {
    font-size: 80px;
    animation: iconPulse 1s infinite;
}

@keyframes iconPulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

.game-over-content h1 {
    color: #ff0000;
    font-family: var(--font-heading);
    font-size: 3rem;
    margin: 20px 0 10px;
    text-shadow: 0 0 20px rgba(255, 0, 0, 0.8);
    animation: glitchText 0.1s infinite;
}

@keyframes glitchText {
    0% {
        transform: translate(0);
    }

    20% {
        transform: translate(-2px, 2px);
    }

    40% {
        transform: translate(2px, -2px);
    }

    60% {
        transform: translate(-1px, 1px);
    }

    80% {
        transform: translate(1px, -1px);
    }

    100% {
        transform: translate(0);
    }
}

.game-over-content h2 {
    color: #ff4444;
    font-family: var(--font-mono);
    font-size: 1.2rem;
    letter-spacing: 3px;
    margin-bottom: 20px;
}

.game-over-content p {
    color: #ccc;
    font-size: 1rem;
    line-height: 1.6;
    margin: 10px 0;
}

.game-over-content .casualties {
    color: #ff0000;
    font-family: var(--font-mono);
    font-size: 1.3rem;
    margin-top: 20px;
    padding: 10px;
    border: 1px dashed #ff0000;
    background: rgba(255, 0, 0, 0.1);
}

.game-over-content .casualties span {
    font-weight: bold;
    animation: flickerNumber 0.2s infinite;
}

@keyframes flickerNumber {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

/* =========================================
   NUCLEAR STRIKE SYSTEM
   ========================================= */

.nuke-btn {
    background: linear-gradient(180deg, #ff6600, #cc0000);
    border: 2px solid #ffcc00;
    color: #fff;
    padding: 10px 15px;
    font-family: var(--font-mono);
    font-weight: bold;
    font-size: 0.9rem;
    cursor: pointer;
    text-shadow: 0 0 5px #000;
    box-shadow: 0 0 10px rgba(255, 100, 0, 0.5);
    transition: all 0.3s;
    animation: nukeGlow 1.5s infinite;
}

.nuke-btn:hover {
    background: linear-gradient(180deg, #ff8800, #ff0000);
    box-shadow: 0 0 20px rgba(255, 100, 0, 0.8);
    transform: scale(1.05);
}

@keyframes nukeGlow {

    0%,
    100% {
        box-shadow: 0 0 10px rgba(255, 100, 0, 0.5);
    }

    50% {
        box-shadow: 0 0 20px rgba(255, 200, 0, 0.8);
    }
}

/* Nuke explosion effect on map */
.nuke-explosion {
    pointer-events: none;
}

.nuke-explosion circle.blast {
    fill: none;
    stroke: #ff6600;
    stroke-width: 3;
}

.nuke-explosion circle.core {
    fill: #ffff00;
}

.nuke-flash-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: white;
    z-index: 9500;
    pointer-events: none;
    opacity: 0;
}

.nuke-flash-overlay.active {
    animation: nukeFlash 1s ease-out forwards;
}

@keyframes nukeFlash {
    0% {
        opacity: 1;
    }

    100% {
        opacity: 0;
    }
}

/* =========================================
   RESEARCH SYSTEM
   ========================================= */

.research-btn {
    background: linear-gradient(180deg, #1a4a1a, #0a2a0a);
    border: 1px solid var(--system-green);
    color: var(--system-green);
    padding: 10px 16px;
    font-family: var(--font-mono);
    font-weight: bold;
    cursor: pointer;
    width: 100%;
    margin-bottom: 10px;
    transition: all 0.3s;
}

.research-btn:hover {
    background: linear-gradient(180deg, #2a5a2a, #1a4a1a);
    box-shadow: 0 0 15px rgba(0, 255, 65, 0.3);
}

.research-branch {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid #333;
    margin-bottom: 15px;
    padding: 10px;
}

.branch-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 10px;
    border-bottom: 1px dashed #333;
    margin-bottom: 10px;
}

.branch-icon {
    font-size: 1.5rem;
}

.branch-title {
    font-family: var(--font-heading);
    font-weight: bold;
    color: var(--text-primary);
    font-size: 1rem;
}

.branch-desc {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-left: auto;
}

.research-items {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.research-item {
    background: rgba(20, 20, 20, 0.8);
    border: 1px solid #444;
    padding: 10px;
    width: 180px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.research-item:hover {
    border-color: var(--system-green);
    background: rgba(0, 255, 65, 0.05);
}

.research-item.locked {
    opacity: 0.5;
    cursor: not-allowed;
}

.research-item.locked:hover {
    border-color: #444;
    background: rgba(20, 20, 20, 0.8);
}

.locked-reason {
    color: #ff4444;
    font-size: 0.6rem;
    font-weight: bold;
    margin-top: 5px;
    text-align: center;
    border-top: 1px dotted #ff4444;
    padding-top: 3px;
    text-transform: uppercase;
}

.research-item.unlocked {
    border-color: var(--system-green);
    background: rgba(0, 255, 65, 0.1);
}

.research-item.unlocked::after {
    content: '✓';
    position: absolute;
    top: 5px;
    right: 5px;
    color: var(--system-green);
    font-weight: bold;
}

.research-item-icon {
    font-size: 1.5rem;
    text-align: center;
    margin-bottom: 5px;
}

.research-item-name {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-primary);
    text-align: center;
    margin-bottom: 5px;
    font-weight: bold;
}

.research-item-desc {
    font-size: 0.65rem;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 8px;
    min-height: 25px;
}

.research-item-cost {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: #ffcc00;
    text-align: center;
    padding-top: 5px;
    border-top: 1px dashed #333;
}

.research-item.unlocked .research-item-cost {
    color: var(--system-green);
}

.research-item.affordable .research-item-cost {
    color: var(--system-green);
}

.research-stats {
    display: flex;
    gap: 20px;
    font-family: var(--font-mono);
    font-size: 0.8rem;
}

/* Nuke button locked state */
.nuke-btn.locked {
    background: #333;
    border-color: #555;
    color: #666;
    cursor: not-allowed;
    animation: none;
    box-shadow: none;
}

.nuke-btn.locked:hover {
    transform: none;
    box-shadow: none;
    background: #333;
}

/* =========================================
   NUCLEAR STRIKE CONFIRMATION MODAL
   ========================================= */

.nuke-confirm-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease-out;
}

.nuke-confirm-modal.hidden {
    display: none;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.nuke-confirm-bg {
    position: absolute;
    font-size: 50vmin;
    color: rgba(255, 100, 0, 0.08);
    z-index: 0;
    animation: nukeBgPulse 2s infinite;
    user-select: none;
    pointer-events: none;
}

@keyframes nukeBgPulse {

    0%,
    100% {
        transform: scale(1);
        color: rgba(255, 100, 0, 0.08);
    }

    50% {
        transform: scale(1.05);
        color: rgba(255, 150, 0, 0.12);
    }
}

.nuke-confirm-content {
    position: relative;
    z-index: 1;
    background: linear-gradient(180deg, rgba(80, 30, 0, 0.9), rgba(30, 10, 0, 0.95));
    border: 3px solid #ff6600;
    box-shadow:
        0 0 50px rgba(255, 100, 0, 0.4),
        inset 0 0 30px rgba(255, 100, 0, 0.1);
    padding: 0;
    max-width: 500px;
    width: 90%;
}

.nuke-confirm-header {
    background: linear-gradient(180deg, #ff6600, #cc3300);
    padding: 20px;
    text-align: center;
    border-bottom: 2px solid #ff8800;
}

.nuke-icon-large {
    font-size: 3rem;
    display: block;
    animation: iconPulseNuke 0.5s infinite;
}

@keyframes iconPulseNuke {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

.nuke-confirm-header h1 {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    color: #fff;
    margin: 10px 0 5px;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    letter-spacing: 3px;
}

.nuke-confirm-header h2 {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: #ffcc00;
    letter-spacing: 2px;
}

.nuke-confirm-body {
    padding: 25px;
}

.nuke-target-info {
    text-align: center;
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px dashed #ff6600;
}

.nuke-label {
    font-family: var(--font-mono);
    color: #888;
    font-size: 0.9rem;
}

.nuke-value {
    font-family: var(--font-heading);
    color: #fff;
    font-size: 1.5rem;
    margin-left: 10px;
}

.nuke-stats {
    display: flex;
    justify-content: space-around;
    margin-bottom: 20px;
}

.nuke-stat {
    text-align: center;
}

.nuke-stat-label {
    display: block;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: #888;
    margin-bottom: 5px;
}

.nuke-stat-value {
    font-family: var(--font-mono);
    font-size: 1.2rem;
    color: #ffcc00;
    font-weight: bold;
}

.nuke-stat-value.danger {
    color: #ff4444;
}

.nuke-stat-value.none {
    color: #666;
}

.nuke-warning {
    text-align: center;
    padding: 15px;
    background: rgba(255, 0, 0, 0.2);
    border: 1px solid #ff4444;
    color: #ff6666;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    animation: warningFlash 1s infinite;
}

@keyframes warningFlash {

    0%,
    100% {
        background: rgba(255, 0, 0, 0.2);
    }

    50% {
        background: rgba(255, 0, 0, 0.35);
    }
}

.nuke-confirm-footer {
    display: flex;
    justify-content: space-between;
    padding: 20px;
    background: rgba(0, 0, 0, 0.5);
    border-top: 1px solid #333;
}

.nuke-confirm-btn {
    background: linear-gradient(180deg, #ff4400, #cc0000);
    border: 2px solid #ff6600;
    color: #fff;
    padding: 15px 30px;
    font-family: var(--font-mono);
    font-weight: bold;
    font-size: 1rem;
    cursor: pointer;
    text-shadow: 0 0 5px #000;
    box-shadow: 0 0 15px rgba(255, 100, 0, 0.5);
    transition: all 0.3s;
    animation: confirmBtnPulse 1s infinite;
}

.nuke-confirm-btn:hover {
    background: linear-gradient(180deg, #ff6600, #ff0000);
    box-shadow: 0 0 25px rgba(255, 100, 0, 0.8);
    transform: scale(1.05);
}

@keyframes confirmBtnPulse {

    0%,
    100% {
        box-shadow: 0 0 15px rgba(255, 100, 0, 0.5);
    }

    50% {
        box-shadow: 0 0 25px rgba(255, 150, 0, 0.8);
    }
}

/* =========================================
   SITE UPGRADE SYSTEM
   ========================================= */

.upgrade-btn {
    background: linear-gradient(180deg, #1a3a5a, #0a2040);
    border: 1px solid #00aaff;
    color: #00ccff;
    padding: 8px 15px;
    font-family: var(--font-mono);
    font-weight: bold;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s;
}

.upgrade-btn:hover {
    background: linear-gradient(180deg, #2a4a6a, #1a3a5a);
    box-shadow: 0 0 10px rgba(0, 170, 255, 0.4);
}

.upgrade-btn:disabled {
    background: #222;
    border-color: #444;
    color: #555;
    cursor: not-allowed;
}

/* =========================================
   QTE BREACH MODAL
   ========================================= */

.qte-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(50, 0, 0, 0.95);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: qteFlash 0.5s infinite;
}

.qte-modal.hidden {
    display: none;
}

@keyframes qteFlash {

    0%,
    100% {
        background: rgba(50, 0, 0, 0.95);
    }

    50% {
        background: rgba(80, 0, 0, 0.95);
    }
}

.qte-content {
    background: linear-gradient(180deg, #200000, #100000);
    border: 3px solid #ff0000;
    box-shadow:
        0 0 50px rgba(255, 0, 0, 0.6),
        inset 0 0 30px rgba(255, 0, 0, 0.1);
    padding: 0;
    min-width: 500px;
    animation: qtePulse 0.3s infinite;
}

@keyframes qtePulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.01);
    }
}

.qte-header {
    background: linear-gradient(180deg, #ff0000, #aa0000);
    padding: 20px;
    text-align: center;
}

.qte-alert {
    font-family: var(--font-mono);
    font-size: 1.2rem;
    color: #fff;
    font-weight: bold;
    animation: blink 0.3s infinite;
    letter-spacing: 2px;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.qte-site {
    font-family: var(--font-heading);
    font-size: 2rem;
    color: #ffcc00;
    margin-top: 10px;
    text-shadow: 0 0 10px rgba(255, 200, 0, 0.5);
}

.qte-body {
    padding: 30px;
}

.qte-instruction {
    text-align: center;
    font-family: var(--font-mono);
    font-size: 1rem;
    color: #888;
    margin-bottom: 20px;
    letter-spacing: 2px;
}

.qte-sequence {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 25px;
}

.qte-key {
    width: 50px;
    height: 50px;
    border: 2px solid #666;
    background: #111;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: var(--font-mono);
    font-size: 1.5rem;
    font-weight: bold;
    color: #888;
    transition: all 0.1s;
}

.qte-key.active {
    border-color: #ffcc00;
    color: #ffcc00;
    background: rgba(255, 200, 0, 0.1);
    box-shadow: 0 0 15px rgba(255, 200, 0, 0.5);
    transform: scale(1.1);
}

.qte-key.correct {
    border-color: var(--system-green);
    color: var(--system-green);
    background: rgba(0, 255, 0, 0.1);
}

.qte-key.wrong {
    border-color: #ff0000;
    color: #ff0000;
    background: rgba(255, 0, 0, 0.2);
    animation: shake 0.3s;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    75% {
        transform: translateX(5px);
    }
}

.qte-timer-container {
    width: 100%;
    height: 8px;
    background: #222;
    border: 1px solid #444;
    margin-bottom: 15px;
}

.qte-timer-bar {
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, #ff0000, #ffcc00, var(--system-green));
    transition: width 0.1s linear;
}

.qte-stats {
    display: flex;
    justify-content: space-between;
    font-family: var(--font-mono);
    font-size: 0.9rem;
}

.qte-errors {
    color: #ff4444;
}

.qte-remaining {
    color: #00ccff;
}

/* =========================================
   REVOLT WARNING SYSTEM
   ========================================= */

.revolt-warning-banner {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(90deg, #440000, #880000, #440000);
    color: #fff;
    padding: 12px 20px;
    font-family: var(--font-mono);
    font-size: 1rem;
    font-weight: bold;
    text-align: center;
    z-index: 9000;
    animation: revoltBannerFlash 0.5s infinite;
    letter-spacing: 1px;
    border-bottom: 2px solid #ff4444;
    cursor: pointer;
}

.revolt-warning-banner:hover {
    background: linear-gradient(90deg, #660000, #cc0000, #660000);
}

.revolt-warning-banner .qte-prompt {
    color: #ffcc00;
    text-decoration: underline;
    animation: blink 0.5s infinite;
}

.revolt-warning-banner.hidden {
    display: none;
}

@keyframes revoltBannerFlash {

    0%,
    100% {
        background: linear-gradient(90deg, #440000, #880000, #440000);
    }

    50% {
        background: linear-gradient(90deg, #660000, #aa0000, #660000);
    }
}

/* Revolt flash on danger overlay */
.danger-flash-overlay.revolt-flash {
    opacity: 1;
    animation: revoltScreenFlash 0.8s infinite;
    pointer-events: none;
}

@keyframes revoltScreenFlash {

    0%,
    100% {
        opacity: 0.15;
        background: rgba(255, 0, 0, 0.3);
    }

    50% {
        opacity: 0.25;
        background: rgba(255, 50, 0, 0.4);
    }
}

/* Research Cost Display */
.cost-ok {
    color: var(--system-green);
}

.cost-no {
    color: #ff4444;
}

.cost-complete {
    color: var(--system-green);
    font-weight: bold;
}

/* RP Inline Display */
.rp-separator {
    color: #555;
    margin: 0 8px;
}

.rp-inline {
    color: #00ccff;
}

.rp-inline #rp-amount {
    font-weight: bold;
    color: #00ffff;
}

/* =========================================
   SAVE/LOAD BUTTONS
   ========================================= */

.save-controls {
    display: flex;
    gap: 5px;
    margin: 10px 0;
}

.save-btn,
.load-btn {
    flex: 1;
    padding: 8px 12px;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: bold;
    cursor: pointer;
    border: 1px solid #00aaff;
    background: linear-gradient(180deg, #1a3a5a, #0a2040);
    color: #00ccff;
    transition: all 0.2s;
}

.save-btn:hover,
.load-btn:hover {
    background: linear-gradient(180deg, #2a4a6a, #1a3a5a);
    box-shadow: 0 0 10px rgba(0, 170, 255, 0.4);
}

.save-btn {
    border-color: var(--system-green);
    color: var(--system-green);
    background: linear-gradient(180deg, #1a3a2a, #0a2010);
}

.save-btn:hover {
    background: linear-gradient(180deg, #2a4a3a, #1a3a2a);
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.3);
}

/* Mission Assignment Modal */
.mtf-selection-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 10px;
    max-height: 200px;
    overflow-y: auto;
    margin-bottom: 15px;
}

.mtf-option {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid #444;
    padding: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.2s;
}

.mtf-option:hover {
    border-color: #00ccff;
    background: rgba(0, 100, 255, 0.1);
}

.mtf-option.selected {
    border-color: var(--system-green);
    background: rgba(0, 255, 0, 0.1);
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.2);
}

.mtf-option-icon {
    font-size: 1.5rem;
}

.mtf-option-name {
    font-weight: bold;
    font-size: 0.9rem;
    color: #eee;
}

.mtf-option-specialty {
    font-size: 0.7rem;
    color: #888;
    text-transform: uppercase;
}

.assignment-preview {
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid #555;
    padding: 15px;
    border-radius: 4px;
}

.preview-stats {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.stat-row {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-row span:first-child {
    font-size: 0.7rem;
    color: #aaa;
}

.stat-row span:last-child {
    font-size: 1.1rem;
    font-weight: bold;
}

.assignment-message {
    font-size: 0.9rem;
    text-align: center;
    padding-top: 10px;
    border-top: 1px solid #333;
    font-style: italic;
}

.match-good {
    color: var(--system-green);
}

.match-bad {
    color: #ff4444;
}

.match-neutral {
    color: #ffcc00;
}

/* MTF Tree Styles */
.mtf-tree-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40px;
    padding: 20px;
    min-width: 800px;
    /* Ensure space for horizontal breadth */
    position: relative;
}

.mtf-tree-level {
    display: flex;
    gap: 20px;
    justify-content: center;
    position: relative;
    width: 100%;
}

/* Nodes */
.mtf-node {
    width: 220px;
    background: rgba(0, 0, 0, 0.85);
    border: 1px solid #444;
    padding: 10px;
    position: relative;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 5px;
    z-index: 2;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.5);
}

.mtf-node:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.7);
    border-color: #666;
}

.mtf-node.unlocked {
    border-color: var(--system-green);
    background: rgba(0, 40, 0, 0.9);
}

.mtf-node.affordable {
    border-color: #ffaa00;
    background: rgba(60, 40, 0, 0.9);
    animation: pulseBorder 2s infinite;
}

.mtf-node.locked {
    border-color: #333;
    opacity: 0.5;
    filter: grayscale(1);
    pointer-events: none;
}

.mtf-node.locked.next-unlockable {
    pointer-events: auto;
    opacity: 0.8;
}

/* Content styling */
.mtf-node-header {
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 8px;
    margin-bottom: 5px;
}

.mtf-node-icon {
    font-size: 1.8rem;
}

.mtf-node-title {
    display: flex;
    flex-direction: column;
}

.mtf-node-name {
    font-weight: bold;
    font-size: 0.85rem;
    color: #fff;
}

.mtf-node-type {
    font-size: 0.65rem;
    color: #ffaa00;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.mtf-node-desc {
    font-size: 0.75rem;
    color: #ccc;
    line-height: 1.3;
    flex-grow: 1;
    margin-bottom: 5px;
}

.mtf-node-cost {
    font-size: 0.75rem;
    font-weight: bold;
    padding-top: 5px;
    border-top: 1px dashed rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
}

/* Connectors */
.mtf-connector-v {
    position: absolute;
    width: 2px;
    background: #555;
    z-index: 1;
}

.mtf-connector-h {
    position: absolute;
    height: 2px;
    background: #555;
    z-index: 1;
}

@keyframes svgRaidPulse {
    0% {
        stroke-opacity: 1;
        stroke-width: 2px;
        r: 30px;
        opacity: 1;
    }

    50% {
        stroke-opacity: 0.5;
        stroke-width: 6px;
        r: 45px;
        opacity: 0.8;
    }

    100% {
        stroke-opacity: 0;
        stroke-width: 10px;
        r: 60px;
        opacity: 0;
    }
}

.raid-effect-ring {
    fill: none;
    stroke: #ff0000;
    stroke-width: 2px;
    pointer-events: none;
    animation: svgRaidPulse 1.5s infinite;
}

.raid-text-label {
    font-family: var(--font-heading);
    font-weight: bold;
    font-size: 14px;
    fill: #ff0000;
    text-anchor: middle;
    text-shadow: 0 0 5px black;
    animation: blink 0.5s infinite;
}

/* RESTORED: Site Raid Pulse for Image/Icons */
@keyframes raidPulse {
    0% {
        filter: drop-shadow(0 0 2px red) grayscale(100%) brightness(80%) sepia(100%) hue-rotate(-50deg) saturate(1000%);
    }

    50% {
        filter: drop-shadow(0 0 10px red) grayscale(100%) brightness(100%) sepia(100%) hue-rotate(-50deg) saturate(1500%);
    }

    100% {
        filter: drop-shadow(0 0 2px red) grayscale(100%) brightness(80%) sepia(100%) hue-rotate(-50deg) saturate(1000%);
    }
}

.site-raid-pulse {
    /* Use the filter animation to make it pulse RED */
    animation: raidPulse 1s infinite;
    /* Static fallback/base */
    filter: grayscale(100%) brightness(80%) sepia(100%) hue-rotate(-50deg) saturate(1000%) drop-shadow(0 0 5px red);
}

/* =========================================
   DASHBOARD MODAL
   ========================================= */

.dashboard-stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.dashboard-stat-card {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--system-green);
    padding: 15px;
    border-radius: 4px;
    position: relative;
    overflow: hidden;
}

.dashboard-stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--system-green);
    opacity: 0.5;
}

.dashboard-stat-card .stat-label {
    font-size: 0.8rem;
    color: #888;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.dashboard-stat-card .stat-value {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--text-primary);
    font-family: var(--font-mono);
}

.dashboard-stat-card .stat-sub {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 5px;
    font-family: var(--font-mono);
}

.dashboard-sites-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 15px;
}

.dash-site-card {
    background: #0a0a0a;
    border: 1px solid #333;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: all 0.2s;
}

.dash-site-card:hover {
    border-color: #555;
    background: #111;
}

.dash-site-card.hq {
    border-color: #ffd700;
}

.dash-site-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px dashed #333;
    padding-bottom: 8px;
}

.dash-site-name {
    font-weight: bold;
    color: var(--system-green);
    font-size: 1.1rem;
}

.dash-site-type {
    font-size: 0.7rem;
    padding: 2px 6px;
    background: #222;
    border-radius: 3px;
    color: #aaa;
}

.dash-site-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    font-size: 0.8rem;
    color: #aaa;
    gap: 5px;
}

/* =========================================
   MAIN MENU STYLES
   ========================================= */
.main-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #000;
    z-index: 10000;
    /* Above everything */
    display: flex;
    justify-content: center;
    align-items: center;
}

.main-menu.hidden {
    display: none;
}

.menu-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Abstract map background pattern */
    background-image:
        radial-gradient(circle at 50% 50%, rgba(0, 40, 0, 0.4) 0%, rgba(0, 0, 0, 0.9) 80%),
        repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0, 255, 0, 0.03) 3px),
        url('assets/bg_map.png');
    /* User should ensure this file exists or change path */
    background-size: cover;
    filter: blur(2px) contrast(1.2) brightness(0.6);
    pointer-events: none;
    z-index: 0;
}

/* VHS / CRT Effect Overlay */
.menu-background::after {
    content: " ";
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
    z-index: 2;
    background-size: 100% 2px, 3px 100%;
    pointer-events: none;
}

.menu-content {
    position: relative;
    z-index: 10;
    text-align: center;
    background: rgba(0, 0, 0, 0.85);
    padding: 60px;
    border: 1px solid #333;
    box-shadow: 0 0 50px rgba(0, 255, 0, 0.05);
    border-radius: 4px;
    width: 500px;
    max-width: 90vw;
}

.menu-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--system-green), transparent);
}

.menu-logo-container {
    margin-bottom: 50px;
}

.scp-svg-large,
.scp-logo-large {
    width: 250px;
    height: 250px;
    margin-bottom: 20px;
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.8));
    object-fit: contain;
}

@keyframes spinSlow {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.spin-slow {
    animation: spinSlow 20s linear infinite;
}

.menu-logo-container h1 {
    font-size: 2.5rem;
    color: #fff;
    margin: 0;
    letter-spacing: 5px;
    font-weight: 700;
    text-transform: uppercase;
    position: relative;
}

.menu-logo-container h2 {
    font-size: 0.9rem;
    color: #888;
    margin: 5px 0 0 0;
    letter-spacing: 3px;
    font-weight: 400;
}

.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 40px;
}

.menu-btn {
    padding: 15px 30px;
    font-size: 1.2rem;
    letter-spacing: 2px;
    transition: all 0.3s;
}

.menu-btn:not(:disabled):hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.2);
}

.menu-footer {
    font-size: 0.8rem;
    color: #444;
    letter-spacing: 2px;
    line-height: 1.5;
    border-top: 1px solid #222;
    padding-top: 20px;
}

/* Glitch Effect */
.glitch-text {
    position: relative;
}

.glitch-text::before,
.glitch-text::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.8;
}

.glitch-text::before {
    color: #ff0000;
    z-index: -1;
    animation: glitch 2s cubic-bezier(0.25, 0.46, 0.45, 0.94) both infinite;
}

.glitch-text::after {
    color: #0000ff;
    z-index: -2;
    animation: glitch 2s cubic-bezier(0.25, 0.46, 0.45, 0.94) reverse both infinite;
}

@keyframes glitch {
    0% {
        transform: translate(0);
    }

    20% {
        transform: translate(-2px, 2px);
    }

    40% {
        transform: translate(-2px, -2px);
    }

    60% {
        transform: translate(2px, 2px);
    }

    80% {
        transform: translate(2px, -2px);
    }

    100% {
        transform: translate(0);
    }
}

/* =========================================
   MULTIPLAYER MODAL STYLES
   ========================================= */
.multi-modal-content {
    max-width: 800px !important;
    width: 90vw;
    border: 1px solid var(--system-green) !important;
}

.multi-modal-body {
    display: flex;
    gap: 0;
    padding: 0 !important;
}

.multi-panel {
    flex: 1;
    padding: 30px;
    display: flex;
    flex-direction: column;
}

.multi-panel-host {
    background: rgba(0, 255, 0, 0.02);
    border-right: 1px solid #222;
}

.multi-panel-join {
    background: rgba(0, 200, 255, 0.02);
}

.multi-panel-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #333;
}

.multi-panel-header h4 {
    margin: 0;
    font-size: 1.1rem;
    letter-spacing: 2px;
}

.multi-panel-host .multi-panel-header h4 {
    color: var(--system-green);
}

.multi-panel-join .multi-panel-header h4 {
    color: #00ccff;
}

.multi-panel-icon {
    font-size: 1.5rem;
}

.multi-panel-content {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.multi-panel-content label {
    font-size: 0.75rem;
    color: #888;
    letter-spacing: 1px;
    margin-bottom: 5px;
}

.multi-input {
    width: 100%;
    padding: 12px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid #444;
    color: #fff;
    font-family: var(--font-mono);
    font-size: 1rem;
    margin-bottom: 15px;
    transition: border-color 0.2s;
}

.multi-input:focus {
    outline: none;
    border-color: var(--system-green);
}

.multi-panel-join .multi-input:focus {
    border-color: #00ccff;
}

.multi-input-code {
    font-size: 1.1rem;
    letter-spacing: 2px;
    text-align: center;
}

.multi-panel-desc {
    font-size: 0.75rem;
    color: #666;
    line-height: 1.4;
    margin-bottom: 20px;
    flex: 1;
}

.multi-btn {
    width: 100%;
    padding: 15px;
    font-size: 1rem;
    letter-spacing: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.2s;
    margin-top: auto;
}

.multi-btn:hover {
    transform: scale(1.02);
}

.btn-icon {
    font-size: 0.9rem;
}

.multi-divider {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    background: #111;
}

.multi-divider-line {
    width: 1px;
    flex: 1;
    background: linear-gradient(to bottom, transparent, #444, transparent);
}

.multi-divider-text {
    padding: 15px 5px;
    color: #555;
    font-size: 0.8rem;
    letter-spacing: 2px;
}

/* Responsive */
@media (max-width: 700px) {
    .multi-modal-body {
        flex-direction: column;
    }

    .multi-panel-host {
        border-right: none;
        border-bottom: 1px solid #333;
    }

    .multi-divider {
        flex-direction: row;
        padding: 10px 20px;
    }

    .multi-divider-line {
        width: auto;
        height: 1px;
        flex: 1;
        background: linear-gradient(to right, transparent, #444, transparent);
    }
}

.boost-ring {
    animation: rotateLogo 10s linear infinite;
    transform-origin: center;
    transform-box: fill-box;
}

/* =========================================
   FULLSCREEN DRAGGABLE WINDOW
   ========================================= */

.fullscreen-window {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80vw;
    height: 75vh;
    min-width: 600px;
    min-height: 400px;
    background: var(--bg-panel);
    border: 2px solid var(--accent-color);
    box-shadow: 0 0 30px var(--accent-glow), inset 0 0 50px rgba(0, 0, 0, 0.5);
    z-index: 3000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    resize: both;
}

.fullscreen-window.hidden {
    display: none;
}

.fullscreen-window.maximized {
    top: 0 !important;
    left: 0 !important;
    transform: none !important;
    width: 100vw !important;
    height: 100vh !important;
    border: none;
    resize: none;
}

.window-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: linear-gradient(180deg, #1a1a1a 0%, #0a0a0a 100%);
    border-bottom: 1px solid var(--accent-color);
    cursor: move;
    user-select: none;
}

.window-title {
    font-family: var(--font-mono);
    font-size: 1rem;
    color: var(--accent-color);
    letter-spacing: 2px;
    text-shadow: 0 0 10px var(--accent-glow);
}

.window-controls {
    display: flex;
    gap: 5px;
}

.window-btn {
    background: transparent;
    border: 1px solid #444;
    color: #666;
    width: 28px;
    height: 28px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
}

.window-btn:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
}

.window-close-btn:hover {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: #fff;
}

.window-fullscreen-btn:hover {
    background: rgba(211, 47, 47, 0.2);
}

.window-content {
    flex: 1;
    display: flex;
    overflow: hidden;
}

.window-graph-area {
    flex: 2;
    background: #050505;
    border-right: 1px solid #333;
    position: relative;
    overflow: hidden;
}

.window-graph-area #research-graph-container {
    width: 100%;
    height: 100%;
}

.window-info-panel {
    flex: 1;
    min-width: 300px;
    max-width: 400px;
    background: #0a0a0a;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.info-panel-placeholder {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: #444;
    text-align: center;
    padding: 40px;
}

.placeholder-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.5;
}

.placeholder-text {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    letter-spacing: 1px;
}

.info-panel-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.info-panel-content.hidden {
    display: none;
}

.info-header {
    display: flex;
    align-items: center;
    gap: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #333;
}

.info-icon {
    font-size: 2rem;
    width: 50px;
    height: 50px;
    background: #1a1a1a;
    border: 1px solid #333;
    display: flex;
    justify-content: center;
    align-items: center;
}

.info-name {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: bold;
    color: var(--accent-color);
    flex: 1;
}

.info-description {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: #aaa;
    line-height: 1.5;
    padding: 10px;
    background: rgba(0, 0, 0, 0.3);
    border-left: 2px solid #333;
}

.info-stats {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.info-stat-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 10px;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px dashed #222;
}

.info-stat-label {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: #666;
}

.info-stat-value {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-primary);
    font-weight: bold;
}

.info-effects {
    padding: 10px;
    background: rgba(211, 47, 47, 0.05);
    border: 1px solid rgba(211, 47, 47, 0.3);
}

.info-effects-title {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--accent-color);
    margin-bottom: 10px;
    letter-spacing: 1px;
}

.info-effects ul {
    list-style: none;
    padding-left: 0;
}

.info-effects li {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: #aaa;
    padding: 5px 0;
    padding-left: 15px;
    position: relative;
}

.info-effects li::before {
    content: '>';
    position: absolute;
    left: 0;
    color: var(--accent-color);
}

.info-purchase-btn {
    margin-top: 15px;
    width: 100%;
    padding: 15px;
    font-size: 1rem;
    letter-spacing: 1px;
}

.info-purchase-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.window-footer {
    padding: 10px 20px;
    background: #0a0a0a;
    border-top: 1px solid #333;
    display: flex;
    justify-content: center;
    gap: 30px;
}

.window-footer .research-stats {
    display: flex;
    gap: 30px;
    font-family: var(--font-mono);
    font-size: 0.85rem;
}

.fullscreen-window.maximized {
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    transform: none !important;
    border-radius: 0;
    z-index: 10000 !important;
}