
/* ══════════════════════════════════════════════════════════════
   GEOSCAPE — Component Styles
   ══════════════════════════════════════════════════════════════ */

/* display:flex intentionally omitted — goTo() controls display via
   .screen { display:none } / .screen.active { display:flex }.
   Setting it here overrides that, keeping this screen always visible
   and intercepting pointer events on other screens. */
#screen-geoscape {
  flex-direction: column;
  height: 100%;
  background: #1a1a14;
  color: #c8b882;
  font-family: 'Share Tech Mono', 'Courier New', monospace;
}

/* ── Viewport fills all space above the bottom bar ──────────── */
.geo-viewport {
  flex: 1;
  position: relative;
  overflow: hidden;
  cursor: crosshair;
  background: #2a3020;
  min-height: 0; /* critical: lets flex child shrink below content size */
}

#geo-canvas {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  display: block;
}

.geo-entity-layer {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
}

/* ── Map controls — bottom-right of viewport, above bottom bar ─ */
.geo-map-controls {
  position: absolute;
  bottom: 8px;
  right: 10px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  z-index: 10;
}

.geo-coords {
  font-size: 10px;
  color: #7a9060;
  letter-spacing: 0.08em;
  background: rgba(0,0,0,0.55);
  padding: 2px 6px;
  border-radius: 2px;
  pointer-events: none;
}

.geo-map-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  background: rgba(14, 18, 10, 0.88);
  border: 1px solid #3a5028;
  color: #9ab870;
  font-family: inherit;
  font-size: 10px;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.geo-map-btn svg { flex-shrink: 0; }
.geo-map-btn:hover { background: rgba(40,58,24,0.92); border-color: #7aaa40; color: #c8e890; }
.geo-map-btn--secondary { opacity: 0.8; }

/* ── Bottom UI bar ───────────────────────────────────────────── */
.geo-bottom-ui {
  display: flex;
  height: 14vh;
  min-height: 110px;
  max-height: 160px;
  flex-shrink: 0;
  border-top: 1px solid #2a3018;
  background: #0f0f0a;
  overflow: hidden;
}

.geo-panel {
  display: flex;
  flex-direction: column;
  border-right: 1px solid #1e2210;
  overflow: hidden;
  flex-shrink: 0;
}
.geo-panel:last-child { border-right: none; }

/* Panel widths — proportional, not fixed */
.geo-panel--events         { width: 13%; min-width: 120px; }
.geo-panel--resources-left { width: 14%; min-width: 130px; }
.geo-panel--feed           { flex: 1;   min-width: 160px; }
.geo-panel--resources-right{ width: 14%; min-width: 130px; }
.geo-panel--tooltip        { width: 16%; min-width: 140px; }

.geo-panel-header {
  padding: 3px 8px;
  font-size: 9px;
  letter-spacing: 0.15em;
  color: #5a7040;
  background: #0d0f08;
  border-bottom: 1px solid #1a1e0e;
  text-transform: uppercase;
  flex-shrink: 0;
}

.geo-panel-body,
.geo-feed-body,
.geo-tooltip-body {
  flex: 1;
  padding: 5px 10px;
  overflow-y: auto;
  font-size: 10px;
  line-height: 1.5;
  scrollbar-width: thin;
  scrollbar-color: #2a3018 transparent;
}

.geo-event-empty,
.geo-feed-empty,
.geo-tooltip-empty {
  color: #3a4028;
  font-size: 9px;
  font-style: italic;
  padding-top: 2px;
}

/* ── Resource rows ───────────────────────────────────────────── */
.geo-resource-rows {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  padding: 6px 10px;
  height: 100%;
  box-sizing: border-box;
}

.geo-resource-row {
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: default;
}

.geo-res-label {
  width: 68px;
  font-size: 10px;
  color: #7a7058;
  letter-spacing: 0.03em;
  white-space: nowrap;
  flex-shrink: 0;
}

.geo-res-bar-wrap {
  flex: 1;
  height: 4px;
  background: #1e2210;
  border-radius: 1px;
  overflow: hidden;
  min-width: 30px;
}

.geo-res-bar {
  height: 100%;
  width: 50%;
  background: #4a7028;
  border-radius: 1px;
  transition: width 0.4s;
}
.geo-res-bar--medical    { background: #287050; }
.geo-res-bar--engineering{ background: #604020; }
.geo-res-bar--intel      { background: #284860; }
.geo-res-bar--morale     { background: #602848; }
.geo-res-bar--influence  { background: #583860; }

.geo-res-value {
  width: 40px;
  font-size: 10px;
  text-align: right;
  color: #a09060;
  flex-shrink: 0;
}

/* ── Threat bar ──────────────────────────────────────────────── */
.geo-threat-wrap {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-bottom: 1px solid #151808;
  background: #0d0f08;
  flex-shrink: 0;
}
.geo-threat-label {
  font-size: 9px;
  letter-spacing: 0.1em;
  color: #604020;
  white-space: nowrap;
  flex-shrink: 0;
}
.geo-threat-bar-wrap {
  flex: 1;
  height: 4px;
  background: #1e1608;
  border-radius: 1px;
  overflow: hidden;
  min-width: 20px;
}
.geo-threat-bar {
  height: 100%;
  background: #903818;
  border-radius: 1px;
  transition: width 0.4s;
}
.geo-threat-pct {
  font-size: 10px;
  color: #906030;
  width: 32px;
  text-align: right;
  flex-shrink: 0;
}

/* ── Feed entries ────────────────────────────────────────────── */
.geo-feed-entry {
  display: flex;
  gap: 6px;
  padding: 1px 0;
  border-bottom: 1px solid #171a0e;
  font-size: 10px;
  line-height: 1.5;
}
.geo-feed-time { color: #4a5830; white-space: nowrap; flex-shrink: 0; }
.geo-feed-text { color: #9a9060; }

/* ── Tooltip panel ───────────────────────────────────────────── */
.geo-tooltip-title { font-size: 10px; color: #c8b882; margin-bottom: 2px; }
.geo-tooltip-type  { font-size: 8px;  color: #5a7040; letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 3px; }
.geo-tooltip-desc  { font-size: 9px;  color: #8a8060; line-height: 1.4; }

/* ── Upcoming event rows ─────────────────────────────────────── */
.geo-event-row {
  display: flex;
  gap: 5px;
  padding: 1px 0;
  font-size: 10px;
  border-bottom: 1px solid #171a0e;
  line-height: 1.4;
}
.geo-event-turns { color: #7a9060; flex-shrink: 0; font-size: 9px; padding-top: 1px; }
.geo-event-label { color: #8a8060; }
