:root {
    --bg-color: #0b0e14;
    --panel-bg: rgba(13, 17, 23, 0.9);
    --cyan: #00f3ff;
    --purple: #bd00ff;
    --gold: #ffcc00;
    --acid-green: #39ff14;
    --danger: #ff4d4d;
    --text-primary: #e6edf3;
    --text-secondary: #8b949e;
    --border: rgba(255, 255, 255, 0.1);
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
}

#map-container {
    width: 100%;
    height: 100%;
}

#game-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: grid;
    grid-template-rows: 64px 1fr;
    grid-template-columns: 84px 1fr;
    grid-template-areas:
        "hud  hud"
        "nav  main";
}

#map {
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* Visual redesign — Βήμα 1 (2026-09-06): συγκρατημένο treatment στο βασικό Carto Voyager tile
   layer, ώστε ο χάρτης να γίνει το "ήσυχο καμβά" πίσω από το παιχνίδι αντί να ανταγωνίζεται τα
   game objects. Επηρεάζει ΜΟΝΟ τα raster tiles (.leaflet-tile-pane) — ΟΧΙ κτίρια/markers/canvas.
   Ένταση αυξημένη (2026-09-06, 2ο πέρασμα) — η αρχική τιμή ήταν ορατή σε A/B screenshot
   comparison αλλά πολύ διακριτική στην πράξη (χρήστη feedback live: "δεν είδα καμία αλλαγή").
   Δρόμοι/ονόματα παραμένουν ευανάγνωστα σε αυτή την ένταση, επαληθευμένο σε 3 zoom levels. */
.leaflet-tile-pane {
    filter: saturate(0.35) brightness(0.72) contrast(1.15) hue-rotate(-8deg);
}

/* Βήμα 10 follow-up (2026-09-08, code review): the labels-only tile layer (main.js, own pane
   'labelsPane') isn't the base tile — it's the ONLY thing making street/area names readable
   again after the ground layer covered them. Applying the same strong filter as .leaflet-tile-
   pane above would defeat that fix (labels need to stay legible against the muted ground, not
   match its muted tone) — deliberately much lighter, brightness only, full saturation/contrast. */
.leaflet-labels-pane {
    filter: brightness(0.9);
}

#game-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    pointer-events: none;
}

/* UI Panel */
.glass-morphism {
    background: var(--panel-bg);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.8);
}

#ui-panel {
    position: absolute;
    top: 20px;
    left: 20px;
    width: 400px;
    z-index: 100;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-height: calc(100vh - 40px);
    transition: max-height 0.3s ease-in-out;
}

#top-hud {
    grid-area: hud;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 16px;
    z-index: 300;
    border-radius: 0;
    border-left: none;
    border-top: none;
    border-right: none;
}

.hud-title-block {
    flex-shrink: 0;
}

.hud-title-block h1 {
    font-size: 0.95rem;
    line-height: 1.1;
    white-space: nowrap;
}

.hud-title-block .location-tag {
    font-size: 0.55rem;
    color: var(--text-secondary);
}

#top-hud .resource-bar {
    display: flex;
    flex: 1;
    gap: 6px;
    min-width: 0;
    overflow-x: auto;
}

#top-hud .resource {
    flex-direction: row;
    align-items: center;
    gap: 6px;
    min-height: unset;
    padding: 6px 10px;
    grid-column: unset !important;
}

#top-hud .resource .label {
    margin-bottom: 0;
}

.hud-settings-btn {
    height: 36px;
    padding: 0;
    font-size: 1.1rem;
    justify-content: center;
}

/* #settings-open-btn also carries .btn, whose `width: 100%` (style.css ~line 679, later in
   source order) otherwise wins the width tie-break over the .hud-settings-btn class rule above —
   an ID selector is needed to reliably beat it regardless of stylesheet ordering. This was making
   the button balloon to fill nearly the whole top-hud row, starving .resource-bar of its flex
   space and pushing the ⚙️ glyph away from the true right edge (live bug found 2026-09-06). */
#settings-open-btn {
    width: 36px;
    flex: 0 0 36px;
}

#side-nav {
    grid-area: nav;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px 6px;
    z-index: 300;
    border-radius: 0;
    border-top: none;
    border-bottom: none;
    border-left: none;
    background: var(--panel-bg);
    border-right: 1px solid var(--border);
}

