/* WarBrawl database - dark, dense, table-first. Generated site; edit the
   template in Tools/DatabaseSite/template/ and re-run build_site.py. */

:root {
  --bg: #0e1116;
  --bg-raised: #151a21;
  --bg-row: #1a2029;
  --bg-row-alt: #161c24;
  --line: #2c3541;
  --text: #f2f5fa;
  --text-dim: #c3ccd8;
  --text-bright: #ffffff;
  --accent: #e8a33d;
  --accent-dim: #7a5720;
  /* Section headings and item descriptions use this warm tone so the eye can
     find the structure of a detail pane without reading it. */
  --gold: #f0b45a;
  --gold-soft: #d9a44f;
  --link: #6fb3f2;
  --good: #5fbf7a;
  --bad: #e06060;
  --control: #b07ee0;
  --radius: 6px;
  --mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 "Segoe UI", system-ui, -apple-system, sans-serif;
}

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---- top bar ---------------------------------------------------------- */
.topbar {
  display: flex;
  align-items: center;
  gap: 20px;
  height: 52px;
  padding: 0 16px;
  background: #0a0d12;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 30;
}

/* Only ever visible once the sidebar has collapsed into a drawer; the narrow
   media query at the bottom of the file owns both halves of that switch. */
.nav-toggle {
  display: none;
  place-items: center;
  flex: 0 0 34px;
  width: 34px; height: 34px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-raised);
  color: var(--text);
  cursor: pointer;
}
.nav-toggle:hover { border-color: var(--accent-dim); color: var(--accent); }
.nav-toggle svg { width: 20px; height: 20px; }
.nav-scrim {
  display: none;
  position: fixed;
  top: 52px; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, .55);
  z-index: 34;
}

.brand { display: flex; align-items: center; gap: 10px; color: var(--text-bright); }
.brand:hover { text-decoration: none; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 30px; height: 30px;
  border-radius: var(--radius);
  background: var(--accent);
  color: #17120a;
  font-weight: 700;
  font-size: 13px;
}
.brand-text { font-size: 18px; font-weight: 600; letter-spacing: .2px; }
.brand-text em { color: var(--text-dim); font-style: normal; font-weight: 400; }

.search { flex: 1; max-width: 560px; }
.input-wrap { position: relative; display: block; }
.search input,
.controls input {
  width: 100%;
  padding: 7px 76px 7px 11px;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: #ffffff;
  font-size: 14px;
}
.search input::placeholder,
.controls input::placeholder { color: var(--text-dim); }
.search input:focus,
.controls input:focus { outline: none; border-color: var(--accent-dim); }

/* Shortcut hint inside the field. It hides itself once there is text, so it
   never sits on top of what you typed. */
.hotkey {
  position: absolute;
  right: 7px;
  top: 50%;
  transform: translateY(-50%);
  padding: 2px 7px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #0d1219;
  color: var(--text-dim);
  font: 600 11.5px/1.4 var(--mono);
  letter-spacing: .3px;
  pointer-events: none;
  white-space: nowrap;
}
.input-wrap input:not(:placeholder-shown) ~ .hotkey { display: none; }

