/* Cybergame — Modern Cyberpunk Game CSS */

@import url('https://fonts.googleapis.com/css2?family=Electrolize&family=Orbitron:wght@400;700&family=Share+Tech+Mono&display=swap');

@font-face {
    font-family: "Social";
    src: url("../fonts/social1.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
}

@font-face {
    font-family: "Bebas Neue";
    src: url("../fonts/BebasNeue-Regular.ttf") format("truetype");
    font-weight: 400;
    font-style: normal;
}

@font-face {
    font-family: "Netron";
    src: url("../fonts/Netron.ttf") format("truetype");
    font-weight: 400;
    font-style: normal;
}

:root {
    --bg-dark: #02070e;
    --bg-panel: rgba(0, 15, 25, 0.7);
    --border-cyan: rgba(0, 255, 255, 0.25);
    --border-cyan-active: rgba(0, 255, 255, 0.7);
    --glow-cyan: rgba(0, 255, 255, 0.3);
    --text-cyan: #0ff;
    --text-lightblue: #add8e6;
    --text-white: #fff;
    --font-cyber: 'Electrolize', 'Orbitron', 'Segoe UI', Arial, sans-serif;
    --font-mono: 'Share Tech Mono', monospace;
    --theme-yellow: #eb2;
    --theme-yellow-glow: rgba(235, 178, 0, 0.3);
    --theme-yellow-border: rgba(180, 150, 0, 0.5);
    --bg-yellow-panel: rgba(50, 45, 0, 0.6);
}

html,
body {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    font-family: var(--font-cyber);
    background: var(--bg-dark) url('../images/bg_city1.jpg') no-repeat center center fixed;
    background-size: cover;
    color: var(--text-white);
    overflow-x: hidden;
}

div {
    box-sizing: border-box;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #000;
    border: 1px solid rgba(0, 255, 255, 0.1);
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 255, 255, 0.3);
    border-radius: 0px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 255, 255, 0.8);
}

/* Animations */
@keyframes oneblink {
    0% {
        color: #fff;
        text-shadow: 0 0 8px #fff;
    }

    100% {
        color: var(--text-lightblue);
        text-shadow: 0 0 4px var(--text-cyan);
    }
}

@keyframes pulse {
    0% {
        transform: scale(0.96);
        opacity: 0.5;
    }

    50% {
        transform: scale(1);
        opacity: 1;
    }

    100% {
        transform: scale(0.96);
        opacity: 0.5;
    }
}

@keyframes fadein {
    0% {
        opacity: 0;
        transform: scale(0.6);
    }

    100% {
        opacity: 0.7;
        transform: scale(0.9);
    }
}

.blink {
    animation: oneblink 0.8s ease-in-out;
}

/* Layout Elements */
#game_content::after {
    content: '';
    display: block;
    height: 100px;
    width: 100%;
    pointer-events: none;
    clear: both;
}

.top_bar {
    width: 100%;
    height: 40px;
    background-image: url('../images/header2.png');
    background-position: top center;
    background-repeat: no-repeat;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
}

.left_menu {
    width: 150px;
    position: fixed;
    top: 150px;
    left: 15px;
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Circular Menu Cyberpunk Styles */
.left_menu.circular_menu {
    width: 50px;
    top: 160px;
    left: 15px;
    gap: 8px;
}

.left_menu.circular_menu .menu_circle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: rgba(0, 10, 20, 0.75);
    border: 2px solid rgba(0, 255, 255, 0.25);
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.1);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    cursor: pointer;
    text-decoration: none;
}

.left_menu.circular_menu .menu_circle:hover,
.left_menu.circular_menu .menu_circle.active {
    border-color: rgba(0, 255, 255, 0.95);
    box-shadow: 0 0 18px rgba(0, 255, 255, 0.5), inset 0 0 8px rgba(0, 255, 255, 0.3);
    background: rgba(0, 30, 45, 0.9);
    transform: scale(1.08);
}

.left_menu.circular_menu .menu_circle .menu_icon {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.75;
    transition: all 0.3s ease;
}

.left_menu.circular_menu .menu_circle:hover .menu_icon,
.left_menu.circular_menu .menu_circle.active .menu_icon {
    opacity: 1;
    filter: brightness(1.2) drop-shadow(0 0 5px rgba(0, 255, 255, 0.6));
}

.left_menu.circular_menu .menu_circle .menu_label {
    position: absolute;
    left: 56px;
    background: rgba(0, 12, 22, 0.95);
    border: 1px solid rgba(0, 255, 255, 0.45);
    color: var(--text-cyan);
    font-family: var(--font-cyber);
    font-size: 11px;
    font-weight: bold;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 5px 12px;
    border-radius: 4px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transform: translateX(-15px);
    transition: opacity 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 0 12px rgba(0, 255, 255, 0.25);
}

.left_menu.circular_menu .menu_circle:hover .menu_label {
    opacity: 1;
    transform: translateX(0);
}

.left_menu.circular_menu .menu_circle .menu_label::before {
    content: '';
    position: absolute;
    width: 5px;
    height: 5px;
    left: -1px;
    top: -1px;
    border-top: 1px solid var(--text-cyan);
    border-left: 1px solid var(--text-cyan);
}

.left_menu.circular_menu .menu_circle .menu_label::after {
    content: '';
    position: absolute;
    width: 5px;
    height: 5px;
    right: -1px;
    bottom: -1px;
    border-right: 1px solid var(--text-cyan);
    border-bottom: 1px solid var(--text-cyan);
}

.right_menu {
    width: 150px;
    position: fixed;
    top: 150px;
    right: 15px;
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.right_menu.circular_menu {
    width: 50px;
    top: 160px;
    right: 15px;
    gap: 8px;
}

.right_menu.circular_menu .menu_circle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: rgba(0, 10, 20, 0.75);
    border: 2px solid rgba(0, 255, 255, 0.25);
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.1);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    cursor: pointer;
    text-decoration: none;
}

.right_menu.circular_menu .menu_circle:hover,
.right_menu.circular_menu .menu_circle.active {
    border-color: rgba(0, 255, 255, 0.95);
    box-shadow: 0 0 18px rgba(0, 255, 255, 0.5), inset 0 0 8px rgba(0, 255, 255, 0.3);
    background: rgba(0, 30, 45, 0.9);
    transform: scale(1.08);
}

.right_menu.circular_menu .menu_circle .menu_icon {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.75;
    transition: all 0.3s ease;
}

.right_menu.circular_menu .menu_circle:hover .menu_icon,
.right_menu.circular_menu .menu_circle.active .menu_icon {
    opacity: 1;
    filter: brightness(1.2) drop-shadow(0 0 5px rgba(0, 255, 255, 0.6));
}

.right_menu.circular_menu .menu_circle .menu_label {
    position: absolute;
    right: 56px;
    background: rgba(0, 12, 22, 0.95);
    border: 1px solid rgba(0, 255, 255, 0.45);
    color: var(--text-cyan);
    font-family: var(--font-cyber);
    font-size: 11px;
    font-weight: bold;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 5px 12px;
    border-radius: 4px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transform: translateX(15px);
    transition: opacity 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 0 12px rgba(0, 255, 255, 0.25);
}

.right_menu.circular_menu .menu_circle:hover .menu_label {
    opacity: 1;
    transform: translateX(0);
}

.right_menu.circular_menu .menu_circle .menu_label::before {
    content: '';
    position: absolute;
    width: 5px;
    height: 5px;
    left: -1px;
    top: -1px;
    border-top: 1px solid var(--text-cyan);
    border-left: 1px solid var(--text-cyan);
}

.right_menu.circular_menu .menu_circle .menu_label::after {
    content: '';
    position: absolute;
    width: 5px;
    height: 5px;
    right: -1px;
    bottom: -1px;
    border-right: 1px solid var(--text-cyan);
    border-bottom: 1px solid var(--text-cyan);
}

/* Ranking Screen Styles */
.ranking-container {
    width: 860px;
    margin: 80px auto 40px;
    background: rgba(0, 10, 20, 0.9);
    border: 1px solid var(--border-cyan);
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.15);
    border-radius: 8px;
    padding: 24px;
    color: var(--text-white);
    font-family: var(--font-cyber);
}

.ranking-title {
    font-size: 20px;
    color: var(--text-cyan);
    text-transform: uppercase;
    text-shadow: 0 0 8px rgba(0, 255, 255, 0.4);
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(0, 255, 255, 0.2);
    padding-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ranking-controls {
    display: flex;
    gap: 10px;
    font-size: 12px;
}

.ranking-sort-btn {
    background: rgba(0, 15, 25, 0.6);
    border: 1px solid var(--border-cyan);
    color: var(--text-lightblue);
    padding: 6px 12px;
    cursor: pointer;
    text-transform: uppercase;
    font-family: var(--font-cyber);
    font-size: 11px;
    border-radius: 4px;
    transition: all 0.3s;
}

.ranking-sort-btn.active,
.ranking-sort-btn:hover {
    color: var(--text-cyan);
    border-color: var(--border-cyan-active);
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.3);
    background: rgba(0, 30, 45, 0.8);
}

.ranking-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.ranking-table th {
    text-align: left;
    color: var(--text-cyan);
    font-size: 11px;
    text-transform: uppercase;
    border-bottom: 2px solid rgba(0, 255, 255, 0.2);
    padding: 12px;
    font-family: var(--font-mono);
}

.ranking-table td {
    padding: 12px;
    border-bottom: 1px solid rgba(0, 255, 255, 0.1);
    font-size: 13px;
    color: var(--text-lightblue);
    vertical-align: middle;
}

.ranking-table tr:hover td {
    background: rgba(0, 255, 255, 0.05);
    color: var(--text-white);
}

.ranking-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--border-cyan);
    background-size: cover;
    background-position: center;
}

.ranking-coord-link {
    color: var(--text-cyan);
    text-decoration: none;
    cursor: pointer;
}

.ranking-coord-link:hover {
    text-shadow: 0 0 6px rgba(0, 255, 255, 0.6);
}

.bottom_logo {
    position: fixed;
    left: 15px;
    bottom: 25px;
    width: 280px;
    height: 50px;
    background-image: url('../images/logo_horizontal.png');
    background-size: contain;
    background-repeat: no-repeat;
    opacity: 0.6;
    pointer-events: none;
    z-index: 90;
}

.bottom_right_cluster {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 90;
    display: flex;
    align-items: center;
    gap: 10px;
}

.box_bottom_right {
    position: static;
    color: #fff;
    font-family: var(--font-mono);
    background: rgba(0, 5, 10, 0.85);
    padding: 10px 15px;
    border-radius: 4px;
    display: flex;
    gap: 20px;
    align-items: center;
}

.development_matrix_fab {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: 2px solid rgba(0, 255, 255, 0.25);
    background: rgba(0, 10, 20, 0.75);
    color: var(--text-cyan);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.1);
    position: relative;
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.development_matrix_fab:hover,
.development_matrix_fab.active {
    transform: scale(1.08);
    border-color: rgba(0, 255, 255, 0.95);
    background: rgba(0, 30, 45, 0.9);
    box-shadow: 0 0 18px rgba(0, 255, 255, 0.5), inset 0 0 8px rgba(0, 255, 255, 0.3);
}

.development_matrix_icon {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    opacity: 0.75;
    filter: drop-shadow(0 0 4px rgba(0, 255, 255, 0.25));
    transition: opacity 0.2s ease, filter 0.2s ease;
}

.development_matrix_fab:hover .development_matrix_icon,
.development_matrix_fab.active .development_matrix_icon {
    opacity: 1;
    filter: drop-shadow(0 0 6px rgba(0, 255, 255, 0.7));
}

.development_matrix_label {
    position: absolute;
    right: 56px;
    background: rgba(0, 12, 22, 0.95);
    border: 1px solid rgba(0, 255, 255, 0.45);
    color: var(--text-cyan);
    font-family: var(--font-cyber);
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 5px 10px;
    border-radius: 4px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transform: translateX(12px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    box-shadow: 0 0 12px rgba(0, 255, 255, 0.25);
}

.development_matrix_fab:hover .development_matrix_label {
    opacity: 1;
    transform: translateX(0);
}

.box_bottom_right .sector-info {
    text-align: right;
    border-right: 1px solid rgba(255, 255, 255, 0.15);
    padding-right: 20px;
}

.box_bottom_right .time-info {
    text-align: right;
}

.box_bottom_right .mini {
    font-family: var(--font-mono);
    font-size: 9px;
    color: rgba(255, 255, 255, 0.5);
    letter-spacing: 1px;
    margin-bottom: 3px;
    text-transform: uppercase;
}

.box_bottom_right .city-name {
    font-size: 13px;
    font-weight: bold;
    color: #fff;
    text-transform: uppercase;
    margin-bottom: 2px;
}

.box_bottom_right .speed-multiplier {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.7);
}

.box_bottom_right table {
    margin-left: auto;
    border-collapse: collapse;
}

.box_bottom_right td {
    padding: 0 2px;
    font-size: 15px;
    font-weight: bold;
    color: #fff;
}

.box_bottom_right tr.mini td {
    font-family: var(--font-mono);
    font-size: 8px;
    color: rgba(255, 255, 255, 0.4);
    text-shadow: none;
    padding-top: 2px;
}

.development-matrix-screen {
    width: min(1500px, calc(100vw - 190px));
    min-height: calc(100vh - 110px);
    margin: 70px auto 95px;
    color: #eafcff;
}

.development-matrix-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 18px;
    margin-bottom: 14px;
    border-bottom: 1px solid rgba(0, 255, 255, 0.18);
    padding-bottom: 12px;
}

.dev-kicker {
    font-family: var(--font-mono);
    color: rgba(57, 255, 20, 0.8);
    font-size: 11px;
    letter-spacing: 1px;
}

.dev-title {
    font-family: var(--font-cyber);
    font-size: 26px;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0;
    text-shadow: 0 0 12px rgba(0, 255, 255, 0.32);
}

.dev-sector-pill {
    font-family: var(--font-mono);
    color: #9eefff;
    border: 1px solid rgba(0, 255, 255, 0.2);
    background: rgba(0, 12, 20, 0.7);
    border-radius: 4px;
    padding: 8px 10px;
    font-size: 11px;
    text-transform: uppercase;
}

.dev-filterbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.dev-filter-btn {
    border: 1px solid rgba(0, 255, 255, 0.22);
    background: rgba(0, 12, 22, 0.72);
    color: rgba(234, 252, 255, 0.8);
    font-family: var(--font-mono);
    font-size: 11px;
    text-transform: uppercase;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
}

.dev-filter-btn:hover,
.dev-filter-btn.active {
    color: #39ff14;
    border-color: rgba(57, 255, 20, 0.65);
    box-shadow: 0 0 12px rgba(57, 255, 20, 0.18);
}

.development-matrix-shell {
    position: relative;
    min-height: 520px;
    background: rgba(0, 8, 14, 0.76);
    border: 1px solid rgba(0, 255, 255, 0.18);
    border-radius: 4px;
    overflow: auto;
    box-shadow: inset 0 0 28px rgba(0, 255, 255, 0.06);
}

