/* =====================================================================
   PMC: Global Operations – Global Styles
   ===================================================================== */

/* ── CSS Custom Properties ─────────────────────────────────────────── */
:root {
    /* Surfaces */
    --bg:          #0c0c0c;
    --surface-1:   #111111;
    --surface-2:   #191919;
    --surface-3:   #222222;
    --surface-4:   #2c2c2c;

    /* Accent – military brass */
    --accent:         #c9a84c;
    --accent-hover:   #dbbe6a;
    --accent-dim:     rgba(201,168,76,.13);
    --accent-dim2:    rgba(201,168,76,.22);

    /* Semantic colours */
    --clr-success:    #22c55e;
    --clr-danger:     #ef4444;
    --clr-info:       #60a5fa;
    --clr-success-dim: rgba(34,197,94,.12);
    --clr-danger-dim:  rgba(239,68,68,.12);

    /* Borders */
    --border:         rgba(255,255,255,.07);
    --border-med:     rgba(255,255,255,.13);
    --border-strong:  rgba(255,255,255,.22);

    /* Text */
    --text:           #ddddd8;
    --text-secondary: #787872;
    --text-dim:       rgba(255,255,255,.28);

    /* Topbar */
    --topbar-h:    46px;
    --subtab-h:    36px;
    --footer-h:    24px;

    /* Legacy aliases kept for existing components */
    --primaryText:                          var(--text);
    --subText:                              var(--text-secondary);
    --primaryBackground:                    var(--bg);
    --uiPrimaryBackground:                  var(--surface-1);
    --uiPrimaryBackgroundOpaque:            var(--surface-2);
    --uiPrimaryBackgroundTransparant:       rgba(17,17,17,.75);
    --uiPrimaryBackgroundSelectedTransparant: rgba(34,34,34,.75);
    --uiSecondaryBackgroundTransparant:     rgba(25,25,25,.75);
    --uiSecondaryBackground:                var(--surface-3);
    --uiHeaderBackground:                   var(--surface-2);
    --secondaryBackground:                  var(--surface-3);
    --tertiaryBackground:                   var(--surface-4);
    --primaryBorder:                        var(--border);
    --scrollBar:                            rgba(86,88,103,.4);

    /* Tree */
    --tree-row:              rgba(255,255,255,.016);
    --tree-row-hover:        rgba(255,255,255,.048);
    --tree-row-hover-strong: rgba(255,255,255,.08);
    --tree-row-selected:     var(--accent-dim);
    --tree-border:           var(--border);
    --tree-header:           var(--surface-2);
    --tree-guide:            rgba(255,255,255,.06);
    --tree-text:             var(--text);
    --tree-subtle:           var(--text-secondary);

    /* Chip */
    --chip-bg:     rgba(255,255,255,.06);
    --chip-border: rgba(255,255,255,.10);
    --chip-text:   rgba(255,255,255,.50);

    /* Bootstrap overrides */
    --bs-body-bg:            var(--bg);
    --bs-body-color:         var(--text);
    --bs-emphasis-color:     var(--text);
    --bs-secondary-color:    var(--text-secondary);
    --bs-heading-color:      var(--text);
    --bs-link-color:         var(--accent);
    --bs-link-hover-color:   var(--accent-hover);
    --bs-table-color:        var(--text);
    --bs-table-striped-color: var(--text);
    --bs-table-hover-color:  var(--text);
    --bs-secondary:          var(--clr-info);
    --bs-success:            var(--clr-success);
}

/* ── Reset & Base ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html, body {
    min-height: 100%;
    height: 100%;
    overflow: hidden;
    background-color: var(--bg);
    color: var(--text);
    font-family: 'Share Tech Mono', monospace;
    font-size: 13px;
    line-height: 1.5;
    font-weight: 400;
    scrollbar-color: var(--scrollBar) var(--bg);
    -webkit-user-select: none;
    user-select: none;
}

/* ── Scrollbars ────────────────────────────────────────────────────── */
::-webkit-scrollbar              { width: 5px; height: 5px; }
::-webkit-scrollbar-track        { background: transparent; }
::-webkit-scrollbar-thumb        { background: rgba(255,255,255,.14); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover  { background: rgba(255,255,255,.26); }

.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

/* ── Top Bar ───────────────────────────────────────────────────────── */
#ui-topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--topbar-h);
    display: flex;
    align-items: stretch;
    background: var(--surface-2);
    border-bottom: 1px solid var(--border-med);
    /*box-shadow: 0 2px 16px rgba(0,0,0,.6);*/
    box-shadow: rgba(0, 0, 0, 0.25) 0 10px 20px, rgba(0, 0, 0, 0.22) 0 10px 10px;
    z-index: 100;
}

/* Left stats area */
#ui-topbar-stats {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 12px;
    flex-shrink: 0;
    border-right: 1px solid var(--border);
}

.topbar-stat {
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: var(--surface-2);
    border: 1px solid var(--border-med);
    border-radius: 4px;
    padding: 3px 10px;
    min-width: 150px;
    height: 36px;
    line-height: 1.2;
}

.topbar-stat-value {
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: .02em;
}

.topbar-stat-label {
    font-size: 10px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: .06em;
}

/* Centre navigation – always centred relative to the full bar width */
#ui-topbar-nav {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    height: 100%;
    display: flex;
    align-items: stretch;
    justify-content: center;
    padding: 0 8px;
    pointer-events: none;   /* let clicks fall through to sides if widths ever overlap */
}

#ui-topbar-nav > button {
    pointer-events: auto;
}



/* Right controls area */
#ui-topbar-controls {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 12px;
    flex-shrink: 0;
    margin-left: auto;
    border-left: 1px solid var(--border);
}

.topbar-speed-group {
    display: flex;
    align-items: center;
    gap: 2px;
    background: var(--surface-2);
    border: 1px solid var(--border-med);
    border-radius: 4px;
    padding: 3px;
}

.topbar-speed-group .btn {
    min-width: 30px;
    height: 28px;
    padding: 0 6px;
    font-size: 11px;
    border-radius: 3px;
    border: none;
    line-height: 1;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.topbar-actions .btn {
    height: 30px;
    padding: 0 12px;
    font-size: 11px;
    line-height: 1;
}

/* ── Sub-tab Bar ───────────────────────────────────────────────────── */
.sub-tab-bar {
    height: var(--subtab-h);
    display: flex;
    align-items: stretch;
    justify-content: flex-start;
    background: var(--surface-2);
    border-bottom: 1px solid var(--border-med);
    flex-shrink: 0;
    padding: 0 6px;
    gap: 2px;
}

.sub-tab-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 0 18px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--text-secondary);
    font-family: 'Share Tech Mono', monospace;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    cursor: pointer;
    transition: color .15s, border-color .15s, background .15s;
    -webkit-user-select: none;
    user-select: none;
    white-space: nowrap;
}

.sub-tab-btn:hover {
    color: var(--text);
    background: rgba(255,255,255,.03);
}

.sub-tab-btn.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

/* ── Content Area ──────────────────────────────────────────────────── */
#ui-content {
    position: fixed;
    top: var(--topbar-h);
    left: 0; right: 0; bottom: var(--footer-h);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* ── Cards ─────────────────────────────────────────────────────────── */
.card {
    background: var(--surface-1);
    border: 1px solid var(--border);
    border-radius: 4px;
    display: flex;
    flex-direction: column;
}

.card.ui {
    background: var(--surface-1);
    border: 1px solid var(--border);
    border-radius: 4px;
    display: flex;
    flex-direction: column;
}

.card-header {
    background: var(--surface-2) !important;
    border-bottom: 1px solid var(--border-med) !important;
    color: var(--accent) !important;
    font-weight: 700;
    font-size: 10px;
    letter-spacing: .10em;
    text-transform: uppercase;
    padding: 7px 12px !important;
    flex-shrink: 0;
}

.card-body {
    background: var(--surface-1);
    color: var(--text);
    padding: 10px;
    flex: 1;
    min-height: 0;
}

.card-body.no-padding { padding: 0; }

.card-footer {
    background: var(--surface-2) !important;
    border-top: 1px solid var(--border) !important;
    padding: 7px 12px !important;
    flex-shrink: 0;
}

/* ── List Group ────────────────────────────────────────────────────── */
.list-group,
.list-group-item {
    border: 0;
    background: transparent;
}

.list-group-item {
    background: var(--surface-2);
    border: 1px solid var(--border) !important;
    border-radius: 3px !important;
    color: var(--text);
    padding: 5px 10px;
    margin-bottom: 2px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
}

/* ── Toolbar bar (filter rows) ─────────────────────────────────────── */
.toolbar-bar {
    background: var(--surface-2);
    border-bottom: 1px solid var(--border);
    padding: 6px 10px;
}