.search-results {
  position: absolute;
  top: 38px; left: 0; right: 0;
  max-height: 60vh;
  overflow-y: auto;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 12px 32px rgba(0,0,0,.55);
  z-index: 40;
}
.search-group {
  padding: 6px 11px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--text-dim);
  background: #11161d;
  border-top: 1px solid var(--line);
}
.search-hit {
  display: flex;
  gap: 9px;
  align-items: center;
  padding: 6px 11px;
  cursor: pointer;
}
.search-hit:hover, .search-hit.active { background: #202836; }
.search-hit small { color: var(--text-dim); font-size: 13px; }

/* Top right of the bar: out to the game's main site. */
.site-link {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-raised);
  color: var(--text);
  font-size: 13.5px;
  white-space: nowrap;
}
.site-link:hover { text-decoration: none; border-color: var(--accent-dim); color: var(--accent); }
.site-link svg { width: 13px; height: 13px; color: #7f8c9d; }
.site-link:hover svg { color: var(--accent); }

/* Version + build stamp: under the sidebar nav on wide screens, a footer on
   phones (the narrow media query swaps the two). */
.stamp { display: flex; align-items: center; gap: 10px; }
.stamp-side {
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  margin: 14px 12px 8px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.stamp-footer { display: none; }
.generated { color: #8b98a9; font-size: 12.5px; }
/* The game version this data was read out of, so a stale tab is obvious. */
.version {
  padding: 2px 9px;
  border: 1px solid var(--accent-dim);
  border-radius: 999px;
  background: #2a2013;
  color: var(--accent);
  font: 600 12.5px/1.5 var(--mono);
}

/* ---- layout ----------------------------------------------------------- */
/* Fixed viewport height, so the table and the detail pane scroll independently
   and the sticky column headers stay put instead of riding the page scroll. */
.layout { display: flex; align-items: stretch; height: calc(100vh - 52px); }

.sidebar {
  width: 190px;
  flex: 0 0 190px;
  padding: 12px 8px;
  border-right: 1px solid var(--line);
  background: #0b0f14;
  overflow-y: auto;
}
.nav-item {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: var(--radius);
  color: var(--text);
  cursor: pointer;
  font-size: 15px;
}
.nav-item:hover { background: var(--bg-row); text-decoration: none; }
.nav-item.active { background: var(--bg-row); color: var(--text-bright); }
/* A flat 2px rule rather than an inset shadow: the shadow followed the item's
   rounded corners and read as a curve instead of a marker. */
.nav-item.active::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 2px;
  background: var(--accent);
}
.nav-label { display: flex; align-items: center; gap: 10px; min-width: 0; }
.nav-item svg { width: 18px; height: 18px; flex: 0 0 18px; color: #7f8c9d; }
.nav-item:hover svg { color: var(--text-dim); }
.nav-item.active svg { color: var(--accent); }
.nav-item .count { color: var(--text-dim); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.nav-sep { margin: 10px 12px 4px; color: var(--text-dim); font-size: 12px; text-transform: uppercase; letter-spacing: .6px; }

.content { display: flex; flex: 1; min-width: 0; min-height: 0; }
.list-pane { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; }

.list-head { padding: 16px 18px 10px; }
.list-head h1 {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 11px;
  font-size: 23px;
  font-weight: 600;
  color: var(--text-bright);
}
.list-head h1 svg { width: 23px; height: 23px; flex: 0 0 23px; color: var(--accent); }
.blurb { margin: 5px 0 0; color: var(--text-dim); font-size: 14px; max-width: 78ch; }

.controls { display: flex; gap: 10px 16px; align-items: center; flex-wrap: wrap; margin-top: 12px; }
.filter-wrap { width: 280px; flex: 0 0 280px; }
/* ---- facet filters ----------------------------------------------------- */
/* One multi-select button per facet group, on their own full-width row under
   the table filter. A grid rather than wrapped flex on two counts: its tracks
   keep every button the same size, where flex would stretch a lone one on the
   last row into something that reads as a different control; and auto-fill
   packs as many per row as the width allows without a section that has only
   one facet blowing that button up to the width of the pane. Seven groups come
   out as one row on a wide monitor and four on a phone. */
.facets {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(126px, 1fr));
  width: 100%;
  gap: 8px;
}
.facet-dd { position: relative; min-width: 0; }
.facet-dd.open { z-index: 20; }
.facet-button {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-raised);
  color: var(--text-dim);
  font: inherit;
  font-size: 13px;
  line-height: 1.35;
  text-align: left;
  cursor: pointer;
}
.facet-button:hover { border-color: #3d4959; }
.facet-button.on { border-color: var(--accent-dim); background: #2a2013; color: var(--accent); }
.facet-name, .facet-summary { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.facet-summary { color: var(--text-bright); }
.facet-summary:empty { display: none; }
.facet-button.on .facet-summary { color: var(--accent); }
.facet-caret { margin-left: auto; flex: 0 0 auto; font-size: 10px; opacity: .75; }
.facet-menu {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 100%;
  width: max-content;
  max-width: min(72vw, 280px);
  max-height: 52vh;
  overflow-y: auto;
  padding: 4px;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 12px 32px rgba(0, 0, 0, .6);
  z-index: 20;
}
/* A group sitting in the right half of the row hangs its menu off that edge,
   so a wide value list never opens past the screen. */
.facet-dd.right .facet-menu { left: auto; right: 0; }
.facet-dd.open .facet-menu { display: block; }
.facet-option {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 8px;
  border-radius: 4px;
  color: var(--text-dim);
  font-size: 14px;
  cursor: pointer;
  user-select: none;
}
.facet-option:hover { background: #202836; }
.facet-option.clear { margin-bottom: 3px; border-bottom: 1px solid var(--line); border-radius: 4px 4px 0 0; }
.facet-box {
  display: grid;
  place-items: center;
  flex: 0 0 15px;
  width: 15px; height: 15px;
  border: 1px solid #46525f;
  border-radius: 3px;
  background: var(--bg);
}
.facet-option.on .facet-box { border-color: var(--accent); background: var(--accent); }
/* The tick is two borders of an empty box rotated 45 degrees: no icon file, and
   it reads against the accent fill the box takes when it is on. */
.facet-option.on .facet-box::after {
  content: "";
  width: 4px; height: 8px;
  margin-top: -2px;
  border: solid #17120a;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* ---- table ------------------------------------------------------------ */
.table-wrap { flex: 1; overflow: auto; padding: 0 18px 24px; }
table { width: 100%; border-collapse: collapse; }
/* The header row is chrome, not data: a darker strip, a heavier rule under it,
   and text that is smaller, wider-tracked and dimmer than anything around it -
   otherwise it reads as just one more row of uppercase grey. */
thead th {
  position: sticky;
  top: 0;
  z-index: 5;
  text-align: left;
  padding: 10px 10px 8px;
  background: #070a0f;
  border-bottom: 2px solid #3a4553;
  color: #8b98a9;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.1px;
  cursor: pointer;
  white-space: nowrap;
}
thead th:hover { color: var(--text); }
thead th.sorted { color: var(--gold); }
thead th .arrow { color: var(--accent); }
tbody td { padding: 7px 10px; border-bottom: 1px solid #1b212a; vertical-align: middle; }
tbody tr { cursor: pointer; }
tbody tr:nth-child(even) { background: var(--bg-row-alt); }
tbody tr:hover { background: #212a36; }
tbody tr.selected { background: #2b3546; box-shadow: inset 2px 0 0 var(--accent); }

.cell-name { display: flex; align-items: center; gap: 9px; min-width: 190px; }
.cell-name strong { font-weight: 600; color: var(--text-bright); }
.muted { color: var(--text-dim); }
.num { font-variant-numeric: tabular-nums; text-align: right; }
td.wrap-desc { color: #d5dce5; font-size: 14.5px; max-width: 46ch; }

/* ---- icons ------------------------------------------------------------ */
.icon {
  width: 30px; height: 30px;
  flex: 0 0 30px;
  border-radius: 5px;
  background: #0a0d12 center/86% no-repeat;
  border: 1px solid var(--line);
}
.icon.tinted { background-color: currentColor; }
.icon.big { width: 52px; height: 52px; flex-basis: 52px; }
.icon.small { width: 20px; height: 20px; flex-basis: 20px; border-radius: 4px; }
/* Any cross-reference carries its subject's icon, so a Bleed in a table reads
   as the same thing as the Bleed row on the status page. */
.ref { display: inline-flex; align-items: center; gap: 6px; vertical-align: middle; }
.chip.ref { display: inline-flex; padding-left: 5px; }
.icon.placeholder { display: grid; place-items: center; color: var(--text-dim); font-size: 12px; }
.icon.blank { border-color: transparent; background: none; }
/* A framed ability icon supplies its own border art. */
.icon.framed { border-color: transparent; background-color: transparent; }

/* ---- chips ------------------------------------------------------------ */
.chip {
  display: inline-block;
  padding: 2px 9px;
  margin: 2px 4px 2px 0;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #131922;
  color: var(--text-dim);
  font-size: 13px;
  white-space: nowrap;
}
/* Chips that filter the table rather than navigate. Hover only lifts the
   background: a tag pill's colour is data (offense is red), so it must survive
   both hover and being the active filter - the amber "selected" state belongs
   to the facet bar at the top and to colourless chips like the gear slots. */
.chip.filter { cursor: pointer; }
.chip.filter:hover { background: #222b38; }
.chip.filter.on { border-color: var(--accent-dim); background: #2a2013; color: var(--accent); }
.chip.offense { border-color: #5a2b2b; color: #e39b9b; }
.chip.defense { border-color: #274a63; color: #92c2e0; }
.chip.control { border-color: #45305e; color: var(--control); }
.chip.mobility { border-color: #2c5340; color: #86cea6; }
.chip.threshold { border-color: #275a5e; color: #8ed3d6; }

/* A value in a filter menu carries the same tag colour as the chip it matches
   in the table, so the two read as the same vocabulary. */
.facet-option.tone-offense { color: #e39b9b; }
.facet-option.tone-defense { color: #92c2e0; }
.facet-option.tone-control { color: var(--control); }
.facet-option.tone-mobility { color: #86cea6; }
.facet-option.tone-threshold { color: #8ed3d6; }
/* Exclusive labels get their own colour so they never read as just another tag.
   The palette is indexed, not named, so a new label is coloured on sight. */
.chip.label { border-color: #45305e; background: #1b1526; color: var(--control); }
.chip.label:hover { background: #241c33; text-decoration: none; }
.chip.tone-label0, .facet-option.tone-label0 { border-color: #45305e; color: #b07ee0; }
.chip.tone-label1, .facet-option.tone-label1 { border-color: #47542c; color: #b8d67a; }
.chip.tone-label2, .facet-option.tone-label2 { border-color: #235360; color: #7fcfe0; }
.chip.tone-label3, .facet-option.tone-label3 { border-color: #5c3357; color: #e19ad0; }
.chip.tone-label4, .facet-option.tone-label4 { border-color: #364562; color: #9fb4d8; }
.chip.tone-label5, .facet-option.tone-label5 { border-color: #5e3830; color: #e59a8a; }
a.chip[class*="tone-label"]:hover { text-decoration: none; background: #202836; }
.chip.link { color: var(--link); cursor: pointer; border-color: #2b3a4c; }
.chip.link:hover { background: #1c2836; }

/* ---- detail pane ------------------------------------------------------ */
.detail-pane {
  width: 400px;
  flex: 0 0 400px;
  border-left: 1px solid var(--line);
  background: var(--bg-raised);
  overflow-y: auto;
  position: relative;
  height: 100%;
}
.detail-close {
  display: none;
  position: absolute;
  top: 8px; right: 10px;
  background: none;
  border: 0;
  color: var(--text-dim);
  font-size: 22px;
  cursor: pointer;
}
.detail { padding: 16px 18px 40px; }
.detail-empty { color: var(--text-dim); padding: 40px 6px; text-align: center; font-size: 15px; }

.detail-head { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 12px; }
.detail-head h2 { margin: 0 0 3px; font-size: 21px; color: var(--text-bright); }
.detail-head .kicker { color: var(--text-dim); font-size: 13px; }
.detail-desc {
  margin: 0 0 18px;
  padding: 11px 13px;
  background: #11161d;
  border-left: 2px solid var(--gold-soft);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 15.5px;
  font-style: italic;
  color: var(--gold);
}

.block { margin-bottom: 20px; }
/* Gold rule + label, so a glance finds the boundaries between Effect, Statuses
   applied, Rules and so on instead of one undifferentiated column of grey. */
.block h3 {
  margin: 0 0 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(232, 163, 61, .28);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .9px;
  color: var(--gold);
  font-weight: 700;
}
.kv { width: 100%; border-collapse: collapse; }
.kv td { padding: 6px 0; border-bottom: 1px solid #1e2530; vertical-align: top; font-size: 15px; }
.kv td:first-child { color: var(--text-dim); width: 45%; padding-right: 10px; }
.kv td:last-child { text-align: right; font-variant-numeric: tabular-nums; color: var(--text); }
.kv tr:last-child td { border-bottom: 0; }

.mini { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.mini th {
  text-align: left; padding: 5px 6px; color: var(--text-dim);
  font-weight: 600; font-size: 12.5px; text-transform: uppercase; letter-spacing: .4px;
  border-bottom: 1px solid var(--line);
}
.mini td { padding: 6px 6px; border-bottom: 1px solid #1e2530; }
.mini tr:last-child td { border-bottom: 0; }

.note { color: var(--text-dim); font-size: 14px; margin: -4px 0 0; }
/* A note under a field grid needs room; the negative default is for notes that
   sit tight under a heading. */
.calc-panel .note { margin: 16px 0 0; }

.glyph { width: 16px; height: 16px; flex: 0 0 16px; color: var(--text-dim); }
/* The glyph and its count are one token; wrapping between them reads as two. */
.stack-count { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }

.path {
  font-family: var(--mono);
  font-size: 12px;
  color: #94a1b1;
  word-break: break-all;
}

/* Attack phase bar: windup / active / recovery, proportional to tick counts. */
.phases { display: flex; height: 22px; border-radius: 4px; overflow: hidden; border: 1px solid var(--line); }
.phases div { display: grid; place-items: center; font-size: 11.5px; color: #0d1117; font-weight: 600; overflow: hidden; }
.phase-windup { background: #6d7a8c; }
.phase-active { background: var(--accent); }
.phase-recovery { background: #3d4756; color: #aab4c1 !important; }
.phase-legend { display: flex; gap: 12px; margin-top: 6px; font-size: 13px; color: var(--text-dim); }

.empty { padding: 30px; text-align: center; color: var(--text-dim); }

/* ---- narrow screens --------------------------------------------------- */
@media (max-width: 1180px) {
  .detail-pane {
    position: fixed;
    top: 52px; right: 0; bottom: 0;
    width: min(400px, 92vw);
    /* The base rule's height: 100% is the whole viewport, which hangs the last
       52px of the pane - and of its scroller - below the fold. */
    height: auto;
    flex-basis: auto;
    /* A column with its own scroller, so the close button stays under the
       thumb: absolutely positioned, it rode the detail's scroll out of view. */
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateX(100%);
    transition: transform .18s ease;
    box-shadow: -10px 0 30px rgba(0,0,0,.5);
    z-index: 25;
  }
  .detail-pane.open { transform: none; }
  .detail-close {
    display: grid;
    place-items: center;
    position: static;
    align-self: flex-end;
    /* A flex item in a column, so it would otherwise shrink out of its own
       tap target as the detail below it grows. */
    flex: 0 0 auto;
    width: 34px; height: 34px;
    margin: 8px 10px 0;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: var(--bg);
    color: var(--text);
    font-size: 21px;
    line-height: 1;
  }
  .detail-close:hover { border-color: var(--accent-dim); color: var(--accent); }
  .detail { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding-top: 4px; }
  .wrap-desc { display: none; }
}

/* Phone: the sidebar becomes a drawer behind the hamburger, and the detail pane
   takes the whole content area - the 8vw sliver of table left behind it was
   neither readable nor tappable. */
@media (max-width: 760px) {
  .topbar { gap: 10px; padding: 0 10px; }
  .nav-toggle { display: grid; }
  .brand-text { display: none; }
  .site-link { padding: 5px 9px; font-size: 12.5px; }
  .hotkey { display: none; }
  .search input, .controls input { padding-right: 11px; }

  /* The stamp leaves the (now hidden) sidebar for a slim footer; the layout
     gives up its height so the table's scroller stops above it. */
  .stamp-side { display: none; }
  .stamp-footer {
    display: flex;
    justify-content: center;
    height: 34px;
    padding: 0 10px;
    background: #0a0d12;
    border-top: 1px solid var(--line);
  }
  .layout { height: calc(100vh - 52px - 34px); }

  .sidebar {
    position: fixed;
    top: 52px; left: 0; bottom: 0;
    width: 232px;
    flex-basis: auto;
    transform: translateX(-100%);
    transition: transform .18s ease;
    box-shadow: 10px 0 30px rgba(0,0,0,.5);
    z-index: 36;
  }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .nav-scrim { display: block; }

  .detail-pane { width: 100%; left: 0; right: 0; }
  .detail { padding-left: 14px; padding-right: 14px; }

  /* The heading, filter and facets scroll away with the table instead of
     holding a third of a short screen. The column headers stay: they only
     stick once .list-pane is the scrollport, which needs .table-wrap to stop
     being one itself. */
  .list-pane { overflow: auto; }
  .table-wrap { flex: none; overflow: visible; }

  .list-head { padding: 10px 12px 6px; }
  .list-head h1 { font-size: 19px; gap: 8px; }
  .list-head h1 svg { width: 19px; height: 19px; flex-basis: 19px; }
  .blurb { font-size: 13px; }
  .controls { margin-top: 8px; gap: 8px; }
  .filter-wrap { width: auto; flex: 1 1 100%; }
  .table-wrap { padding: 0 12px 20px; }
}

/* ---- damage page ------------------------------------------------------- */
.custom { padding-top: 4px; max-width: 1080px; }
.page .block { margin-bottom: 26px; }
.formula {
  margin: 12px 0 0;
  padding: 12px 14px;
  background: #0a0e14;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--gold);
  font: 13.5px/1.7 var(--mono);
  overflow-x: auto;
}

.charts { display: flex; gap: 22px; flex-wrap: wrap; }
.chart-box { flex: 1 1 380px; min-width: 320px; }
.chart-box h4 {
  margin: 0 0 8px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
}
.chart { width: 100%; height: auto; background: #0a0e14; border: 1px solid var(--line); border-radius: var(--radius); }
.chart .grid { stroke: #202834; stroke-width: 1; }
.chart .curve { fill: none; stroke: var(--accent); stroke-width: 2.2; }
.chart .mark { fill: var(--gold); }
.chart .tick { fill: #8b98a9; font-size: 11px; font-family: var(--mono); }
.chart .tick.end { text-anchor: end; }
.chart .tick.mid { text-anchor: middle; }
.chart .mark-label { fill: var(--gold); font-size: 11px; }

/* Two fighter panels side by side, results underneath. */
.calc-sides { display: flex; gap: 20px; flex-wrap: wrap; }
.calc-panel {
  flex: 1 1 380px;
  min-width: 320px;
  padding: 14px 16px;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.calc-panel h4 {
  margin: 0 0 12px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--gold);
}
.calc-inputs {
  display: grid;
  grid-template-columns: repeat(2, minmax(130px, 1fr));
  gap: 10px 14px;
}
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field-label { color: #8b98a9; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; }
.field input, .field select {
  width: 100%;
  padding: 6px 9px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 14px;
}
.field input:focus, .field select:focus { outline: none; border-color: var(--accent-dim); }
.field-note { padding: 7px 0; color: var(--text-dim); font-size: 13px; }

.attr-label {
  margin: 14px 0 6px;
  color: #8b98a9;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.attr-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.attr .field-label { font-size: 11px; letter-spacing: .4px; }
.attr input { padding: 6px 4px; text-align: center; }
/* The attributes this weapon scales off, so a complete row still shows which
   ones are doing the work. */
.attr.scales .field-label { color: var(--gold); }
.attr.scales input { border-color: var(--accent-dim); }

.calc-out { margin-top: 20px; }
.result-card {
  padding: 14px 16px;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.result-card h4 {
  margin: 0 0 10px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--gold);
}
.calc-steps td:first-child { color: var(--text-dim); }
.calc-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  color: var(--text-dim);
}
.calc-total strong { font-size: 26px; color: var(--gold); font-variant-numeric: tabular-nums; }
.calc-total.sub { border-top: 0; padding-top: 0; margin-top: 4px; }
.calc-total.sub strong { font-size: 17px; color: var(--text); }