.development-matrix-shell::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: linear-gradient(rgba(0, 255, 255, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 28px 28px;
    pointer-events: none;
}

.development-matrix-loading {
    padding: 80px 20px;
    text-align: center;
    color: #0ff;
    font-family: var(--font-mono);
    letter-spacing: 1px;
}

.development-matrix-loading.error {
    color: #ff5b6a;
}

.development-matrix-grid {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: repeat(4, minmax(245px, 1fr));
    gap: 12px;
    min-width: 1120px;
    padding: 14px;
}

.dev-edge-layer {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    min-width: 1120px;
    min-height: 100%;
}

.dev-edge {
    fill: none;
    stroke: rgba(0, 255, 255, 0.13);
    stroke-width: 1.2;
}

.dev-edge.active {
    stroke: rgba(57, 255, 20, 0.78);
    stroke-width: 2.2;
    filter: drop-shadow(0 0 4px rgba(57, 255, 20, 0.5));
}

.dev-lane {
    min-width: 0;
}

.dev-lane-head {
    position: sticky;
    top: 0;
    z-index: 4;
    background: rgba(0, 18, 30, 0.96);
    border: 1px solid rgba(0, 255, 255, 0.24);
    color: #9eefff;
    font-family: var(--font-mono);
    font-size: 11px;
    text-transform: uppercase;
    padding: 9px 10px;
    border-radius: 4px;
    margin-bottom: 10px;
}

.dev-lane-nodes {
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.dev-node {
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr);
    gap: 9px;
    min-height: 55px;
    background: rgba(2, 14, 22, 0.92);
    border: 1px solid rgba(0, 255, 255, 0.18);
    border-left-width: 3px;
    border-radius: 4px;
    padding: 8px;
    cursor: pointer;
    transition: opacity 0.18s ease, transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.dev-node.available {
    border-left-color: #39ff14;
}

.dev-node.locked {
    border-left-color: #ff5b6a;
    filter: grayscale(0.4);
}

.dev-node.owned,
.dev-node.maxed {
    border-left-color: #00f0ff;
}

.dev-node:hover,
.dev-node.related {
    transform: translateX(2px);
    border-color: rgba(57, 255, 20, 0.62);
    box-shadow: 0 0 14px rgba(57, 255, 20, 0.14);
}

.dev-node.dimmed {
    opacity: 0.34;
}

.dev-node-img {
    width: 54px;
    height: 54px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background-size: cover;
    background-position: top center;
    background-color: #000;
}

.dev-node-body {
    min-width: 0;
}

.dev-node-top,
.dev-node-meta {
    display: flex;
    justify-content: space-between;
    gap: 6px;
    font-family: var(--font-mono);
    font-size: 9px;
    color: rgba(234, 252, 255, 0.55);
    text-transform: uppercase;
}

.dev-node-name {
    color: #fff;
    font-size: 13px;
    line-height: 1.2;
    margin: 5px 0 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dev-node-status {
    color: #39ff14;
}

.dev-node.locked .dev-node-status {
    color: #ff5b6a;
}

.dev-node-req {
    font-family: var(--font-mono);
    font-size: 9px;
    color: rgba(158, 239, 255, 0.68);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dev-empty-lane {
    color: rgba(255, 255, 255, 0.35);
    font-family: var(--font-mono);
    font-size: 11px;
    border: 1px dashed rgba(255, 255, 255, 0.12);
    padding: 16px;
    border-radius: 4px;
}

.development-detail-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.96);
    width: min(760px, calc(100vw - 32px));
    max-height: min(78vh, 680px);
    overflow: auto;
    z-index: 2200;
    background: rgba(0, 8, 14, 0.96);
    border: 1px solid rgba(0, 255, 255, 0.38);
    border-radius: 4px;
    padding: 16px;
    box-shadow: 0 22px 70px rgba(0, 0, 0, 0.75), 0 0 28px rgba(0, 255, 255, 0.18);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.16s ease, transform 0.16s ease;
}

.development-detail-panel.active {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, -50%) scale(1);
}

.dev-detail-empty {
    color: rgba(234, 252, 255, 0.58);
    font-family: var(--font-mono);
    font-size: 12px;
}

.dev-detail-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    color: #fff;
    font-size: 16px;
    margin-bottom: 12px;
}

.dev-detail-title strong {
    color: #39ff14;
    font-family: var(--font-mono);
    font-size: 11px;
    margin-left: auto;
}

.dev-detail-close {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid rgba(255, 91, 106, 0.55);
    background: rgba(255, 91, 106, 0.12);
    color: #ffb4bd;
    font-family: var(--font-mono);
    font-weight: bold;
    cursor: pointer;
    flex: 0 0 auto;
}

.dev-detail-close:hover {
    border-color: #ff5b6a;
    color: #fff;
    box-shadow: 0 0 12px rgba(255, 91, 106, 0.32);
}

.dev-detail-grid {
    display: grid;
    grid-template-columns: 88px minmax(0, 1fr);
    gap: 14px;
}

.dev-detail-image {
    width: 88px;
    height: 88px;
    border-radius: 4px;
    border: 1px solid rgba(0, 255, 255, 0.2);
    background-size: cover;
    background-position: top center;
    background-color: #000;
}

.dev-detail-desc {
    font-size: 12px;
    line-height: 1.45;
    color: rgba(234, 252, 255, 0.75);
    margin-bottom: 10px;
}

.dev-detail-stats,
.dev-detail-reqs,
.dev-milestones {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.dev-detail-stats span,
.dev-detail-req,
.dev-milestone {
    font-family: var(--font-mono);
    font-size: 10px;
    color: #9eefff;
    border: 1px solid rgba(0, 255, 255, 0.18);
    background: rgba(0, 18, 30, 0.58);
    border-radius: 4px;
    padding: 6px 8px;
}

.dev-detail-section-title {
    margin: 12px 0 7px;
    color: rgba(57, 255, 20, 0.84);
    font-family: var(--font-mono);
    font-size: 10px;
    text-transform: uppercase;
}

.dev-detail-req,
.dev-milestone {
    display: flex;
    gap: 10px;
    align-items: center;
}

.dev-detail-req strong,
.dev-milestone span {
    color: #fff;
}

.dev-detail-req.missing,
.dev-milestone.missing {
    border-color: rgba(255, 91, 106, 0.38);
    color: #ffb4bd;
}

.dev-detail-req.met,
.dev-milestone.met {
    border-color: rgba(57, 255, 20, 0.32);
}

.dev-milestone em {
    font-style: normal;
    color: rgba(234, 252, 255, 0.64);
}

@media (max-width: 920px) {
    .development-matrix-screen {
        width: calc(100vw - 24px);
        margin-top: 64px;
    }

    .bottom_right_cluster {
        right: 10px;
        bottom: 10px;
    }

    .development_matrix_label {
        display: none;
    }

    .box_bottom_right {
        padding: 8px 10px;
        gap: 10px;
    }
}

/* Resources Box in Top Bar */
.resources {
    display: flex;
    justify-content: center;
    gap: 15px;
    width: 610px;
    margin: 0 auto;
    padding-top: 13px;
    /* 10px lower than original 3px */
    position: relative;
}

.topbar-res-box {
    flex: 1;
    height: 46px;
    min-width: 144px;
    max-width: 176px;
    background: #02070c;
    /* Solid dark background to prevent any transparency */
    border: 1px solid rgba(0, 255, 255, 0.25);
    padding: 6px 12px;
    border-radius: 4px;

    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.05), inset 0 0 10px rgba(0, 255, 255, 0.05);
    transition: border-color 0.3s, box-shadow 0.3s;
}

.topbar-res-box:hover {
    border-color: rgba(0, 255, 255, 0.6);
    box-shadow: 0 0 12px rgba(0, 255, 255, 0.2), inset 0 0 8px rgba(0, 255, 255, 0.1);
}

.topbar-res-box.box_booster {
    min-width: 90px;
    max-width: 110px;
}

.topbar-res-box.box_booster .boss-res-icon {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    object-fit: cover;
    object-position: center;
    transform: scale(0.8);
    transform-origin: center;
    overflow: hidden;
    border: 1px solid rgba(192, 132, 252, 0.45);
    box-shadow: 0 0 10px rgba(192, 132, 252, 0.35);
}

.topbar-res-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
    /* Enable text truncation if needed */
}

.topbar-res-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 2px;
}

.resources .boss-res-label {
    font-family: var(--font-mono);
    font-size: 9px;
    color: rgba(0, 255, 255, 0.6);
    letter-spacing: 1px;
    text-transform: uppercase;
}

.resources .prod_rate {
    font-family: var(--font-mono);
    font-size: 9px;
    color: #0f0;
    opacity: 0.85;
    text-shadow: 0 0 3px rgba(0, 255, 0, 0.4);
    text-align: right;
    margin-top: 0;
}

.resources .boss-res-value {
    font-family: var(--font-mono);
    font-size: 15px;
    color: #fff;
    font-weight: bold;
    text-shadow: 0 0 8px rgba(0, 255, 255, 0.4);
    line-height: 1;
}

.resources .blink {
    animation: oneblink 0.8s ease-in-out;
}

/* Face and Logoff Boxes */
.box_face {
    cursor: pointer;
    position: fixed;
    top: 5px;
    left: 35px;
    width: 80px;
    height: 60px;
    text-align: center;
    display: block;
}

.box_face .icon {
    width: 50px;
    height: 50px;
    background-size: 50px 50px;
    opacity: 0.6;
    border: 1px rgba(0, 50, 50, 1) solid;
    border-radius: 50%;
    margin: 0 auto;
    transition: opacity 0.3s;
}

.box_face:hover .icon {
    opacity: 1;
    filter: brightness(140%);
}

.box_face .name-label {
    width: 150px;
    height: 30px;
    position: absolute;
    left: -35px;
    bottom: -33px;
    font-size: 13px;
    text-align: center;
    color: lightblue;
    text-shadow: 0 0 3px #0ff;
    font-family: var(--font-cyber);
    text-transform: uppercase;
}

.box_logoff {
    cursor: pointer;
    position: fixed;
    top: 5px;
    right: 10px;
    width: 60px;
    height: 50px;
    text-align: center;
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    color: lightblue;
    transition: none;
    display: block;
}

.box_logoff:hover {
    background: transparent;
}

.box_logoff .icon {
    width: 46px;
    height: 46px;
    border: 1px rgba(0, 50, 50, 1) solid;
    border-radius: 50%;
    background-color: rgba(0, 0, 0, 0.4);
    background-image: url('../images/exit.png');
    background-size: 30px 30px;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.6;
    margin: 0 auto;
    transition: opacity 0.3s;
}

.box_logoff:hover .icon {
    opacity: 1;
}

.box_logoff .logoff-label {
    width: 60px;
    height: 30px;
    position: absolute;
    left: 0;
    bottom: -33px;
    font-size: 12px;
    text-align: center;
    color: lightblue;
    font-family: var(--font-cyber);
}


/* Buttons and Menu Links */
.b {
    transition: all 0.3s;
    cursor: pointer;
    color: var(--text-lightblue);
    font-size: 12px;
    background-color: var(--bg-panel);
    border: 1px solid var(--border-cyan);
    border-radius: 4px;
    text-decoration: none;
    display: block;
    text-align: center;
    padding: 8px 12px;
    position: relative;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.b.active,
.b:hover {
    color: var(--text-cyan);
    background-color: rgba(0, 30, 45, 0.9);
    border-color: var(--border-cyan-active);
    box-shadow: 0 0 10px var(--glow-cyan);
}

.b::before {
    content: '';
    position: absolute;
    width: 6px;
    height: 6px;
    left: -1px;
    top: -1px;
    border-top: 1px solid var(--text-cyan);
    border-left: 1px solid var(--text-cyan);
}

.b::after {
    content: '';
    position: absolute;
    width: 6px;
    height: 6px;
    right: -1px;
    bottom: -1px;
    border-right: 1px solid var(--text-cyan);
    border-bottom: 1px solid var(--text-cyan);
}

.b.cyber1 {
    text-align: center;
    padding: 6px;
    box-sizing: border-box;
    background-image: url('../images/button-bg.png');
    background-size: 100px 35px;
    background-repeat: no-repeat;
}

.b.cyber1::before {
    content: '';
    position: absolute;
    width: 10%;
    height: 25%;
    left: -1px;
    top: -1px;
    border-top: 1px rgba(92, 145, 226, .5) solid;
    border-left: 1px rgba(92, 145, 226, .5) solid;
}

.b.cyber1::after {
    content: '';
    position: absolute;
    width: 10%;
    height: 25%;
    right: -1px;
    bottom: -1px;
    border-right: 1px rgba(92, 145, 226, .5) solid;
    border-bottom: 1px rgba(92, 145, 226, .5) solid;
}

/* Base Construction & Grid */
.center_base {
    width: 784px;
    height: 410px;
    position: relative;
    margin: 100px auto 40px;
}

.empty-base-hint {
    position: absolute;
    top: -55px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(3, 8, 16, 0.9);
    border: 1px solid #00f0ff;
    border-radius: 4px;
    padding: 12px 20px;
    color: #00f0ff;
    font-family: 'Share Tech Mono', monospace;
    font-size: 13px;
    font-weight: bold;
    z-index: 100;
    text-align: center;
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.3), inset 0 0 10px rgba(0, 240, 255, 0.1);
    animation: float-arrow 2s ease-in-out infinite;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    pointer-events: none;
    white-space: nowrap;
}

@keyframes float-arrow {

    0%,
    100% {
        transform: translate(-50%, -5px);
    }

    50% {
        transform: translate(-50%, 15px);
    }
}

.box_base {
    transition: opacity 0.2s, filter 0.2s;
    width: 98px;
    height: 69px;
    /* matching original grid scale for building heights */
    opacity: 1;
    position: absolute;
    z-index: 1;
    cursor: pointer;
    background-size: 100% auto;
    background-position: bottom center;
    background-repeat: no-repeat;
    pointer-events: none;
}

.box_base.hover {
    filter: brightness(1.25) drop-shadow(0 0 8px rgba(0, 255, 255, 0.6));
}

.box_base.empty {
    opacity: 0.45;
    /* terrains without building slightly more transparent */
}

.box_base.empty.hover {
    opacity: 0.8;
    filter: none;
}

.box_base.upd {
    animation: pulse 1.5s infinite ease-in-out;
}

