/* ═══════════════════════════════════════════════════════════
   v0.1 SCREENS AWAITING REBUILD
   Fight/Hood, Store, Properties, feed, overlays, combat modal, threat, Stats,
   level-up banner, toast, IAP, Crew, scrollbar, Map and enemy cards — from
   v0.1 unchanged. As each screen is rebuilt under DOM-107 its rules move out to
   css/screens/<name>.css and shrink this file. The job grid left with the
   ACTIVITIES screen (DOM-142); Spots stayed.

   Linked from index.html in this order; the cascade depends on it.
   ═══════════════════════════════════════════════════════════ */
/* ── FIGHT / HOOD ── */
.enemy-list { display: flex; flex-direction: column; gap: var(--gap-list); }
.enemy-card {
  background: var(--panel-fill);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  padding: 11px 13px;
  display: flex;
  align-items: center;
  gap: 12px;
  /* 58px portrait + a long action label leaves too little for the name on a
     390pt screen. Let the action drop to its own row rather than crush the
     info column; it stays right-anchored either way. */
  flex-wrap: wrap;
  row-gap: 10px;
}
/* opps: 58px circle, 1px control edge. Allies get 62px + a chrome ring. */
.enemy-avatar {
  width: 58px; height: 58px;
  border-radius: 50%;
  background: var(--well);
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border-ctrl);
  flex-shrink: 0;
  overflow: hidden;
}
/* keeps the name readable; forces the action to wrap before this crushes */
.enemy-info { flex: 1 1 130px; min-width: 0; }
.enemy-name { font-family: var(--display); font-size: 15px; letter-spacing: 1px; color: var(--text); }
.enemy-stats { display: flex; gap: 12px; font-size: 11px; color: var(--faint); margin-top: 3px; }
.enemy-stats .val { color: var(--text); }
.attack-btn {
  background: var(--control);
  border: 1px solid var(--border-red);
  color: var(--red);
  font-family: var(--display);
  font-size: 13px;
  letter-spacing: 1px;
  padding: 11px 20px;
  border-radius: var(--r-pill);
  cursor: pointer;
  transition: filter .16s;
  flex: 0 0 auto;
  margin-left: auto;
  align-self: center;
  white-space: nowrap;
}
.attack-btn:hover { filter: brightness(1.15); }

/* ── PROPERTIES ── */
/* Bank row (DOM-148) — what is sitting in the spots, and the one control that
   moves it into the wallet. Collecting lived on the ACTIVITIES screen until
   that screen was deleted; this is its replacement, on the screen it is about. */
.prop-bank {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-bottom: var(--gap-list);
  padding-bottom: var(--gap-list);
  border-bottom: 1px solid var(--track);
}
.prop-bank-col { display: flex; flex-direction: column; gap: 3px; }
.prop-bank-k {
  font-family: var(--ui); font-weight: 500; font-size: 10px;
  letter-spacing: 2px; text-transform: uppercase; color: var(--text-label);
}
.prop-bank-v {
  font-family: var(--display); font-size: 20px; letter-spacing: 1px;
  line-height: 1; color: var(--gold);
}
.prop-collect-btn {
  flex: none;
  font-family: var(--display); font-size: 13px; letter-spacing: 1.5px;
  padding: 11px 20px; border-radius: var(--r-pill);
  background: var(--gold-chrome); border: none; color: var(--ink);
  cursor: pointer; transition: filter .16s;
}
.prop-collect-btn:hover:not(:disabled) { filter: brightness(1.06); }
.prop-collect-btn:disabled {
  background: var(--bg-disabled);
  border: 1px solid var(--border-disabled);
  color: var(--text-disabled);
  cursor: not-allowed;
}
.prop-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--gap-list);
}
.prop-card {
  background: var(--panel-fill);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  padding: 12px;
  display: flex;
  flex-direction: column;
}
.prop-name { font-family: var(--display); font-size: 14px; letter-spacing: 1px; color: var(--text); }
.prop-income { color: var(--green); font-size: 12px; margin: 4px 0 6px; font-family: var(--ui); font-weight: 500; }
.prop-owned { color: var(--chrome); font-size: 12px; margin-bottom: 10px; }
.prop-btn {
  width: 100%;
  margin-top: auto;
  background: var(--control);
  border: 1px solid var(--border-ctrl);
  color: var(--text);
  font-family: var(--display);
  font-size: 12px;
  letter-spacing: 1px;
  padding: 10px;
  border-radius: var(--r-pill);
  cursor: pointer;
  transition: filter .16s;
}
.prop-btn:hover { border-color: var(--border-gold); }
.prop-btn:disabled {
  background: var(--chip-locked-bg);
  border: 1px solid var(--chip-locked-border);
  color: var(--disabled);
  cursor: not-allowed;
  filter: none;
}