/* ── Tree View ─────────────────────────────────────────────────────── */
.tree-children {
    position: relative;
    margin-left: 14px;
    padding-left: 12px;
}

.tree-children::before {
    content: "";
    position: absolute;
    left: 6px; top: 0; bottom: 0;
    width: 1px;
    background: var(--tree-guide);
}

.tree-item {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: 6px 10px;
    color: var(--tree-text);
    border-top: 1px solid var(--tree-border);
    background: var(--tree-row);
    cursor: pointer;
    user-select: none;
    transition: background .1s;
}

.tree-item.level-0 { background: rgba(255,255,255,.012); }
.tree-item.level-1 { background: rgba(255,255,255,.022); }
.tree-item.level-2 { background: rgba(255,255,255,.032); }
.tree-item.level-3 { background: rgba(255,255,255,.042); }

.tree-item.create.level-0 { background: rgba(255,255,255,.006); }
.tree-item.create.level-1 { background: rgba(255,255,255,.012); }
.tree-item.create.level-2 { background: rgba(255,255,255,.018); }
.tree-item.create.level-3 { background: rgba(255,255,255,.024); }

.tree-item:hover                { background: var(--tree-row-hover); }
.tree-item:active               { background: var(--tree-row-hover-strong); }

.tree-item.selected,
.tree-item.selected td {
    background: var(--tree-row-selected) !important;
    color: var(--accent) !important;
}

.tree-item.equipment              { cursor: default; }
.tree-item.equipment:hover        { background: rgba(255,255,255,.04); }

.twisty {
    width: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: .85rem;
    flex-shrink: 0;
}

.twisty.placeholder { color: var(--text-dim); }

.label {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 12px;
}

.subtle {
    color: var(--text-secondary);
    font-size: .82em;
    margin-left: .3rem;
}

/* ── Chip ───────────────────────────────────────────────────────────── */
.chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.3rem;
    height: 1.1rem;
    padding: 0 .38rem;
    font-size: .66rem;
    font-weight: 600;
    color: var(--chip-text);
    background: var(--chip-bg);
    border: 1px solid var(--chip-border);
    border-radius: 999px;
    flex-shrink: 0;
}

/* ── Item Cards ─────────────────────────────────────────────────────── */
.item-card {
    cursor: pointer;
    background: var(--surface-2);
    border: 1px solid var(--border) !important;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 4px;
    transition: border-color .15s, background .15s;
    min-height: 88px;
}

.item-card:hover {
    background: var(--surface-3);
    border-color: var(--border-med) !important;
}

.item-card.selected,
.item-card.selectable-row.selected {
    border-color: var(--accent) !important;
    background: var(--accent-dim) !important;
}

.item-card .item-image {
    width: 88px; min-width: 88px; max-width: 88px;
    height: 88px; min-height: 88px; max-height: 88px;
    background: var(--surface-3);
    flex-shrink: 0;
}

.item-card .item-image img {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
}

.item-card-content { padding: 0; overflow: hidden; }

.item-card-header { padding: 7px 10px 3px; }

