/* board.x4c.ru — the thin layer on top of the vendored panel stylesheet.
 *
 * Everything structural comes from assets/vendor/rustapp.css. This file only
 * covers the few surfaces that stylesheet has no rules for — the login screen,
 * our own modal, and the toast stack — plus a couple of sidebar bits our
 * markup arranges differently.
 *
 * Colours are taken from the vendor palette's own custom properties, so this
 * file stays in step with it instead of hardcoding a second set of greys.
 */

/* ---- login / error card ------------------------------------------------ */
.login-card {
  width: 100%;
  max-width: 380px;
  padding: 28px;
  border-radius: 12px;
  background: hsl(var(--twc-grey-950));
  border: 1px solid hsl(var(--twc-grey-850));
  text-align: center;
}
.login-brand {
  font-size: 20px;
  font-weight: 600;
  color: hsl(var(--twc-grey-50));
  margin-bottom: 8px;
}
.login-card p { margin: 0 0 20px; font-size: 14px; }
.login-btn { display: inline-flex; width: 100%; justify-content: center; }

/* ---- sidebar bits our markup arranges differently ---------------------- */
.navigation .footer-row {
  margin-top: auto;
  padding: 8px;
  border-top: 1px solid hsl(var(--twc-grey-850));
}
.navigation .logout-row .item-name { color: hsl(var(--twc-red-500)); }
.navigation .search.search-full { cursor: pointer; }

/* ---- modal ------------------------------------------------------------- */
.modal-bg {
  position: fixed; inset: 0; z-index: 60;
  display: none; align-items: center; justify-content: center; padding: 20px;
  background: rgba(0, 0, 0, .6);
  backdrop-filter: blur(4px);
}
.modal-bg.show { display: flex; }
.modal {
  width: 100%; max-width: 620px; max-height: 88vh; overflow: auto;
  padding: 22px; border-radius: 12px;
  background: hsl(var(--twc-grey-950));
  border: 1px solid hsl(var(--twc-grey-850));
}
.modal h2 { margin: 0 0 16px; font-size: 17px; font-weight: 600; color: hsl(var(--twc-grey-50)); }
.modal .field { margin-bottom: 14px; }
.modal .field label {
  display: block; margin-bottom: 6px;
  font-size: 12px; color: hsl(var(--twc-grey-500));
}
.modal .field input, .modal .field select, .modal .field textarea {
  width: 100%; height: 38px; padding: 0 10px;
  border-radius: 8px; font: inherit; outline: none;
  background: hsl(var(--twc-grey-1000));
  border: 1px solid hsl(var(--twc-grey-850));
  color: hsl(var(--twc-grey-50));
}
.modal .field textarea { height: auto; padding: 9px 10px; resize: vertical; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }

/* ---- toasts ------------------------------------------------------------ */
#toasts {
  position: fixed; right: 18px; bottom: 18px; z-index: 80;
  display: flex; flex-direction: column; gap: 8px;
  pointer-events: none;
}
.board-toast {
  min-width: 240px; padding: 12px 16px; border-radius: 10px;
  background: hsl(var(--twc-grey-900));
  border: 1px solid hsl(var(--twc-grey-800));
  color: hsl(var(--twc-grey-50));
  font-size: 13px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .45);
  animation: board-toast-in .18s ease;
}
.board-toast.ok  { border-left: 3px solid hsl(var(--twc-ra-online)); }
.board-toast.err { border-left: 3px solid hsl(var(--twc-red-500)); }
@keyframes board-toast-in { from { transform: translateX(16px); opacity: 0 } to { transform: none; opacity: 1 } }

/* ---- overview stat cards ----------------------------------------------- */
/* The vendor sheet has no KPI-tile class of its own, so these are built from
   its palette tokens to sit alongside its surfaces rather than beside them. */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
  padding: 16px;
}
.stat-card {
  padding: 16px 18px;
  border-radius: 10px;
  background: hsl(var(--twc-grey-950));
  border: 1px solid hsl(var(--twc-grey-850));
}

/* ---- blocks, charts ---------------------------------------------------- */
.panel-block {
  margin: 16px;
  padding: 16px 18px;
  border-radius: 10px;
  background: hsl(var(--twc-grey-950));
  border: 1px solid hsl(var(--twc-grey-850));
}
.block-title {
  margin: 0 0 12px;
  font-size: 13px; font-weight: 500;
  color: hsl(var(--twc-grey-400));
}
.split-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.split-2 .panel-block { margin: 16px; }

