:root {
    --noir-black: #08090c;
    --anthracite: #17191f;
    --bordeaux: #4b1e2a;
    --bottle-green: #18322d;
    --aged-gold: #c2a46d;
    --fog: #e6dfd2;
    --panel-bg: rgba(22, 24, 29, 0.92);
    --border-soft: rgba(194, 164, 109, 0.22);
}

body {
    min-height: 100vh;
    background:
        radial-gradient(circle at 8% 18%, rgba(194, 164, 109, 0.16), transparent 28%),
        radial-gradient(circle at 85% 14%, rgba(24, 50, 45, 0.5), transparent 35%),
        linear-gradient(180deg, #101015 0%, #07080d 100%);
    color: var(--fog);
    font-family: "Inter", sans-serif;
    overflow-x: hidden;
    position: relative;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220' viewBox='0 0 220 220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='220' height='220' filter='url(%23n)' opacity='0.17'/%3E%3C/svg%3E");
    mix-blend-mode: soft-light;
    opacity: 0.18;
    z-index: 1;
}

body::after {
    content: "";
    position: fixed;
    inset: -8vmax;
    pointer-events: none;
    background: radial-gradient(circle, transparent 40%, rgba(0, 0, 0, 0.74) 100%);
    z-index: 1;
}

.text-muted {
    color: rgba(230, 223, 210, 0.55) !important;
}

.app-shell {
    position: relative;
    z-index: 2;
}

.brand-title,
.section-title,
.route-title {
    font-family: "Cinzel", serif;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.desktop-sidebar {
    position: sticky;
    top: 0;
    min-height: 100vh;
    background: linear-gradient(180deg, rgba(8, 9, 12, 0.96) 0%, rgba(20, 22, 28, 0.9) 62%, rgba(24, 50, 45, 0.8) 100%);
    border-right: 1px solid var(--border-soft);
    box-shadow: 6px 0 30px rgba(0, 0, 0, 0.42);
}

.sidebar-nav .nav-link {
    color: rgba(230, 223, 210, 0.85);
    border: 1px solid transparent;
    border-radius: 0.8rem;
    padding: 0.6rem 0.85rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: .55rem;
}

.sidebar-nav .nav-link:hover,
.sidebar-nav .nav-link.active {
    background: linear-gradient(120deg, rgba(75, 30, 42, 0.35), rgba(24, 50, 45, 0.35));
    border-color: rgba(194, 164, 109, 0.4);
    color: #fff4dd;
    box-shadow: 0 0 0.65rem rgba(194, 164, 109, 0.16);
}



.menu-unread-badge {
    min-width: 1.35rem;
    height: 1.35rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    padding: 0 .35rem;
    background: #dc3545;
    color: #fff;
    font-size: .72rem;
    font-weight: 700;
    line-height: 1;
    box-shadow: 0 0 0 .15rem rgba(220, 53, 69, .28);
}

.main-content {
    padding: 1.1rem 1.25rem 2rem;
}

.game-version-badge {
    position: fixed;
    right: 0.85rem;
    bottom: 0.65rem;
    z-index: 3;
    font-size: 0.7rem;
    color: rgba(230, 223, 210, 0.6);
    background-color: rgba(8, 9, 12, 0.38);
    border: 1px solid rgba(194, 164, 109, 0.18);
    border-radius: 999px;
    padding: 0.15rem 0.45rem;
    pointer-events: none;
    user-select: none;
}

.content-header,
.panel {
    background: linear-gradient(145deg, rgba(75, 30, 42, 0.13), transparent 40%), linear-gradient(180deg, var(--panel-bg) 0%, rgba(14, 16, 21, 0.95) 100%);
    border: 1px solid var(--border-soft);
    border-radius: 1rem;
    box-shadow: 0 1.2rem 2.3rem rgba(0, 0, 0, 0.45);
    color: var(--fog);
}

.content-header {
    padding: 1rem 1.1rem;
}

.route-title {
    color: var(--aged-gold);
    margin: 0;
    font-size: 1.15rem;
}

.route-pane {
    display: none;
    animation: fadeIn 0.22s ease;
}

.route-pane.active {
    display: block;
}

.route-pane[data-route-pane="spedizioni"] .text-light-emphasis {
    color: #9da7b1 !important;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(3px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.section-title {
    color: var(--aged-gold);
    font-size: 1rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: .5rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.8rem;
}

.stats-card {
    padding: .85rem;
    border-radius: .9rem;
    border: 1px solid rgba(194, 164, 109, 0.22);
    background: rgba(8, 9, 12, 0.45);
}

.stats-label {
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: rgba(230, 223, 210, 0.75);
}

.stats-value {
    font-size: 1.35rem;
    font-weight: 700;
    color: #f5e9d0;
    line-height: 1.15;
}

.table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--fog);
    --bs-table-border-color: rgba(194, 164, 109, 0.16);
    --bs-table-striped-bg: rgba(194, 164, 109, 0.04);
    --bs-table-striped-color: var(--fog);
    --bs-table-hover-bg: rgba(194, 164, 109, 0.08);
}