#side-nav .tab-btn {
    flex: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 10px 2px;
    border-radius: 8px;
    border-bottom: none;
    line-height: 1.25;
    white-space: normal;
}

#side-nav .tab-btn.active {
    background: rgba(0, 243, 255, 0.1);
    border-bottom: none;
}

#main-area {
    grid-area: main;
    position: relative;
    overflow: hidden;
}

#main-area #map {
    position: absolute;
    top: 0;
    left: 0;
}

/* Visual redesign — Βήμα 2 (2026-09-06): drop-shadow στα claimed κτίρια (Leaflet SVG paths, ίδιο
   className hook που ήδη υπάρχει) — illusion βάθους πάνω στα ΗΔΗ υπάρχοντα, ακριβή polygons.
   Ένταση μειωμένη (2026-09-06, Visual.4) — από το Visual.3 η στέγη κάθεται πια πάνω σε πραγματικούς
   τοίχους (wall quads), το βάθος δεν χρειάζεται πια βαριά σκιά για να "πειστεί" ο θεατής· μια ήπια
   contact shadow αρκεί, ώστε να μη θολώνει το ίδιο το roof/wall σχήμα. .neon-building-partner
   κρατά πιο έντονη — landmark αίσθηση — αλλά κι αυτή ελαφρύτερη απ' ό,τι πριν. */
.neon-building {
    filter: drop-shadow(1px 2px 2px rgba(0, 0, 0, 0.35));
}

.neon-building-partner {
    filter: drop-shadow(2px 4px 4px rgba(0, 0, 0, 0.45)) drop-shadow(0 0 8px rgba(255, 255, 255, 0.15));
}

/* Floating context bar — appears anchored to the selected building on the
   map, instead of forcing a hunt through the static left panel. */
#building-context-bar {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 200;
    width: 280px;
    /* overflow stays visible on this element — the decorative tail sits
       at -8px outside the box, and `overflow-y: auto` alone would compute
       overflow-x to auto too (CSS spec) and clip it. Scrolling lives on
       the inner .context-bar-scroll wrapper instead. */
    pointer-events: none;
    opacity: 0;
    transform: translateY(4px) scale(0.98);
    transition: opacity 0.15s ease-out, transform 0.15s ease-out;
}

#building-context-bar.visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

.context-bar-scroll {
    max-height: min(70vh, 480px);
    overflow-y: auto;
    padding: 14px 16px 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    border-radius: 12px;
}

.context-bar-header {
    display: flex;
    justify-content: flex-end;
    margin: -4px -6px -2px 0;
}

.context-bar-close {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 6px;
}

.context-bar-close:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.08);
}

.context-bar-tail {
    position: absolute;
    bottom: -8px;
    left: 24px;
    width: 16px;
    height: 16px;
    background: var(--panel-bg);
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    transform: rotate(45deg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

/* Bar was flipped below the tap point (not enough room above) — move the
   tail to the top edge so it still points at the building. */
#building-context-bar.flip-below .context-bar-tail {
    top: -8px;
    bottom: auto;
    border-right: none;
    border-bottom: none;
    border-left: 1px solid var(--border);
    border-top: 1px solid var(--border);
}

header h1 {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--gold);
    text-shadow: 0 0 10px rgba(255, 204, 0, 0.3);
}

.location-tag {
    font-size: 0.55rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* Tabs */
.panel-tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

.tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    padding: 10px;
    color: var(--text-secondary);
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 0.7rem;
    cursor: pointer;
    transition: all 0.2s;
    border-bottom: 2px solid transparent;
}

.tab-btn.active {
    color: var(--cyan);
    border-bottom: 2px solid var(--cyan);
}

.tab-content {
    display: none;
    overflow-y: auto;
    padding-right: 5px;
}

.tab-content.active {
    display: block;
}

/* Resources */
.resource-bar {
    display: grid;
    grid-template-columns: repeat(6, 1fr); /* 6 units for flexible 3-item / 2-item rows */
    gap: 8px;
}

.resource {
    background: rgba(0, 0, 0, 0.3);
    padding: 12px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    min-height: 70px; /* Assured height for all content */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.2);
}

