/* ==========================================================================
   RUG PATROL — feed.css
   The page around the game: the live stats bar, the town feed beside the
   stage, and the roster of traders under it.
   ========================================================================== */

/* the game section gets more width than the prose sections, so the stage
   keeps its size when the feed column sits beside it */
#game .wrap { max-width: 1440px; }

.gtick {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 18px;
  padding: 9px 14px;
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  font-family: var(--f-mono);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--txt-faint);
}
.gtick b { color: var(--txt); font-weight: 500; margin-left: 4px; }
.gtick b.hl-red { color: var(--red); }
.gtick b.hl-green { color: var(--green); }
.gtick__clock { margin-left: auto; color: var(--txt-dim); }
.gtick__status {
  padding: 3px 9px;
  border-radius: 99px;
  border: 1px solid var(--line);
  font-family: var(--f-pixel);
  font-size: 9.5px;
  color: var(--txt-dim);
}
.gtick__status.is-hunting { color: var(--amber); border-color: var(--amber-dim); }
.gtick__status.is-chase   { color: var(--red); border-color: var(--red-dim); }
.gtick__status.is-caught  { color: var(--ice); border-color: #2A5670; }
.gtick__status.is-won     { color: var(--green); border-color: var(--green-dim); }
.gtick__status.is-lost    { color: var(--red); border-color: var(--red-dim); }

.game-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
}
/* A grid item's min-width defaults to its content, and an overlay panel's
   width counts as content — so a 680px menu inside the stage used to push
   the whole page wider than a phone. */
.game-main > * { min-width: 0; }
@media (min-width: 1100px) {
  .game-main { grid-template-columns: minmax(0, 1fr) 300px; }
  /* the feed never sets the row height — the stage does */
  .feed { height: 0; min-height: 100%; }
}

/* ---------------------------------------------------------------- feed */

.feed {
  display: flex;
  flex-direction: column;
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  min-height: 0;
}
@media (max-width: 1099px) { .feed { max-height: 340px; } }

.feed__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line-soft);
  font-family: var(--f-pixel);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.feed__count {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--f-mono);
  font-size: 11px;
  color: var(--txt-faint);
  text-transform: none;
  letter-spacing: 0;
}
.feed__count .dot { color: var(--green); }

.feed__list {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.feed__list:empty::before {
  content: "Nothing yet. Take the contract from Vlad and the town starts talking.";
  display: block;
  padding: 18px 14px;
  font-family: var(--f-mono);
  font-size: 12px;
  color: var(--txt-faint);
}

.post {
  display: flex;
  gap: 10px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line-soft);
  animation: post-in 0.35s var(--ease);
}
@keyframes post-in {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: none; }
}
.post__face {
  flex: none;
  image-rendering: pixelated;
  border-radius: 50%;
  background: var(--bg-3);
}
.post__body { min-width: 0; flex: 1; }
.post__text {
  margin: 0;
  font-family: var(--f-head);
  font-size: 13px;
  line-height: 1.45;
  color: var(--txt);
  overflow-wrap: anywhere;
}
.post__at {
  display: block;
  margin-top: 3px;
  font-family: var(--f-mono);
  font-size: 10.5px;
  color: var(--txt-faint);
}

/* X-style card, used only for the fictional caller */
.post--x { background: rgba(180, 120, 255, 0.04); }
.post__head {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 3px;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
}
.post__head b { color: var(--txt); }
.post__check {
  display: inline-grid;
  place-items: center;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #1D9BF0;
  color: #fff;
  font-size: 8px;
  font-weight: 700;
}
.post__handle {
  color: var(--txt-faint);
  font-family: var(--f-mono);
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.post__src { margin-left: auto; font-family: var(--f-pixel); font-size: 10px; color: var(--txt-dim); }
.post__ca {
  margin-top: 6px;
  display: inline-block;
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: 3px;
  font-family: var(--f-mono);
  font-size: 11px;
  color: var(--amber);
}
.post__stats {
  display: flex;
  gap: 14px;
  margin-top: 7px;
  font-family: var(--f-mono);
  font-size: 10.5px;
  color: var(--txt-faint);
}

/* Telegram mirror */
.post--tg {
  flex-direction: column;
  gap: 3px;
  border-left: 2px solid #2AABEE;
  background: rgba(42, 171, 238, 0.05);
}
.post__chan { font-family: var(--f-mono); font-size: 11px; color: var(--txt-faint); }
.post__chan b { color: #6FC8F2; font-weight: 500; }
.post--tg .post__text { font-family: var(--f-mono); font-size: 12px; }

/* trader events and system notices */
.post--trader.is-bad  { border-left: 2px solid var(--red); background: rgba(255, 77, 94, 0.05); }
.post--trader.is-good { border-left: 2px solid var(--green); }
.post--trader.is-warn { border-left: 2px solid var(--amber); }
.post--sys .post__text { font-family: var(--f-mono); font-size: 12px; color: var(--txt-dim); }
.post__dot {
  flex: none;
  width: 6px;
  height: 6px;
  margin-top: 6px;
  border-radius: 50%;
  background: var(--txt-faint);
}
.post--sys.is-good .post__dot { background: var(--green); }

/* --------------------------------------------------------------- roster */

.roster {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 8px;
}
.rc {
  display: grid;
  grid-template-columns: 30px 1fr auto;
  grid-template-areas: "face meta bag" "face state state";
  column-gap: 10px;
  row-gap: 2px;
  align-items: center;
  padding: 9px 12px;
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}
.rc__face { grid-area: face; image-rendering: pixelated; border-radius: 4px; background: var(--bg-3); }
.rc__meta { grid-area: meta; min-width: 0; line-height: 1.2; }
.rc__meta b { display: block; font-size: 13px; }
.rc__meta span { font-family: var(--f-mono); font-size: 10.5px; color: var(--txt-faint); }
.rc__bag { grid-area: bag; text-align: right; font-family: var(--f-mono); font-size: 12px; line-height: 1.2; }
.rc__val { display: block; color: var(--txt); }
.rc__chg { font-style: normal; font-size: 11px; color: var(--txt-faint); }
.rc__chg.up { color: var(--green); }
.rc__chg.down { color: var(--red); }
.rc__state {
  grid-area: state;
  font-family: var(--f-pixel);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--txt-faint);
}
.rc.is-aping { border-color: var(--amber-dim); }
.rc.is-aping .rc__state { color: var(--amber); }
.rc.is-rekt { border-color: var(--red-dim); background: rgba(255, 77, 94, 0.05); }
.rc.is-rekt .rc__state { color: var(--red); }
.rc.is-saved .rc__state,
.rc.is-pumped .rc__state { color: var(--green); }

.rc--add {
  display: grid;
  place-items: center;
  grid-template-columns: 1fr;
  grid-template-areas: none;
  min-height: 52px;
  border-style: dashed;
  font-family: var(--f-pixel);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--txt-dim);
  cursor: pointer;
}
.rc--add:hover { border-color: var(--green); color: var(--green); }
.rc--add[disabled] { opacity: 0.4; cursor: not-allowed; }