/* Energy rain effect for constructing/upgrading buildings */
.box_base.upd::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        linear-gradient(to top, transparent 0%, rgba(0, 255, 255, 0.2) 30%, rgba(0, 255, 255, 0.7) 70%, rgba(220, 255, 255, 1) 85%, transparent 95%) 10% 0 / 1.5px 30px repeat-y,
        linear-gradient(to top, transparent 0%, rgba(0, 255, 255, 0.2) 30%, rgba(0, 255, 255, 0.7) 70%, rgba(220, 255, 255, 1) 85%, transparent 95%) 25% 0 / 2px 40px repeat-y,
        linear-gradient(to top, transparent 0%, rgba(0, 255, 255, 0.2) 30%, rgba(0, 255, 255, 0.7) 70%, rgba(220, 255, 255, 1) 85%, transparent 95%) 40% 0 / 1px 50px repeat-y,
        linear-gradient(to top, transparent 0%, rgba(0, 255, 255, 0.2) 30%, rgba(0, 255, 255, 0.7) 70%, rgba(220, 255, 255, 1) 85%, transparent 95%) 55% 0 / 2.5px 60px repeat-y,
        linear-gradient(to top, transparent 0%, rgba(0, 255, 255, 0.2) 30%, rgba(0, 255, 255, 0.7) 70%, rgba(220, 255, 255, 1) 85%, transparent 95%) 70% 0 / 1.5px 40px repeat-y,
        linear-gradient(to top, transparent 0%, rgba(0, 255, 255, 0.2) 30%, rgba(0, 255, 255, 0.7) 70%, rgba(220, 255, 255, 1) 85%, transparent 95%) 85% 0 / 2px 30px repeat-y;
    -webkit-mask-image: linear-gradient(to top, rgba(0, 0, 0, 1) 20%, rgba(0, 0, 0, 0) 95%);
    mask-image: linear-gradient(to top, rgba(0, 0, 0, 1) 20%, rgba(0, 0, 0, 0) 95%);
    clip-path: polygon(0% 0%, 100% 0%, 100% 65%, 50% 100%, 0% 65%);
    animation: energyRain 4.5s infinite linear;
    mix-blend-mode: screen;
    pointer-events: none;
    z-index: 2;
}

@keyframes energyRain {
    0% {
        background-position:
            10% 0,
            25% 0,
            40% 0,
            55% 0,
            70% 0,
            85% 0;
    }

    100% {
        background-position:
            10% -600px,
            25% -600px,
            40% -600px,
            55% -600px,
            70% -600px,
            85% -600px;
    }
}

.sel {
    cursor: pointer;
    position: absolute;
    z-index: 5;
    background-color: transparent;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sel:hover {
    background-color: transparent;
}

.sel .building-tooltip {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    background-color: rgba(2, 7, 14, 0.95);
    border: 1px solid var(--border-cyan-active);
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.3);
    border-radius: 4px;
    padding: 6px 10px;
    color: var(--text-white);
    font-family: var(--font-cyber);
    font-size: 11px;
    text-align: center;
    white-space: nowrap;
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-5px);
    z-index: 10;
}

.sel:hover .building-tooltip {
    opacity: 1;
}

.sel .building-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 5px;
    border-style: solid;
    border-color: var(--border-cyan-active) transparent transparent transparent;
}

.sel .building-tooltip .b-name {
    font-weight: bold;
    color: var(--text-cyan);
    text-transform: uppercase;
    font-size: 11px;
    margin-bottom: 2px;
}

.sel .building-tooltip .b-level {
    font-size: 10px;
    color: var(--text-lightblue);
}

/* Upgrade panels & menus right side */
.upd_build,
#new_build {
    transition: right 0.4s ease-out, opacity 0.3s;
    opacity: 0;
    width: 440px;
    height: min(680px, calc(100vh - 28px));
    min-height: 560px;
    position: absolute;
    top: 10px;
    right: -520px;
    z-index: 1000;
    background:
        linear-gradient(180deg, rgba(18, 24, 31, 0.98), rgba(5, 8, 12, 0.98)),
        repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.025) 0 1px, transparent 1px 28px);
    border: 1px solid rgba(131, 145, 161, 0.28);
    border-left: 3px solid rgba(184, 129, 74, 0.9);
    border-radius: 6px;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55);
    padding: 18px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.upd_build .title,
#new_build .title {
    font-size: 13px;
    color: #d8dee6;
    border-bottom: 1px solid rgba(131, 145, 161, 0.22);
    padding-bottom: 10px;
    margin-bottom: 14px;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-family: var(--font-cyber);
}

.upd_build .content,
#new_build .content {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 2px 8px 16px 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
    scrollbar-gutter: stable;
}

.upd_build .close-btn,
#new_build .close-btn {
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid rgba(131, 145, 161, 0.28);
    color: #9aa7b7;
    text-align: center;
    padding: 8px;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 12px;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.12em;
}

.upd_build .close-btn:hover,
#new_build .close-btn:hover {
    background: rgba(184, 129, 74, 0.12);
    border-color: rgba(184, 129, 74, 0.55);
    color: #d7c3aa;
}

/* Build Item Card */
.edificio {
    color: #b7c0cc;
}

.build-card {
    position: relative;
    flex: 0 0 auto;
    background:
        linear-gradient(145deg, rgba(15, 19, 25, 0.98), rgba(6, 8, 12, 0.98));
    border: 1px solid rgba(131, 145, 161, 0.2);
    border-radius: 6px;
    padding: 14px;
    overflow: hidden;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035), 0 8px 22px rgba(0, 0, 0, 0.32);
}

.build-card::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        linear-gradient(90deg, rgba(184, 129, 74, 0.12), transparent 34%),
        repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.025) 0 1px, transparent 1px 5px);
    opacity: 0.55;
}

.build-card>* {
    position: relative;
    z-index: 2;
}

.build-card-topline {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-family: var(--font-cyber);
    font-size: 10px;
    letter-spacing: 0.13em;
    color: #8e9bab;
    text-transform: uppercase;
}

.build-card-topline strong {
    color: #c8955a;
    font-size: 11px;
}

.build-card-main {
    display: grid;
    grid-template-columns: 72px 1fr;
    gap: 12px;
    align-items: start;
    min-height: 72px;
}

.build-card-art {
    width: 72px;
    aspect-ratio: 1;
    border-radius: 5px;
    border: 1px solid rgba(131, 145, 161, 0.25);
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.build-card-art img {
    width: 88%;
    height: 88%;
    object-fit: contain;
    filter: saturate(0.7) contrast(1.05) brightness(0.84);
}

.build-card-copy {
    min-width: 0;
}

.edificio .build-title {
    font-size: 15px;
    font-weight: 700;
    color: #eef2f6;
    line-height: 1.15;
    letter-spacing: 0.02em;
}

.edificio p {
    font-size: 12px;
    color: #8f9aaa;
    margin: 5px 0 0 0;
    max-width: none;
    line-height: 1.35;
}

.build-delta-panel {
    display: grid;
    gap: 5px;
    margin-top: 9px;
}

.build-delta-row {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    padding: 5px 7px;
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid rgba(131, 145, 161, 0.14);
    border-radius: 4px;
    font-size: 10px;
    color: #9aa7b7;
}

.build-delta-row strong {
    color: #cbd4dd;
    font-weight: 700;
    white-space: nowrap;
}

.build-ledger {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 7px;
    margin-top: 12px;
}

.build-ledger-item {
    min-width: 0;
    padding: 8px 7px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(131, 145, 161, 0.18);
    border-radius: 5px;
    display: grid;
    grid-template-columns: 16px 1fr;
    gap: 2px 6px;
    align-items: center;
}

.build-ledger-item.ok {
    border-color: rgba(85, 125, 91, 0.5);
    background: rgba(57, 80, 60, 0.13);
}

.build-ledger-item.warn {
    border-color: rgba(157, 68, 68, 0.62);
    background: rgba(90, 28, 28, 0.22);
}

.build-ledger-item.neutral {
    border-color: rgba(184, 129, 74, 0.36);
    background: rgba(108, 75, 42, 0.15);
}

.build-ledger-icon {
    content: '';
    width: 14px;
    height: 14px;
    background-size: contain;
    background-repeat: no-repeat;
    grid-row: span 2;
    opacity: 0.82;
}

.build-ledger-icon.cre {
    background-image: url('../images/credits1.png');
}

.build-ledger-icon.har {
    background-image: url('../images/hardware.png');
}

.build-ledger-icon.time {
    background-image: url('../images/time.png');
}

.build-ledger-label {
    font-size: 9px;
    color: #8793a3;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    line-height: 1;
}

.build-ledger-item strong {
    color: #e4e8ed;
    font-family: var(--font-mono);
    font-size: 12px;
    line-height: 1.1;
    overflow-wrap: anywhere;
}

.build-reqs-panel {
    margin-top: 10px;
    padding: 9px;
    border-radius: 5px;
    background: rgba(0, 0, 0, 0.22);
    border: 1px solid rgba(131, 145, 161, 0.16);
}

.build-section-label {
    font-family: var(--font-cyber);
    font-size: 9px;
    letter-spacing: 0.16em;
    color: #8e9bab;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.build-req-item {
    display: grid;
    grid-template-columns: 58px 1fr auto;
    gap: 8px;
    align-items: center;
    padding: 6px 0;
    border-top: 1px solid rgba(131, 145, 161, 0.1);
    font-size: 11px;
}

.build-req-item:first-of-type {
    border-top: 0;
}

.build-req-state {
    font-size: 9px;
    letter-spacing: 0.08em;
    font-family: var(--font-mono);
    color: #8793a3;
}

.build-req-name {
    color: #c5cdd6;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.build-req-level {
    color: #d1b184;
    font-family: var(--font-mono);
    font-weight: 700;
}

.build-req-item.met .build-req-state {
    color: #8aa889;
}

.build-req-item.missing .build-req-state,
.build-req-item.missing .build-req-name,
.build-req-item.missing .build-req-level {
    color: #d66a62;
}

.build-card-action {
    margin-top: 12px;
    margin-bottom: 2px;
}

.edificio .build-btn {
    width: 100%;
    background: linear-gradient(180deg, rgba(184, 129, 74, 0.22), rgba(92, 64, 38, 0.24));
    border: 1px solid rgba(184, 129, 74, 0.5);
    color: #e8dccf;
    padding: 9px 12px;
    font-size: 12px;
    cursor: pointer;
    border-radius: 4px;
    font-family: var(--font-cyber);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s, border-color 0.2s, transform 0.2s;
}

.edificio .build-btn small {
    color: #a8947b;
    font-family: var(--font-mono);
    font-size: 9px;
}

.edificio .build-btn:hover {
    background: linear-gradient(180deg, rgba(184, 129, 74, 0.32), rgba(92, 64, 38, 0.34));
    border-color: rgba(213, 159, 101, 0.72);
    transform: translateY(-1px);
}

.build-card-blocked,
.build-card-status {
    margin-top: 12px;
    margin-bottom: 2px;
    border: 1px solid rgba(157, 68, 68, 0.5);
    background: rgba(90, 28, 28, 0.18);
    border-radius: 5px;
    padding: 9px 10px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.build-card-blocked strong,
.build-card-status {
    color: #d66a62;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.12em;
}

.build-card-blocked span {
    color: #b6a09e;
    font-size: 11px;
}

.build-card.is-complete {
    padding: 18px;
    text-align: center;
}

.build-empty-state {
    border: 1px solid rgba(131, 145, 161, 0.22);
    background: rgba(0, 0, 0, 0.24);
    border-radius: 6px;
    padding: 18px;
    color: #9aa7b7;
    display: grid;
    gap: 6px;
}

.build-empty-state strong {
    color: #d8dee6;
    font-size: 12px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.build-empty-state span {
    color: #8f9aaa;
    font-size: 12px;
}

/* ─── Cyberpunk Task Construction Cards ──────────────────────────────────── */
.cyber-tasks {
    width: 600px;
    margin: 24px auto 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cyber-tasks-title {
    font-family: var(--font-cyber);
    font-size: 11px;
    letter-spacing: 0.3em;
    color: rgba(0, 255, 255, 0.45);
    text-align: center;
    margin-bottom: 4px;
    text-transform: uppercase;
}

.cyber-tasks-title-glyph {
    color: rgba(0, 255, 255, 0.2);
    font-size: 13px;
}

.cyber-task-card {
    position: relative;
    background: linear-gradient(135deg, rgba(0, 20, 35, 0.92) 0%, rgba(0, 8, 18, 0.98) 100%);
    border: 1px solid rgba(0, 200, 255, 0.3);
    border-left: 3px solid #0cf;
    border-radius: 4px;
    padding: 12px 14px 0 14px;
    overflow: hidden;
    box-shadow: 0 0 18px rgba(0, 200, 255, 0.08), inset 0 0 30px rgba(0, 255, 255, 0.02);
    transition: box-shadow 0.3s;
}

.cyber-task-card:hover {
    box-shadow: 0 0 28px rgba(0, 200, 255, 0.18), inset 0 0 40px rgba(0, 255, 255, 0.04);
}

/* Scanlines overlay */
.cyber-task-scanlines {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: repeating-linear-gradient(0deg,
            transparent,
            transparent 2px,
            rgba(0, 0, 0, 0.06) 2px,
            rgba(0, 0, 0, 0.06) 4px);
    z-index: 2;
}

/* Header row: icon + info + timer */
.cyber-task-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
    position: relative;
    z-index: 3;
}

.cyber-task-icon {
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    background-size: cover;
    background-position: top center;
    border: 1px solid rgba(0, 255, 255, 0.2);
    border-radius: 3px;
    filter: brightness(0.9) saturate(0.8);
    image-rendering: pixelated;
    box-shadow: 0 0 8px rgba(0, 200, 255, 0.2);
}

.cyber-task-info {
    flex: 1;
    min-width: 0;
}

.cyber-task-name {
    font-family: var(--font-cyber);
    font-size: 13px;
    font-weight: bold;
    color: #e0f8ff;
    letter-spacing: 0.08em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cyber-task-level {
    color: #0cf;
    font-size: 11px;
    font-weight: normal;
    margin-left: 6px;
    opacity: 0.85;
}

.cyber-task-pos {
    font-family: var(--font-mono);
    font-size: 10px;
    color: rgba(0, 200, 255, 0.45);
    letter-spacing: 0.15em;
    margin-top: 3px;
}

/* Timer block */
.cyber-task-timer {
    text-align: right;
    flex-shrink: 0;
}

.cyber-timer-label {
    font-family: var(--font-cyber);
    font-size: 8px;
    letter-spacing: 0.35em;
    color: rgba(0, 255, 255, 0.3);
    text-transform: uppercase;
    margin-bottom: 2px;
}

.cyber-timer-value {
    font-family: var(--font-mono);
    font-size: 18px;
    color: #0ff;
    text-shadow: 0 0 8px rgba(0, 255, 255, 0.9), 0 0 20px rgba(0, 255, 255, 0.4);
    letter-spacing: 0.06em;
    animation: timerPulse 1s ease-in-out infinite;
}

@keyframes timerPulse {

    0%,
    100% {
        text-shadow: 0 0 8px rgba(0, 255, 255, 0.9), 0 0 20px rgba(0, 255, 255, 0.4);
    }

    50% {
        text-shadow: 0 0 14px rgba(0, 255, 255, 1), 0 0 35px rgba(0, 255, 255, 0.65), 0 0 60px rgba(0, 200, 255, 0.2);
    }
}

/* Progress track */
.cyber-progress-track {
    position: relative;
    height: 14px;
    background: rgba(0, 20, 35, 0.8);
    border-top: 1px solid rgba(0, 200, 255, 0.15);
    border-bottom: 1px solid rgba(0, 200, 255, 0.1);
    margin: 0 -14px;
    overflow: hidden;
    z-index: 3;
}

.cyber-progress-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg,
            rgba(0, 150, 220, 0.6) 0%,
            rgba(0, 220, 255, 0.85) 70%,
            rgba(180, 255, 255, 0.95) 100%);
    box-shadow: 0 0 12px rgba(0, 255, 255, 0.7), inset 0 0 8px rgba(255, 255, 255, 0.15);
    transition: width 0.95s linear;
    z-index: 1;
}

.cyber-progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 6px;
    height: 100%;
    background: rgba(255, 255, 255, 0.85);
    box-shadow: 0 0 10px #fff, 0 0 20px #0ff;
    animation: progressHead 0.5s ease-in-out infinite alternate;
}

@keyframes progressHead {
    from {
        opacity: 0.7;
        box-shadow: 0 0 8px #fff, 0 0 16px #0ff;
    }

    to {
        opacity: 1;
        box-shadow: 0 0 14px #fff, 0 0 28px #0ff, 0 0 40px rgba(0, 200, 255, 0.4);
    }
}

/* Random glitch slice on progress bar */
.cyber-progress-glitch {
    position: absolute;
    top: 3px;
    height: 3px;
    width: 30px;
    background: rgba(255, 255, 255, 0.15);
    z-index: 4;
    animation: glitchSlide 3.5s ease-in-out infinite;
    pointer-events: none;
}

@keyframes glitchSlide {
    0% {
        left: -40px;
        opacity: 0;
    }

    10% {
        opacity: 0.8;
    }

    40% {
        left: 110%;
        opacity: 0.3;
    }

    41% {
        opacity: 0;
        left: -40px;
    }

    100% {
        left: -40px;
        opacity: 0;
    }
}

.cyber-progress-text {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-cyber);
    font-size: 8px;
    letter-spacing: 0.25em;
    color: rgba(200, 240, 255, 0.5);
    z-index: 5;
    pointer-events: none;
    text-transform: uppercase;
}