#gold-stat { grid-column: span 2; }
#pop-stat { grid-column: span 2; }
#discontent-stat { grid-column: span 2; }
#health-stat { grid-column: span 3; }
#research-stat { grid-column: span 3; }

.resource .label {
    font-size: 0.65rem; /* Larger font */
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.resource .value {
    font-size: 0.85rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums; /* STOP SHAKING */
    letter-spacing: -0.02em;
}

#gold-stat {
    cursor: help; /* Hints that hovering reveals the full income breakdown */
}

#gold-stat .value { color: var(--gold); }
#pop-stat .value { color: #ff9f1c; }
#discontent-stat .value { color: #ff4d4d; }
#health-stat .value { color: #00ff88; }
#research-stat .value { color: var(--cyan); }

.status-grid .resource {
    padding: 8px;
}

.crisis-panel {
    background: rgba(0, 0, 0, 0.2);
    padding: 12px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Research Cards */
#research-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 20px;
}

.research-card {
    background: rgba(255, 255, 255, 0.05);
    padding: 12px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    transition: 0.3s;
}

.research-card.unlocked {
    border-color: #00ff88;
    background: rgba(0, 255, 136, 0.05);
}

.research-card h4 {
    font-size: 0.8rem;
    margin-bottom: 5px;
    color: white;
}

.research-card p {
    font-size: 0.65rem;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.research-card .footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.research-card .cost {
    font-size: 0.7rem;
    font-weight: bold;
    color: var(--gold);
}
#production-stat .value { color: var(--acid-green); }
#maintenance-stat .value { color: #ff8e8e; }

.status-grid .resource {
    padding: 8px;
}

.energy-panel {
    background: rgba(0, 0, 0, 0.2);
    padding: 10px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

#energy-bar.overload {
    background: repeating-linear-gradient(
        45deg,
        #ff4d4d,
        #ff4d4d 10px,
        #ffcc00 10px,
        #ffcc00 20px
    );
    animation: flicker 0.2s infinite;
}


@keyframes flicker {
    0% { opacity: 0.8; }
    50% { opacity: 1; }
    100% { opacity: 0.8; }
}

#building-actions .btn-repair {
    width: 100%;
    background: #ffcc00;
    color: #000;
    font-weight: 700;
    animation: pulse-border 1s infinite;
}

@keyframes pulse-border {
    0% { box-shadow: 0 0 0 0 rgba(255, 204, 0, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(255, 204, 0, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 204, 0, 0); }
}

#building-actions .btn-demolish {
    width: 100%;
    background: #4a1d1d;
    color: #ff4d4d;
    border: 1px solid #ff4d4d;
    font-weight: 700;
    margin-top: 5px;
}

#building-actions .btn-demolish:hover {
    background: #ff4d4d;
    color: #000;
    box-shadow: 0 0 15px rgba(255, 77, 77, 0.4);
}

/* Building Info */
#selected-building {
    padding: 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    border-left: 3px solid var(--cyan);
    margin-bottom: 15px;
}

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

.building-header h4 {
    font-size: 0.8rem;
    color: var(--text-primary);
}

.status-tag {
    font-size: 0.55rem;
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
}

.status-tag.claimed {
    color: var(--cyan);
    background: rgba(0, 243, 255, 0.1);
}

.building-stats {
    font-size: 0.7rem;
    color: var(--text-secondary);
}

/* Action Menu */
.button-group {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-top: 20px;
}

/* Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  transition: all 0.3s;
}

.modal.hidden {
  opacity: 0;
  pointer-events: none;
}

.modal-content {
  background: #1a1a2e;
  padding: 30px;
  border: 2px solid var(--cyan);
  border-radius: 12px;
  width: 90%;
  max-width: 500px;
  box-shadow: 0 0 30px rgba(0, 243, 255, 0.3);
}

.modal-content h2 {
  color: var(--cyan);
  margin-bottom: 25px;
  text-align: center;
  letter-spacing: 2px;
}

.modal-section {
  margin-bottom: 20px;
}

.modal-section label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
  letter-spacing: 1px;
}

.modal-section select {
  width: 100%;
  padding: 12px;
  background: #0f3460;
  border: 1px solid #16213e;
  color: #fff;
  border-radius: 6px;
  outline: none;
}

.tier-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.tier-btn {
  background: #0f3460;
  border: 1px solid #16213e;
  padding: 10px;
  color: #fff;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.tier-btn.active {
  border-color: var(--acid-green);
  background: rgba(57, 255, 20, 0.1);
  box-shadow: 0 0 10px rgba(57, 255, 20, 0.2);
}

.location-picker-status {
  background: rgba(0,0,0,0.3);
  padding: 15px;
  text-align: center;
  border-radius: 6px;
  font-size: 0.9rem;
  color: var(--gold);
  border: 1px dashed var(--gold);
  margin-top: 20px;
}

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 30px;
}

.modal-actions .btn {
  flex: 1;
}

/* Event Cards */
.event-card {
  background: rgba(255,255,255,0.05);
  border-left: 4px solid var(--purple);
  padding: 15px;
  margin-bottom: 12px;
  border-radius: 6px;
}