/* ── FEED ──
   Two lines, no panel and no border. Newest at --muted with a 4px dot
   in the outcome colour; older lines drop to --ghost.
   The dot carries the colour — the text never does. */
#feed {
  max-height: 132px;
  overflow-y: auto;
  font-family: var(--ui);
  font-size: 11px;
  line-height: 1.5;
  margin-bottom: 16px;
  scrollbar-width: none;
}
#feed::-webkit-scrollbar { width: 0; }
.feed-line {
  display: flex; align-items: baseline; gap: 8px;
  padding: 3px 0;
  color: var(--ghost);
}
.feed-line::before {
  content: '';
  flex: none;
  width: 4px; height: 4px; border-radius: 50%;
  background: var(--ghost);
}
.feed-line:first-child { color: var(--muted); }
.feed-line:first-child.win::before   { background: var(--green); }
.feed-line:first-child.loss::before  { background: var(--red); }
.feed-line:first-child.info::before  { background: var(--muted); }
.feed-line:first-child.gold::before  { background: var(--chrome); }

/* ── OVERLAYS ──
   Backdrop rgba(6,6,8,.72), the screen behind at blur(3px) / opacity .3.
   Combat centres; the plug dialog rises from the bottom edge. */
.overlay {
  display: none;
  position: absolute; inset: 0;
  background: rgba(6,6,8,.72);
  backdrop-filter: blur(3px);
  z-index: 200;
  align-items: center;
  justify-content: center;
}
.overlay.open { display: flex; }

/* ── COMBAT MODAL ── */
.combat-box {
  background: var(--panel-fill);
  border: 1px solid var(--border-gold);
  border-radius: 24px;
  box-shadow: var(--modal-shadow);
  padding: 24px;
  width: 360px;
  text-align: center;
}
.combat-title {
  font-family: var(--display);
  font-size: 22px;
  letter-spacing: 1px;
  background: linear-gradient(135deg,#f3e0b4,#e8c98a 45%,#a8873f);
  -webkit-background-clip: text;
          background-clip: text;
  color: transparent;
  margin-bottom: 16px;
}
.vs-row {
  display: flex;
  justify-content: space-around;
  align-items: center;
  margin-bottom: 20px;
}
.fighter { text-align: center; }
.fighter-name { font-family: var(--display); letter-spacing: 1px; font-size: 14px; color: var(--text); }
.hp-bar {
  width: 100px; height: 7px; background: var(--track);
  border-radius: var(--r-pill); overflow: hidden; margin: 6px auto 0;
}
.hp-fill { height: 100%; background: var(--green); border-radius: var(--r-pill); transition: width .4s; }
.hp-fill.enemy-hp { background: var(--red); }
.vs-text { font-family: var(--display); font-size: 18px; color: var(--ghost); letter-spacing: 1px; }

/* The sparkline well — the one place the round history is drawn. Replaces
   both the monospace log and the separate #sim-canvas-wrap that grew up
   beside it. chrome line = you, --red = opp. Renderer: js/combat.js. */
.combat-log {
  position: relative;
  background: var(--well);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  padding: 10px;
  height: 74px;
  overflow: hidden;
  margin-bottom: 16px;
}
/* no display declaration above, so the UA [hidden] rule still wins — but
   state this explicitly so adding one later can't silently un-hide the well */
.combat-log[hidden] { display: none; }

.combat-spark { display: block; width: 100%; height: 100%; }
.combat-spark .you { fill: none; stroke: var(--chrome); stroke-width: 1.5; }
.combat-spark .opp { fill: none; stroke: var(--red); stroke-width: 1.5; }
.combat-spark-mid { stroke: var(--border-ctrl); stroke-width: 1; stroke-dasharray: 3 4; }
.combat-spark-dot { stroke: none; }
.combat-spark-dot.you { fill: var(--chrome); }
.combat-spark-dot.opp { fill: var(--red); }

.combat-spark-result {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--display); font-size: 34px; letter-spacing: 2px;
  opacity: 0; transition: opacity .4s;
  pointer-events: none;
}
.combat-spark-result.show { opacity: 1; }
.combat-spark-result.win  { color: var(--green); }
.combat-spark-result.loss { color: var(--red); }