.task_time {
    font-size: 13px;
    color: #e96;
    font-family: var(--font-mono);
    text-align: right;
}

/* Boss Panel */
.body_container {
    width: 800px;
    height: 600px;
    margin: 120px auto;
    border-radius: 50%;
    background-color: rgba(0, 30, 60, 0.15);
    position: relative;
}

.boss_body {
    width: 387px;
    height: 600px;
    margin: 0 auto;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    opacity: 0.8;
}

.upd_box {
    cursor: pointer;
    position: absolute;
    width: 50px;
    height: 50px;
    transition: filter 0.3s;
}

.upd_box:hover {
    filter: drop-shadow(0 0 8px var(--text-cyan));
}

.boss_val {
    position: absolute;
    width: 200px;
    height: 24px;
    border-bottom: 1px solid rgba(0, 255, 255, 0.2);
    line-height: 24px;
    font-size: 13px;
    color: rgba(0, 255, 255, 0.8);
    font-family: var(--font-mono);
}

/* Units list screen */
.center_600 {
    width: 65%;
    max-width: 1200px;
    margin: 100px auto 40px;
    color: var(--text-white);
}

.units_container {
    width: 240px;
    height: 320px;
    background-size: cover;
    background-repeat: no-repeat;
    border: 1px solid var(--border-cyan);
    border-radius: 8px;
    background-color: rgba(0, 10, 20, 0.85);
    float: left;
    margin-top: 20px;
    margin-right: 20px;
    position: relative;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

.unit_data {
    padding: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(0, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.3);
}

.unit_data .tot {
    font-weight: bold;
    color: var(--text-cyan);
    background: #000;
    padding: 2px 6px;
    border: 1px solid var(--border-cyan);
    border-radius: 4px;
    font-family: var(--font-mono);
}

.unit_data .liv {
    font-size: 11px;
    color: #88a0b0;
    font-weight: bold;
}

.unit_data .nome {
    position: absolute;
    top: 45px;
    left: 10px;
    font-size: 14px;
    font-weight: bold;
    color: var(--text-white);
    text-shadow: 0 0 4px rgba(0, 255, 255, 0.5);
}

.unit_img {
    width: 100%;
    height: 180px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    margin-top: 35px;
    opacity: 0.85;
}

.units_container .stats-box {
    position: absolute;
    bottom: 10px;
    left: 10px;
    right: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(0, 255, 255, 0.1);
    border-radius: 4px;
    padding: 6px;
}

.units_container .info {
    font-size: 10px;
    color: #c0d0e0;
    display: flex;
    align-items: center;
    gap: 4px;
    width: 47%;
    margin-bottom: 2px;
}

.units_container .info::before {
    content: '';
    width: 12px;
    height: 12px;
    background-size: contain;
    background-repeat: no-repeat;
    display: inline-block;
}

.info.power::before {
    background-image: url('../images/power.png');
}

.info.health::before {
    background-image: url('../images/salute.png');
}

.info.armor::before {
    background-image: url('../images/corazza.png');
}

.info.cre::before {
    background-image: url('../images/credits1.png');
}

.info.har::before {
    background-image: url('../images/hardware.png');
}

.info.time::before {
    background-image: url('../images/time.png');
}

.units_container .add {
    position: absolute;
    right: 10px;
    top: 45px;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    color: #fff;
    background-color: rgba(0, 155, 255, 0.3);
    border: 1px solid rgba(0, 155, 255, 0.5);
    font-size: 16px;
    font-weight: bold;
    text-align: center;
    line-height: 22px;
    cursor: pointer;
    transition: background 0.2s;
}

.units_container .add:hover {
    background-color: rgba(0, 155, 255, 0.7);
}

/* Map screen center styling */
#center_map {
    position: fixed;
    top: 85px;
    bottom: 115px;
    left: 100px;
    right: 100px;

    width: auto;
    height: auto;
    margin: 0px;
    border: 1px rgba(0, 100, 100, 0.3) solid;
    border-radius: 15px;
    background-color: rgba(0, 5, 10, 0.5);
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.15);
    overflow: hidden;
}

#canvas1 {
    width: 100%;
    height: 100%;
    border-radius: 15px;
    display: block;
}

/* Minimap */
#minimap {
    width: 200px;
    height: 200px;
    position: absolute;
    top: 20px;
    right: 20px;
    border: 1px rgba(0, 100, 100, 0.5) solid;
    background-color: #000;
    overflow: hidden;
    opacity: 0.8;
    z-index: 10;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.2);
    cursor: pointer;
}

.minimap-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('../images/map/city.jpg');
    background-size: 200px 200px;
    filter: brightness(0.2);
    z-index: 1;
    pointer-events: none;
}

#minimap .fill {
    position: absolute;
    background-image: url('../images/map/city.jpg');
    background-size: 200px 200px;
    filter: brightness(0.2);
    z-index: 5;
    pointer-events: none;
}

#minipos {
    position: absolute;
    z-index: 1000;
    box-sizing: border-box;
    border: 1px solid lightblue;
    pointer-events: none;
}

/* Coordinate HUD */
.posf {
    color: lightblue;
    font-size: 13px;
    text-shadow: 0px 0px 4px #aaa;
    width: auto;
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    top: calc(100vh - 115px);
    bottom: auto;
    z-index: 10;
    background: rgba(0, 20, 30, 0.85);
    padding: 8px 22px 7px 22px;
    border-radius: 0;
    border: 1px rgba(0, 100, 100, 0.5) solid;
    border-top: 0;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.15);
    clip-path: polygon(0 0, 100% 0, calc(100% - 18px) 100%, 18px 100%);
    display: flex;
    align-items: center;
    gap: 8px;
}

.posf input {
    text-align: center;
    padding: 0px;
    height: 20px;
    line-height: 20px;
    width: 35px;
    font-family: var(--font-cyber);
    box-sizing: border-box;
}

#px {
    border: 1px rgba(0, 150, 150, 0.5) solid;
    color: #4aa;
    background-color: rgba(0, 50, 50, 0.2);
}

#py {
    border: 1px rgba(180, 150, 0, 0.5) solid;
    color: #eb2;
    background-color: rgba(50, 45, 0, 0.2);
}

.posf button {
    cursor: pointer;
    height: 20px;
    width: 40px;
    background-color: rgba(0, 100, 100, 0.5);
    border: 1px rgba(0, 100, 100, 0.5) solid;
    font-family: var(--font-cyber);
    color: lightblue;
}

/* Error banner overlay */
#error {
    position: fixed;
    top: 200px;
    left: 0px;
    width: 100%;
    z-index: 1500;
}

/* Login/Register screen */
.auth-container {
    width: 450px;
    margin: 100px auto;
    background: rgba(0, 10, 20, 0.85);
    border: 1px solid var(--border-cyan);
    border-radius: 8px;
    box-shadow: 0 0 30px rgba(0, 255, 255, 0.25);
    padding: 30px;
}

.auth-header {
    font-size: 24px;
    font-weight: bold;
    color: var(--text-cyan);
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 25px;
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.4);
}

.auth-form-group {
    margin-bottom: 20px;
}

.auth-form-group label {
    display: block;
    font-size: 12px;
    color: var(--text-lightblue);
    margin-bottom: 6px;
    text-transform: uppercase;
}

.auth-form-group input,
.auth-form-group select {
    width: 100%;
    padding: 10px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border-cyan);
    border-radius: 4px;
    color: #fff;
    font-family: var(--font-cyber);
    font-size: 14px;
    box-sizing: border-box;
}

.auth-form-group input:focus,
.auth-form-group select:focus {
    border-color: var(--border-cyan-active);
    outline: none;
    box-shadow: 0 0 8px var(--glow-cyan);
}

.auth-btn {
    width: 100%;
    padding: 12px;
    background: rgba(0, 100, 100, 0.3);
    border: 1px solid var(--border-cyan-active);
    color: var(--text-cyan);
    font-family: var(--font-cyber);
    font-size: 16px;
    font-weight: bold;
    text-transform: uppercase;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.3s;
}

.auth-btn:hover {
    background: rgba(0, 255, 255, 0.25);
    box-shadow: 0 0 15px var(--glow-cyan);
}

.auth-links {
    margin-top: 20px;
    text-align: center;
    font-size: 12px;
}

.auth-links a {
    color: var(--text-lightblue);
    text-decoration: none;
    margin: 0 10px;
}

.auth-links a:hover {
    color: var(--text-cyan);
    text-decoration: underline;
}

.alert {
    padding: 10px 15px;
    border-radius: 4px;
    font-size: 13px;
    margin-bottom: 20px;
    text-align: center;
}

.alert-danger {
    background: rgba(255, 0, 0, 0.15);
    border: 1px solid rgba(255, 0, 0, 0.4);
    color: #ff9999;
}

.alert-success {
    background: rgba(0, 255, 0, 0.15);
    border: 1px solid rgba(0, 255, 0, 0.4);
    color: #99ff99;
}

/* ─── Cyberpunk Base Details Modal ───────────────────────────────────────── */
.cyber_modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 5, 10, 0.85);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.cyber_modal_content {
    background: linear-gradient(135deg, rgba(0, 20, 35, 0.95) 0%, rgba(0, 8, 18, 0.98) 100%);
    border: 2px solid var(--border-cyan);
    box-shadow: 0 0 25px rgba(0, 255, 255, 0.3), inset 0 0 15px rgba(0, 255, 255, 0.05);
    border-radius: 6px;
    padding: 22px 28px;
    width: 380px;
    position: relative;
    font-family: var(--font-cyber);
    color: var(--text-white);
}

.cyber_modal_content .title {
    font-size: 15px;
    font-weight: bold;
    color: var(--text-cyan);
    letter-spacing: 0.15em;
    margin-bottom: 18px;
    border-bottom: 1px solid rgba(0, 255, 255, 0.2);
    padding-bottom: 8px;
}

.cyber_modal_content .field {
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    font-size: 12px;
}

.cyber_modal_content .label {
    color: var(--text-lightblue);
    letter-spacing: 0.08em;
}

.cyber_modal_content .value {
    font-family: var(--font-mono);
    color: var(--text-white);
}

.cyber_modal_content .value.highlight {
    color: #0ff;
    text-shadow: 0 0 5px rgba(0, 255, 255, 0.5);
}

.cyber_modal_content .close-btn {
    margin-top: 18px;
    width: 100%;
    background: transparent;
    border: 1px solid var(--border-cyan);
    color: var(--text-cyan);
    padding: 8px;
    font-family: var(--font-cyber);
    font-size: 12px;
    font-weight: bold;
    letter-spacing: 0.1em;
    cursor: pointer;
    transition: all 0.3s;
}

.cyber_modal_content .close-btn:hover {
    background: rgba(0, 255, 255, 0.15);
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.4);
}

/* ─── Units Screen ─────────────────────────────────────────────────────────── */

.units-loading,
.units-error {
    text-align: center;
    color: #0ff;
    font-family: var(--font-cyber);
    font-size: 16px;
    letter-spacing: 0.3em;
    margin-top: 200px;
    animation: oneblink 1s ease-in-out infinite alternate;
}

.units-screen {
    padding: 90px 80px 60px 90px;
    max-width: 1200px;
    margin: 0 auto;
}

.units-faction-block {
    max-width: 947px;
    margin: 0 auto 36px;
}

/* ── Faction header bar ── */
.units-faction-header {
    display: flex;
    align-items: center;
    gap: 18px;
    margin: 36px 0 18px;
    padding: 10px 20px;
    background: linear-gradient(90deg,
            rgba(0, 0, 0, 0) 0%,
            rgba(0, 0, 0, 0.55) 20%,
            rgba(0, 0, 0, 0.55) 80%,
            rgba(0, 0, 0, 0) 100%);
    border-top: 1px solid var(--faction-accent, #0ff);
    border-bottom: 1px solid var(--faction-accent, #0ff);
    box-shadow: 0 0 18px var(--faction-glow, rgba(0, 255, 255, 0.3));
}

.faction-tag {
    font-family: var(--font-cyber);
    font-size: 10px;
    letter-spacing: 0.35em;
    color: var(--faction-accent, #0ff);
    opacity: 0.65;
    text-transform: uppercase;
    flex: 1;
}

.faction-tag:last-child {
    text-align: right;
}

.faction-name {
    font-family: var(--font-cyber);
    font-size: 16px;
    font-weight: bold;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: var(--faction-accent, #0ff);
    text-shadow: 0 0 12px var(--faction-glow, rgba(0, 255, 255, 0.6));
}

/* ── Units grid ── */
.units-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    justify-content: flex-start;
}

/* ── Unit Card ── */
.unit-card {
    width: 175px;
    flex-shrink: 0;
    cursor: pointer;
    transition: transform 0.25s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.unit-card.locked {
    cursor: not-allowed;
}

.unit-card:hover {
    transform: translateY(-6px) scale(1.03);
}

.unit-card-deck {
    width: 175px;
    height: 220px;
    background-image: url('../images/unita/deck.png');
    background-size: 175px 220px;
    background-repeat: no-repeat;
    position: relative;
    border-radius: 6px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.7), 0 0 12px var(--faction-glow, rgba(0, 255, 255, 0.2));
    transition: box-shadow 0.25s;
}

.unit-card:hover .unit-card-deck {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.8), 0 0 22px var(--faction-glow, rgba(0, 255, 255, 0.45));
}

.unit-card-inner {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    padding: 10px 10px 8px;
}

/* Header: tier stars + name */
.unit-card-header {
    text-align: center;
    margin-bottom: 4px;
}

.unit-tier {
    font-size: 9px;
    color: var(--faction-accent, #0ff);
    letter-spacing: 2px;
    text-shadow: 0 0 6px var(--faction-glow, rgba(0, 255, 255, 0.5));
}

.unit-name {
    font-family: var(--font-cyber);
    font-size: 11px;
    font-weight: bold;
    color: #e8f4ff;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-top: 2px;
    line-height: 1.2;
}

/* Portrait */
.unit-portrait {
    flex: 1;
    background-size: cover;
    background-position: top center;
    background-repeat: no-repeat;
    margin: 4px -2px;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 1) 60%, rgba(0, 0, 0, 0) 100%);
    -webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 1) 60%, rgba(0, 0, 0, 0) 100%);
}

