/* The garage. Its own stylesheet, and every selector under .gx so nothing in
   here can collide with the viewer's chrome in index.html (which owns #topbar,
   #view, and a bare `button` rule -- note that `.gx-btn` restates everything
   that rule sets, so the garage does not inherit a look it did not ask for).

   Industrial and dry, like the rest of it: amber on charcoal, one accent, no
   rounded corners, no shadows, no animation. */

.gx {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  background: #0b0c0f;
  color: #d8dbe0;
  font: 13px/1.45 ui-monospace, "Cascadia Code", Consolas, monospace;
  overflow: hidden;
}

.gx[hidden] { display: none !important; }

/* ------------------------------------------------------------------- bar */

.gx-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: #101218;
  border-bottom: 1px solid #232630;
  flex: 0 0 auto;
  flex-wrap: wrap;
}

.gx-title {
  color: #e0a458;
  font-weight: 600;
  letter-spacing: 0.14em;
  margin-right: 10px;
}

.gx-picker { display: inline-flex; gap: 2px; }
.gx-spacer { flex: 1 1 auto; }

.gx-tab {
  background: #161920;
  border: 1px solid #2a2e38;
  color: #9aa0ac;
  padding: 3px 8px;
  font: inherit;
  letter-spacing: 0.06em;
  cursor: pointer;
}
.gx-tab:hover { background: #1e222b; color: #d8dbe0; }
.gx-tab.gx-on { background: #2b2113; border-color: #e0a458; color: #e0a458; }

.gx-btn {
  background: #1a1d24;
  border: 1px solid #333844;
  color: #d8dbe0;
  padding: 4px 12px;
  font: inherit;
  letter-spacing: 0.06em;
  cursor: pointer;
}
.gx-btn:hover { background: #262a33; border-color: #4a5060; }
.gx-btn:active { background: #14161b; }
.gx-primary { border-color: #e0a458; color: #e0a458; }

/* ------------------------------------------------------------------ body */

.gx-body {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  /* Four fixed columns plus the deck is more than a laptop is wide, and .gx is
     overflow:hidden -- so without this the last column (BASE) is clipped with
     no way to reach it, rather than scrolled to. */
  overflow-x: auto;
}

.gx-col {
  overflow: auto;
  padding: 8px 10px;
  min-height: 0;
}

.gx-palette { flex: 0 0 250px; border-right: 1px solid #232630; }
.gx-deckcol { flex: 1 1 auto; display: flex; flex-direction: column; }
.gx-stats { flex: 0 0 300px; border-left: 1px solid #232630; }

.gx-head {
  color: #8a8f9c;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 11px;
  margin: 2px 0 8px;
  border-bottom: 1px solid #232630;
  padding-bottom: 4px;
}

.gx-role {
  color: #e0a458;
  letter-spacing: 0.1em;
  font-size: 11px;
  margin: 10px 0 3px;
}

.gx-part {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 2px 4px;
  border: 1px solid transparent;
  cursor: pointer;
}
.gx-part:hover { background: #171a21; border-color: #333844; }
.gx-part-name { color: #d8dbe0; }
.gx-part-meta { color: #71767f; font-size: 11px; white-space: nowrap; }

/* ------------------------------------------------------------------ deck */

.gx-deckwrap {
  flex: 1 1 auto;
  overflow: auto;
  padding: 6px 0 10px;
  min-height: 0;
}

.gx-grid {
  display: grid;
  gap: 1px;
  background: #171a21;
  border: 1px solid #262a33;
  width: max-content;
}

.gx-cell {
  background: #0f1116;
  border: 1px solid #14171d;
}
.gx-cell:hover { outline: 1px solid #3a4150; }

/* One rule per role, so a deck reads as what is on it. These match the
   renderer's ROLE_COLOR table in ui/render/mechs.js. */
.gx-r-cockpit    { background: #cea95c; }
.gx-r-plate      { background: #949aa4; }
.gx-r-generator  { background: #c47636; }
.gx-r-booster    { background: #689cc8; }
.gx-r-hardpoint  { background: #60646e; }
.gx-r-weapon     { background: #ba5846; }
.gx-r-tool       { background: #68b294; }
.gx-r-bay        { background: #8a8064; }
.gx-r-hopper     { background: #7e765e; }
.gx-r-grinder    { background: #ac664e; }
.gx-r-furnace    { background: #bc603c; }
.gx-r-fabricator { background: #9c8cc4; }
.gx-r-tank       { background: #568ab2; }
.gx-r-belt       { background: #6e644e; }
.gx-r-antenna    { background: #848e98; }
.gx-r-prop       { background: #9c8c5c; }
.gx-r-cradle     { background: #78848e; }
.gx-r-lift       { background: #808892; }

.gx-ghost-ok  { background: #3d5a3f; outline: 1px solid #7fd08a; }
.gx-ghost-bad { background: #5a3434; outline: 1px solid #e07a58; }

.gx-legs {
  margin: 6px 0 0;
  background: #2a2e38;
  border: 1px solid #3a4150;
  color: #8a8f9c;
  font-size: 11px;
  padding: 2px 6px;
  overflow: hidden;
  white-space: nowrap;
  box-sizing: border-box;
}

.gx-status {
  color: #9aa0ac;
  min-height: 1.5em;
  padding: 4px 0;
  border-top: 1px solid #232630;
  flex: 0 0 auto;
}

.gx-rot { margin-right: 6px; }

/* ----------------------------------------------------------------- stats */

.gx-preview {
  display: block;
  width: 240px;
  height: 240px;
  background: #0d0f13;
  border: 1px solid #262a33;
  margin-bottom: 8px;
  image-rendering: pixelated;
}

.gx-table { margin-bottom: 8px; }

.gx-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 1px 0;
  border-bottom: 1px solid #14171d;
}
.gx-k { color: #71767f; font-size: 11px; letter-spacing: 0.06em; }
.gx-v { color: #d8dbe0; text-align: right; }

.gx-delta { border-bottom: none; margin-top: 4px; }
/* A row that is telling you something is wrong. gx-delta is the stats panel's
   appended summary row and carries no colour at all -- reusing it for the power
   bus said nothing and inserted a stray gap. */
.gx-warn .gx-v { color: #e07a58; }
.gx-up { color: #7fd08a; }
.gx-down { color: #e07a58; }

.gx-reasons { margin: 6px 0 10px; }
.gx-ok { color: #7fd08a; letter-spacing: 0.12em; }
.gx-bad { color: #e07a58; font-size: 12px; padding: 1px 0; }

.gx-pool { color: #e0a458; letter-spacing: 0.08em; margin-bottom: 4px; }

.gx-trow {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 2px 0;
}
.gx-step {
  background: #1a1d24;
  border: 1px solid #333844;
  color: #d8dbe0;
  width: 22px;
  font: inherit;
  cursor: pointer;
}
.gx-step:hover { background: #262a33; }
.gx-tv { width: 2em; text-align: center; color: #e0a458; }
.gx-note { color: #5f646d; font-size: 11px; }

@media (max-width: 1100px) {
  .gx-palette { flex-basis: 200px; }
  .gx-stats { flex-basis: 250px; }
  .gx-base { flex-basis: 190px; }
}

/* --- the BASE panel (M2) ----------------------------------------------
   Its own class prefix, its own column, and it reuses gx-row/gx-k/gx-v and
   gx-part-name/gx-part-meta rather than inventing a second set of names for
   the same two shapes. */
.gx-base {
  flex: 0 0 240px;
  min-width: 200px;
  overflow-y: auto;
}
.gx-structures {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.gx-structure {
  display: flex;
  flex-direction: column;
  padding: 4px 6px;
  background: #14161b;
  border: 1px solid #23262f;
}
.gx-structure .gx-part-meta { color: #8a8f9c; white-space: normal; }