.combat-result {
  font-family: var(--display);
  font-size: 18px;
  letter-spacing: 1px;
  color: var(--text);
  margin-bottom: 12px;
}
/* RUN — the secondary action beside the hostile HIT 'EM (DOM-72). One region,
   one hostile primary; the escape hatch stays quiet. */
.run-btn {
  width: 100%;
  margin-top: 8px;
  background: var(--control);
  border: 1px solid var(--border-ctrl);
  color: var(--text);
  font-family: var(--display);
  font-size: 12px;
  letter-spacing: 1px;
  padding: 10px;
  border-radius: var(--r-pill);
  cursor: pointer;
  transition: filter .16s;
}
.run-btn:hover { border-color: var(--border-gold); }
.run-btn:disabled, .attack-btn:disabled {
  background: var(--chip-locked-bg);
  border: 1px solid var(--chip-locked-border);
  color: var(--disabled);
  cursor: not-allowed;
}

/* THE HOSPITAL (DOM-72/DOM-76). No longer a card on a screen: it is app chrome
   above every tab (DOM-142), so the lockout is visible wherever the player is.
   Placement lives with the shell in css/10-chrome.css; these are its internals. */
.hospital-body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.hospital-status { font-family: var(--ui); font-size: 13px; color: var(--body); }
.hospital-timer { font-family: var(--ui); font-weight: 700; color: var(--green); }
.hospital-heal-btn {
  background: var(--control);
  border: 1px solid var(--border-ctrl);
  color: var(--text);
  font-family: var(--display);
  font-size: 12px;
  letter-spacing: 1px;
  padding: 10px 16px;
  border-radius: var(--r-pill);
  cursor: pointer;
  white-space: nowrap;
  transition: filter .16s;
}
.hospital-heal-btn:hover { border-color: var(--border-gold); }
.hospital-heal-btn:disabled {
  background: var(--chip-locked-bg);
  border: 1px solid var(--chip-locked-border);
  color: var(--disabled);
  cursor: not-allowed;
}

/* The Hospital's premium exit (DOM-76) — secondary pill with the gold edge;
   the Cash heal keeps the card's action slot, this sits beside it. */
.hospital-iap-btn {
  background: var(--control);
  border: 1px solid var(--border-gold);
  color: var(--chrome);
  font-family: var(--display);
  font-size: 12px;
  letter-spacing: 1px;
  padding: 10px 16px;
  border-radius: var(--r-pill);
  cursor: pointer;
}
.hospital-iap-btn:hover { border-color: var(--chrome); }

