/* ============================================
   SUPPLY LINES — Game UI Stylesheet
   ============================================ */

:root {
    --bg-deep: #0a0e17;
    --bg-panel: #111827;
    --bg-card: #1a2235;
    --bg-hover: #1f2a40;
    --border: #2a3550;
    --text: #e2e8f0;
    --text-muted: #8892a8;
    --text-dim: #5a6478;
    --accent: #22d3ee;
    --accent-glow: rgba(34, 211, 238, 0.15);
    --green: #34d399;
    --green-glow: rgba(52, 211, 153, 0.2);
    --red: #f87171;
    --red-glow: rgba(248, 113, 113, 0.2);
    --gold: #fbbf24;
    --gold-glow: rgba(251, 191, 36, 0.15);
    --orange: #fb923c;
    --purple: #a78bfa;
    --font: 'Inter', system-ui, sans-serif;
    --mono: 'JetBrains Mono', monospace;
    --radius: 8px;
    --radius-sm: 4px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    height: 100%;
    overflow: hidden;
    font-family: var(--font);
    background: var(--bg-deep);
    color: var(--text);
    font-size: 14px;
}

/* -------- TOP BAR -------- */
#top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5%;
    background: var(--bg-panel);
    border-bottom: 1px solid var(--border);
    z-index: 100;
}

.top-bar-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.logo {
    font-weight: 700;
    font-size: 16px;
    letter-spacing: 2px;
    color: var(--accent);
}

.sim-day {
    font-family: var(--mono);
    font-size: 12px;
    color: var(--text-muted);
    background: var(--bg-card);
    padding: 4px 10px;
    border-radius: var(--radius-sm);
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.stat-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-card);
    padding: 5px 12px;
    border-radius: 20px;
    font-family: var(--mono);
    font-size: 13px;
    font-weight: 500;
    border: 1px solid var(--border);
}

.stat-pill i {
    color: var(--gold);
    font-size: 12px;
}

.faction-rep-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    font-weight: 700;
}

.faction-rep-item span {
    font-family: var(--mono);
    font-weight: 500;
}

/* -------- MAIN LAYOUT -------- */
#app {
    display: flex;
    height: calc(100vh - 48px);
}

/* -------- MAP PANEL -------- */
#map-panel {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #070b12;
    position: relative;
    overflow: hidden;
}

#map-container {
    position: relative;
    width: 95%;
    max-height: 95%;
    aspect-ratio: 2311/2001;
}

#world-map {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    filter: brightness(0.85) saturate(0.9);
}

#map-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* Zoom Controls */
#map-zoom-controls {
    position: absolute;
    top: 10%;
    left: 5%;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 10;
}

.zoom-btn {
    width: 40px;
    height: 40px;
    background: rgba(17, 24, 39, 0.7);
    border: 1px solid rgba(42, 53, 80, 0.7);
    color: var(--text);
    border-radius: 6px;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    transition: all 0.2s ease;
}

.zoom-btn:hover {
    background: rgba(34, 211, 238, 0.2);
    border-color: var(--accent);
    color: var(--accent);
}

@media (max-width: 768px) {
    .zoom-btn {
        width: 50px;
        height: 50px;
        font-size: 24px;
        background: rgba(17, 24, 39, 0.85);
    }
}

#map-overlay g {
    pointer-events: all;
}

/* City Markers */
.city-marker {
    cursor: pointer;
}

/* Invisible hit-area for easy clicking/tapping */
.city-marker-hit {
    fill: transparent;
    stroke: none;
}

.city-marker-ring {
    fill: none;
    stroke: var(--accent);
    stroke-width: 3;
    opacity: 1;
    transition: transform 0.25s ease, stroke-width 0.25s ease, opacity 0.25s ease, filter 0.25s ease;
    transform-origin: center;
    transform-box: fill-box;
    /* ADD THIS LINE */
}

.city-marker:hover .city-marker-ring,
.city-marker:active .city-marker-ring,
.city-marker.touched .city-marker-ring {
    transform: scale(1.3);
    stroke-width: 4;
    opacity: 1;
    filter: drop-shadow(0 0 8px var(--accent));
}

.city-marker-dot {
    fill: var(--accent);
    filter: drop-shadow(0 0 4px var(--accent));
    transition: transform 0.25s ease, filter 0.25s ease;
    transform-origin: center;
    transform-box: fill-box;
    /* ADD THIS LINE */
}