/* Stats row */
.unit-stats {
    display: flex;
    justify-content: space-around;
    margin: 4px 0 2px;
    gap: 4px;
}

.unit-stat {
    display: flex;
    align-items: center;
    gap: 3px;
    font-family: var(--font-mono);
    font-size: 11px;
    color: #c8e8f0;
}

.stat-icon {
    width: 12px;
    height: 12px;
    object-fit: contain;
    opacity: 0.85;
    flex-shrink: 0;
}

/* Costs row */
.unit-costs {
    display: flex;
    justify-content: space-between;
    gap: 2px;
    padding: 3px 2px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.unit-cost-item {
    display: flex;
    align-items: center;
    gap: 2px;
    font-family: var(--font-mono);
    font-size: 9px;
    color: rgba(200, 230, 255, 0.75);
}

/* Locked state & overlay */
.unit-card.locked .unit-portrait {
    filter: brightness(0);
}

.unit-lock-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 88%;
    background: none;
    border: none;
    box-shadow: none;
    padding: 2px;
    text-align: center;
    box-sizing: border-box;
    z-index: 5;
    pointer-events: none;
}

.unit-lock-overlay .lock-title {
    font-family: var(--font-cyber);
    font-size: 13px;
    color: #993333;
    font-weight: bold;
    letter-spacing: 2px;
    margin-bottom: 6px;
    text-transform: uppercase;
}

.unit-lock-overlay .lock-reqs-list {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.unit-lock-overlay .lock-req-item {
    font-family: var(--font-cyber);
    font-size: 11px;
    color: #888888;
    line-height: 1.3;
}

.unit-lock-overlay .lock-req-lvl {
    color: #c09030;
    font-weight: bold;
}

.unit-owned-badge {
    position: absolute;
    right: -8px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 20, 30, 0.95);
    border: 1px solid var(--faction-accent, #0ff);
    box-shadow: 0 0 8px var(--faction-glow, rgba(0, 255, 255, 0.4));
    color: #fff;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: bold;
    padding: 4px 8px;
    border-radius: 4px;
    z-index: 4;
    text-shadow: 0 0 4px var(--faction-glow, rgba(0, 255, 255, 0.5));
}

/* Custom styling for unit and defense cards stats/costs layout */
.unit-card .unit-stats,
.unit-card .unit-costs {
    transform: translateY(-10px);
}

.unit-card .stat-icon {
    width: 18px;
    height: 18px;
}

/* ═══════════════════════════════════════════════════════════════════
   BOSS SCREEN
   ═══════════════════════════════════════════════════════════════════ */

@keyframes boss-fadein {
    0% {
        opacity: 0;
        transform: translateY(10px) scale(0.97);
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes boss-body-appear {
    0% {
        opacity: 0;
        transform: scale(0.85) translateY(20px);
    }

    100% {
        opacity: 0.92;
        transform: scale(1) translateY(0);
    }
}

@keyframes boss-pulse-glow {

    0%,
    100% {
        box-shadow: 0 0 15px rgba(0, 255, 255, 0.2), inset 0 0 20px rgba(0, 30, 60, 0.4);
    }

    50% {
        box-shadow: 0 0 30px rgba(0, 255, 255, 0.4), inset 0 0 20px rgba(0, 60, 100, 0.3);
    }
}

@keyframes boss-scanline-move {
    0% {
        background-position: 0 0;
    }

    100% {
        background-position: 0 100px;
    }
}

@keyframes boss-node-appear {
    0% {
        opacity: 0;
        transform: scale(0.5);
    }

    70% {
        opacity: 1;
        transform: scale(1.1);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.boss-screen {
    position: relative;
    max-width: 1100px;
    margin: 40px auto 0;
    padding: 20px 20px 10px;
    animation: boss-fadein 0.5s ease forwards;
    overflow: hidden;
}

/* CRT scanlines */
.boss-scanlines {
    pointer-events: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(to bottom,
            transparent 0px,
            transparent 3px,
            rgba(0, 0, 0, 0.06) 3px,
            rgba(0, 0, 0, 0.06) 4px);
    z-index: 0;
    animation: boss-scanline-move 4s linear infinite;
}

/* Header */
.boss-header {
    position: relative;
    z-index: 2;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    padding: 0 10px 14px;
    border-bottom: 1px solid rgba(0, 255, 255, 0.2);
    margin-bottom: 20px;
}

.boss-tagline {
    font-family: var(--font-mono);
    font-size: 11px;
    color: rgba(0, 255, 255, 0.5);
    letter-spacing: 2px;
    margin-bottom: 4px;
}

.boss-username {
    font-family: 'Orbitron', var(--font-cyber);
    font-size: 28px;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 0 20px rgba(0, 255, 255, 0.6), 0 0 40px rgba(0, 255, 255, 0.2);
    letter-spacing: 3px;
}

.boss-class-badge {
    display: inline-block;
    margin-top: 5px;
    padding: 3px 12px;
    font-family: var(--font-cyber);
    font-size: 11px;
    color: #0ff;
    border: 1px solid rgba(0, 255, 255, 0.4);
    background: rgba(0, 255, 255, 0.08);
    letter-spacing: 2px;
    clip-path: polygon(8px 0%, 100% 0%, calc(100% - 8px) 100%, 0% 100%);
}

.boss-header-right {
    text-align: right;
}

.boss-coord {
    font-family: var(--font-mono);
    font-size: 10px;
    color: rgba(0, 255, 255, 0.4);
    letter-spacing: 1px;
    margin-bottom: 3px;
}

.boss-coord-value {
    font-family: var(--font-mono);
    font-size: 20px;
    color: rgba(0, 255, 255, 0.9);
    letter-spacing: 2px;
}

/* Large Vital Bars */
.boss-vital-row-large {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.boss-vital-label-large {
    font-family: var(--font-mono);
    font-size: 11px;
    color: rgba(0, 255, 255, 0.7);
    letter-spacing: 1px;
    font-weight: bold;
}

.boss-vital-bar-wrap-large {
    position: relative;
    height: 34px;
    background: rgba(0, 25, 40, 0.6);
    border: 1px solid rgba(0, 255, 255, 0.25);
    border-radius: 4px;
    overflow: hidden;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.8);
}

.boss-vital-bar-wrap-large::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 3;
    pointer-events: none;
    background-image: linear-gradient(90deg,
            transparent calc(100% - 1px),
            rgba(0, 10, 18, 0.1) calc(100% - 1px),
            rgba(0, 10, 18, 0.1) 100%);
    /* filter: drop-shadow(1px 0 0 rgba(255, 255, 255, 0.08)); */
    background-size: calc(100% / var(--boss-vital-steps, 10)) 100%;
    background-repeat: repeat-x;
}

.boss-vital-fill-large {
    position: relative;
    z-index: 1;
    height: 100%;
    transition: width 1s linear;
    box-shadow: 0 0 8px currentColor;
}

.boss-vital-text-large {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: bold;
    color: #ffffff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9), 0 0 5px rgba(0, 0, 0, 0.5);
    pointer-events: none;
    z-index: 4;
}

.boss-system-capsule-section {
    margin-top: 0;
    margin-bottom: 18px;
}

.boss-system-capsule-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 18px;
    align-items: stretch;
}

.boss-system-column,
.boss-capsule-column {
    min-width: 0;
}

.boss-capsule-column .boss-capsule-panel {
    height: 100%;
    margin-bottom: 0;
    padding: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

@media (max-width: 820px) {
    .boss-system-capsule-grid {
        grid-template-columns: 1fr;
    }
}

/* Regen rate badge shown next to vital bar labels when boss is in capsule */
.boss-regen-badge {
    display: inline-flex;
    align-items: center;
    margin-left: 8px;
    padding: 1px 6px;
    background: rgba(0, 255, 102, 0.12);
    border: 1px solid rgba(0, 255, 102, 0.4);
    border-radius: 3px;
    font-size: 9px;
    font-family: var(--font-mono);
    font-weight: bold;
    color: #00ff66;
    letter-spacing: 0.5px;
    animation: regen-badge-pulse 1.5s ease-in-out infinite;
    vertical-align: middle;
}

@keyframes regen-badge-pulse {
    0%, 100% { opacity: 0.7; box-shadow: 0 0 4px rgba(0, 255, 102, 0.3); }
    50%       { opacity: 1.0; box-shadow: 0 0 8px rgba(0, 255, 102, 0.7); }
}


.boss-capsule-panel {
    background: rgba(0, 15, 30, 0.75);
    border: 1px solid rgba(0, 255, 255, 0.25);
    border-radius: 4px;
    padding: 15px;
    margin-bottom: 20px;
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.05);
}

.boss-capsule-panel.active {
    border-color: #00ffcc;
    box-shadow: 0 0 20px rgba(0, 255, 204, 0.15);
}

.boss-capsule-panel.idle {
    border-color: rgba(255, 255, 255, 0.15);
}

.boss-capsule-panel.error {
    border-color: #ff5555;
    box-shadow: 0 0 15px rgba(255, 85, 85, 0.1);
}

.capsule-status-text {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: bold;
    letter-spacing: 1.5px;
    color: #0ff;
}

.boss-capsule-panel.active .capsule-status-text {
    color: #00ffcc;
    text-shadow: 0 0 8px rgba(0, 255, 204, 0.5);
}

.boss-capsule-panel.error .capsule-status-text {
    color: #ff5555;
}

.boss-capsule-btn {
    display: block;
    width: 100%;
    margin-top: 12px;
    padding: 10px;
    font-family: var(--font-cyber);
    font-size: 12px;
    font-weight: bold;
    letter-spacing: 2px;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.boss-capsule-btn.btn-enter {
    background: rgba(0, 255, 100, 0.1);
    border: 1px solid #00ff66;
    color: #00ff66;
}

.boss-capsule-btn.btn-enter:hover {
    background: #00ff66;
    color: #000;
    box-shadow: 0 0 15px rgba(0, 255, 102, 0.4);
}

.boss-capsule-btn.btn-exit {
    background: rgba(255, 100, 0, 0.1);
    border: 1px solid #ff6600;
    color: #ff6600;
}

.boss-capsule-btn.btn-exit:hover {
    background: #ff6600;
    color: #fff;
    box-shadow: 0 0 15px rgba(255, 102, 0, 0.4);
}

.boss-capsule-btn:disabled {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.3);
    cursor: not-allowed;
}

/* In-Capsule Visual Effects */
.boss-body-wrap.in-capsule-mode {
    border-color: #00ffcc;
    box-shadow: 0 0 30px rgba(0, 255, 204, 0.15);
    background: radial-gradient(circle at center, rgba(0, 50, 40, 0.5) 0%, rgba(0, 15, 20, 0.9) 100%);
    overflow: hidden;
}

.boss-body-wrap.in-capsule-mode .boss-body-img {
    filter: drop-shadow(0 0 15px rgba(0, 255, 204, 0.6)) contrast(1.1) saturate(1.2);
    animation: capsule-float 3s ease-in-out infinite;
}

.capsule-liquids {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 4;
    pointer-events: none;
    background: linear-gradient(180deg, rgba(0, 255, 204, 0.08) 0%, rgba(0, 255, 204, 0.15) 100%);
}

.capsule-glass-glare {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0) 40%, rgba(255, 255, 255, 0) 80%, rgba(255, 255, 255, 0.05) 100%);
    z-index: 6;
}

.capsule-warning-light {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 255, 204, 0.15);
    border: 1px solid #00ffcc;
    border-radius: 3px;
    padding: 3px 10px;
    font-family: var(--font-mono);
    font-size: 8px;
    font-weight: bold;
    color: #00ffcc;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    animation: text-pulse 2s ease infinite;
    z-index: 7;
}

/* Cable flowing animation */
.cable-flow {
    stroke-dasharray: 6, 6;
    animation: dash-flow 2s linear infinite;
}

.cable-flow-reverse {
    stroke-dasharray: 8, 8;
    animation: dash-flow-rev 3s linear infinite;
}

/* Bubble animations */
.bubble {
    position: absolute;
    bottom: -20px;
    background: rgba(0, 255, 204, 0.35);
    border-radius: 50%;
    box-shadow: 0 0 6px rgba(0, 255, 204, 0.5);
    animation: rise-up 4s ease-in infinite;
}

.bubble-1 {
    width: 8px;
    height: 8px;
    left: 15%;
    animation-delay: 0s;
    animation-duration: 4s;
}

.bubble-2 {
    width: 5px;
    height: 5px;
    left: 45%;
    animation-delay: 1s;
    animation-duration: 3s;
}

.bubble-3 {
    width: 10px;
    height: 10px;
    left: 75%;
    animation-delay: 0.5s;
    animation-duration: 5s;
}

.bubble-4 {
    width: 6px;
    height: 6px;
    left: 30%;
    animation-delay: 2.2s;
    animation-duration: 3.5s;
}

.bubble-5 {
    width: 4px;
    height: 4px;
    left: 60%;
    animation-delay: 1.7s;
    animation-duration: 4.5s;
}

@keyframes rise-up {
    0% {
        bottom: -20px;
        transform: translateX(0);
        opacity: 0;
    }

    10% {
        opacity: 0.6;
    }

    90% {
        opacity: 0.8;
    }

    100% {
        bottom: 100%;
        transform: translateX(15px);
        opacity: 0;
    }
}

@keyframes dash-flow {
    to {
        stroke-dashoffset: -20;
    }
}

@keyframes dash-flow-rev {
    to {
        stroke-dashoffset: 20;
    }
}

@keyframes capsule-float {
    0% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-8px);
    }

    100% {
        transform: translateY(0);
    }
}

@keyframes text-pulse {

    0%,
    100% {
        opacity: 0.6;
        box-shadow: 0 0 4px rgba(0, 255, 204, 0.2);
    }

    50% {
        opacity: 1;
        box-shadow: 0 0 12px rgba(0, 255, 204, 0.5);
    }
}

/* Body container: two columns */
.boss-body-container {
    position: relative;
    z-index: 2;
    display: flex;
    gap: 30px;
    align-items: flex-start;
    min-height: 500px;
}