.event-card .header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
}

.event-card .name {
  font-weight: bold;
}

.event-card .tier {
  font-size: 0.7rem;
  background: #333;
  padding: 2px 6px;
  border-radius: 4px;
}

.event-card .revenue {
  font-family: 'monospace';
  color: var(--gold);
}

.event-completion-notification {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 300px;
  padding: 20px;
  border: 2px solid var(--acid-green);
  z-index: 10001;
  animation: slideInRight 0.5s ease-out;
}

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.btn {
    width: 100%;
    padding: 10px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.2s;
    text-transform: uppercase;
}

.btn-primary { background: var(--cyan); color: #000; }
.btn-primary:hover:not(:disabled) { box-shadow: 0 0 15px var(--cyan); transform: translateY(-1px); }

.btn-secondary { background: var(--purple); color: #fff; }
.btn-secondary:hover:not(:disabled) { box-shadow: 0 0 15px var(--purple); transform: translateY(-1px); }

.btn:disabled { opacity: 0.3; cursor: not-allowed; filter: grayscale(1); }

/* Tech Grid */
.tech-tier { margin-bottom: 20px; }
.tech-tier h3 {
    font-size: 0.7rem; color: var(--acid-green); margin-bottom: 10px;
    border-bottom: 1px solid rgba(57, 255, 20, 0.2); padding-bottom: 4px;
}

.tech-grid { display: flex; flex-direction: column; gap: 8px; }

.tech-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 10px;
    transition: 0.2s;
}

.tech-card.unlocked { border-color: var(--acid-green); background: rgba(57, 255, 20, 0.03); }
.tech-card.available:hover { border-color: var(--cyan); }

.tech-header { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; }
.tech-icon { font-size: 1.2rem; }
.tech-header h4 { font-size: 0.75rem; }
.tech-desc { font-size: 0.6rem; color: var(--text-secondary); margin-bottom: 8px; }

.tech-footer { display: flex; justify-content: space-between; align-items: center; }
.tech-costs { font-size: 0.6rem; color: var(--gold); display: flex; gap: 8px; }

.unlock-btn { padding: 4px 8px; font-size: 0.6rem; }
.status-label { font-size: 0.6rem; font-weight: 700; color: var(--acid-green); }

/* Log Panel */
.log-panel {
    height: 100px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 8px;
    padding: 8px;
    font-family: monospace;
    font-size: 0.65rem;
    overflow-y: auto;
}

.log-entry { margin-bottom: 2px; }
.log-entry.system { color: var(--gold); }
.log-entry.build { color: var(--cyan); }

/* Scan Line */
#scan-line {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: rgba(0, 243, 255, 0.05);
    z-index: 1000;
    pointer-events: none;
    animation: scan 10s linear infinite;
}

@keyframes scan {
    from { top: -3px; }
    to { top: 100%; }
}

/* Leaflet UI Overrides */
.leaflet-container { background: var(--bg-color) !important; }
.leaflet-control-zoom { border: none !important; margin-right: 20px !important; margin-bottom: 20px !important; }
.leaflet-bar { box-shadow: none !important; border: 1px solid var(--border) !important; }
.leaflet-bar a { background: var(--panel-bg) !important; color: var(--cyan) !important; border-bottom: 1px solid var(--border) !important; }

/* UTILITY CLASSES (replacing inline styles) */
.hidden { display: none !important; }