.chart { width: 100%; height: 200px; display: block; overflow: visible; }
.chart-legend { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 10px; }
.chart-key {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; color: hsl(var(--twc-grey-400));
}
.chart-key i { width: 9px; height: 9px; border-radius: 2px; display: inline-block; }

.bar-list { display: flex; flex-direction: column; gap: 8px; }
.bar-row { display: grid; grid-template-columns: 1fr 2fr auto; gap: 10px; align-items: center; }
.bar-label { font-size: 13px; color: hsl(var(--twc-grey-300)); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { height: 8px; border-radius: 999px; background: hsl(var(--twc-grey-900)); overflow: hidden; }
.bar-track i { display: block; height: 100%; background: hsl(var(--twc-primary-600)); border-radius: 999px; }
.bar-value { font-size: 12px; color: hsl(var(--twc-grey-400)); min-width: 40px; text-align: right; }

/* ---- live map ---------------------------------------------------------- */
.map-wrap { padding: 16px; display: flex; justify-content: center; }
.map-inner {
  position: relative; width: 100%; max-width: 900px; aspect-ratio: 1 / 1;
  border-radius: 10px; overflow: hidden;
  border: 1px solid hsl(var(--twc-grey-850));
  background: hsl(var(--twc-grey-1000));
}
.map-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.map-placeholder {
  display: flex; align-items: center; justify-content: center;
  color: hsl(var(--twc-grey-600)); font-size: 13px;
}
.map-dot {
  position: absolute; width: 10px; height: 10px; padding: 0;
  border-radius: 50%; border: 1.5px solid rgba(0,0,0,.55);
  transform: translate(-50%, -50%); cursor: pointer;
}
.map-dot.alive   { background: hsl(var(--twc-ra-online)); }
.map-dot.raiding { background: hsl(var(--twc-orange-500)); }
.map-dot.dead    { background: hsl(var(--twc-grey-500)); }
.map-dot:hover   { transform: translate(-50%, -50%) scale(1.6); z-index: 5; }
.map-legend { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; font-size: 12px; }

/* ---- signs gallery ----------------------------------------------------- */
.sign-grid {
  display: grid; gap: 12px; padding: 16px;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
}
.sign-card {
  border-radius: 10px; overflow: hidden;
  background: hsl(var(--twc-grey-950));
  border: 1px solid hsl(var(--twc-grey-850));
}
.sign-card.destroyed { opacity: .55; }
.sign-img { aspect-ratio: 4 / 3; background: hsl(var(--twc-grey-1000)); }
.sign-img img { width: 100%; height: 100%; object-fit: contain; display: block; }
.sign-missing {
  display: flex; align-items: center; justify-content: center; height: 100%;
  font-size: 12px; color: hsl(var(--twc-grey-600));
}
.sign-meta { padding: 9px 11px; }
.sign-meta p { margin: 0; font-size: 12px; line-height: 1.45; }

/* ---- select ------------------------------------------------------------ */
.board-select {
  height: 32px; padding: 0 8px; border-radius: 6px; font: inherit; font-size: 13px;
  background: hsl(var(--twc-grey-1000));
  border: 1px solid hsl(var(--twc-grey-850));
  color: hsl(var(--twc-grey-100));
  outline: none; cursor: pointer;
}

/* ---- empty state ------------------------------------------------------- */
.board-empty {
  padding: 60px 20px; text-align: center;
  color: hsl(var(--twc-grey-500)); font-size: 14px;
}

/* The vendor sheet expects rows to be links; ours are plain divs that still
   need the pointer affordance where a click does something. */
.row.defaultHover.clickable { cursor: pointer; }

/* ---- map grid overlay -------------------------------------------------- */
/* Rust's own A1/B2 squares, drawn over the map image. Doubles as a check that
   the image still matches the running map: a player Rust reports in T4 has to
   land in the square labelled T4. */
.grid-line { position: absolute; background: rgba(255,255,255,.10); pointer-events: none; }
.grid-line.v { top: 0; bottom: 0; width: 1px; }
.grid-line.h { left: 0; right: 0; height: 1px; }
.grid-label {
  position: absolute; pointer-events: none;
  font-size: 9px; line-height: 1;
  color: rgba(255,255,255,.45);
  text-shadow: 0 1px 2px rgba(0,0,0,.9);
  transform: translate(-50%, -50%);
}
.grid-label.col { top: 7px; }
.grid-label.row { left: 9px; }

/* ---- inline tags (VPN / datacentre / teammate) -------------------------- */
.ip-tag {
  display: inline-block; margin-left: 6px;
  padding: 1px 6px; border-radius: 4px;
  font-size: 10px; font-weight: 600; line-height: 1.5;
  vertical-align: middle; white-space: nowrap;
}
.ip-tag.proxy   { background: hsl(var(--twc-red-950));     color: hsl(var(--twc-red-300)); }
.ip-tag.hosting { background: hsl(var(--twc-orange-950));  color: hsl(var(--twc-orange-300)); }
.ip-tag.ok      { background: hsl(var(--twc-grey-850));    color: hsl(var(--twc-ra-online)); margin-left: 0; }
.ip-tag.warn    { background: hsl(var(--twc-orange-950));  color: hsl(var(--twc-orange-300)); margin-left: 0; }

/* The arrow between a giver and a receiver. */
.arrow-container {
  display: flex; align-items: center; justify-content: center;
  color: hsl(var(--twc-grey-600));
}

/* ---- permission / settings checkboxes ---------------------------------- */
.perm-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 8px; }
.perm {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: hsl(var(--twc-grey-200)); cursor: pointer;
  padding: 5px 0;
}
.perm input[type="checkbox"] { width: auto; height: auto; margin: 0; cursor: pointer; }
.perm input[disabled] { cursor: not-allowed; opacity: .5; }
.panel-block .field { margin-bottom: 14px; }
.panel-block .field label { display: block; margin-bottom: 6px; font-size: 12px; color: hsl(var(--twc-grey-500)); }
.panel-block .field input, .panel-block .field select {
  width: 100%; max-width: 420px; height: 38px; padding: 0 10px;
  border-radius: 8px; font: inherit; outline: none;
  background: hsl(var(--twc-grey-1000));
  border: 1px solid hsl(var(--twc-grey-850));
  color: hsl(var(--twc-grey-50));
}