/* Offer sheet (DOM-76) — raised at the out-of-Stamina / out-of-Moves gates. */
.offer-box {
  background: var(--panel-fill);
  border: 1px solid var(--border-gold);
  border-radius: 24px;
  box-shadow: var(--modal-shadow);
  padding: 24px;
  width: 320px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.offer-title {
  font-family: var(--display);
  font-size: 22px;
  letter-spacing: 2px;
  color: var(--text);
}
.offer-desc {
  font-family: var(--ui);
  font-size: 14px;
  line-height: 1.5;
  color: var(--body);
}
.offer-buy-btn {
  background: var(--chrome-fill);
  border: none;
  color: var(--chrome-ink);
  font-family: var(--display);
  font-size: 13px;
  letter-spacing: 1px;
  padding: 12px 16px;
  border-radius: var(--r-pill);
  cursor: pointer;
}
.offer-dismiss-btn {
  background: var(--control);
  border: 1px solid var(--border-ctrl);
  color: var(--muted);
  font-family: var(--display);
  font-size: 12px;
  letter-spacing: 1px;
  padding: 10px 16px;
  border-radius: var(--r-pill);
  cursor: pointer;
}

.close-combat {
  background: var(--chrome-fill);
  border: none;
  color: var(--chrome-ink);
  font-family: var(--display);
  font-size: 13px;
  letter-spacing: 1px;
  padding: 11px 30px;
  border-radius: var(--r-pill);
  cursor: pointer;
  transition: filter .16s;
}
.close-combat:hover { filter: brightness(1.06); }

/* ── THREAT ──
   A rating out of 8, never animated. --red on --ghost. */
.threat-bar { font-family: var(--ui); font-size: 11px; letter-spacing: 0; }
.threat-on  { color: var(--red); }
.threat-off { color: var(--ghost); }
.threat-label {
  color: var(--faint); font-size: 10px; letter-spacing: 2px;
  text-transform: uppercase; margin-left: 5px;
}

/* ── STATS TAB ── */
.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap-list);
}
.stat-row {
  background: var(--panel-fill);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  padding: 12px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  /* space-between leaves nothing between the two children once the label runs
     long — INCOME/COLLECT measured a 0px gap. The gap floors it; the value is
     the half that must stay readable, so the label is the one that shrinks. */
  gap: 10px;
}
.stat-row .label { min-width: 0; }
.stat-row .val { flex: none; }
.stat-row .label {
  color: var(--faint); font-size: 10px; letter-spacing: 2px;
  text-transform: uppercase;
}
.stat-row .val { font-family: var(--ui); font-weight: 500; font-size: 14px; color: var(--text); }

/* gear chips in the stats inventory — was an inline blob carrying #161616
   and radius 4px; the icon it held is retired with the data field */
.gear-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--control);
  border: 1px solid var(--border-ctrl);
  border-radius: var(--r-pill);
  padding: 8px 14px;
  font-family: var(--ui);
  font-size: 13px;
  color: var(--text);
}

/* upgrade level on an owned item (DOM-88); prestige levels read the same,
   the label text carries the distinction */
.gear-level {
  font-size: 11px;
  color: var(--faint);
  letter-spacing: 1px;
}

/* peer action in a list of peer items — secondary per the contract */
.gear-upgrade-btn {
  background: var(--control);
  border: 1px solid var(--border-ctrl);
  color: var(--text);
  font-family: var(--display);
  font-size: 12px;
  letter-spacing: 1px;
  padding: 6px 12px;
  border-radius: var(--r-pill);
  cursor: pointer;
  transition: filter .16s;
}
.gear-upgrade-btn:hover { border-color: var(--border-gold); }
.gear-upgrade-btn:disabled {
  background: var(--chip-locked-bg);
  border: 1px solid var(--chip-locked-border);
  color: var(--disabled);
  cursor: not-allowed;
}