.city-marker:hover .city-marker-dot,
.city-marker:active .city-marker-dot,
.city-marker.touched .city-marker-dot {
    transform: scale(1.4);
    filter: drop-shadow(0 0 8px var(--accent));
}

.city-marker.selected .city-marker-ring {
    stroke: var(--gold);
    stroke-width: 3;
    opacity: 1;
    transform: scale(1.08);
    filter: drop-shadow(0 0 6px var(--gold));
    transform-origin: center;
}

.city-marker.selected:hover .city-marker-ring,
.city-marker.selected:active .city-marker-ring {
    transform: scale(1.17);
}

.city-marker.selected .city-marker-dot {
    fill: var(--gold);
    transform: scale(1.125);
    filter: drop-shadow(0 0 6px var(--gold));
    transform-origin: center;
}

.city-label {
    fill: #fff;
    font-family: var(--font);
    font-size: 28px;
    font-weight: 600;
    text-anchor: middle;
    pointer-events: none;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
    filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.9));
}

/* Route Lines */
.route-line {
    stroke: var(--accent);
    stroke-width: 1.5;
    stroke-dasharray: 6 4;
    opacity: 0.4;
    fill: none;
}

/* Vehicle Markers */
.vehicle-marker {
    transition: all 1s linear;
}

.vehicle-icon {
    /* Nice colors   00FFFF blue keeps in theme,  FFFF00 favourite: #FFFF00 !important;
    yellow */
    fill: currentColor;
    filter: drop-shadow(0 0 3px #000) drop-shadow(0 0 3px currentColor);
}

.vehicle-fa-icon,
.vehicle-svg-icon {
    filter: drop-shadow(0 0 3px #000) drop-shadow(0 0 3px currentColor);
    text-shadow: 0 0 3px #000;
}

.vehicle-marker[data-status="idle"] .vehicle-pulse {
    display: none;
}

.vehicle-pulse {
    opacity: 0.3;
    animation: pulse-ring 2s ease-out infinite;
    transform-origin: center;
    transform-box: fill-box;
    /* ADD THIS LINE */
}

@keyframes pulse-ring {
    0% {
        transform: scale(16);
        opacity: 0.4;
    }

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

/* -------- SIDE PANEL -------- */
#side-panel {
    width: 620px;
    min-width: 560px;
    background: var(--bg-panel);
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Tab Nav */
#panel-tabs {
    display: flex;
    border-bottom: 1px solid var(--border);
    background: var(--bg-card);
}

.tab-btn {
    flex: 1;
    padding: 12px 0;
    background: none;
    border: none;
    color: var(--text-muted);
    font-family: var(--font);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.tab-btn:hover {
    color: var(--text);
    background: var(--bg-hover);
}

.tab-btn.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.tab-btn i {
    margin-right: 6px;
}

/* Tab Content */
.tab-content {
    display: none;
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.tab-content.active {
    display: flex;
    flex-direction: column;
}

/* City Select Prompt */
#city-select-prompt {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    flex: 1;
    color: var(--text-dim);
}

#city-select-prompt h3 {
    color: var(--text-muted);
    margin-bottom: 8px;
}

/* City Header */
.city-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.city-header h2 {
    font-size: 20px;
    font-weight: 600;
    color: #fff;
}

#send-vehicle-section {
    margin-left: auto;
}

.btn-send-compact {
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 600;
    background: linear-gradient(135deg, #22d3ee, #06b6d4);
    border: none;
    border-radius: 16px;
    color: #000;
    cursor: pointer;
    font-family: var(--font);
    transition: all 0.2s;
    white-space: nowrap;
    box-shadow: 0 2px 8px var(--accent-glow);
}

.btn-send-compact:hover {
    box-shadow: 0 4px 16px var(--accent-glow);
    filter: brightness(1.1);
}

.btn-send-compact i {
    margin-right: 4px;
}

.city-tag {
    font-size: 11px;
    font-weight: 500;
    padding: 3px 10px;
    border-radius: 20px;
    background: var(--accent-glow);
    color: var(--accent);
    border: 1px solid rgba(34, 211, 238, 0.3);
}

.faction-badge {
    font-size: 11px;
    font-weight: 500;
    padding: 3px 10px;
    border-radius: 20px;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.city-meta {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 16px;
    display: flex;
    gap: 16px;
}

.city-meta i {
    color: var(--gold);
    margin-right: 4px;
}

/* Vehicle selector */
#city-vehicle-selector,
#yard-stationed-selector {
    display: flex;
    flex-direction: column;
    /* Stack the row and the button vertically */
    gap: 12px;
    /* Space between the input row and the button */
    margin-bottom: 14px;
    padding: 12px;
    /* Slightly more padding for the new layout */
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

/* New class to keep label and select together on the top line */
.vehicle-select-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

#city-vehicle-selector label,
#yard-stationed-selector label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    white-space: nowrap;
}

/* Vehicle Pill Selection */
.vehicle-pill-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
}

.vehicle-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #000;
    color: #fff;
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 6px 12px;
    font-size: 12px;
    font-family: var(--font);
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}