/* ---- chat stream ------------------------------------------------------- */
/* The vendor sheet styles .player-message and its parts; these fill the gaps
   its layout assumes (a scroll container with a fixed height, and the send
   footer, which our panel drives through the command queue). */
.player-message-chat-root { display: flex; flex-direction: column; height: 100%; position: relative; }
.messages-container { flex: 1 1 auto; min-height: 0; display: flex; }
.player-message-page-list-wrapper {
  flex: 1 1 auto; overflow-y: auto; min-height: 0;
  padding: 8px 16px 4px;
  display: flex; flex-direction: column;
}
.player-message-observer { height: 1px; flex: 0 0 auto; }

.player-message-date-header {
  display: flex; align-items: center; justify-content: center;
  margin: 12px 0 8px; position: sticky; top: 0; z-index: 2;
}
.player-message-date-header p {
  margin: 0; padding: 3px 12px; border-radius: 999px;
  font-size: 11px; color: hsl(var(--twc-grey-400));
  background: hsl(var(--twc-grey-900)); border: 1px solid hsl(var(--twc-grey-850));
}

.player-message .type {
  display: inline-block; margin-right: 6px; padding: 0 5px;
  border-radius: 4px; font-size: 10px; font-weight: 600;
  background: hsl(var(--twc-grey-850)); color: hsl(var(--twc-grey-300));
}
.player-message .type.team   { background: hsl(var(--twc-grey-850)); color: hsl(var(--twc-ra-online)); }
.player-message .type.direct { background: hsl(var(--twc-grey-850)); color: hsl(var(--twc-ra-joining)); }
.player-message .message-item .arrow { margin: 0 5px; color: hsl(var(--twc-grey-600)); }
.player-message .message-item .author { cursor: pointer; }
.player-message .message-item .author:hover { text-decoration: underline; }
.player-message .interaction-button { cursor: pointer; user-select: none; }

.player-message-down-scroll {
  position: absolute; right: 22px; bottom: 74px; z-index: 5;
  width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: hsl(var(--twc-grey-850)); border: 1px solid hsl(var(--twc-grey-800));
  color: hsl(var(--twc-grey-200)); cursor: pointer;
}
.player-message-down-scroll:hover { background: hsl(var(--twc-grey-800)); }

.player-message-page-footer-container {
  flex: 0 0 auto; padding: 12px 16px;
  border-top: 1px solid hsl(var(--twc-grey-850));
}
.chat-send { display: flex; gap: 8px; align-items: center; }
.chat-send input {
  flex: 1 1 auto; height: 38px; padding: 0 12px;
  border-radius: 8px; font: inherit; outline: none;
  background: hsl(var(--twc-grey-1000));
  border: 1px solid hsl(var(--twc-grey-850));
  color: hsl(var(--twc-grey-50));
}