.item-card-title {
    font-weight: 700;
    font-size: 13px;
    color: var(--text);
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.item-card-description {
    color: var(--text-secondary);
    font-size: 11px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
}

.item-card-footer {
    display: flex;
    justify-content: flex-end;
    align-items: stretch;
    background: rgba(0,0,0,.25);
    min-height: 28px;
}



.item-card-price {
    font-weight: 700;
    font-size: 12px;
    padding: 0 8px;
    display: flex;
    align-items: center;
}

.card-corner-btn {
    background: rgba(255,255,255,.05);
    color: var(--text);
    border: none;
    border-left: 1px solid var(--border-med);
    padding: 0 14px;
    font-size: 11px;
    font-family: 'Share Tech Mono', monospace;
    font-weight: 700;
    letter-spacing: .05em;
    cursor: pointer;
    transition: background .15s, color .15s;
    flex-shrink: 0;
}

.card-corner-btn:hover:not(:disabled) {
    background: var(--accent-dim2);
    color: var(--accent);
}

.card-corner-btn:disabled {
    opacity: .3;
    cursor: default;
}

/* ── Selectable Rows & Tables ──────────────────────────────────────── */
.selectable-row                { cursor: pointer; }
.selectable-row:hover          { background: rgba(255,255,255,.05); }

.selected,
.selected td {
    background-color: var(--tree-row-selected) !important;
    color: var(--accent) !important;
}

.table {
    background-color: transparent;
    color: var(--text);
    font-size: 12px;
}

.table thead th {
    background: var(--surface-2);
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-med);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.table td, .table th { border-top: 1px solid var(--border); }

.table-striped tbody tr:nth-of-type(odd) { background-color: rgba(255,255,255,.022); }
.table-hover tbody tr:hover              { background-color: rgba(255,255,255,.05); }
.table-hover tbody tr.selected,
.table-hover tbody tr.selected td        { background-color: var(--tree-row-selected) !important; }

/* ── Buttons ────────────────────────────────────────────────────────── */
button { color: var(--text); }

.btn {
    font-family: 'Share Tech Mono', monospace;
    font-size: 12px;
    border-radius: 3px;
}

.btn-primary {
    --bs-btn-bg:               var(--accent);
    --bs-btn-border-color:     var(--accent);
    --bs-btn-color:            #000;
    --bs-btn-hover-bg:         var(--accent-hover);
    --bs-btn-hover-border-color: var(--accent-hover);
    --bs-btn-hover-color:      #000;
    --bs-btn-active-bg:        var(--accent-hover);
    --bs-btn-active-border-color: var(--accent-hover);
    --bs-btn-active-color:     #000;
}

.btn-outline-primary {
    --bs-btn-color:            var(--text-secondary);
    --bs-btn-border-color:     var(--border-med);
    --bs-btn-hover-color:      var(--text);
    --bs-btn-hover-bg:         rgba(255,255,255,.07);
    --bs-btn-hover-border-color: var(--border-strong);
    --bs-btn-active-color:     var(--text);
    --bs-btn-active-bg:        rgba(255,255,255,.10);
    --bs-btn-active-border-color: var(--border-strong);
    --bs-btn-disabled-color:   var(--text-dim);
    --bs-btn-disabled-border-color: var(--border);
}

.btn-outline-success {
    --bs-btn-color:            var(--clr-success);
    --bs-btn-border-color:     rgba(34,197,94,.35);
    --bs-btn-hover-color:      #000;
    --bs-btn-hover-bg:         var(--clr-success);
    --bs-btn-hover-border-color: var(--clr-success);
    font-size: 11px;
}

.btn-outline-danger {
    --bs-btn-color:            var(--clr-danger);
    --bs-btn-border-color:     rgba(239,68,68,.35);
    --bs-btn-hover-color:      #fff;
    --bs-btn-hover-bg:         var(--clr-danger);
    --bs-btn-hover-border-color: var(--clr-danger);
    font-size: 11px;
}

.btn-secondary {
    --bs-btn-bg:           var(--surface-3);
    --bs-btn-border-color: var(--border-med);
    --bs-btn-color:        var(--text-secondary);
    --bs-btn-hover-bg:     var(--surface-4);
    --bs-btn-hover-border-color: var(--border-strong);
    --bs-btn-hover-color:  var(--text);
}

.btn-outline-secondary {
    --bs-btn-color:          var(--text-secondary);
    --bs-btn-border-color:   var(--border-med);
    --bs-btn-hover-color:    var(--text);
    --bs-btn-hover-bg:       rgba(255,255,255,.06);
    --bs-btn-hover-border-color: var(--border-strong);
}

.btn-secondary.active {
    background: var(--surface-4) !important;
    border-color: var(--accent) !important;
    color: var(--accent) !important;
}

/* ── Form Controls ──────────────────────────────────────────────────── */
.form-control,
.form-select,
select.form-control {
    background-color: var(--surface-2) !important;
    color: var(--text) !important;
    border: 1px solid var(--border-med) !important;
    border-radius: 3px;
    font-family: 'Share Tech Mono', monospace;
    font-size: 12px;
}

.form-control:focus,
.form-select:focus {
    background-color: var(--surface-3) !important;
    border-color: var(--accent) !important;
    box-shadow: 0 0 0 2px var(--accent-dim) !important;
    color: var(--text) !important;
}

.form-control::placeholder { color: var(--text-dim) !important; }

.form-control:disabled,
.form-control[disabled] {
    background-color: var(--surface-1) !important;
    color: var(--text-secondary) !important;
    border-color: var(--border) !important;
    opacity: .65;
}

.form-control-full,
select.form-control { width: 100%; min-width: 100%; }

/* ── Text Utilities ─────────────────────────────────────────────────── */
.text-muted                      { color: var(--text-secondary) !important; }
.text-muted.interactive:hover    { color: var(--text) !important; }
.label.interactive:hover         { color: var(--accent) !important; }
.text-success                    { color: var(--clr-success) !important; }
.text-danger                     { color: var(--clr-danger) !important; }

.noselect, .no-user-select {
    -webkit-user-select: none;
    user-select: none;
}

.fa, .fa-solid { color: var(--text); }

/* ── Layout Utilities ───────────────────────────────────────────────── */
.container.full {
    padding: 8px;
    margin: 0;
    min-width: 100%; width: 100%; max-width: 100%;
}

.row     { margin: 0; }
.row > * { padding-right: 4px; padding-left: 4px; }

.padding-bottom { padding-bottom: 4px; }
.padding-top    { padding-top:    4px; }
.no-padding     { padding: 0; }

.full-height  { min-height: 100%; height: 100%; max-height: 100%; }
.full-width   { min-width:  100%; width:  100%; max-width:  100%; }
.half-height  { min-height: 50%;  height: 50%;  max-height: 50%;  }
.max-full-height { max-height: 100%; }

.height-100 { min-height: 100%; height: 100%; max-height: 100%; }
.height-80  { min-height: 80%;  height: 80%;  max-height: 80%;  }
.height-75  { min-height: 75%;  height: 75%;  max-height: 75%;  }
.height-60  { min-height: 60%;  height: 60%;  max-height: 60%;  }
.height-50  { min-height: 50%;  height: 50%;  max-height: 50%;  }
.height-40  { min-height: 40%;  height: 40%;  max-height: 40%;  }
.height-30  { min-height: 30%;  height: 30%;  max-height: 30%;  }
.height-25  { min-height: 25%;  height: 25%;  max-height: 25%;  }
.height-20  { min-height: 20%;  height: 20%;  max-height: 20%;  }

/* ── Scroll Containers ──────────────────────────────────────────────── */
.card-body-scroll           { overflow-y: auto; }

.card-body-fixed-scroll {
    flex: 1;
    min-height: 0;
    overflow: auto;
}

.card-body-fixed-scroll-32 {
    flex: 1;
    min-height: 0;
    overflow: auto;
}

/* ── Map ────────────────────────────────────────────────────────────── */
.map-container {
    position: absolute;
    inset: 0;
    background: radial-gradient(#1a2128, #060606);
}

.maplibregl-control-container { display: none; }

/* ── Icon images ────────────────────────────────────────────────────── */
.icon-image {
    width: 75px; min-width: 75px; max-width: 75px;
    height: 75px; min-height: 75px; max-height: 75px;
}


.card-corner-btn {
    background: rgba(255,255,255,0.06);
    color: #fff;
    border: none;
    border-radius: 0;
    padding: 0.25rem 1.1rem;
    font-size: 1em;
    transition: background 0.15s, box-shadow 0.15s;
    box-shadow: 0 1px 2px rgba(0,0,0,0.08);
    cursor: pointer;
    outline: none;
    position: relative;
    z-index: 2;
    border-left-width: 2px;
    border-left-color: black;
    border-left-style: solid;
    height: 100%;
}

.card-corner-btn:hover:not(:disabled) {
    background-color: rgba(68, 68, 68, 0.75);
    color: var(--primaryText);
}

    .card-corner-btn:disabled {
        opacity: 0.5;
        cursor: default;
    }

.icon-image {
    min-width: 75px;
    width: 75px;
    max-width: 75px;
    min-height: 75px;
    height: 75px;
    max-height: 75px;
}

.row > * {
    padding-right: 4px;
    padding-left: 4px;
}
.row {
    margin: 0px;
}
.padding-bottom {
    padding-bottom: 4px;
}
.padding-top {
    padding-top: 4px;
}

.add-btn-small-right {
    height: 20px;
    padding: 0 2px;
    font-size: 10px;
    float: right;
}a


/* Selectable table row styling to show hover and selection in dark theme */
.selectable-row {
    cursor: pointer;
}
.selectable-row:hover {
    background: rgba(255,255,255,0.06);
}
/* Override active row styling to fit the dark theme */
.selected,
.selected td {
    background-color: rgba(68, 68, 68, 0.75) !important;
    color: var(--primaryText) !important;
}

/* Slightly brighter Bootstrap table overrides for better visibility in dark theme */
.table {
    background-color: transparent;
    color: var(--bs-table-color);
}
.table thead th {
    background-color: rgba(255,255,255,0.08);
    color: var(--primaryText);
    border-bottom: 1px solid rgba(255,255,255,0.10);
}
.table td, .table th {
    border-top: 1px solid rgba(255,255,255,0.08);
}
.table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(255,255,255,0.06);
}
.table-hover tbody tr:hover {
    background-color: rgba(255,255,255,0.12);
}
.table-hover tbody tr.selected,
.table-hover tbody tr.selected td {
    background-color: rgba(68,68,68,0.8) !important;
}

.noselect {
    -webkit-touch-callout: none; /* iOS Safari */
    -webkit-user-select: none; /* Safari */
    -khtml-user-select: none; /* Konqueror HTML */
    -moz-user-select: none; /* Old versions of Firefox */
    -ms-user-select: none; /* Internet Explorer/Edge */
    user-select: none; /* Non-prefixed version, currently
                                  supported by Chrome, Edge, Opera and Firefox */
}

:root,
[data-bs-theme="light"],
[data-bs-theme="dark"] {
    --bs-body-color: smokewhite;
    --bs-body-color-rgb: 245, 245, 245;
    --bs-emphasis-color: smokewhite;
    --bs-emphasis-color-rgb: 245, 245, 245;
    --bs-secondary-color: black;
    --bs-secondary-color-rgb: 180, 180, 180;
    --bs-heading-color: smokewhite;
    --bs-link-color: smokewhite;
    --bs-link-hover-color: white;
    --bs-navbar-color: smokewhite;
    --bs-navbar-hover-color: white;
    --bs-dropdown-color: smokewhite;
    --bs-table-color: smokewhite;
    --bs-table-striped-color: smokewhite;
    --bs-table-hover-color: smokewhite;
    --bs-btn-bg: smokewhite;
    --bs-secondary: #0ea5e9;
    --bs-success: #10b981;
    --bs-btn-border-color: smokewhite;
    --bs-btn-color: smokewhite;
    --bs-btn-border-color: smokewhite;
    /*    --bs-success: #10b981;*/
    --bs-body-bg: rgba(0, 0, 0, 0.6);
    --uiPrimaryBackground: rgba(0, 0, 0, 0.8);
    --uiPrimaryBackgroundOpaque: rgba(0, 0, 0, 0.95);
    --primaryBackground: #222222;
    /*--uiPrimaryBackground: rgba(34, 34, 34, 0.95);*/
    --uiPrimaryBackgroundTransparant: rgba(34, 34, 34, 0.6);
    --uiPrimaryBackgroundSelectedTransparant: rgba(68, 68, 68, 0.6);
    --uiSecondaryBackgroundTransparant: rgba(66, 66, 66, 0.6);
    --uiSecondaryBackground: rgb(59, 59, 59);
    --uiHeaderBackground: rgba(34, 34, 34, 0.95);
    --secondaryBackground: #525252;
    --tertiaryBackground: #7e7e7e;
    --inversePrimaryBackground: rgb(170, 185, 196);
    /*--primaryBorder: rgb(126, 126, 126);*/
    --primaryBorder: rgba(255,255,255,0.1);
    --primaryShadow: rgba(255, 255, 255, 0);
    --secondaryShadow: #112a861a;
    --shadow1: rgba(255, 255, 255, 0.07);
    --shadow2: rgba(255, 255, 255, 0.05);
    --indicatorBackground: black;
    --primaryButton: #5b5b5b;
    --infoButton: #0d6efd;
    --successButton: green;
    --warningButton: orange;
    --severeButton: #dc3545;
    --primary: #5b5b5b;
    --info: #0d6efd;
    --success: green;
    --warning: #bd7d00;
    --severe: #dc3545;
    /*--primaryTitle: rgb(26, 28, 33);*/
    /*--secondaryTitle: rgb(26, 28, 33);*/
    --primaryText: rgb(255, 255, 255);
    --subText: rgba(187, 187, 187, 0.53);
    --scrollBar: rgba(86, 88, 103, 0.5);
    --category1: rgba(32, 178, 170, 0.53);
    --tree-row: rgba(255,255,255,0.03); /* similar to table stripes */
    --tree-row-alt: rgba(255,255,255,0.06); /* your striped odd */
    --tree-row-hover: rgba(255,255,255,0.06); /* your row hover */
    --tree-row-hover-strong: rgba(255,255,255,0.12); /* your table-hover */
    --tree-row-selected: rgba(68, 68, 68, 0.75); /* your selected row */

    --tree-border: rgba(255,255,255,0.08); /* your table borders */
    --tree-header: rgba(255,255,255,0.08); /* your thead */
    --tree-guide: rgba(255,255,255,0.08); /* guide line */

    --tree-text: var(--primaryText);
    --tree-subtle: var(--subText);
    /* quieter than badges */
    --chip-bg: rgba(255,255,255,0.06);
    --chip-border: rgba(255,255,255,0.10);
    --chip-text: rgba(255,255,255,0.70);
}


.btn-primary {
    --bs-btn-bg: #ddd;
    --bs-btn-border-color: #ddd;
    --bs-btn-color: #000; /* text color */

    --bs-btn-hover-bg: white;
    --bs-btn-hover-border-color: white;
    --bs-btn-hover-color: #000;
    --bs-btn-active-bg: #e6e6e6;
    --bs-btn-active-border-color: #e6e6e6;
    --bs-btn-active-color: #000;
}

.btn-outline-primary {
    --bs-btn-color: #ddd;
    --bs-btn-border-color: #ddd;
    --bs-btn-hover-color: #000;
    --bs-btn-hover-bg: #ddd;
    --bs-btn-hover-border-color: #ddd;
    --bs-btn-active-color: #000;
    --bs-btn-active-bg: #e6e6e6;
    --bs-btn-active-border-color: #e6e6e6;
    --bs-btn-disabled-color: #ddd;
    --bs-btn-disabled-bg: transparent;
    --bs-btn-disabled-border-color: #ddd;
}


/* Hide scrollbar for Chrome, Safari and Opera */
.no-scrollbar::-webkit-scrollbar {
    display: none;
}

/* Hide scrollbar for IE, Edge and Firefox */
.no-scrollbar {
    -ms-overflow-style: none; /* IE and Edge */
    scrollbar-width: none; /* Firefox */
}

.text-muted {
    color: #a5a5a5 !important;
}
.text-muted.interactive {
    /*pointer-events:none;*/
}
.text-muted.interactive:hover {
    color: #fff !important;
}
    .label.interactive:hover {
        font-weight: bolder !important;
    }


.card.ui {
    background: var(--uiPrimaryBackground);
    border: 0;
    opacity: 0.8; /* matches your style */
}

/* base cleanup */
.list-group, .list-group-item {
    border: 0;
    background: transparent;
}

.card .card-body.no-padding {
    padding: 0;
}

/* toolbar */
.toolbar-bar {
    background: var(--tree-header);
    border-bottom: 1px solid rgba(255,255,255,0.10);
}

/* children indentation + vertical guide line */
.tree-children {
    position: relative;
    margin-left: 14px;
    padding-left: 12px;
}

.tree-children::before {
    content: "";
    position: absolute;
    left: 6px;
    top: 0;
    bottom: 0;
    width: 1px;
    background: var(--tree-guide);
    opacity: 0.9;
}

/* row */
.tree-item {
    display: flex;
    align-items: center;
    gap: .55rem;
    padding: .5rem .75rem;
    color: var(--tree-text);
    border-top: 1px solid var(--tree-border);
    background: var(--tree-row);
    cursor: pointer;
    user-select: none;
}
 /*style="background: #0B0B0B; color: #a5a5a5;"*/
    /* alternate striping per level helps clarity */

    .tree-item.level-0 {
        background: rgba(255,255,255,0.03);
    }

    .tree-item.level-1 {
        background: rgba(255,255,255,0.04);
    }

    .tree-item.level-2 {
        background: rgba(255,255,255,0.05);
    }

    .tree-item.level-3 {
        background: rgba(255,255,255,0.06);
    }


    .tree-item.create.level-0 {
        background: rgba(255,255,255,0.01);
    }

    .tree-item.create.level-1 {
        background: rgba(255,255,255,0.02);
    }

    .tree-item.create.level-2 {
        background: rgba(255,255,255,0.03);
    }

    .tree-item.create.level-3 {
        background: rgba(255,255,255,0.04);
    }

    .tree-item.create.level-0:hover {
        background: rgba(255,255,255,0.04);
    }

    .tree-item.create.level-1:hover {
        background: rgba(255,255,255,0.05);
    }

    .tree-item.create.level-2:hover {
        background: rgba(255,255,255,0.06);
    }

    .tree-item.create.level-3:hover {
        background: rgba(255,255,255,0.07);
    }



    /* hover like your tables */
    .tree-item:hover {
        background: var(--tree-row-hover);
    }

    .tree-item:active {
        background: var(--tree-row-hover-strong);
    }

    /* optional "selected" style if you later add selection */
    .tree-item.selected {
        background: var(--tree-row-selected) !important;
        color: var(--primaryText) !important;
    }

/* twisty: less “buttony”, more like an icon */
.twisty {
    width: 1.1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,0.70);
    font-size: .95rem;
    line-height: 1;
    opacity: 0.9;
}

    .twisty.placeholder {
        color: rgba(255,255,255,0.35);
    }