.vehicle-pill i {
    color: var(--gold);
    font-size: 14px;
}

.vehicle-pill:hover {
    border-color: var(--accent);
}

.vehicle-pill.selected {
    background: #111;
    border-color: var(--gold);
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.8);
}

/* Dispatch Status Messages */
.dispatch-status-msg {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    font-family: var(--font);
    background: var(--green-glow);
    color: var(--green);
    border: 1px solid rgba(52, 211, 153, 0.3);
    width: 100%;
}

.dispatch-status-msg.en-route {
    background: var(--gold-glow);
    color: var(--gold);
    border-color: rgba(251, 191, 36, 0.3);
    animation: en-route-pulse 2s ease-in-out infinite;
}

.dispatch-eta {
    margin-left: auto;
    font-family: var(--mono);
    font-weight: 600;
    font-size: 11px;
}

@keyframes en-route-pulse {

    0%,
    100% {
        opacity: 0.8;
    }

    50% {
        opacity: 1;
    }
}

/* Make the dispatch button more prominent since it's now on its own line */
#btn-dispatch-vehicle {
    width: 100%;
    padding: 10px;
    /* Taller button is easier to tap */
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Market Filters */
.filter-btn {
    padding: 6px 10px;
    background: var(--bg-deep);
    border: 1px solid var(--border);
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 12px;
    font-family: var(--font);
    transition: all 0.2s;
}

.filter-btn:hover {
    background: var(--bg-hover);
    color: var(--text);
}

.filter-btn.active {
    background: var(--accent-glow);
    border-color: var(--accent);
    color: var(--accent);
}

#market-search:focus {
    outline: none;
    border-color: var(--accent);
}


/* Resource table */
.resource-table-wrap {
    flex: 1;
    overflow-y: auto;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--bg-card);
    position: relative;
}

/* No feed static effect */
.resource-table-wrap.no-feed #resource-table {
    opacity: 0.05;
    pointer-events: none;
}

.resource-table-wrap .no-feed-static {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.resource-table-wrap.no-feed .no-feed-static {
    opacity: 1;
}

.no-feed-static .static-noise {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(0deg,
            transparent,
            transparent 2px,
            rgba(255, 255, 255, 0.03) 2px,
            rgba(255, 255, 255, 0.03) 4px);
    animation: static-flicker 0.15s infinite;
}

@keyframes static-flicker {
    0% {
        opacity: 0.8;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0.8;
    }
}

.no-feed-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--text-dim);
    text-align: center;
    animation: no-feed-pulse 2s ease-in-out infinite;
}

.no-feed-message i {
    font-size: 32px;
    color: var(--text-dim);
    margin-bottom: 4px;
}

.no-feed-message span {
    font-size: 14px;
    letter-spacing: 1px;
}

.no-feed-hint {
    font-size: 11px !important;
    color: var(--text-muted);
    opacity: 0.7;
}

@keyframes no-feed-pulse {

    0%,
    100% {
        opacity: 0.6;
    }

    50% {
        opacity: 1;
    }
}

#resource-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

#resource-table thead {
    position: sticky;
    top: 0;
    z-index: 2;
}

#resource-table th {
    background: var(--bg-deep);
    color: var(--text-muted);
    font-weight: 500;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 8px 10px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

#resource-table td {
    padding: 6px 8px;
    border-bottom: 1px solid rgba(42, 53, 80, 0.5);
    vertical-align: middle;
}

#resource-table tbody tr {
    transition: background 0.15s;
}

#resource-table tbody tr:hover {
    background: var(--bg-hover);
}

.res-name {
    font-weight: 500;
    text-transform: capitalize;
}

.res-stock {
    font-family: var(--mono);
    color: var(--text-muted);
    font-size: 12px;
}

.res-buy {
    font-family: var(--mono);
    color: var(--red);
    font-weight: 500;
}

.res-sell {
    font-family: var(--mono);
    color: var(--green);
    font-weight: 500;
}