#crisis-alert {
    position: absolute;
    top: 100px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    background: rgba(255, 0, 0, 0.9);
    padding: 20px;
    border: 4px solid white;
    border-radius: 12px;
    color: white;
    text-align: center;
    box-shadow: 0 0 50px rgba(255, 0, 0, 0.5);
    pointer-events: none;
}

#crisis-alert h2 { margin: 0; color: white; }
#crisis-alert p { margin: 10px 0 0; font-weight: bold; }

.status-grid-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 10px;
}

.energy-row-container { margin-bottom: 10px; }
.progress-label-flex {
    font-size: 0.6rem;
    color: var(--text-secondary);
    margin-bottom: 5px;
    display: flex;
    justify-content: space-between;
}

.progress-track {
    background: rgba(0,0,0,0.4);
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    transition: width 0.3s, background 0.3s;
}

.mt-15 { margin-top: 15px; }
.mb-10 { margin-bottom: 10px; }
.mb-20 { margin-bottom: 20px; }
.w-full { width: 100%; }

.protest-panel {
    background: rgba(255, 77, 77, 0.1);
    border: 1px solid #ff4d4d;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.protest-panel p {
    color: #ff4d4d;
    font-weight: bold;
    font-size: 0.8rem;
    margin-bottom: 10px;
}

#tax-break-btn {
    background: #ffcc00;
    color: #000;
}

.emergency-bailout { margin-bottom: 20px; }
#bailout-btn { background: #bd00ff; color: white; }

.bailout-warning {
    font-size: 0.6rem;
    color: #ff4d4d;
    text-align: center;
    margin-top: 5px;
}

.danger-zone {
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: 8px;
}

.danger-header {
    color: #ff4d4d;
    font-weight: bold;
    margin-bottom: 10px;
}

#reset-game-btn { background: #ff4d4d; color: white; }
#quit-game-btn { background: #444; color: white; }

/* Splash Screen & Fullscreen Layout */
#splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: var(--bg-color);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20000;
}

.splash-content {
    text-align: center;
    animation: fadeIn 1s ease-out;
}

.splash-loading {
    text-align: center;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(0, 243, 255, 0.1);
    border-top: 4px solid var(--cyan);
    border-radius: 50%;
    margin: 0 auto 20px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* CONTRACTS */
.contract-card {
    background: rgba(26, 26, 46, 0.95);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    animation: slideInRight 0.4s ease-out;
}

@keyframes slideInRight {
    from { transform: translateX(100px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.contract-card button {
    font-family: 'Outfit', sans-serif;
    font-size: 0.7rem;
    font-weight: 600;
}

/* SPECIALIZATION */
#spec-options .btn {
    text-align: left;
    margin-bottom: 10px;
    height: auto !important;
}

#spec-options .btn strong {
    display: block;
    color: var(--cyan);
    font-size: 1rem;
}

#spec-options .btn small {
    font-weight: 300;
    opacity: 0.8;
}

/* TAX PANEL */
.tax-panel {
    background: rgba(255, 255, 255, 0.03);
    padding: 12px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

#tax-slider {
    accent-color: var(--cyan);
    height: 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.1);
    outline: none;
}

/* --- OBJECTIVE BANNER (milestones / onboarding) --- */
#objective-banner {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 10px 12px;
    margin-bottom: 12px;
    border: 1px solid var(--gold);
    border-left: 4px solid var(--gold);
    border-radius: 6px;
    background: rgba(255, 204, 0, 0.06);
}

#objective-banner .objective-title {
    color: var(--gold);
    font-weight: 700;
    font-size: 0.8rem;
    letter-spacing: 1px;
}

#objective-banner .objective-hint {
    color: var(--text-secondary, #8b949e);
    font-size: 0.72rem;
    line-height: 1.35;
}

#city-needs-banner {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 10px 12px;
    margin-bottom: 12px;
    border: 1px solid #ff9f1c;
    border-left: 4px solid #ff9f1c;
    border-radius: 6px;
    background: rgba(255, 159, 28, 0.08);
}

#city-needs-banner .need-title {
    color: #ff9f1c;
    font-weight: 700;
    font-size: 0.8rem;
    letter-spacing: 1px;
}

#city-needs-banner .need-hint {
    color: var(--text-secondary, #8b949e);
    font-size: 0.72rem;
    line-height: 1.35;
}