/* ---- add-victim list ---- */
.vic-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.vic-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px 4px 10px;
  border: 1px solid var(--line);
  border-radius: 99px;
  font-family: var(--f-mono);
  font-size: 12px;
}
.vic-chip i { font-style: normal; color: var(--txt-faint); }
.vic-chip button {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 0;
  background: var(--bg-3);
  color: var(--txt-dim);
  cursor: pointer;
  line-height: 1;
}
.vic-chip button:hover { background: var(--red-dim); color: #fff; }

/* ======================================================================
   ODDS board · agent guardrails · PnL card
   ====================================================================== */

.g-panel.mkt, .g-panel.agent-setup { width: min(640px, 100%); }
.g-panel p b { color: var(--txt); font-weight: 500; }

.mk-stakes {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 12px 0 14px;
  font-family: var(--f-pixel);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--txt-faint);
}
.mk-stakes span { margin-right: 4px; }

.mk {
  padding: 12px 14px;
  margin-bottom: 8px;
  background: var(--bg);
  border: 1px solid var(--line-soft);
  border-radius: 4px;
}
.mk.is-closed { opacity: 0.5; }
.mk__q { font-size: 14px; font-weight: 600; margin-bottom: 9px; }
.mk__q em { font-style: normal; font-family: var(--f-mono); font-size: 11px; color: var(--txt-faint); font-weight: 400; }
.mk__opts { display: flex; flex-wrap: wrap; gap: 6px; }
.mk__opt {
  display: grid;
  grid-template-columns: auto auto;
  grid-template-areas: "l p" "w w";
  gap: 1px 10px;
  align-items: baseline;
  padding: 7px 11px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--txt);
  font-family: var(--f-mono);
  font-size: 12px;
  cursor: pointer;
  transition: border-color 0.15s var(--ease), background 0.15s var(--ease);
}
.mk__opt span { grid-area: l; }
.mk__opt b { grid-area: p; font-weight: 500; color: #C9A0FF; }
.mk__opt i { grid-area: w; font-style: normal; font-size: 10.5px; color: var(--txt-faint); }
.mk__opt:hover { border-color: #B478FF; background: rgba(180, 120, 255, 0.1); }
.mk__opt[disabled] { cursor: not-allowed; }

.mk-pos { margin-top: 14px; }
.mk-pos__row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
  border-bottom: 1px solid var(--line-soft);
  font-family: var(--f-mono);
  font-size: 12px;
  color: var(--txt-dim);
}
.mk-pos__row em { font-style: normal; color: var(--txt-faint); }
.mk-pos__row.is-won em { color: var(--green); }
.mk-pos__row.is-lost em { color: var(--red); }

.ag-opts { display: grid; gap: 6px; }
.ag-opt {
  display: grid;
  gap: 3px;
  padding: 10px 12px;
  text-align: left;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--txt);
  cursor: pointer;
}
.ag-opt b { font-family: var(--f-head); font-size: 14px; }
.ag-opt span { font-family: var(--f-mono); font-size: 11.5px; color: var(--txt-faint); }
.ag-opt.is-sel { border-color: var(--green); background: rgba(0, 224, 90, 0.07); }
.agent-setup .cc__field { margin-top: 14px; }

/* ---- the end card ---- */
.g-over { width: min(760px, 100%); }
.pnl {
  margin: 16px 0 4px;
  aspect-ratio: 840 / 600;
  background: #05070B;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  display: grid;
  place-items: center;
}
.pnl img { width: 100%; height: 100%; display: block; }
.pnl__loading { font-family: var(--f-mono); font-size: 12px; color: var(--txt-faint); }
.pnl__share { margin-top: 12px; padding-top: 0; border-top: 0; }