/* ---- statistics: KPI tiles and share breakdowns ------------------------ */
.stats-sub {
  margin: 0; padding: 0 16px 4px;
  font-size: 13px; color: hsl(var(--twc-grey-500));
}
.tool-sep {
  display: inline-block; width: 1px; height: 22px; margin: 0 4px;
  background: hsl(var(--twc-grey-800)); vertical-align: middle;
}

.stat-card.kpi { display: flex; flex-direction: column; gap: 2px; }
.kpi-row { display: flex; align-items: baseline; gap: 10px; margin-top: 4px; }
.kpi-value { font-size: 26px; font-weight: 600; color: hsl(var(--twc-grey-50)); line-height: 1.1; }
.kpi-delta {
  font-size: 12px; font-weight: 600; padding: 1px 6px; border-radius: 4px;
}
/* Up is not automatically good — more bans can mean a worse week — so the
   colours read as direction, not judgement. */
.kpi-delta.up   { background: hsl(var(--twc-grey-850)); color: hsl(var(--twc-ra-online)); }
.kpi-delta.down { background: hsl(var(--twc-grey-850)); color: hsl(var(--twc-red-400)); }
.kpi-delta.flat { background: hsl(var(--twc-grey-850)); color: hsl(var(--twc-grey-500)); }
.kpi-prev { margin: 2px 0 0; font-size: 11px; color: hsl(var(--twc-grey-600)); }

.share-list { display: flex; flex-direction: column; gap: 9px; }
.share-row {
  display: grid; grid-template-columns: minmax(90px, 1.4fr) 2fr auto auto;
  gap: 10px; align-items: center;
}
.share-label {
  font-size: 13px; color: hsl(var(--twc-grey-300));
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.share-track { height: 8px; border-radius: 999px; background: hsl(var(--twc-grey-900)); overflow: hidden; }
.share-track i { display: block; height: 100%; border-radius: 999px; background: hsl(var(--twc-primary-600)); }
.share-pct { font-size: 11px; color: hsl(var(--twc-grey-500)); min-width: 52px; text-align: right; }
.share-n   { font-size: 12px; color: hsl(var(--twc-grey-300)); min-width: 38px; text-align: right; font-weight: 600; }

/* ---- block header with its own controls -------------------------------- */
.block-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 4px; flex-wrap: wrap;
}
.block-head .block-title { margin: 0; }
.block-tools { display: flex; gap: 6px; }

/* ---- statistics: pieces the vendor sheet does not cover ---------------- */
/* Capacity bar segments. Their stylesheet ships .progress-bar and one .value;
   the four-colour split is ours, matching the legend beneath it. */
.progress-bar { display: flex; overflow: hidden; }
.progress-bar .value.seg-online   { background: hsl(var(--twc-ra-online)); }
.progress-bar .value.seg-joining  { background: hsl(var(--twc-ra-joining)); }
.progress-bar .value.seg-reserved { background: hsl(var(--twc-ra-yellow)); }
.progress-bar .value.seg-queued   { background: hsl(var(--twc-ra-queued)); }

.online-card .legend { display: flex; flex-wrap: wrap; gap: 14px; }
.bg-green-500 { background: hsl(var(--twc-ra-online)); }
.bg-blue-500  { background: hsl(var(--twc-ra-joining)); }
.bg-amber-400 { background: hsl(var(--twc-ra-yellow)); }
.bg-red-500   { background: hsl(var(--twc-ra-queued)); }

/* Chart card: title/subtitle on the left, its own period selects on the right. */
.chart > .header {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-bottom: 6px;
}
.chart > .header .title    { margin: 0; font-size: 15px; font-weight: 600; color: hsl(var(--twc-grey-50)); }
.chart > .header .subtitle { margin: 2px 0 0; font-size: 12px; color: hsl(var(--twc-grey-500)); }
.chart .item.h-\[260px\]   { height: 260px; }

.select .activator {
  display: inline-flex; align-items: center; gap: 6px;
  height: 32px; padding: 0 10px; border-radius: 8px;
  font-size: 13px; color: hsl(var(--twc-grey-200));
  background: hsl(var(--twc-grey-900)); border: 1px solid hsl(var(--twc-grey-850));
  cursor: default;
}

.range-row { display: flex; gap: 6px; flex-wrap: wrap; }
.card-wrapper { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.chart-legend { display: flex; gap: 18px; flex-wrap: wrap; justify-content: center; margin: 6px 0 8px; }
.chart { width: 100%; height: 260px; display: block; }
.chart-empty {
  height: 200px; display: flex; align-items: center; justify-content: center;
  color: hsl(var(--twc-grey-600)); font-size: 13px;
}