/* label text */
.label {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.subtle {
    color: var(--tree-subtle);
    margin-left: .35rem;
    font-size: .85em;
}

/* count chip: quiet + compact (way less clutter than a badge) */
.chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.35rem;
    height: 1.15rem;
    padding: 0 .4rem;
    font-size: .70rem;
    font-weight: 500;
    letter-spacing: .01em;
    color: var(--chip-text);
    background: var(--chip-bg);
    border: 1px solid var(--chip-border);
    border-radius: 999px;
}

/* if you want chips only on hover (super clean) */
/*
.chip { opacity: 0; transform: translateX(2px); transition: opacity .12s ease, transform .12s ease; }
.tree-item:hover .chip { opacity: 1; transform: translateX(0); }
*/

/* equipment rows slightly lighter + not clickable */
.tree-item.equipment {
    cursor: default;
    color: rgba(255,255,255,0.90);
}

    .tree-item.equipment:hover {
        background: rgba(255,255,255,0.06);
    }















.container.full {
    padding: 8px;
    margin: 0;
    min-width: 100%;
    width: 100%;
    max-width: 100%;
}

.height-100 {
    min-height: 100%;
    height: 100%;
    max-height: 100%;
}
.height-80 {
    min-height: 80%;
    height: 80%;
    max-height: 80%;
}
.height-75 {
    min-height: 75%;
    height: 75%;
    max-height: 75%;
}
.height-60 {
    min-height: 60%;
    height: 60%;
    max-height: 60%;
}
.height-50 {
    min-height: 50%;
    height: 50%;
    max-height: 50%;
}
.height-40 {
    min-height: 40%;
    height: 40%;
    max-height: 40%;
}
.height-30 {
    min-height: 30%;
    height: 30%;
    max-height: 30%;
}
.height-25 {
    min-height: 25%;
    height: 25%;
    max-height: 25%;
}
.height-20 {
    min-height: 20%;
    height: 20%;
    max-height: 20%;
}










.half-height {
    min-height: 50%;
    height: 50%;
    max-height: 50%;
}
.full-height {
    min-height: 100%;
    height: 100%;
    max-height: 100%;
}
.full-width {
    min-width: 100%;
    width: 100%;
    max-width: 100%;
}
.max-full-height {
    max-height: 100%;
}

.no-padding {
    padding: 0px;
}

button {
    color: whitesmoke;
}

.form-control::placeholder {
    color: rgba(0, 0, 0, 0.3);
}

/* Make disabled form controls match the dark theme */
.form-control:disabled,
.form-control[disabled] {
    background-color: var(--uiPrimaryBackground) !important;
    color: var(--primaryText) !important;
    border: 1px solid var(--primaryBorder) !important;
    box-shadow: none !important;
    opacity: 0.9;
}

.form-control:disabled::placeholder,
.form-control[disabled]::placeholder {
    color: var(--subText) !important;
    opacity: 0.8;
}

body {
    color: whitesmoke !important;
    -webkit-touch-callout: none; /* iOS Safari */
    -webkit-user-select: none; /* Safari */
    -khtml-user-select: none; /* Konqueror HTML */
    -moz-user-select: none; /* Old versions of Firefox */
    -ms-user-select: none; /* Internet Explorer/Edge */
    user-select: none; /* Non-prefixed version, currently
                                  supported by Chrome, Edge, Opera and Firefox */
}

.fa {
    color: whitesmoke;
}

.fa-solid {
    color: whitesmoke;
}

html, body {
    scrollbar-color: var(--scrollBar) var(--primaryBackground);
    font-family: 'Share Tech Mono', monospace;
    font-size: 14px;
    line-height: 1.14286;
    font-weight: 400;
    font-kerning: normal;
    color: whitesmoke;
    background-color: #222222;
}




#ui-top-bar-center {
    padding: 0;
}

#ui-top-bar-left {
    background: var(--uiPrimaryBackground);
    border: 0 solid var(--primaryBorder);
    border-bottom-width: 2px;
    opacity: 0.8;
    box-shadow: rgba(0, 0, 0, 0.25) 0 10px 20px, rgba(0, 0, 0, 0.22) 0 10px 10px;
    height: 36px;
}