/* --- POI / PARTNERSHIP UI --- */
.poi-build-header {
    padding: 8px 10px;
    margin-bottom: 8px;
    border: 1px dashed var(--gold);
    border-radius: 6px;
    color: var(--gold);
    font-size: 0.75rem;
    font-weight: 600;
}

.free-starter-hint {
    padding: 8px 10px;
    margin-bottom: 8px;
    border: 1px dashed var(--acid-green);
    border-radius: 6px;
    color: var(--acid-green);
    font-size: 0.72rem;
    font-weight: 600;
}

/* --- DISTRICTS (CITY tab) --- */
.district-card {
    padding: 10px 12px;
    margin-bottom: 8px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-left: 3px solid var(--cyan);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.03);
}

.district-card.done {
    border-left-color: var(--gold);
    background: rgba(255, 204, 0, 0.05);
}

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

.district-name {
    font-weight: 700;
    font-size: 0.78rem;
    letter-spacing: 0.5px;
}

.district-bonus {
    color: var(--gold);
    font-weight: 700;
    font-size: 0.75rem;
}

.district-progress {
    font-size: 0.68rem;
    color: var(--text-secondary, #8b949e);
    margin: 4px 0;
}

.district-story {
    font-size: 0.68rem;
    color: var(--text-secondary, #8b949e);
    font-style: italic;
    line-height: 1.35;
}

#daily-bonus-info {
    font-size: 0.72rem;
    color: var(--gold);
}

/* Βήμα 9 dedup (2026-09-07 code review): shared dark-glass chip recipe for map-chrome badges —
   .district-label-pill, .quest-marker-badge and .weather-badge all used their own hand-copied
   version of this (and had already drifted: blur 4/4/10px, alpha .8/.85/.85, border 1/1.5/1px).
   Edit the look once here; each specific class below only overrides shape/color/size. */
.district-label-pill,
.quest-marker-badge,
.weather-badge {
    background: rgba(13, 17, 23, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

/* District name labels on the map */
.district-label {
    pointer-events: none;
    white-space: nowrap;
    text-align: center;
}

.district-label .district-label-pill {
    display: inline-block;
    padding: 3px 10px;
    border-color: rgba(0, 243, 255, 0.3);
    border-radius: 20px;
    color: rgba(0, 243, 255, 0.85);
    font-family: 'Outfit', sans-serif;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.district-label.done .district-label-pill {
    border-color: rgba(255, 204, 0, 0.35);
    color: rgba(255, 204, 0, 0.9);
}

/* --- SPONSORS (Phase 3 pilot) --- */
.sponsor-card {
    padding: 10px 12px;
    margin-bottom: 8px;
    border: 1px solid rgba(255, 204, 0, 0.35);
    border-left: 3px solid var(--gold);
    border-radius: 6px;
    background: rgba(255, 204, 0, 0.04);
}

.sponsor-card.done {
    border-color: rgba(57, 255, 20, 0.4);
    border-left-color: #39ff14;
    background: rgba(57, 255, 20, 0.05);
}

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

.sponsor-name { font-weight: 700; font-size: 0.78rem; letter-spacing: 0.5px; }

.sponsor-demo-badge {
    font-size: 0.6rem;
    font-weight: 700;
    color: #ff9f1c;
    border: 1px solid #ff9f1c;
    border-radius: 4px;
    padding: 1px 5px;
}

.sponsor-category { font-size: 0.65rem; color: var(--text-secondary, #8b949e); margin: 2px 0; }
.sponsor-offer { font-size: 0.72rem; color: var(--gold); margin: 4px 0; }
.sponsor-quest { font-size: 0.68rem; color: var(--text-secondary, #8b949e); line-height: 1.4; }

.sponsor-coupon {
    margin-top: 6px;
    padding: 8px;
    border: 1px dashed #39ff14;
    border-radius: 6px;
    font-size: 0.72rem;
    color: #39ff14;
    letter-spacing: 1px;
}

.sponsor-marker {
    text-align: center;
    animation: sponsor-pulse 2s ease-in-out infinite;
}

/* Βήμα 9 — quest marker badge: shared dark-glass recipe above, circular for a single glyph.
   border-color/box-shadow are set inline per-marker (sponsor.brandColor or gold fallback). */
.quest-marker-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    font-size: 15px;
}

@keyframes sponsor-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

/* --- BANK PANEL (SYSTEM tab) --- */
.loan-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    margin-bottom: 6px;
    border: 1px solid rgba(255, 77, 77, 0.4);
    border-left: 3px solid #ff4d4d;
    border-radius: 6px;
    background: rgba(255, 77, 77, 0.05);
    font-size: 0.72rem;
}

.loan-remaining { color: var(--text-secondary, #8b949e); font-size: 0.68rem; }
.loan-repay-btn { padding: 5px 10px; font-size: 0.65rem; flex-shrink: 0; }

#seizure-warning {
    margin-top: 6px;
    padding: 8px;
    border: 1px solid #ff4d4d;
    border-radius: 6px;
    color: #ff4d4d;
    font-size: 0.72rem;
    font-weight: 700;
    animation: sponsor-pulse 1s ease-in-out infinite;
}

#objective-banner .objective-weekly {
    color: var(--cyan);
    font-size: 0.68rem;
    margin-top: 3px;
    padding-top: 4px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

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

.panel-toggle-row {
    display: flex;
    justify-content: flex-end;
}

#panel-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    font-size: 1rem;
    flex: 0 0 32px;
}

#ui-panel.collapsed {
    max-height: 60px;
    overflow: hidden;
}

@media (max-width: 600px) {
    #ui-panel {
        width: calc(100vw - 40px);
        left: 20px;
        top: 20px;
        max-height: 60vh;
    }
    
    #ui-panel.collapsed {
        max-height: 60px;
        overflow: hidden;
    }
    
    .tab-btn {
        min-height: 44px;
    }
    
    #panel-toggle-btn {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Small screens: the sidebar already covers most of the width, so a
       bubble anchored to the tapped building has nowhere good to sit —
       dock it as a bottom sheet instead (JS skips inline top/left here). */
    #building-context-bar {
        left: 20px !important;
        right: 20px;
        top: auto !important;
        bottom: 20px;
        width: auto;
        max-height: 45vh;
    }

    .context-bar-tail {
        display: none;
    }

    #top-hud {
        flex-wrap: wrap;
        height: auto;
        padding: 8px;
    }

    #top-hud .resource-bar {
        order: 3;
        flex-basis: 100%;
        overflow-x: auto;
    }

    #side-nav {
        flex-direction: row;
        padding: 4px;
    }

    #game-container {
        grid-template-rows: auto 56px 1fr;
        grid-template-areas:
            "hud  hud"
            "nav  nav"
            "main main";
    }
}