/* Trade Buttons */
.trade-btns {
    display: flex;
    gap: 4px;
    align-items: center;
}

.qty-input {
    width: 40px;
    padding: 4px 2px;
    text-align: center;
    font-family: var(--mono);
    font-size: 12px;
    background: var(--bg-deep);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    appearance: textfield;
    -moz-appearance: textfield;
}

.qty-input::-webkit-outer-spin-button,
.qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.qty-input:focus {
    outline: none;
    border-color: var(--accent);
}

.btn-trade {
    padding: 4px 8px;
    font-size: 11px;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-family: var(--font);
    transition: all 0.15s;
}

.btn-buy {
    background: var(--green-glow);
    color: var(--green);
    border: 1px solid rgba(52, 211, 153, 0.3);
}

.btn-buy:hover {
    background: var(--green);
    color: #000;
}

.btn-sell {
    background: var(--red-glow);
    color: var(--red);
    border: 1px solid rgba(248, 113, 113, 0.3);
}

.btn-sell:hover {
    background: var(--red);
    color: #000;
}

.btn-trade:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Send Vehicle - handled in city header now */

/* -------- FLEET TAB -------- */
.fleet-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px;
    margin-bottom: 10px;
    transition: border-color 0.2s;
}

.fleet-card:hover {
    border-color: var(--accent);
}