/* Left column: body image */
.boss-body-wrap {
    position: relative;
    flex-shrink: 0;
    width: 350px;
    min-height: 580px;
    background: radial-gradient(ellipse at center, rgba(0, 30, 60, 0.35) 0%, transparent 70%);
    border: 1px solid rgba(0, 255, 255, 0.1);
    border-radius: 4px;
}

.boss-body-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 110%;
    background-size: auto 100%;
    background-repeat: no-repeat;
    background-position: center top;
    animation: boss-body-appear 1.2s ease forwards;
    opacity: 0.3;
}

.regen-active {
    position: relative;
    overflow: hidden;
}

.regen-active::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background-image: linear-gradient(-45deg,
            rgba(255, 255, 255, 0.25) 25%,
            transparent 25%,
            transparent 50%,
            rgba(255, 255, 255, 0.25) 50%,
            rgba(255, 255, 255, 0.25) 75%,
            transparent 75%,
            transparent);
    z-index: 2;
    background-size: 30px 30px;
    animation: move-stripes 1.5s linear infinite;
    opacity: 0.8;
}

@keyframes move-stripes {
    0% {
        background-position: 0 0;
    }

    100% {
        background-position: 30px 30px;
    }
}

/* Face badge in top-left corner */
.boss-face-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    width: 70px;
    height: 70px;
    background-size: cover;
    background-position: center top;
    border: 2px solid rgba(0, 255, 255, 0.5);
    clip-path: polygon(0 0, 80% 0, 100% 20%, 100% 100%, 0 100%);
    box-shadow: 0 0 12px rgba(0, 255, 255, 0.3);
    z-index: 3;
}

/* SVG nodes layer */
.boss-nodes-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 4;
}

.boss-upd-box {
    position: absolute;
    width: 50px;
    height: 50px;
    animation: boss-node-appear 0.6s ease forwards;
}

.boss-node-label {
    position: absolute;
    bottom: -16px;
    left: 50%;
    transform: translateX(-50%);
    font-family: var(--font-mono);
    font-size: 8px;
    color: rgba(0, 255, 255, 0.7);
    white-space: nowrap;
    letter-spacing: 1px;
}



/* Right column: data panel */
.boss-data-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 500px;
}

.boss-data-section {
    background: rgba(0, 15, 30, 0.7);
    border: 1px solid rgba(0, 255, 255, 0.15);
    border-radius: 4px;
    padding: 14px 16px;
    animation: boss-pulse-glow 4s ease infinite;
}

.boss-data-section-title {
    font-family: var(--font-mono);
    font-size: 10px;
    color: rgba(0, 255, 255, 0.5);
    letter-spacing: 2px;
    margin-bottom: 12px;
    text-transform: uppercase;
}

/* Resource grid */
.boss-resource-grid {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.boss-res-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(0, 255, 255, 0.1);
    padding: 8px 12px;
    border-radius: 4px;
    flex: 1;
    min-width: 100px;
}

.boss-res-icon {
    width: 22px;
    height: 22px;
    object-fit: contain;
    filter: drop-shadow(0 0 4px rgba(0, 255, 255, 0.4));
}

.boss-res-label {
    font-family: var(--font-mono);
    font-size: 9px;
    color: rgba(0, 255, 255, 0.5);
    letter-spacing: 1px;
    text-transform: uppercase;
}

.boss-res-value {
    font-family: var(--font-mono);
    font-size: 16px;
    color: #fff;
    font-weight: bold;
    text-shadow: 0 0 8px rgba(0, 255, 255, 0.4);
}

/* Combat stat blocks */
.boss-stat-grid {
    display: flex;
    gap: 12px;
}

.boss-stat-block {
    flex: 1;
    text-align: center;
    background: rgba(0, 255, 255, 0.03);
    border: 1px solid rgba(0, 255, 255, 0.1);
    padding: 12px 8px;
    border-radius: 4px;
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%);
}

.boss-stat-number {
    font-family: 'Orbitron', var(--font-cyber);
    font-size: 32px;
    font-weight: 700;
    color: #0ff;
    text-shadow: 0 0 15px rgba(0, 255, 255, 0.6);
    line-height: 1;
}

.boss-stat-label {
    font-family: var(--font-mono);
    font-size: 9px;
    color: rgba(255, 255, 255, 0.4);
    letter-spacing: 2px;
    margin-top: 4px;
    text-transform: uppercase;
}

/* Buildings list */
.boss-bld-list {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.boss-bld-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.boss-bld-name {
    font-family: var(--font-mono);
    font-size: 10px;
    color: rgba(255, 255, 255, 0.7);
    width: 120px;
    flex-shrink: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.boss-bld-bar-wrap {
    flex: 1;
    height: 5px;
    background: rgba(0, 255, 255, 0.06);
    border: 1px solid rgba(0, 255, 255, 0.15);
    border-radius: 2px;
    overflow: hidden;
}

.boss-bld-bar {
    height: 100%;
    background: linear-gradient(90deg, rgba(0, 255, 255, 0.5), rgba(0, 255, 255, 0.9));
    border-radius: 2px;
    box-shadow: 0 0 5px rgba(0, 255, 255, 0.5);
    transition: width 0.8s ease;
}

.boss-bld-lv {
    font-family: var(--font-mono);
    font-size: 10px;
    color: rgba(0, 255, 255, 0.7);
    width: 30px;
    text-align: right;
}

/* Footer strip */
.boss-footer {
    position: relative;
    z-index: 2;
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin-top: 40px;
    padding: 10px 14px;
    border-top: 1px solid rgba(0, 255, 255, 0.1);
    background: rgba(0, 255, 255, 0.03);
}

.boss-footer-line {
    font-family: var(--font-mono);
    font-size: 10px;
    color: rgba(255, 255, 255, 0.4);
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* Green Theme (Own Convoy) */
.cyber_modal_content.green_theme {
    border-color: #00ff66;
    box-shadow: 0 0 25px rgba(0, 255, 102, 0.3), inset 0 0 15px rgba(0, 255, 102, 0.05);
}

.cyber_modal_content.green_theme .title {
    color: #00ff66;
    border-bottom-color: rgba(0, 255, 102, 0.2);
}

.cyber_modal_content.green_theme .close-btn {
    border-color: #00ff66;
    color: #00ff66;
}

.cyber_modal_content.green_theme .close-btn:hover {
    background: rgba(0, 255, 102, 0.15);
    box-shadow: 0 0 10px rgba(0, 255, 102, 0.4);
}

.cyber_modal_content.green_theme .value.highlight {
    color: #00ff66;
    text-shadow: 0 0 5px rgba(0, 255, 102, 0.5);
}

/* Red Theme (Other Convoy) */
.cyber_modal_content.red_theme {
    border-color: #ff3333;
    box-shadow: 0 0 25px rgba(255, 51, 51, 0.3), inset 0 0 15px rgba(255, 51, 51, 0.05);
}

.cyber_modal_content.red_theme .title {
    color: #ff3333;
    border-bottom-color: rgba(255, 51, 51, 0.2);
}

.cyber_modal_content.red_theme .close-btn {
    border-color: #ff3333;
    color: #ff3333;
}

.cyber_modal_content.red_theme .close-btn:hover {
    background: rgba(255, 51, 51, 0.15);
    box-shadow: 0 0 10px rgba(255, 51, 51, 0.4);
}

.cyber_modal_content.red_theme .value.highlight {
    color: #ff3333;
    text-shadow: 0 0 5px rgba(255, 51, 51, 0.5);
}

/* Warning Banner inside Red Theme */
.cyber_modal_content .warning-banner {
    background: rgba(255, 51, 51, 0.1);
    border: 1px solid rgba(255, 51, 51, 0.3);
    color: #ff3333;
    font-size: 10px;
    text-align: center;
    padding: 6px;
    border-radius: 4px;
    margin-top: 15px;
    letter-spacing: 0.05em;
    animation: pulse-border 1.5s infinite alternate;
}

@keyframes pulse-border {
    0% {
        border-color: rgba(255, 51, 51, 0.2);
    }

    100% {
        border-color: rgba(255, 51, 51, 0.6);
    }
}

/* Section Title inside Modal */
.cyber_modal_content .section-title {
    font-size: 11px;
    color: #88a0b0;
    margin: 15px 0 8px;
    letter-spacing: 0.1em;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 3px;
    text-transform: uppercase;
}

/* Sub-fields for unit listings */
.cyber_modal_content .sub-field {
    margin-left: 10px;
    margin-bottom: 6px;
    display: flex;
    justify-content: space-between;
    font-size: 11px;
}

.cyber_modal_content .sub-label {
    color: rgba(255, 255, 255, 0.7);
}

.cyber_modal_content .sub-value {
    color: #00ff66;
    font-family: var(--font-mono);
}

.cyber_modal_content .sub-field.empty {
    color: rgba(255, 255, 255, 0.4);
    font-style: italic;
    justify-content: center;
}

/* ─── Right Menu ───────────────────────────────────────────────────────────── */
.right_menu {
    width: 65px;
    position: fixed;
    top: 160px;
    right: 20px;
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.right_menu .menu_circle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(0, 10, 20, 0.75);
    border: 2px solid rgba(0, 255, 255, 0.25);
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.1);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    cursor: pointer;
    text-decoration: none;
}

.right_menu .menu_circle:hover,
.right_menu .menu_circle.active {
    border-color: rgba(0, 255, 255, 0.95);
    box-shadow: 0 0 18px rgba(0, 255, 255, 0.5), inset 0 0 8px rgba(0, 255, 255, 0.3);
    background: rgba(0, 30, 45, 0.9);
    transform: scale(1.08);
}

.right_menu .menu_circle .menu_icon {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.75;
    transition: all 0.3s ease;
}

.right_menu .menu_circle:hover .menu_icon,
.right_menu .menu_circle.active .menu_icon {
    opacity: 1;
    filter: brightness(1.2) drop-shadow(0 0 5px rgba(0, 255, 255, 0.6));
}

.right_menu .menu_circle .menu_label {
    position: absolute;
    right: 72px;
    background: rgba(0, 12, 22, 0.95);
    border: 1px solid rgba(0, 255, 255, 0.45);
    color: var(--text-cyan);
    font-family: var(--font-cyber);
    font-size: 11px;
    font-weight: bold;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 6px 14px;
    border-radius: 4px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transform: translateX(15px);
    transition: opacity 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 0 12px rgba(0, 255, 255, 0.25);
}

.right_menu .menu_circle:hover .menu_label {
    opacity: 1;
    transform: translateX(0);
}

.right_menu .menu_circle .menu_label::before {
    content: '';
    position: absolute;
    width: 5px;
    height: 5px;
    left: -1px;
    top: -1px;
    border-top: 1px solid var(--text-cyan);
    border-left: 1px solid var(--text-cyan);
}

.right_menu .menu_circle .menu_label::after {
    content: '';
    position: absolute;
    width: 5px;
    height: 5px;
    right: -1px;
    bottom: -1px;
    border-right: 1px solid var(--text-cyan);
    border-bottom: 1px solid var(--text-cyan);
}

.ranking-container {
    width: 90%;
    max-width: 950px;
    margin: 100px auto 0;
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
    font-family: var(--font-cyber);
}

.soundtracks-screen {
    min-height: 100vh;
    position: relative;
    overflow: auto;
    background-image: url('../images/rock.jpg');
    background-size: cover;
    background-position: center;
    padding: 92px 120px 60px;
}

.soundtracks-screen::before {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    pointer-events: none;
    z-index: 0;
}

.soundtracks-screen::after {
    content: none;
}

.soundtracks-shell {
    position: relative;
    z-index: 1;
    max-width: 1040px;
    margin: 0 auto;
}

.soundtracks-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 18px;
    margin-bottom: 24px;
}

.soundtracks-title {
    font-family: var(--font-cyber);
    font-size: 34px;
    color: #00f0ff;
    text-transform: uppercase;
    letter-spacing: 0;
    text-shadow: 0 0 16px rgba(0, 240, 255, 0.75), 2px 2px 0 rgba(255, 0, 85, 0.75);
    margin-bottom: 6px;
}

.soundtracks-dev {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 5px 12px;
    border: 1px solid rgba(255, 0, 85, 0.55);
    background: rgba(12, 0, 18, 0.78);
    color: #ff4f9a;
    font-family: var(--font-mono);
    font-size: 12px;
    box-shadow: 0 0 14px rgba(255, 0, 85, 0.22);
}

.soundtrack-sequence-controls {
    display: flex;
    gap: 10px;
    align-items: center;
    flex: 0 0 auto;
}

.soundtrack-sequence-btn {
    min-width: 142px;
    height: 38px;
    border: 1px solid rgba(0, 240, 255, 0.65);
    background: rgba(0, 24, 34, 0.92);
    color: #00f0ff;
    font-family: var(--font-cyber);
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0;
    border-radius: 4px;
    cursor: pointer;
    box-shadow: 0 0 14px rgba(0, 240, 255, 0.22);
}

.soundtrack-sequence-btn.skip {
    min-width: 76px;
}

.soundtrack-sequence-btn:hover {
    background: rgba(0, 240, 255, 0.18);
    box-shadow: 0 0 18px rgba(0, 240, 255, 0.38);
}

.soundtrack-sequence-btn.active {
    border-color: rgba(57, 255, 20, 0.72);
    color: #39ff14;
    box-shadow: 0 0 20px rgba(57, 255, 20, 0.3), inset 0 0 16px rgba(57, 255, 20, 0.1);
}

.soundtrack-sequence-btn:disabled {
    cursor: not-allowed;
    opacity: 0.45;
    box-shadow: none;
}

.soundtracks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
}

.soundtracks-loading {
    grid-column: 1 / -1;
    min-height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(0, 240, 255, 0.28);
    background: rgba(0, 10, 18, 0.74);
    color: #00f0ff;
    font-family: var(--font-mono);
    font-size: 14px;
}

.soundtracks-loading.error {
    color: #ff3e4e;
    border-color: rgba(255, 62, 78, 0.5);
}

.soundtrack-card {
    min-height: 86px;
    position: relative;
    border: 1px solid rgba(0, 240, 255, 0.48);
    background:
        linear-gradient(135deg, rgba(0, 240, 255, 0.12), rgba(255, 0, 85, 0.08)),
        rgba(0, 9, 20, 0.86);
    box-shadow: 0 0 18px rgba(0, 240, 255, 0.16), inset 0 0 24px rgba(0, 0, 0, 0.45);
    padding: 16px;
    clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 18px, 100% 100%, 18px 100%, 0 calc(100% - 18px));
}

.soundtrack-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(#00f0ff, #ff0055);
    box-shadow: 0 0 12px rgba(0, 240, 255, 0.8);
}

.soundtrack-card.locked {
    filter: grayscale(1);
    opacity: 0.68;
    border-color: rgba(160, 170, 180, 0.32);
    background: rgba(18, 20, 24, 0.88);
    box-shadow: none;
}

.soundtrack-card-top {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
}

.soundtrack-card.playing {
    border-color: rgba(57, 255, 20, 0.72);
    box-shadow: 0 0 22px rgba(57, 255, 20, 0.18), inset 0 0 24px rgba(0, 240, 255, 0.14);
}

.soundtrack-card-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
    min-width: 96px;
}