.top-switch-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 0 22px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--text-secondary);
    font-family: 'Share Tech Mono', monospace;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .10em;
    text-transform: uppercase;
    cursor: pointer;
    transition: color .15s, border-color .15s, background .15s;
    white-space: nowrap;
    -webkit-user-select: none;
    user-select: none;
}

.top-switch-btn:hover {
    color: var(--text);
    background: rgba(255,255,255,.04);
}

.top-switch-btn.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
    /*background: var(--accent-dim);*/
}

.top-switch-btn.active:hover {
    /*background: var(--accent-dim2);*/
}

/* no-op — legacy rounded-corner variants */
.top-switch-btn-left,
.top-switch-btn-right,
.top-switch-btn-center {
}

.top-switch-btn:hover {
    opacity: 0.9;
    background: #666;
}
.top-switch-btn.active {
    /*background: #444;*/
    /*border: 0 solid var(--accent);*/
    border-bottom-width: 4px;
}
.top-switch-btn.active:hover {
    /*background: #666;*/
    border: 0 solid white;
    border-bottom-width: 4px;
}

.top-switch-btn {
    /*background: var(--uiPrimaryBackground);*/ 
    background: var(--surface-2);
    border: 0 solid var(--primaryBorder);
    border-bottom-width: 4px;
    /*box-shadow: rgba(0, 0, 0, 0.25) 0 10px 20px, rgba(0, 0, 0, 0.22) 0 10px 10px;*/
    min-height: 45px;
    height: 45px;
    text-align: center;
    padding: 9px;
    font-size: 16px;
    font-weight: bold;
    border-left-width: 1px;
    border-right-width: 1px;
    float: left;
    width: 130px;
    text-align: center;
    cursor: pointer;
    -webkit-touch-callout: none; /* iOS Safari */
    -webkit-user-select: none; /* Safari */
    -khtml-user-select: none; /* Konqueror HTML */
    -moz-user-select: none; /* Old versions of Firefox */
    -ms-user-select: none; /* Internet Explorer/Edge */
    user-select: none; /* Non-prefixed version, currently
                                  supported by Chrome, Edge, Opera and Firefox */
}
 


.sunk-container {
    background-color: #222;
    border-radius: 5px;
    padding: 4px 10px;
    font-weight: bolder;
    box-shadow: inset 0 0 10px #000;
    font-size: 15px;
    margin-top: 4px;
    margin-left: 8px;
    width: 160px;
}

.top-switch-btn-left {
    border-radius: 0 0 0 13px;
    border-right-width: 1px;
}

.top-switch-btn-right {
    border-radius: 0 0 13px 0;
    border-left-width: 1px;
}

#ui-top-bar-right {
    background: var(--uiPrimaryBackground);
    border: 0 solid var(--primaryBorder);
    border-bottom-width: 2px;
    opacity: 0.8;
    box-shadow: rgba(0, 0, 0, 0.25) 0 10px 20px, rgba(0, 0, 0, 0.22) 0 10px 10px;
    height: 36px;
}

.map-container {
    min-height: 100%;
    height: 100%;
    max-height: 100%;
    position: absolute;
    min-width: 100%;
    width: 100%;
    max-width: 100%;
    background: radial-gradient(#2c353c, #0d0d0d);
}
.maplibregl-control-container {
    display: none;
}

/* Card body scrollable container utilities */
.card-body-scroll {
    overflow-y: scroll;
}

.card-body-fixed-scroll {
/*    min-height: calc(100% - 80px);
    height: calc(100% - 80px);
    max-height: calc(100% - 80px);*/
    overflow: scroll;
}

.card-body-fixed-scroll-32 {
/*    min-height: calc(100% - 32px);
    height: calc(100% - 32px);
    max-height: calc(100% - 32px);*/
    overflow: scroll;
}

/* Item card styling */
.item-card {
    cursor: pointer;
    min-height: 100px;
    border-radius: 0.5rem;
    overflow: hidden;
    margin-bottom: 0.25rem;
}

.item-card .item-image {
    width: 100px;
    min-width: 100px;
    max-width: 100px;
    min-height: 100px;
    height: 100px;
    max-height: 100px;
}

.item-card .item-image img {
    width: 100%;
    height: 100%;
    min-height: 100px;
    object-fit: cover;
    border-radius: 0;
    display: block;
}

.item-card-content {
    padding: 0;
}

.item-card-header {
    padding: 0.75rem 0.75rem 0.25rem 0.75rem;
}

.item-card-title {
    font-weight: 600;
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.item-card-description {
    color: var(--subText);
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 2.5em;
    max-height: 2.8em;
}

.item-card-footer-small {
    max-height: 22px;
    min-height: 22px;
}

.item-card-footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    background: #121212;
    border-radius: 0 0 0.5rem 0;
    color: #fff;
    font-size: 0.95em;
}

.item-card-price {
    font-weight: 600;
    padding: 0.5rem 0.5rem 0.5rem 0;
    min-width: 70px;
    text-align: right;
    font-size: 1em;
}

/* Form control full-width helper */
.form-control-full {
    min-width: 100%;
    width: 100%;
}

/* Select dropdown styling */
select.form-control {
    min-width: 100%;
    width: 100%;
}

/* ── Selection Bar (inside secondary sub-tab-bar) ──────────────── */
.sub-tab-bar-left {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    min-width: 0;
}

.sub-tab-bar-center {
    display: flex;
    align-items: stretch;
    justify-content: center;
    flex-shrink: 0;
}

.sub-tab-bar-right {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    min-width: 0;
    overflow: hidden;
}

.ui-tab-content {
    flex: 1;
    overflow: hidden;
    position: relative;
}

.selbar-group {
    display: flex;
    align-items: center;
    gap: 0;
}

.selbar-section {
    display: flex;
    flex-direction: row;
    align-items: center;
    padding: 0 8px;
    gap: 6px;
    flex-shrink: 0;
    width: 300px;
    max-width: 300px;
    overflow: hidden;
}

.selbar-label {
    font-size: 9px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: .10em;
    white-space: nowrap;
    flex-shrink: 0;
    width: 50px;
    max-width: 50px;
    overflow: hidden;
}
.selbar-label.operation {
    width: 60px;
    max-width: 60px;
}

.selbar-select-row {
    display: flex;
    align-items: center;
    flex: 1;
    gap: 3px;
}

.selbar-select {
    flex: 1;
    min-width: 0;
    background: var(--surface-3);
    color: var(--text-secondary);
    border: 1px solid var(--border-med);
    border-radius: 3px;
    font-family: 'Share Tech Mono', monospace;
    font-size: 13px;
    padding: 1px 5px;
    height: 26px;
    cursor: pointer;
    outline: none;
    transition: border-color .15s, color .15s, background .15s;
    width: 218px;
    max-width: 218px;
    overflow: hidden;
}

.selbar-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-dim);
}

.selbar-select.selbar-select-active {
    color: var(--accent);
    border-color: rgba(201, 168, 76, .40);
    background: rgba(201, 168, 76, .08);
    font-weight: 700;
}

.selbar-select option,
.selbar-select optgroup {
    background: var(--surface-3);
    color: var(--text);
    font-weight: 400;
}

.selbar-clear {
    background: transparent;
    border: none;
    color: var(--text-dim);
    font-size: 10px;
    padding: 0;
    width: 14px;
    height: 14px;
    line-height: 1;
    cursor: pointer;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color .15s;
}

.selbar-clear:hover {
    color: var(--clr-danger);
}

.selbar-clear-hidden {
    visibility: hidden;
    pointer-events: none;
}

.selbar-divider {
    width: 1px;
    height: 20px;
    background: var(--border-med);
    flex-shrink: 0;
    margin: 0 2px;
}

.selbar-stats {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 0 10px;
}

.selbar-stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    line-height: 1.15;
    min-width: 62px;
    padding: 0 8px;
    border-left: 1px solid var(--border);
    height: 100%;
}

.selbar-stat-value {
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
}

.selbar-stat-key {
    font-size: 8px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: .06em;
    white-space: nowrap;
}

/* Clickable stat chip in the sub-tab-bar-right */
.selbar-stat-nav {
    cursor: pointer;
    transition: background .15s;
}

.selbar-stat-nav:hover {
    background: rgba(255,255,255,.05);
}

.selbar-stat-nav:hover .selbar-stat-value {
    color: var(--accent);
}

.selbar-stat-nav:hover .selbar-stat-key {
    color: var(--text-secondary);
}

/* =====================================================================
   LANDING & ABOUT PAGES
   ===================================================================== */