.fleet-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.fleet-card-title {
    font-weight: 600;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.fleet-card-title i {
    color: var(--gold);
}

.fleet-status {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-idle {
    background: var(--green-glow);
    color: var(--green);
}

.status-traveling {
    background: var(--gold-glow);
    color: var(--gold);
}

.fleet-card-body {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.fleet-card-body strong {
    color: var(--text);
}

.fleet-eta {
    font-family: var(--mono);
    color: var(--gold);
    font-weight: 500;
}

.fleet-cargo-list {
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid var(--border);
}

.vehicle-type-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.fleet-capacity {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
}

.capacity-bar {
    flex: 1;
    height: 6px;
    background: var(--bg-dark);
    border-radius: 3px;
    overflow: hidden;
}

.capacity-fill {
    height: 100%;
    background: var(--green);
    transition: width 0.3s;
}

.capacity-text {
    font-size: 11px;
    font-family: var(--mono);
    color: var(--text-muted);
}

.fleet-role {
    font-size: 11px;
    color: var(--text-muted);
    font-style: italic;
    margin-top: 4px;
}

/* Fleet Shop */
.fleet-shop {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.fleet-shop h4 {
    font-size: 14px;
    margin-bottom: 12px;
    color: var(--accent);
}

.shop-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 8px;
}

.shop-item-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.shop-item-name {
    font-weight: 600;
    font-size: 13px;
}

.shop-item-role {
    font-size: 11px;
    color: var(--text-muted);
}

.shop-item-stats {
    font-size: 11px;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.btn-buy-vehicle {
    background: var(--accent);
    color: var(--bg);
    border: none;
    padding: 6px 12px;
    border-radius: var(--radius);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}

.btn-buy-vehicle:hover {
    opacity: 0.8;
}

.btn-owned {
    background: var(--bg-dark);
    color: var(--text-dim);
    border: 1px solid var(--border);
    padding: 6px 12px;
    border-radius: var(--radius);
    font-size: 12px;
    cursor: not-allowed;
}

.cargo-item {
    display: flex;
    justify-content: space-between;
    padding: 2px 0;
    font-size: 12px;
}

.cargo-item-name {
    text-transform: capitalize;
    color: var(--text);
}

.cargo-item-qty {
    font-family: var(--mono);
    color: var(--accent);
}

/* -------- CONTRACTS TAB -------- */
.contract-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px;
    margin-bottom: 10px;
    transition: border-color 0.2s, transform 0.2s;
}

.contract-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}

.contract-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.contract-title {
    font-weight: 600;
    font-size: 14px;
    color: var(--text);
    margin-bottom: 4px;
}

.contract-desc {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.4;
    margin-bottom: 12px;
}

.contract-destination,
.contract-rewards {
    display: flex;
    align-items: flex-start;
    gap: 7px;
    font-size: 12px;
    line-height: 1.4;
    margin-bottom: 8px;
    padding: 7px 9px;
    border-radius: var(--radius-sm);
}

.contract-destination {
    color: var(--accent);
    background: var(--accent-glow);
    border: 1px solid rgba(34, 211, 238, 0.25);
}

.contract-rewards {
    color: var(--green);
    background: var(--green-glow);
    border: 1px solid rgba(52, 211, 153, 0.25);
}

.contract-destination i,
.contract-rewards i {
    margin-top: 2px;
    flex: 0 0 auto;
}

.contract-source-badge {
    display: inline-block;
    margin-left: 6px;
    padding: 2px 7px;
    border-radius: 999px;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    vertical-align: middle;
    color: var(--gold);
    background: var(--gold-glow);
    border: 1px solid rgba(251, 191, 36, 0.35);
}

.contract-expiry {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 11px;
    color: var(--text-dim);
    margin-bottom: 10px;
}

.contract-expiry i {
    color: var(--gold);
}

.contract-difficulty {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    padding: 2px 6px;
    border-radius: 4px;
    letter-spacing: 0.5px;
}

.diff-easy {
    background: var(--green-glow);
    color: var(--green);
}

.diff-medium {
    background: var(--gold-glow);
    color: var(--gold);
}

.diff-hard {
    background: var(--red-glow);
    color: var(--red);
}

.contract-objectives {
    background: var(--bg-deep);
    border-radius: var(--radius-sm);
    padding: 8px;
    margin-bottom: 12px;
}

.obj-item {
    font-size: 11px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
}

.obj-item:last-child {
    margin-bottom: 0;
}

.obj-item i {
    color: var(--accent);
    width: 12px;
    text-align: center;
}

.obj-item.completed {
    color: var(--green);
}

.obj-item.completed i {
    color: var(--green);
}

.contract-actions {
    display: flex;
    justify-content: flex-end;
}

.btn-accept-contract {
    background: linear-gradient(135deg, #22d3ee, #06b6d4);
    color: #000;
    border: none;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 8px var(--accent-glow);
}

.btn-accept-contract:hover {
    box-shadow: 0 4px 12px var(--accent-glow);
    filter: brightness(1.1);
}

/* -------- TOAST -------- */
#toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 999;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 18px;
    font-size: 13px;
    color: var(--text);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
    animation: toast-in 0.3s ease, toast-out 0.3s ease 2.7s forwards;
    display: flex;
    align-items: center;
    gap: 10px;
}

.toast.toast-success {
    border-left: 4px solid var(--green);
}

.toast.toast-error {
    border-left: 4px solid var(--red);
}

.toast.toast-info {
    border-left: 4px solid var(--accent);
}

/* Rich action confirmation (purchases, sales, storage transfers) */
.toast.toast-rich {
    align-items: flex-start;
    width: min(360px, calc(100vw - 40px));
    padding: 14px 16px;
    animation: toast-in 0.3s ease, toast-out 0.3s ease 4.7s forwards;
}

.toast.toast-rich > i {
    margin-top: 2px;
    color: var(--green);
    flex: 0 0 auto;
}

.toast.toast-rich.toast-error > i {
    color: var(--red);
}

.toast.toast-rich.toast-info > i {
    color: var(--accent);
}

.toast-body {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.toast-title {
    font-weight: 600;
    font-size: 13.5px;
    line-height: 1.35;
}

.toast-detail {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.4;
}

.toast-next {
    font-size: 12px;
    color: var(--accent);
    font-weight: 600;
    line-height: 1.4;
    margin-top: 2px;
}

/* Keep toasts clear of the fixed Next Objective panel. */
body.has-next-objective #toast-container {
    bottom: var(--next-objective-offset, 160px);
}

@media (max-width: 600px) {
    #toast-container {
        left: 12px;
        right: 12px;
        bottom: 12px;
    }

    .toast.toast-rich {
        width: 100%;
    }
}

@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateX(40px);
    }

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

@keyframes toast-out {
    to {
        opacity: 0;
        transform: translateX(40px);
    }
}


/* -------- ACCOUNT UI -------- */
.account-pill {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-card);
    padding: 0px 0px 0px 16px;
    border-radius: 24px;
    border: 1px solid var(--border);
    position: relative;
    cursor: default;
    transition: border-color 0.2s;
}

.account-pill:hover {
    border-color: var(--accent);
}

#player-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.btn-account-icon {
    background: linear-gradient(135deg, var(--bg-card), var(--bg-hover));
    border: 1px solid var(--border);
    color: var(--text-muted);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-account-icon:hover {
    color: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 0 10px var(--accent-glow);
}

/* Dropdown */
.account-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 220px;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
    z-index: 1000;
    animation: slide-up 0.2s ease;
}