.table-light,
.table thead {
    --bs-table-bg: rgba(24, 50, 45, 0.34);
    --bs-table-color: var(--fog);
    color: var(--fog);
}


.technology-description {
    color: rgba(230, 223, 210, 0.82);
}
.form-select,
.form-control {
    background-color: rgba(7, 9, 12, 0.78);
    border: 1px solid rgba(194, 164, 109, 0.3);
    color: var(--fog);
}

.form-select:focus,
.form-control:focus {
    background-color: rgba(7, 9, 12, 0.95);
    border-color: rgba(194, 164, 109, 0.72);
    box-shadow: 0 0 0 0.22rem rgba(194, 164, 109, 0.13);
    color: var(--fog);
}

.btn {
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.045em;
    font-weight: 600;
    font-size: .82rem;
}

.btn-primary,
.btn-success,
.btn-outline-light:hover {
    background: linear-gradient(110deg, #18322d, #245146);
    border-color: rgba(194, 164, 109, 0.5);
    color: #f5f0e4;
}

.btn-danger {
    background: linear-gradient(110deg, #4b1e2a, #7d2e45);
    border-color: rgba(194, 164, 109, 0.5);
}

.btn-outline-light {
    border-color: rgba(194, 164, 109, 0.55);
    color: var(--aged-gold);
}

.app-card {
    background: linear-gradient(165deg, rgba(75, 30, 42, 0.16), rgba(8, 9, 12, 0.95) 42%);
    border: 1px solid rgba(194, 164, 109, 0.24);
    border-radius: 1rem;
    box-shadow: 0 1rem 2rem rgba(0, 0, 0, 0.34);
    color: var(--fog);
}

.app-card .card-header {
    background: rgba(194, 164, 109, 0.08);
    border-bottom: 1px solid rgba(194, 164, 109, 0.2);
    color: #f3e7cb;
}

.app-card .card-body {
    background: transparent;
}

.notifications-messages-pane .section-subtitle {
    color: var(--aged-gold);
    letter-spacing: .04em;
    text-transform: uppercase;
}

.notifications-messages-pane .list-group-item {
    background: rgba(8, 9, 12, 0.84);
    border-color: rgba(194, 164, 109, 0.22);
    color: var(--fog);
}

.notifications-messages-pane .list-group-item:hover,
.notifications-messages-pane .list-group-item:focus,
.notifications-messages-pane .list-group-item.active {
    background: linear-gradient(110deg, rgba(24, 50, 45, 0.56), rgba(75, 30, 42, 0.48));
    border-color: rgba(194, 164, 109, 0.4);
    color: #fff2d7;
}

.message-list-shell {
    height: 360px;
    overflow-y: auto;
    overflow-x: hidden;
    word-break: break-word;
    border: 1px solid rgba(194, 164, 109, 0.24);
    border-radius: .65rem;
    background: rgba(8, 9, 12, 0.72);
    padding: .55rem .7rem;
    margin-bottom: .5rem;
}

.progress {
    background: rgba(230, 223, 210, 0.12);
    border-radius: 999px;
    height: 0.65rem;
}

.progress-bar-room {
    background: linear-gradient(90deg, #c2a46d, #8f7749);
}

.progress-bar-recruit {
    background: linear-gradient(90deg, #245146, #3b7969);
}

.status-dot {
    width: .62rem;
    height: .62rem;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.4);
}

.status-dot.attack {
    background: #c2455a;
}

.status-dot.transport {
    background: #3d9a86;
}

.map-preview {
    min-height: 220px;
    border-radius: .9rem;
    border: 1px solid rgba(194, 164, 109, 0.28);
    background:
        linear-gradient(to top, rgba(8, 9, 12, 0.9) 0 35%, rgba(8, 9, 12, 0.45) 55%, transparent 100%),
        radial-gradient(circle at 70% 22%, rgba(194, 164, 109, 0.13), transparent 30%),
        repeating-linear-gradient(90deg, rgba(8, 10, 14, 0.95) 0 8%, transparent 8% 11%);
    box-shadow: inset 0 0 1.2rem rgba(0, 0, 0, 0.4);
    padding: 1rem;
}

.form-inline-grid {
    display: grid;
    gap: .75rem;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    align-items: end;
}

.expedition-step {
    min-width: 0;
}

.expedition-step-target {
    grid-column: 1 / -1;
}

.expedition-step-full {
    grid-column: 1 / -1;
}

@media (min-width: 1200px) {
    .form-inline-grid {
        grid-template-columns: repeat(2, minmax(220px, 1fr));
    }
}

.mobile-topbar {
    position: sticky;
    top: 0;
    z-index: 1040;
    backdrop-filter: blur(2px);
    background: rgba(8, 9, 12, 0.85);
    border-bottom: 1px solid var(--border-soft);
}


.resource-counter-bar {
    position: sticky;
    top: .7rem;
    z-index: 1025;
    padding: .85rem 1rem;
    border-radius: 1rem;
    background: linear-gradient(145deg, rgba(24, 50, 45, 0.34), rgba(8, 9, 12, 0.92));
    border: 1px solid rgba(194, 164, 109, 0.32);
    box-shadow: 0 .8rem 1.5rem rgba(0, 0, 0, .4);
    backdrop-filter: blur(6px);
}

.resource-counter-title {
    font-family: "Cinzel", serif;
    color: var(--aged-gold);
    letter-spacing: .06em;
    text-transform: uppercase;
    font-size: .8rem;
    margin-bottom: .65rem;
}

.resource-counter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: .6rem;
}

.resource-counter-item {
    border: 1px solid rgba(194, 164, 109, 0.24);
    border-radius: .8rem;
    padding: .55rem .65rem;
    background: rgba(8, 9, 12, .46);
}

.resource-counter-name {
    font-size: .76rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: rgba(230, 223, 210, .75);
}

.resource-counter-value {
    font-size: 1.2rem;
    font-weight: 700;
    color: #f5e9d0;
    line-height: 1.2;
}

.resource-counter-income {
    font-size: .74rem;
    color: rgba(230, 223, 210, .72);
}

@media (min-width: 992px) {
    .main-content {
        padding: 1.5rem 1.8rem 2rem;
    }

    .resource-counter-bar {
        top: 1rem;
    }
}


.map-toolbar {
    display: grid;
    grid-template-columns: auto minmax(120px, 160px) auto auto 1fr;
    align-items: end;
    gap: .7rem;
}

.map-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(240px, 320px);
    gap: 1rem;
    align-items: start;
}

.city-map-shell {
    background: rgba(8, 9, 12, 0.65);
    border: 1px solid rgba(194, 164, 109, 0.2);
    border-radius: 1rem;
    padding: .7rem;
    overflow: auto;
}

.city-map-grid {
    display: grid;
    grid-template-columns: repeat(50, 20px);
    grid-template-rows: repeat(50, 20px);
    gap: 1px;
    min-width: max-content;
    background: rgba(194, 164, 109, 0.14);
    border: 1px solid rgba(194, 164, 109, 0.25);
}

.city-cell {
    width: 20px;
    height: 20px;
    position: relative;
    background: rgba(12, 14, 18, 0.92);
    border: 1px solid rgba(112, 97, 70, 0.26);
    color: #f7e6bf;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .58rem;
}

.city-cell.occupied {
    background: linear-gradient(145deg, rgba(75, 30, 42, 0.86), rgba(125, 46, 69, 0.78));
    border-color: rgba(194, 164, 109, 0.45);
    box-shadow: inset 0 0 0 1px rgba(194, 164, 109, 0.34);
}

.map-tooltip {
    display: none;
    position: absolute;
    left: 50%;
    top: calc(100% + 6px);
    transform: translateX(-50%);
    z-index: 5;
    background: #0f1217;
    border: 1px solid rgba(194, 164, 109, 0.4);
    border-radius: .5rem;
    color: #f4ead5;
    padding: .3rem .45rem;
    font-size: .7rem;
    white-space: nowrap;
    box-shadow: 0 .4rem 1rem rgba(0, 0, 0, 0.45);
}

.city-cell:hover .map-tooltip {
    display: block;
}

.map-legend {
    border-radius: .9rem;
}

.legend-dot {
    width: .7rem;
    height: .7rem;
    border-radius: 50%;
    display: inline-block;
    margin-right: .45rem;
}

.legend-dot.occupied {
    background: #c06a7c;
}

.legend-dot.empty {
    background: rgba(230, 223, 210, 0.25);
    border: 1px solid rgba(230, 223, 210, 0.5);
}

@media (max-width: 1199px) {
    .map-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 767px) {
    .map-toolbar {
        grid-template-columns: auto 1fr auto;
    }

    .map-toolbar .small {
        grid-column: 1 / -1;
    }
}