.soundtrack-id,
.soundtrack-level {
    color: #ff4f9a;
    font-family: var(--font-mono);
    font-size: 11px;
}

.soundtrack-level {
    max-width: 132px;
    text-align: right;
    line-height: 14px;
}

.soundtrack-visualizer {
    width: 42px;
    height: 30px;
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    gap: 5px;
    opacity: 0;
}

.soundtrack-menu-visualizer {
    position: absolute;
    left: 50%;
    top: 34px;
    width: 18px;
    height: 10px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 2px;
    opacity: 0;
    pointer-events: none;
    transform: translateX(-50%);
    z-index: 2;
}

.soundtrack-inline-controls {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

.soundtrack-icon-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid rgba(0, 240, 255, 0.6);
    background: rgba(0, 24, 34, 0.9);
    color: #00f0ff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    box-shadow: 0 0 12px rgba(0, 240, 255, 0.2);
}

.soundtrack-icon-btn svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.soundtrack-icon-btn:hover {
    background: rgba(0, 240, 255, 0.18);
    box-shadow: 0 0 14px rgba(0, 240, 255, 0.35);
}

.soundtrack-icon-btn:disabled {
    cursor: not-allowed;
    opacity: 0.42;
    box-shadow: none;
}

.soundtrack-card.playing .soundtrack-icon-btn {
    border-color: rgba(57, 255, 20, 0.72);
    color: #39ff14;
    box-shadow: 0 0 14px rgba(57, 255, 20, 0.3);
}

.soundtrack-visualizer span,
.soundtrack-menu-visualizer span {
    width: 6px;
    height: 8px;
    background: linear-gradient(180deg, #39ff14, #00f0ff);
    box-shadow: 0 0 10px rgba(57, 255, 20, 0.75);
    transform-origin: bottom;
}

.soundtrack-menu-visualizer span {
    width: 3px;
    height: 4px;
    background: #ffffff;
    box-shadow: 0 0 6px rgba(255, 255, 255, 0.85);
}

.soundtrack-card.playing .soundtrack-visualizer,
.menu_circle.soundtrack-playing .soundtrack-menu-visualizer {
    opacity: 1;
}

.soundtrack-card.playing .soundtrack-visualizer span:nth-child(1) {
    animation: soundtrack-bar-1 0.58s ease-in-out infinite;
}

.soundtrack-card.playing .soundtrack-visualizer span:nth-child(2) {
    animation: soundtrack-bar-2 0.44s ease-in-out infinite;
}

.soundtrack-card.playing .soundtrack-visualizer span:nth-child(3) {
    animation: soundtrack-bar-3 0.66s ease-in-out infinite;
}

.menu_circle.soundtrack-playing .soundtrack-menu-visualizer span:nth-child(1) {
    animation: soundtrack-menu-bar-1 0.58s ease-in-out infinite;
}

.menu_circle.soundtrack-playing .soundtrack-menu-visualizer span:nth-child(2) {
    animation: soundtrack-menu-bar-2 0.44s ease-in-out infinite;
}

.menu_circle.soundtrack-playing .soundtrack-menu-visualizer span:nth-child(3) {
    animation: soundtrack-menu-bar-3 0.66s ease-in-out infinite;
}

@keyframes soundtrack-bar-1 {
    0%, 100% { height: 9px; }
    45% { height: 30px; }
}

@keyframes soundtrack-bar-2 {
    0%, 100% { height: 18px; }
    50% { height: 34px; }
}

@keyframes soundtrack-bar-3 {
    0%, 100% { height: 11px; }
    55% { height: 27px; }
}

@keyframes soundtrack-menu-bar-1 {
    0%, 100% { height: 4px; }
    45% { height: 9px; }
}

@keyframes soundtrack-menu-bar-2 {
    0%, 100% { height: 6px; }
    50% { height: 10px; }
}

@keyframes soundtrack-menu-bar-3 {
    0%, 100% { height: 5px; }
    55% { height: 8px; }
}

.soundtrack-name {
    color: #ffffff;
    font-family: var(--font-cyber);
    font-size: 16px;
    text-transform: uppercase;
    margin-top: 7px;
    line-height: 1.2;
}

.soundtrack-lock {
    margin-top: 12px;
    color: #a9b3bd;
    font-family: var(--font-mono);
    font-size: 12px;
}

.soundtrack-btn {
    min-width: 84px;
    height: 34px;
    border: 1px solid rgba(0, 240, 255, 0.6);
    background: rgba(0, 24, 34, 0.9);
    color: #00f0ff;
    font-family: var(--font-cyber);
    font-size: 12px;
    cursor: pointer;
    text-transform: uppercase;
}

.soundtrack-btn:hover {
    background: rgba(0, 240, 255, 0.18);
    box-shadow: 0 0 14px rgba(0, 240, 255, 0.35);
}

.soundtrack-btn:disabled {
    cursor: not-allowed;
    opacity: 0.42;
    box-shadow: none;
}

.soundtrack-btn.lyric {
    border-color: rgba(255, 0, 85, 0.62);
    color: #ff4f9a;
}

.soundtrack-btn.lyric:hover {
    background: rgba(255, 0, 85, 0.14);
    box-shadow: 0 0 14px rgba(255, 0, 85, 0.3);
}

.soundtrack-lyrics-modal {
    max-width: 680px;
    width: 90%;
}

.soundtrack-lyrics-box {
    max-height: 420px;
    overflow: auto;
    margin-top: 16px;
    padding: 16px;
    background: rgba(0, 0, 0, 0.46);
    border: 1px solid rgba(0, 240, 255, 0.22);
    color: #e8f8ff;
    font-family: var(--font-mono);
    font-size: 13px;
    line-height: 1.55;
}

@media (max-width: 780px) {
    .soundtracks-screen {
        padding: 92px 18px 80px;
    }

    .soundtracks-header {
        flex-direction: column;
        align-items: stretch;
    }

    .soundtracks-title {
        font-size: 26px;
    }

    .soundtrack-sequence-btn {
        width: 100%;
    }

    .soundtrack-sequence-controls {
        width: 100%;
    }
}

.ranking-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(0, 255, 255, 0.2);
    padding-bottom: 12px;
    margin-bottom: 20px;
}

.ranking-title {
    font-size: 20px;
    font-weight: bold;
    color: var(--text-cyan);
    letter-spacing: 0.15em;
    text-shadow: 0 0 8px rgba(0, 255, 255, 0.4);
}

.ranking-sort-controls {
    display: flex;
    gap: 12px;
    align-items: center;
}

.ranking-sort-label {
    font-size: 11px;
    color: var(--text-lightblue);
    letter-spacing: 0.08em;
}

.ranking-sort-btn {
    background: rgba(0, 20, 35, 0.6);
    border: 1px solid rgba(0, 255, 255, 0.3);
    color: var(--text-lightblue);
    font-family: var(--font-cyber);
    font-size: 11px;
    font-weight: bold;
    padding: 6px 14px;
    cursor: pointer;
    transition: all 0.3s;
    border-radius: 3px;
    letter-spacing: 0.05em;
}

.ranking-sort-btn:hover {
    background: rgba(0, 255, 255, 0.1);
    color: var(--text-cyan);
    border-color: rgba(0, 255, 255, 0.7);
}

.ranking-sort-btn.active {
    background: rgba(0, 255, 255, 0.2);
    color: var(--text-cyan);
    border-color: var(--text-cyan);
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.3);
}

.ranking-table-wrapper {
    overflow-x: auto;
}

.ranking-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    text-align: left;
}

.ranking-table th {
    border-bottom: 2px solid rgba(0, 255, 255, 0.3);
    padding: 8px 10px;
    color: var(--text-cyan);
    font-weight: bold;
    letter-spacing: 0.08em;
}

.ranking-table td {
    padding: 6px 10px;
    border-bottom: 1px solid rgba(0, 255, 255, 0.1);
    color: var(--text-white);
    vertical-align: middle;
}

.ranking-table tr:hover td {
    background: rgba(0, 255, 255, 0.04);
}

.ranking-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid rgba(0, 255, 255, 0.35);
    background-size: cover;
    background-position: center;
    box-shadow: 0 0 5px rgba(0, 255, 255, 0.2);
}

.ranking-username {
    font-weight: bold;
    color: var(--text-white);
    letter-spacing: 0.05em;
}

.ranking-coords {
    color: var(--text-cyan);
    text-decoration: none;
    cursor: pointer;
    font-family: var(--font-mono);
}

.ranking-coords:hover {
    color: var(--text-white);
    text-shadow: 0 0 5px rgba(0, 255, 255, 0.8);
}

.ranking-power {
    font-family: var(--font-mono);
    color: #eb2;
    font-weight: bold;
    text-shadow: 0 0 3px rgba(235, 187, 0, 0.3);
}

.ranking-level {
    font-family: var(--font-mono);
    color: var(--text-lightblue);
}

.ranking-rank {
    font-family: var(--font-mono);
    font-size: 14px;
    color: var(--text-cyan);
    font-weight: bold;
    text-align: center;
    width: 40px;
}

/* ─── Cyberchat Screen ──────────────────────────────────────────────────────── */
.chat-container {
    width: 90%;
    max-width: 800px;
    margin: 100px auto 0;
    display: flex;
    flex-direction: column;
    height: calc(100vh - 200px);
    font-family: var(--font-cyber);
}

.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid rgba(0, 255, 255, 0.3);
    padding-bottom: 12px;
    margin-bottom: 15px;
}

.chat-title {
    font-size: 18px;
    font-weight: bold;
    color: var(--text-cyan);
    letter-spacing: 0.15em;
    text-shadow: 0 0 8px rgba(0, 255, 255, 0.4);
}

.chat-status {
    font-family: var(--font-mono);
    font-size: 11px;
    color: #00ff66;
    letter-spacing: 0.08em;
}

.chat-feed {
    flex: 1;
    background: rgba(0, 10, 20, 0.65);
    border: 1px solid rgba(0, 255, 255, 0.15);
    border-radius: 4px;
    padding: 15px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow: inset 0 0 15px rgba(0, 255, 255, 0.05);
}

.chat-message {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 8px 12px;
    border-radius: 4px;
    background: rgba(0, 30, 45, 0.25);
    border-left: 3px solid rgba(0, 255, 255, 0.35);
    max-width: 85%;
    align-self: flex-start;
}

.chat-message-self {
    align-self: flex-end;
    border-left: none;
    border-right: 3px solid rgba(0, 255, 255, 0.8);
    background: rgba(0, 255, 255, 0.05);
    flex-direction: row-reverse;
}

.chat-message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid rgba(0, 255, 255, 0.35);
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
    box-shadow: 0 0 5px rgba(0, 255, 255, 0.2);
}

.chat-message-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    position: relative;
}

.chat-message-header {
    display: flex;
    gap: 10px;
    align-items: baseline;
}

.chat-message-self .chat-message-header {
    flex-direction: row-reverse;
}

.chat-message-author {
    font-size: 11px;
    font-weight: bold;
    color: var(--text-cyan);
    letter-spacing: 0.05em;
}

.chat-message-self .chat-message-author {
    color: #fff;
    text-shadow: 0 0 4px rgba(0, 255, 255, 0.4);
}

.chat-message-time {
    font-family: var(--font-mono);
    font-size: 9px;
    color: rgba(255, 255, 255, 0.35);
}

.chat-message-body {
    font-family: var(--font-mono);
    font-size: 12px;
    color: #e2f1f6;
    word-break: break-word;
    line-height: 1.4;
}

.chat-remove-btn {
    position: absolute;
    top: -7px;
    right: -9px;
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid rgba(255, 62, 78, 0.45);
    border-radius: 50%;
    background: rgba(35, 0, 10, 0.85);
    color: #ff3e4e;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s, border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.chat-message:hover .chat-remove-btn {
    opacity: 1;
}

.chat-remove-btn:hover {
    background: rgba(255, 62, 78, 0.18);
    border-color: rgba(255, 62, 78, 0.9);
    box-shadow: 0 0 8px rgba(255, 62, 78, 0.45);
}

.chat-remove-btn svg {
    width: 11px;
    height: 11px;
    fill: currentColor;
}

.chat-message-removed {
    border-left-color: rgba(255, 62, 78, 0.45);
    opacity: 0.88;
}

.chat-message-self.chat-message-removed {
    border-right-color: rgba(255, 62, 78, 0.55);
}

.chat-message-removed .chat-message-body {
    color: #ff3e4e;
    font-style: italic;
    text-shadow: 0 0 6px rgba(255, 62, 78, 0.25);
}

.chat-input-area {
    display: flex;
    gap: 12px;
    margin-top: 15px;
}

.chat-input {
    flex: 1;
    background: rgba(0, 10, 20, 0.85);
    border: 1px solid rgba(0, 255, 255, 0.3);
    color: #fff;
    font-family: var(--font-cyber);
    font-size: 12px;
    padding: 10px 14px;
    border-radius: 4px;
    outline: none;
    box-shadow: inset 0 0 8px rgba(0, 255, 255, 0.05);
    transition: all 0.3s;
}

.chat-input:focus {
    border-color: rgba(0, 255, 255, 0.8);
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.25), inset 0 0 8px rgba(0, 255, 255, 0.05);
}

.chat-send-btn {
    background: rgba(0, 20, 35, 0.65);
    border: 1px solid var(--border-cyan);
    color: var(--text-cyan);
    font-family: var(--font-cyber);
    font-size: 11px;
    font-weight: bold;
    letter-spacing: 0.1em;
    padding: 0 24px;
    cursor: pointer;
    transition: all 0.3s;
    border-radius: 4px;
}

.chat-send-btn:hover {
    background: rgba(0, 255, 255, 0.15);
    color: #fff;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.4);
    border-color: rgba(0, 255, 255, 0.8);
}

/* Boss Upgrade Panel Styles */
.boss-upgrades-grid {
    display: flex;
    gap: 15px;
    margin-top: 15px;
    width: 100%;
}

.boss-stat-row-upgrade {
    flex: 1;
    background: rgba(0, 15, 30, 0.7);
    border: 1px solid rgba(0, 255, 255, 0.15);
    border-radius: 4px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    box-shadow: 0 0 12px rgba(0, 255, 255, 0.03);
}

.boss-stat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.boss-stat-title {
    font-family: var(--font-cyber);
    font-size: 13px;
    font-weight: bold;
    color: #e0f8ff;
    letter-spacing: 0.1em;
}

.boss-stat-curr-val {
    font-family: var(--font-mono);
    font-size: 16px;
    font-weight: bold;
    color: #0ff;
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.4);
}

.boss-stat-curr-val .next-val-hint {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.45);
    margin-left: 6px;
    text-shadow: none;
}

.boss-upgrade-costs {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 11px;
    font-family: var(--font-mono);
    background: rgba(0, 0, 0, 0.25);
    padding: 8px 10px;
    border-radius: 4px;
    border: 1px solid rgba(0, 255, 255, 0.05);
}

.boss-upgrade-costs .cost-item {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #94a3b8;
}

.boss-upgrade-costs .cost-item.cost-ok {
    color: #39ff14;
}