/* ── Root container (overrides the global overflow:hidden) ─────── */
.landing-root {
    position: fixed;
    inset: 0;
    overflow-y: auto;
    overflow-x: hidden;
    background: var(--bg);
    color: var(--text);
    font-family: 'Share Tech Mono', monospace;
    scrollbar-color: var(--scrollBar) var(--bg);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ── Navigation ────────────────────────────────────────────────── */
.landing-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 54px;
    padding: 0 32px;
    background: rgba(12, 12, 12, .92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-med);
    max-height: 28px;
}

.landing-nav-logo {
    font-size: 16px;
    font-weight: 700;
    color: var(--accent);
    text-decoration: none;
    letter-spacing: .12em;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: color .15s;
}
.landing-nav-logo:hover { color: var(--accent-hover); }

.landing-nav-logo-img {
    height: 22px;
    width: auto;
    object-fit: contain;
}

.landing-hero-logo {
    display: block;
    width: 110px;
    height: auto;
    margin: 0 auto 24px;
    filter: drop-shadow(0 0 18px rgba(201,168,76,.35));
}

.landing-footer-logo-img {
    height: 14px;
    width: auto;
    object-fit: contain;
    opacity: .85;
}

.landing-nav-links {
    display: flex;
    align-items: center;
    gap: 6px;
}

.landing-nav-link {
    padding: 6px 16px;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: .08em;
    border-radius: 3px;
    transition: color .15s, background .15s;
}
.landing-nav-link:hover {
    color: var(--text);
    background: rgba(255,255,255,.04);
}

.landing-nav-play {
    color: var(--accent);
    border: 1px solid var(--accent);
    margin-left: 8px;
}
.landing-nav-play:hover {
    background: var(--accent);
    color: #000;
}

/* ── Hero Section ──────────────────────────────────────────────── */
.landing-hero {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 80vh;
    padding: 80px 32px;
    overflow: hidden;
}

.landing-hero-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 60% at 50% 40%, rgba(70,177,98,.06) 0%, transparent 70%),
        radial-gradient(ellipse 50% 80% at 80% 20%, rgba(70,177,98,.04) 0%, transparent 60%);
    pointer-events: none;
}

.landing-hero-content {
    position: relative;
    max-width: 1200px;
    text-align: center;
    z-index: 1;
}

.landing-hero-title {
    font-size: clamp(40px, 8vw, 72px);
    font-weight: 700;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--text);
    margin: 0 0 16px;
    line-height: 1.1;
}

.landing-hero-subtitle {
    font-size: clamp(16px, 2.5vw, 20px);
    color: var(--accent);
    margin: 0 0 20px;
    letter-spacing: .04em;
    font-weight: 700;
}

.landing-hero-desc {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0 0 36px;
    line-height: 1.7;
    max-width: 540px;
    margin-left: auto;
    margin-right: auto;
}

.landing-hero-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* ── Buttons ───────────────────────────────────────────────────── */
.landing-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 28px;
    font-family: 'Share Tech Mono', monospace;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    text-decoration: none;
    border-radius: 3px;
    cursor: pointer;
    transition: background .15s, color .15s, border-color .15s, box-shadow .15s;
    white-space: nowrap;
}

.landing-btn-primary {
    background: var(--accent);
    color: #000;
    border: 1px solid var(--accent);
}
.landing-btn-primary:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
    box-shadow: 0 0 20px var(--accent-dim2);
    color: #000;
}

.landing-btn-outline {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-med);
}
.landing-btn-outline:hover {
    color: var(--text);
    border-color: var(--border-strong);
    background: rgba(255,255,255,.04);
}

.landing-btn-lg {
    padding: 14px 40px;
    font-size: 15px;
}

/* ── Sections ──────────────────────────────────────────────────── */
.landing-section {
    padding: 72px 32px;
    max-width: 1000px;
    margin: 0 auto;
    width: 100%;
}

.landing-section-alt {
    max-width: 100%;
    background: var(--surface-1);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}
.landing-section-alt > * {
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
}

.landing-section-title {
    font-size: 28px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: var(--text);
    text-align: center;
    margin: 0 auto 10px;
}

.landing-section-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    text-align: center;
    margin: 0 0 48px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

/* ── Feature Cards ─────────────────────────────────────────────── */
.landing-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}

.landing-feature-card {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 28px 24px;
    transition: border-color .15s, background .15s;
}
.landing-feature-card:hover {
    border-color: var(--border-med);
    background: var(--surface-3);
}

.landing-feature-icon {
    font-size: 22px;
    color: var(--accent);
    margin-bottom: 14px;
}

.landing-feature-card h3 {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--text);
    margin: 0 0 10px;
}

.landing-feature-card p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.65;
    margin: 0;
}

/* ── Steps ─────────────────────────────────────────────────────── */
.landing-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 24px;
}

.landing-step {
    text-align: center;
    padding: 20px;
}

.landing-step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid var(--accent);
    color: var(--accent);
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 16px;
}

.landing-step h3 {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--text);
    margin: 0 0 8px;
}

.landing-step p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
}

/* ── CTA ───────────────────────────────────────────────────────── */
.landing-cta {
    text-align: center;
    padding: 80px 32px;
    max-width: 100%;
    background: linear-gradient(180deg, var(--bg) 0%, var(--surface-1) 100%);
    border-top: 1px solid var(--border);
}

.landing-cta .landing-section-title {
    margin-bottom: 10px;
}
.landing-cta .landing-section-subtitle {
    margin-bottom: 32px;
}

/* ── Footer ────────────────────────────────────────────────────── */
.landing-footer {
    border-top: 1px solid var(--border);
    background: var(--surface-1);
    padding: 20px 32px;
    margin-top: auto;
}

.landing-footer-inner {
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.landing-footer-copy {
    font-size: 12px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.landing-footer-links {
    display: flex;
    gap: 20px;
}

.landing-footer-links a {
    font-size: 11px;
    color: var(--text-secondary);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: .08em;
    transition: color .15s;
}
.landing-footer-links a:hover {
    color: var(--accent);
}

/* ── About Page ────────────────────────────────────────────────── */
.about-block {
    max-width: 700px;
    margin: 0 auto;
}

.about-heading {
    font-size: 20px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .10em;
    color: var(--text);
    margin: 0 0 18px;
}

.about-block p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.75;
    margin: 0 0 14px;
}

.about-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}

.about-card {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 24px;
    transition: border-color .15s;
}
.about-card:hover {
    border-color: var(--border-med);
}

.about-card h3 {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--accent);
    margin: 0 0 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.about-card p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.65;
    margin: 0;
}

.about-tech-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 18px;
}

.about-tech-tag {
    display: inline-block;
    padding: 4px 12px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--accent);
    background: var(--accent-dim);
    border: 1px solid var(--accent-dim2);
    border-radius: 3px;
}

/* =====================================================================
   LOBBY PAGE  (Save Selection)
   ===================================================================== */

.lobby-section {
    max-width: 700px;
    margin: 0 auto;
    padding: 60px 32px;
}

.lobby-title {
    font-size: 28px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: var(--text);
    text-align: center;
    margin: 0 0 10px;
}

.lobby-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    text-align: center;
    margin: 0 0 36px;
}

.lobby-error {
    background: var(--clr-danger-dim);
    border: 1px solid rgba(239,68,68,.3);
    border-radius: 4px;
    padding: 10px 16px;
    margin-bottom: 16px;
    color: var(--clr-danger);
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.lobby-new-save {
    margin-bottom: 32px;
}

.lobby-new-save-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.lobby-name-input {
    flex: 1;
    height: 42px !important;
    font-size: 14px !important;
    padding: 8px 14px !important;
}

.lobby-create-btn {
    padding: 10px 24px !important;
    white-space: nowrap;
    flex-shrink: 0;
}

.lobby-validation-hint {
    font-size: 11px;
    color: var(--clr-danger);
    margin-top: 6px;
    padding-left: 2px;
}

.lobby-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.lobby-empty i {
    font-size: 36px;
    color: var(--text-dim);
    margin-bottom: 16px;
    display: block;
}

.lobby-empty p {
    font-size: 13px;
    margin: 0;
}

.lobby-saves-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 32px;
}

.lobby-save-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 16px 20px;
    transition: border-color .15s, background .15s;
}

.lobby-save-card:hover {
    border-color: var(--border-med);
    background: var(--surface-3);
}

.lobby-save-info {
    flex: 1;
    min-width: 0;
}

.lobby-save-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lobby-save-details {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.lobby-save-details span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.lobby-save-meta {
    font-size: 10px;
    color: var(--text-dim);
    letter-spacing: .02em;
}

.lobby-save-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    margin-left: 16px;
}

.lobby-delete-btn {
    padding: 10px 14px !important;
    color: var(--text-dim) !important;
    border-color: var(--border) !important;
}