@keyframes slide-up {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

.dropdown-hint {
    font-size: 11px;
    color: var(--text-dim);
    padding: 8px 12px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 8px;
}

.dropdown-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: none;
    border: none;
    color: var(--text);
    font-family: var(--font);
    font-size: 13px;
    text-align: left;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

.dropdown-btn:hover {
    background: var(--bg-hover);
    color: var(--accent);
}

.dropdown-btn i {
    width: 16px;
    color: var(--text-muted);
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fade-in 0.3s ease;
}

@keyframes fade-in {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 12px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
    overflow: hidden;
    animation: modal-pop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modal-pop {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: var(--accent);
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
}

.modal-close:hover {
    color: var(--text);
}

.modal-body {
    padding: 24px;
}

.modal-body p {
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.5;
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.welcome-modal .modal-body {
    text-align: center;
}

.welcome-text {
    font-size: 16px !important;
    color: var(--text) !important;
    margin-bottom: 24px !important;
}

.welcome-options {
    display: flex;
    gap: 16px;
}

.welcome-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 24px 16px;
    background: var(--bg-deep);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    cursor: pointer;
    transition: all 0.2s;
}

.welcome-btn:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}

.welcome-btn i {
    font-size: 28px;
    color: var(--accent);
}

.welcome-btn span {
    font-weight: 600;
    font-size: 14px;
}

.welcome-btn small {
    font-size: 11px;
    color: var(--text-dim);
}

.form-group input {
    width: 100%;
    background: var(--bg-deep);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 16px;
    color: var(--text);
    font-family: var(--font);
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 10px var(--accent-glow);
}

.btn-primary {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #22d3ee, #06b6d4);
    border: none;
    border-radius: var(--radius);
    color: #000;
    font-family: var(--font);
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 10px;
}

.btn-primary:hover {
    filter: brightness(1.1);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--accent-glow);
}

.form-switch {
    text-align: center;
    margin-top: 20px;
    font-size: 12px;
    color: var(--text-dim) !important;
}

.form-switch a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
}

.form-switch a:hover {
    text-decoration: underline;
}

/* -------- SCROLLBAR -------- */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-deep);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #3a4a6a;
}

/* -------- RESPONSIVE -------- */
@media (max-width: 900px) {
    #app {
        flex-direction: column;
    }

    #side-panel {
        width: 100%;
        min-width: unset;
        border-left: none;
        border-top: 1px solid var(--border);
        height: 50vh;
    }

    #map-panel {
        height: 50vh;
    }
}

/* -------- RESPONSIVE (MOBILE) -------- */
@media (max-width: 900px) {
    #top-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .top-bar-left,
    .top-bar-right {
        justify-content: space-between;
        width: 100%;
    }

    /* ... keep your existing #app, #side-panel, and #map-panel rules ... */

    /* 1. Increase City Text Size for Mobile */
    .city-label {
        font-size: 48px;
        /* Increased from 28px */
    }

    /* 2. Increase All City Markers (Base Size) for Mobile */
    .city-marker-ring {
        transform: scale(1.6);
        /* Makes the ring 60% larger by default on mobile */
    }

    .city-marker-dot {
        transform: scale(1.6);
        /* Makes the center dot 60% larger */
    }

    /* 3. Increase Selected (Yellow/Gold) Markers for Mobile */
    .city-marker.selected .city-marker-ring {
        transform: scale(1.8);
        /* Even larger when selected so it stands out */
        stroke-width: 5;
        /* Thicker border for better visibility */
    }

    .city-marker.selected .city-marker-dot {
        transform: scale(1.8);
    }

    /* 4. Increase Hover/Touch Size for Mobile Feedback */
    .city-marker:hover .city-marker-ring,
    .city-marker.touched .city-marker-ring {
        transform: scale(2.0);
        /* Significant growth when tapped/touched */
    }

    .city-marker:hover .city-marker-dot,
    .city-marker.touched .city-marker-dot {
        transform: scale(2.2);
    }
}
/* Trade guidance */
.qty-preset {
    background: var(--bg-deep);
    border: 1px solid var(--border);
    color: var(--text-muted);
    border-radius: 4px;
    padding: 4px 6px;
    font-size: 10px;
    cursor: pointer;
}
.qty-preset:hover { border-color: var(--accent); color: var(--accent); }
.contract-badge {
    display: inline-block;
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--accent);
    border: 1px solid var(--accent);
    border-radius: 999px;
    padding: 1px 5px;
    margin-left: 4px;
    vertical-align: middle;
}