.boss-upgrade-costs .cost-item.cost-warn {
    color: #ff3333;
    font-weight: bold;
}

.boss-upgrade-costs .cost-icon {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.boss-upgrade-costs .cost-icon.cre {
    background: #ffcc00;
    box-shadow: 0 0 5px #ffcc00;
}

.boss-upgrade-costs .cost-icon.har {
    background: #00ffcc;
    box-shadow: 0 0 5px #00ffcc;
}

.boss-upgrade-costs .cost-icon.time {
    background: #a855f7;
    box-shadow: 0 0 5px #a855f7;
}

.boss-upgrade-btn {
    background: rgba(0, 255, 255, 0.1);
    border: 1px solid rgba(0, 255, 255, 0.4);
    color: #0ff;
    font-family: var(--font-cyber);
    font-size: 11px;
    font-weight: bold;
    letter-spacing: 0.1em;
    padding: 8px 14px;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s;
    text-transform: uppercase;
}

.boss-upgrade-btn:hover:not(:disabled) {
    background: rgba(0, 255, 255, 0.25);
    color: #fff;
    box-shadow: 0 0 12px rgba(0, 255, 255, 0.4);
    border-color: rgba(0, 255, 255, 0.8);
}

.boss-upgrade-btn:disabled {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.2);
    cursor: not-allowed;
}

.boss-upgrade-max {
    font-family: var(--font-cyber);
    font-size: 11px;
    color: #ffaa00;
    letter-spacing: 0.15em;
    text-align: center;
    background: rgba(255, 170, 0, 0.08);
    border: 1px solid rgba(255, 170, 0, 0.2);
    padding: 8px;
    border-radius: 4px;
    font-weight: bold;
}

/* --- MAINFRAME MODULE STYLES --- */
.mainframe-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 960px;
    margin: 60px auto;
    gap: 30px;
    font-family: var(--font-cyber);
}

.mainframe-monitor-wrapper {
    position: relative;
    width: 100%;
    max-width: 1005px;
    aspect-ratio: 1.7 / 1;
    margin: 0 auto;
    filter: drop-shadow(0 0 15px rgba(0, 240, 255, 0.15));
}

.mainframe-monitor-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('../images/terminal.png') no-repeat center center;
    background-size: 100% 100%;
    pointer-events: none;
    z-index: 2;
}

.mainframe-terminal-content {
    position: absolute;
    top: 15%;
    left: 14.5%;
    width: 71%;
    height: 65.5%;
    background: rgba(0, 5, 2, 0.95);
    z-index: 1;
    border-radius: 4px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 12px;
    box-sizing: border-box;
    font-family: var(--font-mono);
    color: #39ff14;
    text-shadow: 0 0 5px rgba(57, 255, 20, 0.5);
    font-size: 11px;
    line-height: 1.4;
}

.blinking-cursor {
    animation: blinking-glow 1s infinite;
}

@keyframes blinking-glow {

    0%,
    49% {
        opacity: 1;
    }

    50%,
    100% {
        opacity: 0;
    }
}

.mainframe-terminal-feed {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 10px;
    word-break: break-all;
    padding-right: 5px;
}

.mainframe-terminal-feed::-webkit-scrollbar {
    width: 4px;
}

.mainframe-terminal-feed::-webkit-scrollbar-thumb {
    background: rgba(57, 255, 20, 0.3);
}

.mainframe-terminal-input-row {
    display: flex;
    align-items: center;
    gap: 8px;
    border-top: 1px solid rgba(57, 255, 20, 0.15);
    padding-top: 8px;
}

.mainframe-terminal-prompt {
    font-weight: bold;
    color: #39ff14;
}

.mainframe-terminal-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #39ff14;
    font-family: var(--font-mono);
    font-size: 13px;
    text-shadow: 0 0 5px rgba(57, 255, 20, 0.5);
}

.mainframe-section-title {
    width: 100%;
    font-family: 'Orbitron', sans-serif;
    font-size: 18px;
    font-weight: bold;
    color: var(--text-cyan);
    letter-spacing: 2px;
    text-transform: uppercase;
    border-left: 3px solid var(--text-cyan);
    padding-left: 10px;
    margin: 15px 0 5px 0;
    text-shadow: 0 0 8px rgba(0, 255, 255, 0.3);
}

.mainframe-programs-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    width: 100%;
}

.mainframe-program-card {
    background-image: url('../images/unita/deck.png');
    background-size: 100% 100%;
    background-repeat: no-repeat;
    border-radius: 6px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 155px;
    height: 180px;
    box-sizing: border-box;
    position: relative;
    transition: all 0.25s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.6);
}

.mainframe-program-card.locked {
    filter: brightness(0.7) grayscale(0.2);
}

.mainframe-program-card.locked .mainframe-program-portrait {
    background-image: none !important;
    background-color: #000000 !important;
    border-color: rgba(255, 62, 78, 0.2);
}

.mainframe-program-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 240, 255, 0.2), inset 0 0 12px rgba(0, 240, 255, 0.05);
}

.mainframe-program-portrait {
    width: 100%;
    height: 85px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    margin-bottom: 2px;
    border-radius: 4px;
    border: 1px solid rgba(0, 240, 255, 0.1);
    background-color: rgba(0, 5, 10, 0.5);
    position: relative;
}

.mainframe-lock-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 95%;
    text-align: center;
    box-sizing: border-box;
    z-index: 5;
    pointer-events: none;
    line-height: 1.2;
}

.mainframe-lock-overlay .lock-title {
    font-family: var(--font-cyber);
    font-size: 11px;
    color: #ff3e4e;
    font-weight: bold;
    letter-spacing: 1.5px;
    margin-bottom: 4px;
    text-transform: uppercase;
}

.mainframe-lock-overlay .lock-reqs-list {
    font-family: monospace;
    font-size: 9px;
    color: #ff9800;
    text-transform: uppercase;
}

.mainframe-program-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 11px;
    font-weight: bold;
    color: #fff;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mainframe-program-desc {
    display: none;
}

.mainframe-program-price {
    font-size: 14px;
    font-family: var(--font-mono);
    color: #00f0ff;
    text-shadow: 0 0 8px rgba(0, 240, 255, 0.7);
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
    font-weight: bold;
}

.mainframe-program-stats {
    display: flex;
    justify-content: space-around;
    font-size: 13px;
    color: #fff;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.3);
    font-family: monospace;
    margin-top: 2px;
    margin-bottom: 2px;
    align-items: center;
}

.mainframe-program-stats-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.mainframe-cost-icon {
    display: inline-block;
    width: 14px;
    height: 14px;
    background-size: contain;
    background-repeat: no-repeat;
    vertical-align: middle;
}
.mainframe-cost-icon.cre {
    background-image: url('../images/credits1.png');
    width: 18px;
    height: 18px;
    filter: drop-shadow(0 0 5px rgba(0, 240, 255, 0.9));
}
.mainframe-cost-icon.ene {
    background-image: url('../images/energy.png');
    width: 16px;
    height: 16px;
    filter: drop-shadow(0 0 3px rgba(57, 255, 20, 0.5));
}

.mainframe-btn {
    width: 100%;
    background: rgba(0, 240, 255, 0.08);
    border: 1px solid rgba(0, 240, 255, 0.4);
    color: var(--text-cyan);
    font-family: var(--font-cyber);
    font-size: 11px;
    font-weight: bold;
    letter-spacing: 0.1em;
    padding: 8px;
    cursor: pointer;
    border-radius: 3px;
    transition: all 0.2s;
    text-align: center;
    text-transform: uppercase;
}

.mainframe-btn:hover {
    background: rgba(0, 240, 255, 0.2);
    color: #fff;
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.4);
    border-color: rgba(0, 240, 255, 0.8);
}

.mainframe-servers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 15px;
    width: 100%;
    margin-bottom: 20px;
}

.mainframe-server-card {
    background: rgba(3, 8, 15, 0.75);
    border: 1px solid rgba(0, 240, 255, 0.12);
    border-radius: 4px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    position: relative;
    transition: all 0.25s ease;
}

.mainframe-server-card:hover {
    border-color: rgba(0, 240, 255, 0.35);
    box-shadow: 0 0 12px rgba(0, 240, 255, 0.08);
}

.mainframe-server-img {
    height: 110px;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 0 8px rgba(0, 240, 255, 0.25));
    transition: filter 0.3s;
}

.mainframe-server-card:hover .mainframe-server-img {
    filter: drop-shadow(0 0 12px rgba(0, 240, 255, 0.5));
}

.mainframe-server-title {
    font-size: 11px;
    font-weight: bold;
    color: #fff;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.mainframe-server-status {
    font-size: 10px;
    font-family: var(--font-mono);
    color: #39ff14;
    text-transform: uppercase;
}

.mainframe-server-status.locked {
    color: #ff3e4e;
}

.mission-overlay {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(0, 0, 0, 0.78);
    backdrop-filter: blur(6px);
    box-sizing: border-box;
}

.mission-box {
    width: min(900px, 96vw);
    max-height: min(760px, 92vh);
    overflow: auto;
    background: linear-gradient(180deg, rgba(7, 14, 24, 0.98), rgba(2, 6, 12, 0.98));
    border: 1px solid rgba(0, 240, 255, 0.45);
    border-radius: 6px;
    box-shadow: 0 0 34px rgba(0, 240, 255, 0.18), inset 0 0 22px rgba(0, 240, 255, 0.05);
    padding: 22px;
    color: #dffcff;
    box-sizing: border-box;
}

.mission-box.completed {
    border-color: rgba(57, 255, 20, 0.52);
    box-shadow: 0 0 38px rgba(57, 255, 20, 0.16), inset 0 0 22px rgba(57, 255, 20, 0.05);
}

.mission-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 16px;
}

.mission-number {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-cyan);
    letter-spacing: 0;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.mission-title {
    font-family: var(--font-cyber);
    font-size: 24px;
    line-height: 1.2;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 0;
}

.mission-state-pill {
    flex: 0 0 auto;
    border: 1px solid rgba(0, 240, 255, 0.35);
    border-radius: 4px;
    padding: 8px 10px;
    font-family: var(--font-mono);
    font-size: 11px;
    color: #ffffff;
    background: rgba(0, 240, 255, 0.08);
}

.mission-body {
    display: block;
    min-height: 260px;
}

.mission-image {
    float: left;
    width: min(390px, 46%);
    aspect-ratio: 3 / 2;
    object-fit: cover;
    border-radius: 5px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(0, 0, 0, 0.35);
    margin: 0 22px 14px 0;
}

.mission-copy {
    min-width: 0;
}

.mission-text {
    font-family: var(--font-main);
    font-size: 15px;
    line-height: 1.55;
    color: #d8f8ff;
    min-height: 120px;
    white-space: normal;
}

.mission-requirements {
    clear: both;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 10px;
    margin-top: 16px;
}

.mission-requirement {
    display: grid;
    grid-template-columns: 42px 1fr auto;
    align-items: center;
    gap: 10px;
    min-height: 56px;
    padding: 8px 10px;
    border: 1px solid rgba(255, 62, 78, 0.38);
    border-radius: 5px;
    background: rgba(255, 62, 78, 0.08);
}

.mission-requirement.met {
    border-color: rgba(57, 255, 20, 0.38);
    background: rgba(57, 255, 20, 0.07);
}

.mission-req-icon {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    background-color: rgba(0, 0, 0, 0.32);
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.mission-req-main {
    min-width: 0;
}

.mission-req-title {
    font-family: var(--font-cyber);
    font-size: 12px;
    color: #ffffff;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mission-req-label {
    font-family: var(--font-mono);
    font-size: 11px;
    color: rgba(216, 248, 255, 0.76);
    margin-top: 2px;
}

.mission-req-progress {
    font-family: var(--font-mono);
    font-size: 13px;
    color: #ffffff;
}

.mission-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 20px;
}

.mission-action-btn {
    min-width: 150px;
    border: 1px solid rgba(0, 240, 255, 0.6);
    border-radius: 4px;
    padding: 12px 18px;
    background: rgba(0, 240, 255, 0.12);
    color: #ffffff;
    font-family: var(--font-cyber);
    font-size: 13px;
    font-weight: bold;
    letter-spacing: 0;
    cursor: pointer;
    text-transform: uppercase;
}

.mission-action-btn:hover:not(:disabled) {
    background: rgba(0, 240, 255, 0.25);
    box-shadow: 0 0 14px rgba(0, 240, 255, 0.25);
}

.mission-action-btn:disabled {
    opacity: 0.55;
    cursor: wait;
}

.mission-bottom-bar {
    position: fixed;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    z-index: 900;
    width: min(620px, calc(100vw - 300px));
    min-height: 35px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 5px 22px;
    border: 1px solid rgba(210, 235, 240, 0.76);
    border-bottom: 0;
    border-radius: 0;
    background: rgba(204, 214, 218, 0.88);
    color: #061015;
    box-shadow: 0 -4px 16px rgba(210, 235, 240, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.65);
    cursor: pointer;
    box-sizing: border-box;
    clip-path: polygon(18px 0, calc(100% - 18px) 0, 100% 100%, 0 100%);
    overflow: hidden;
}

.mission-bottom-bar::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
        linear-gradient(90deg, transparent 0%, rgba(0, 240, 255, 0.38) 42%, rgba(255, 255, 255, 0.72) 50%, rgba(0, 240, 255, 0.32) 58%, transparent 100%),
        repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.04) 0 1px, transparent 1px 12px);
    transform: translateX(-110%);
    opacity: 0.9;
}

.mission-bottom-bar:not(.completed)::before {
    animation: missionBarEvolve 2.4s linear infinite;
}

.mission-bottom-bar.completed {
    border-color: rgba(57, 255, 20, 0.52);
    background: rgba(214, 224, 218, 0.9);
    box-shadow: 0 -4px 16px rgba(57, 255, 20, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.68);
}

.mission-bottom-kicker,
.mission-bottom-state {
    font-family: var(--font-mono);
    font-size: 11px;
    color: #0c3f47;
    white-space: nowrap;
    position: relative;
}

.mission-bottom-bar.completed .mission-bottom-state {
    color: #167a2d;
}

.mission-bottom-title {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-family: var(--font-cyber);
    font-size: 13px;
    text-align: left;
    color: #061015;
    position: relative;
}

@keyframes missionBarEvolve {
    0% {
        transform: translateX(-110%);
    }

    100% {
        transform: translateX(110%);
    }
}

@media (max-width: 820px) {
    .mission-overlay {
        padding: 14px;
        align-items: flex-start;
        overflow: auto;
    }

    .mission-box {
        padding: 16px;
        max-height: none;
    }

    .mission-head {
        display: flex;
        flex-direction: column;
    }

    .mission-body {
        min-height: 0;
    }

    .mission-image {
        float: none;
        width: 100%;
        margin: 0 0 14px 0;
    }

    .mission-title {
        font-size: 19px;
    }

    .mission-state-pill {
        align-self: flex-start;
    }

    .mission-bottom-bar {
        width: calc(100vw - 24px);
        bottom: 0;
        grid-template-columns: 1fr auto;
    }

    .mission-bottom-kicker {
        display: none;
    }
}