.lobby-delete-btn:hover {
    color: var(--clr-danger) !important;
    border-color: rgba(239,68,68,.4) !important;
    background: var(--clr-danger-dim) !important;
}

.lobby-back {
    text-align: center;
    padding-top: 16px;
}

/* =====================================================================
   ACCOUNT PAGES  (Login / Register)
   ===================================================================== */

.account-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 80vh;
    padding: 60px 24px;
}

.account-card {
    width: 100%;
    max-width: 420px;
    background: var(--surface-1);
    border: 1px solid var(--border-med);
    border-radius: 6px;
    overflow: hidden;
}

.account-card-header {
    text-align: center;
    padding: 32px 28px 20px;
    border-bottom: 1px solid var(--border);
    background: var(--surface-2);
}

.account-card-header i {
    font-size: 28px;
    color: var(--accent);
    margin-bottom: 12px;
    display: block;
}

.account-card-header h1 {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--text);
    margin: 0 0 6px;
}

.account-card-header p {
    font-size: 12px;
    color: var(--text-secondary);
    margin: 0;
    letter-spacing: .04em;
}

.account-card-body {
    padding: 28px;
}

.account-field {
    margin-bottom: 18px;
}

.account-field label {
    display: block;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .10em;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.account-field .form-control {
    width: 100%;
    height: 40px;
    padding: 8px 12px;
    font-size: 13px;
}

.account-field .text-danger {
    display: block;
    font-size: 11px;
    margin-top: 4px;
}

.account-field-hint {
    display: block;
    font-size: 10px;
    color: var(--text-dim);
    margin-top: 4px;
    letter-spacing: .02em;
}

.account-field-check {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 22px;
}

.account-field-check .form-check-input {
    width: 16px;
    height: 16px;
    margin: 0;
    background-color: var(--surface-3);
    border: 1px solid var(--border-med);
    border-radius: 3px;
    cursor: pointer;
    accent-color: var(--accent);
}

.account-field-check .form-check-input:checked {
    background-color: var(--accent);
    border-color: var(--accent);
}

.account-field-check label {
    font-size: 12px;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
}

.account-submit {
    width: 100%;
    justify-content: center;
    padding: 12px 28px;
    font-size: 13px;
    margin-top: 4px;
}

.account-card-footer {
    text-align: center;
    padding: 16px 28px;
    border-top: 1px solid var(--border);
    background: var(--surface-2);
    font-size: 12px;
}

.account-card-footer span {
    color: var(--text-secondary);
    margin-right: 6px;
}

.account-card-footer a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 700;
    letter-spacing: .04em;
    transition: color .15s;
}

.account-card-footer a:hover {
    color: var(--accent-hover);
}

/* Override alert styling for dark theme */
.account-card-body .alert {
    background: var(--surface-3);
    border: 1px solid var(--border-med);
    border-radius: 4px;
    font-size: 12px;
    padding: 10px 14px;
    margin-bottom: 18px;
}

.account-card-body .alert-danger {
    border-color: rgba(239, 68, 68, .35);
    color: var(--clr-danger);
    background: var(--clr-danger-dim);
}

.account-card-body .alert-success {
    border-color: rgba(34, 197, 94, .35);
    color: var(--clr-success);
    background: var(--clr-success-dim);
}

.account-card-body .validation-message,
.account-card-body .text-danger {
    color: var(--clr-danger);
}

/* Override validation summary list for dark theme */
.account-card-body .validation-errors {
    list-style: none;
    padding: 0;
    margin: 0 0 14px;
    font-size: 11px;
    color: var(--clr-danger);
}

/* =====================================================================
   TOPBAR USER MENU & DROPDOWN
   ===================================================================== */

.topbar-user-menu {
    position: relative;
}

.topbar-user-btn {
    display: flex;
    align-items: center;
    gap: 7px;
    height: 34px;
    padding: 0 12px;
    background: var(--surface-2);
    border: 1px solid var(--border-med);
    border-radius: 4px;
    color: var(--text-secondary);
    font-family: 'Share Tech Mono', monospace;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .04em;
    cursor: pointer;
    transition: color .15s, border-color .15s, background .15s;
    white-space: nowrap;
}

.topbar-user-btn:hover {
    color: var(--text);
    border-color: var(--border-strong);
    background: var(--surface-3);
}

.topbar-user-btn i:first-child {
    font-size: 11px;
    color: var(--accent);
}

.topbar-user-name {
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Backdrop to close dropdown on outside click */
.topbar-dropdown-backdrop {
    position: fixed;
    inset: 0;
    z-index: 199;
}

.topbar-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 200px;
    background: var(--surface-2);
    border: 1px solid var(--border-med);
    border-radius: 4px;
    box-shadow: 0 8px 32px rgba(0,0,0,.6), 0 2px 8px rgba(0,0,0,.4);
    z-index: 200;
    padding: 4px 0;
    overflow: hidden;
}

.topbar-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 16px;
    background: transparent;
    border: none;
    color: var(--text);
    font-family: 'Share Tech Mono', monospace;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .04em;
    cursor: pointer;
    transition: background .12s, color .12s;
    text-align: left;
}

.topbar-dropdown-item:hover {
    background: rgba(255,255,255,.06);
    color: var(--text);
}

.topbar-dropdown-item i {
    width: 16px;
    text-align: center;
    font-size: 11px;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.topbar-dropdown-item:hover i {
    color: var(--accent);
}

.topbar-dropdown-logout {
    color: var(--clr-danger);
}
.topbar-dropdown-logout i {
    color: var(--clr-danger) !important;
}
.topbar-dropdown-logout:hover {
    background: var(--clr-danger-dim);
}

.topbar-dropdown-divider {
    height: 1px;
    background: var(--border);
    margin: 4px 0;
}

.topbar-dropdown-debug-label {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .10em;
    color: var(--text-dim);
    padding: 4px 16px 2px;
}

.topbar-dropdown-debug {
    color: var(--text-secondary);
    font-size: 11px;
}
.topbar-dropdown-debug i {
    color: var(--text-dim) !important;
}
.topbar-dropdown-debug:hover {
    color: var(--text);
}

/* =====================================================================
   SETTINGS OVERLAY
   ===================================================================== */

.settings-overlay-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .55);
    z-index: 500;
}

.settings-overlay {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 520px;
    max-width: 94vw;
    max-height: 85vh;
    background: var(--surface-1);
    border: 1px solid var(--border-med);
    border-radius: 6px;
    box-shadow: 0 16px 64px rgba(0,0,0,.7), 0 4px 16px rgba(0,0,0,.5);
    z-index: 501;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.settings-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    border-bottom: 1px solid var(--border-med);
    background: var(--surface-2);
    flex-shrink: 0;
}

.settings-header h2 {
    font-size: 16px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .10em;
    color: var(--text);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.settings-header h2 i {
    color: var(--accent);
    font-size: 15px;
}

.settings-close {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 16px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 3px;
    transition: color .15s, background .15s;
}

.settings-close:hover {
    color: var(--text);
    background: rgba(255,255,255,.06);
}

.settings-body {
    padding: 20px 24px;
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1;
}

.settings-section {
    margin-bottom: 24px;
}

.settings-section:last-child {
    margin-bottom: 0;
}

.settings-section-title {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: var(--accent);
    margin-bottom: 14px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border);
}

.settings-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    gap: 16px;
}

.settings-row label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text);
    letter-spacing: .02em;
    white-space: nowrap;
    flex-shrink: 0;
}

.settings-slider-group {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 200px;
    flex-shrink: 0;
    min-width: 0;
}

.settings-slider {
    flex: 1;
    min-width: 0;
    width: 0;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--surface-4);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

.settings-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--accent);
    border: 2px solid var(--surface-1);
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(0,0,0,.4);
}

.settings-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--accent);
    border: 2px solid var(--surface-1);
    cursor: pointer;
}

.settings-slider-value {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-secondary);
    min-width: 36px;
    text-align: right;
    font-family: 'Share Tech Mono', monospace;
}

.settings-select {
    width: 200px !important;
    max-width: 200px !important;
    min-width: 0 !important;
    flex-shrink: 0;
    height: 30px !important;
    font-size: 11px !important;
    padding: 2px 8px !important;
}

.settings-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
}

.settings-toggle input[type="checkbox"] {
    width: 16px;
    height: 16px;
    background-color: var(--surface-3);
    border: 1px solid var(--border-med);
    border-radius: 3px;
    cursor: pointer;
    accent-color: var(--accent);
}

.settings-toggle-label {
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 600;
    min-width: 24px;
}

.settings-footer {
    display: flex;
    justify-content: flex-end;
    padding: 14px 24px;
    border-top: 1px solid var(--border);
    background: var(--surface-2);
    flex-shrink: 0;
}

.settings-row-disabled {
    opacity: .35;
    pointer-events: none;
    cursor: default;
}