/* ── LEVEL UP BANNER ── */
.levelup-banner {
  display: none;
  position: absolute;
  top: 70px; left: 50%; transform: translateX(-50%);
  background: var(--panel-fill);
  border: 1px solid var(--border-gold);
  border-radius: var(--r-panel);
  padding: 14px 28px;
  z-index: 300;
  text-align: center;
  animation: slideDown 0.4s ease;
}
.levelup-banner.show { display: block; }
@keyframes slideDown { from { opacity: 0; top: 50px; } to { opacity: 1; top: 70px; } }
/* "chrome text" per the selector table = --chrome ink; the clipped gradient
   is reserved for the four sanctioned uses (DOM-99) */
.levelup-text {
  font-family: var(--display);
  font-size: 20px;
  letter-spacing: 2px;
  color: var(--chrome);
}

/* ── TOAST ── */
.toast {
  position: absolute;
  top: 64px;
  left: 50%;
  z-index: 90;
  transform: translateX(-50%) translateY(-10px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .28s ease, transform .28s ease;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  border-radius: var(--r-pill);
  background: var(--panel-fill);
  border: 1px solid var(--border-gold);
  font-family: var(--display);
  font-size: 12px;
  letter-spacing: 1px;
  color: var(--chrome);
  max-width: 360px;
  text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
/* No .toast.bad override: the contract defines exactly one toast style
   (--panel-fill + --border-gold + chrome text), and red is combat-only.
   Refusals read from the copy; the .bad class stays as a semantic marker
   only (DOM-98). */

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #2a2a34; border-radius: var(--r-pill); }

/* ── MAP TAB ──
   Map mode is handled by `.app.is-map` in the shell section above.
   The runtime palette lives in js/map.js — CSS cannot reach it (DOM-39). */
#tab-map { padding: 0; height: calc(100vh - 56px); display: none; }
#tab-map.active { display: flex; flex-direction: column; }
.map-outer,
#tab-map .map-outer {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  background: #17171c;
}
.map-controls {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.map-controls button {
  width: 36px;
  height: 36px;
  background: rgba(17,17,22,.9);
  border: 1px solid var(--border-ctrl);
  color: var(--text);
  font-family: var(--display);
  font-size: 14px;
  letter-spacing: 1px;
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color .16s;
}
.map-controls button:hover { border-color: var(--border-gold); }
.map-controls button.active-mode {
  background: var(--chrome-fill);
  color: var(--chrome-ink);
  border-color: transparent;
}
#map-zoom-chip {
  text-align: center;
  font-family: var(--ui);
  font-size: 10px;
  color: var(--faint);
  padding: 2px 0;
  letter-spacing: 2px;
}
.map-hint {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 18px 12px 10px;
  text-align: center;
  font-family: var(--ui);
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--ghost);
  pointer-events: none;
  /* was `white-space: nowrap` + a centering transform, which overflowed the
     402px frame and clipped both ends of the line */
  background: linear-gradient(0deg, rgba(0,0,0,0.55), rgba(0,0,0,0));
}

/* ── ENEMY / FIGHT CARDS ──
   Opps: 58px circle, 1px --border-ctrl edge, no filters. */
.enemy-portrait-wrap {
  width: 58px;
  height: 58px;
  flex-shrink: 0;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid var(--border-ctrl);
  background: var(--well);
  display: flex;
  align-items: center;
  justify-content: center;
}
.enemy-portrait {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}
.enemy-role {
  font-size: 10px; color: var(--faint); letter-spacing: 2px;
  text-transform: uppercase; margin-top: 1px;
}
.enemy-reward { font-size: 11px; color: var(--faint); margin-top: 2px; }
/* locked opps render at full contrast — the chip names the gate */
.enemy-locked {
  padding: 8px 14px;
  font-family: var(--display);
  font-size: 12px;
  letter-spacing: 1px;
  color: var(--disabled);
  background: var(--chip-locked-bg);
  border: 1px solid var(--chip-locked-border);
  border-radius: var(--r-pill);
  align-self: center;
  flex: 0 0 auto;
  margin-left: auto;
  white-space: nowrap;
}