/* Real-Weather Layer Styles */
.weather-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 400;
    transition: background-color 1s ease, backdrop-filter 1s ease;
}

.weather-overlay.weather-night {
    background-color: rgba(10, 15, 30, 0.25);
}

.weather-overlay.weather-cloudy {
    backdrop-filter: contrast(0.9) brightness(0.95);
}

.weather-overlay.weather-fog {
    background-color: rgba(200, 210, 220, 0.15);
    backdrop-filter: blur(1px);
}

.weather-overlay.weather-rain {
    background-color: rgba(15, 35, 60, 0.2);
}

.weather-overlay.weather-snow {
    background-color: rgba(230, 240, 255, 0.15);
}

.weather-overlay.weather-thunderstorm {
    background-color: rgba(25, 10, 35, 0.3);
}

.weather-badge {
    flex-shrink: 0;
    color: var(--text-primary, #f0f6fc);
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    gap: 6px;
    pointer-events: none;
}

.weather-badge .weather-icon {
    font-size: 1.1rem;
}

#delivery-panel {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 320px;
    z-index: 150;
    padding: 0;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-6px) scale(0.98);
    transition: opacity 0.15s ease-out, transform 0.15s ease-out;
}

#delivery-panel.visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

.delivery-brand-stripe {
    height: 5px;
    background: linear-gradient(90deg, var(--delivery-accent, var(--gold)), var(--delivery-accent-2, var(--gold)));
}

.delivery-panel-body {
    padding: 16px 18px 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.delivery-monogram {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--delivery-accent, var(--gold));
    color: #fff;
    font-weight: 700;
    font-size: 1.05rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.delivery-brand-name { color: var(--delivery-accent, var(--gold)); }
.delivery-route-fee { color: var(--delivery-accent, var(--gold)); }