/* ── Cheat Menu overlay ─────────────────────────────────────────────── */
.cheat-overlay {
    width: 620px;
}

/* Current-value readout on the right of each settings-row */
.cheat-current-value {
    font-size: 13px;
    font-weight: 700;
    color: var(--accent);
    font-family: 'Share Tech Mono', monospace;
    white-space: nowrap;
}

/* One row: number input + immediate −/+/Set buttons */
.cheat-input-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
}

.cheat-input {
    width: 150px !important;
    max-width: 150px !important;
    min-width: 0 !important;
    height: 30px !important;
    font-size: 12px !important;
    padding: 2px 8px !important;
    flex-shrink: 0;
}

/* Wrapping row of preset quick-action buttons */
.cheat-quick-btns {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 4px;
}

/* =====================================================================
   TOAST NOTIFICATIONS
   ===================================================================== */

#toast-container {
    position: fixed;
    bottom: calc(var(--footer-h) + 12px);
    right: 16px;
    z-index: 1000;
    display: flex;
    flex-direction: column-reverse;
    gap: 8px;
    pointer-events: none;
}

.game-toast {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--surface-2);
    border: 1px solid var(--border-med);
    border-radius: 4px;
    color: var(--text);
    font-family: 'Share Tech Mono', monospace;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .04em;
    box-shadow: 0 4px 20px rgba(0,0,0,.5), 0 1px 6px rgba(0,0,0,.3);
    pointer-events: auto;
    opacity: 0;
    transform: translateX(30px);
    transition: opacity .25s ease, transform .25s ease;
    white-space: nowrap;
    max-width: 320px;
}

.game-toast-visible {
    opacity: 1;
    transform: translateX(0);
}

.game-toast-exit {
    opacity: 0;
    transform: translateX(30px);
    transition: opacity .2s ease, transform .2s ease;
}

.game-toast-icon {
    color: var(--accent);
    font-size: 12px;
    flex-shrink: 0;
}

/* =====================================================================
   GAME STATUS FOOTER
   ===================================================================== */

#game-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--footer-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--surface-1);
    border-top: 1px solid var(--border);
    padding: 0 12px;
    z-index: 99;
    font-family: 'Share Tech Mono', monospace;
}

.game-footer-left,
.game-footer-right {
    display: flex;
    align-items: center;
    gap: 6px;
}

.game-footer-item {
    font-size: 10px;
    color: var(--text-secondary);
    letter-spacing: .04em;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.game-footer-item i {
    font-size: 9px;
    color: var(--text-dim);
}

.game-footer-divider {
    width: 1px;
    height: 12px;
    background: var(--border);
    flex-shrink: 0;
}

/* ── Footer Speed Dropdown (opens upward) ──────────────────────── */
.footer-speed-wrapper {
    position: relative;
}

.footer-speed-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 3px;
    color: var(--accent);
    font-family: 'Share Tech Mono', monospace;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .04em;
    padding: 1px 8px;
    cursor: pointer;
    transition: background .12s, border-color .12s, color .12s;
    height: 20px;
    white-space: nowrap;
}

.footer-speed-btn i:first-child {
    font-size: 9px;
}

.footer-speed-btn:hover {
    background: rgba(255,255,255,.06);
    border-color: var(--border-med);
    color: var(--accent-hover);
}

.footer-speed-dropdown {
    position: absolute;
    bottom: calc(100% + 6px);
    left: 0;
    display: flex;
    flex-direction: row;
    background: var(--surface-2);
    border: 1px solid var(--border-med);
    border-radius: 4px;
    box-shadow: 0 -4px 20px rgba(0,0,0,.5), 0 -1px 6px rgba(0,0,0,.3);
    z-index: 200;
    padding: 3px;
    gap: 2px;
    overflow: hidden;
}

.footer-speed-option {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 26px;
    padding: 0 8px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 3px;
    color: var(--text-secondary);
    font-family: 'Share Tech Mono', monospace;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition: background .12s, color .12s, border-color .12s;
    white-space: nowrap;
}

.footer-speed-option:hover {
    background: rgba(255,255,255,.07);
    color: var(--text);
    border-color: var(--border-med);
}

.footer-speed-option.active {
    background: var(--accent);
    color: #000;
    border-color: var(--accent);
}

.footer-speed-option.active:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
}

/* ── Exit Confirmation Overlay ─────────────────────────────────── */
.exit-confirm-overlay {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 360px;
    max-width: 90vw;
    background: var(--surface-1);
    border: 1px solid var(--border-med);
    border-radius: 6px;
    box-shadow: 0 16px 64px rgba(0,0,0,.7), 0 4px 16px rgba(0,0,0,.5);
    z-index: 501;
    padding: 32px 28px 24px;
    text-align: center;
}

.exit-confirm-icon {
    font-size: 28px;
    color: var(--accent);
    margin-bottom: 14px;
}

.exit-confirm-title {
    font-size: 16px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .10em;
    color: var(--text);
    margin-bottom: 8px;
}

.exit-confirm-desc {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 24px;
    letter-spacing: .02em;
}

.exit-confirm-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
}

/* =====================================================================
   UI POLISH – Enhanced Hover & Interaction States
   ===================================================================== */

/* Topbar stat hover lift */
.topbar-stat {
    transition: border-color .15s, background .15s, transform .1s;
}
.topbar-stat:hover {
    border-color: var(--border-strong);
    background: var(--surface-3);
    transform: translateY(-1px);
}

/* Speed button press effect */
.topbar-speed-group .btn {
    transition: background .12s, color .12s, transform .08s, box-shadow .12s;
}
.topbar-speed-group .btn:active:not(:disabled) {
    transform: scale(.93);
}

/* Card hover glow */
.card.ui {
    transition: border-color .2s, box-shadow .2s;
}
.card.ui:hover {
    border-color: var(--border-med);
    box-shadow: 0 2px 12px rgba(0,0,0,.3);
}

/* Card header subtle accent bar on hover */
.card.ui:hover > .card-header {
    border-bottom-color: var(--accent-dim2) !important;
}

/* Item card hover lift */
.item-card {
    transition: border-color .15s, background .15s, transform .15s, box-shadow .15s;
}
.item-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(0,0,0,.35);
}

/* Item card selected pulse border */
.item-card.selected {
    box-shadow: 0 0 0 1px var(--accent), 0 4px 16px rgba(201,168,76,.15);
}

/* Card corner button active press */
.card-corner-btn {
    transition: background .12s, color .12s, transform .08s;
}
.card-corner-btn:active:not(:disabled) {
    transform: scale(.95);
}

/* Tree item smooth transitions */
.tree-item {
    transition: background .12s, color .12s, padding-left .15s;
}
.tree-item:hover {
    padding-left: calc(.75rem + 2px);
}

/* List group item hover */
.list-group-item {
    transition: background .12s, border-color .15s;
}
.list-group-item:hover {
    background: var(--surface-3);
    border-color: var(--border-med) !important;
}

/* Chip hover highlight */
.chip {
    transition: color .15s, background .15s, border-color .15s;
}
.tree-item:hover .chip {
    color: var(--accent);
    border-color: var(--accent-dim2);
    background: var(--accent-dim);
}

/* Button press feedback for all btn */
.btn {
    transition: background .12s, color .12s, border-color .12s, transform .08s, box-shadow .12s;
}
.btn:active:not(:disabled) {
    transform: scale(.96);
}

/* Sub-tab button glow on active */
.sub-tab-btn.active {
    text-shadow: 0 0 8px var(--accent-dim2);
}

/* Top switch button hover glow */
.top-switch-btn {
    transition: color .15s, background .15s, border-color .15s, box-shadow .15s;
}
.top-switch-btn.active {
    text-shadow: 0 0 10px rgba(201,168,76,.3);
}

/* Dropdown item icon transition */
.topbar-dropdown-item i {
    transition: color .12s, transform .12s;
}
.topbar-dropdown-item:hover i {
    transform: translateX(1px);
}

/* Focus ring for accessibility */
.btn:focus-visible,
.top-switch-btn:focus-visible,
.sub-tab-btn:focus-visible,
.selbar-select:focus-visible,
.form-control:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
}

/* Selectable row hover accent indicator */
.selectable-row {
    transition: background .12s, border-color .12s;
    border-left: 2px solid transparent;
}
.selectable-row:hover {
    border-left-color: var(--accent-dim2);
}

/* Smooth scrollbar fade-in for scroll containers */
.card-body-scroll,
.card-body-fixed-scroll,
.card-body-fixed-scroll-32 {
    scrollbar-color: transparent transparent;
    transition: scrollbar-color .3s;
}
.card-body-scroll:hover,
.card-body-fixed-scroll:hover,
.card-body-fixed-scroll-32:hover {
    scrollbar-color: var(--scrollBar) transparent;
}
