/* The look follows the unit and compare pages of beyondallreason.info (docs/website.md). */
:root {
  --bg: #000; --card: #070707; --panel: #161616; --line: #262626; --text: #f2f2f2; --muted: #8d8d8d; --gold: #f0b95a;
  --arm: rgb(90, 140, 235); --cor: rgb(235, 85, 75); --leg: rgb(130, 218, 105); --scv: rgb(175, 105, 225); --rap: rgb(20, 20, 20);
}
/* --accent: colour of names and active buttons; --accent-text: the same as readable text on black; --on-accent: text on an active button */
.f-arm { --accent: var(--arm); --accent-text: var(--arm); --on-accent: #fff; --accent-line: var(--arm); }
.f-cor { --accent: var(--cor); --accent-text: var(--cor); --on-accent: #fff; --accent-line: var(--cor); }
.f-leg { --accent: var(--leg); --accent-text: var(--leg); --on-accent: #06170a; --accent-line: var(--leg); }
.f-scv { --accent: var(--scv); --accent-text: var(--scv); --on-accent: #fff; --accent-line: var(--scv); }
.f-rap { --accent: var(--rap); --accent-text: #c9c9c9; --on-accent: #fff; --accent-line: #8d8d8d; }  /* black cannot be read on the black page */

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 400 15px/1.35 Poppins, "Segoe UI", system-ui, sans-serif; }
body { min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
img { display: block; }
/* the keyboard: what has the focus gets a gold frame (not after a click with the mouse) */
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.card:focus-visible, .row:focus-visible { outline-offset: -2px; }
.toggle input:focus-visible + i { outline: 2px solid var(--gold); outline-offset: 2px; }
.message { text-align: center; color: var(--muted); margin: 80px auto; max-width: 640px; }
.message code { color: var(--text); }

.nav { display: flex; align-items: center; gap: 24px; padding: 12px 24px; border-bottom: 1px solid var(--line); }
.brand { font-weight: 500; }
#nav-links { display: flex; gap: 4px; flex: 1; }
#nav-links a { padding: 4px 14px; color: var(--muted); }
#nav-links a.active { color: var(--text); background: var(--panel); }
#version { color: var(--muted); font-size: 13px; }
.gh { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.gh:hover { color: var(--text); }
#version select { background: var(--panel); border: 1px solid var(--line); padding: 2px 6px; }

.legal { color: #777; font-size: 12px; text-align: center; max-width: 900px; margin: 0 auto; padding: 24px; }
.legal a { color: #999; text-decoration: underline; }

/* ------------------------------------------------ catalog */
.title { display: flex; flex-wrap: wrap; justify-content: center; align-items: baseline; gap: 8px 22px; padding: 18px 24px 6px; }
.title b { font-size: 36px; font-weight: 700; color: var(--accent-text); }
.title h1 { font-size: 56px; font-weight: 300; margin: 0; line-height: 1.1; }
.switch { color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: baseline; font-weight: 300; font-size: 17px; }
.switch a { font-weight: 700; color: var(--accent-text); letter-spacing: -.3px; }
.switch a:hover { text-decoration: underline; }

.tabs { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px; padding: 12px 24px; }
.tabs :is(a, button) { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 0 20px 8px; font-size: 18px; font-weight: 300; color: var(--accent-text); letter-spacing: -.3px; }
.tabs :is(a, button) svg { width: 16px; height: 16px; fill: #fff; margin-top: -4px; }
.tabs :is(a, button).active { background: var(--accent); color: var(--on-accent); box-shadow: inset 0 0 0 1px var(--accent-line); }

.controls { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 16px 28px; padding: 14px 24px; }
.seg { display: inline-flex; }
.seg button { display: flex; align-items: center; gap: 8px; padding: 9px 16px; background: #0e0e0e; font-size: 16px; font-weight: 300; }
.seg button svg { width: 22px; height: 17px; fill: currentColor; }
.seg button.active { background: var(--accent); color: var(--on-accent); box-shadow: inset 0 0 0 1px var(--accent-line); }
.seg.small button { padding: 5px 12px; font-size: 13px; font-weight: 400; }
.toggle { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 16px; font-weight: 300; letter-spacing: -.3px; }
.toggle input { position: absolute; opacity: 0; }
.toggle i { width: 40px; height: 22px; border-radius: 7px; background: #333; position: relative; display: block; }
.toggle i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 5px; background: #fff; transition: left .12s; }
.toggle input:checked + i { background: var(--accent); box-shadow: inset 0 0 0 1px var(--accent-line); }
.toggle input:checked + i::after { left: 21px; }
.search { background: #0b0b0b; border: 1px solid var(--line); border-radius: 26px; padding: 8px 20px; outline: none; font-size: 14px; }
.controls .search { width: 250px; max-width: 100%; }
.search:focus { border-color: #555; }
.search::placeholder { color: #777; }

.grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px; padding: 12px 24px 110px; }
.card { width: 210px; min-height: 210px; background: var(--card); padding: 8px; position: relative; cursor: pointer; display: flex; flex-direction: column; align-items: center; text-align: center; outline: 1px solid transparent; }
.card:hover { background: #111; }
.card.selected { outline: 2px solid var(--accent-line); outline-offset: -2px; background: #111; }
.card .pic { width: 156px; height: 156px; object-fit: contain; }
.card .name { margin-top: -30px; position: relative; font-size: 17px; letter-spacing: -.3px; text-shadow: 0 0 4px #000, 0 0 2px #000; }
.card .desc { color: var(--accent-text); font-size: 13px; letter-spacing: -.2px; font-weight: 300; padding: 2px 0 8px; text-shadow: 0 0 4px #000; }
.hide-names .name, .hide-names .desc { display: none; }
.hide-names .card { min-height: 190px; }
.tier { background: #2a2a2a; color: #cfcfcf; font-size: 12px; padding: 2px 6px; display: inline-block; }
.tier.t3 { background: var(--accent); color: var(--on-accent); box-shadow: inset 0 0 0 1px var(--accent-line); }
.card .tier { position: absolute; top: 8px; left: 8px; z-index: 1; }
.role { width: 22px; height: 22px; object-fit: contain; }
.card .role { position: absolute; top: 8px; right: 10px; z-index: 1; }
.check { position: absolute; top: 36px; right: 10px; color: var(--accent-text); font-weight: 700; z-index: 1; }

.list { max-width: 1240px; margin: 0 auto; padding: 8px 24px 110px; }
.row { display: grid; grid-template-columns: 34px 28px 56px minmax(120px, 1.1fr) minmax(160px, 1.6fr) repeat(4, 76px); align-items: center; gap: 12px; padding: 4px 10px; border-bottom: 1px solid #141414; cursor: pointer; font-size: 14px; }
.row:hover { background: #101010; }
.row.selected { background: #141414; box-shadow: inset 3px 0 0 var(--accent-line); }
.row.head { color: var(--muted); font-size: 12px; cursor: default; background: none; }
.row .pic { width: 52px; height: 52px; object-fit: contain; }
.row .num { text-align: right; font-variant-numeric: tabular-nums; }
.row .desc { color: var(--accent-text); font-weight: 300; }
.empty { color: var(--muted); text-align: center; width: 100%; padding: 40px; }

#tray { position: fixed; left: 0; right: 0; bottom: 0; display: flex; justify-content: center; pointer-events: none; }
.tray { pointer-events: auto; display: flex; align-items: center; gap: 12px; background: #141414; border: 1px solid #333; border-bottom: 0; padding: 8px 14px; max-width: 94vw; }
.tray .thumbs { display: flex; gap: 2px; overflow: hidden; max-width: 50vw; }
.tray img { width: 40px; height: 40px; object-fit: contain; }
.btn { background: var(--panel); border: 1px solid #333; padding: 7px 16px; }
.btn:hover { background: #222; }
.btn.go { background: var(--gold); border-color: var(--gold); color: #000; font-weight: 500; }

/* ------------------------------------------------ compare */
.cmp-kicker { color: var(--gold); text-align: center; font-size: 30px; font-weight: 300; margin: 12px 0 0; }
.cmp-body { display: flex; padding: 16px 24px 16px; }
.cmp-wrap { flex: 1; min-width: 0; position: relative; }
.cmp-scroll { overflow-x: auto; }
/* the edge arrows: more columns are hidden there (the bar at the bottom of the scrolled area is about 17 px high) */
.more { position: absolute; top: 0; bottom: 17px; width: 64px; z-index: 5; font-size: 44px; line-height: 1; color: #fff; display: flex; align-items: center; }
.more[hidden] { display: none; }
.more-right { right: 0; justify-content: flex-end; padding-right: 6px; background: linear-gradient(90deg, transparent, rgba(0, 0, 0, .92) 70%); animation: nudge-right 1.6s ease-in-out infinite; }
.more-left { left: 0; justify-content: flex-start; padding-left: 6px; background: linear-gradient(270deg, transparent, rgba(0, 0, 0, .92) 70%); animation: nudge-left 1.6s ease-in-out infinite; }
.more:hover { color: var(--gold); }
@keyframes nudge-right { 50% { padding-right: 0; } }
@keyframes nudge-left { 50% { padding-left: 0; } }
.cmp-empty { color: #bdbdbd; max-width: 620px; margin: 0 auto; padding: 36px 20px; font-weight: 300; }
.cmp-empty h3 { color: var(--text); font-size: 24px; font-weight: 300; margin: 0 0 12px; }
.cmp-empty .hint { color: var(--muted); font-size: 13px; } .cmp-empty a { text-decoration: underline; } .cmp-empty .example { text-decoration: none; }
.steps { padding-left: 22px; margin: 0 0 18px; } .steps li { margin: 6px 0; } .steps b, .help li b { color: var(--text); font-weight: 500; }
.examples { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 18px; }
.example { display: flex; align-items: center; gap: 2px; padding: 4px 14px 4px 6px; background: var(--card); border: 1px solid var(--line); color: var(--text); font-weight: 400; }
.example:hover { background: var(--panel); border-color: #555; }
.example img { width: 44px; height: 44px; object-fit: contain; } .example span { margin-left: 8px; }
.none { color: #555; }
.chooser { flex: none; width: clamp(340px, 28vw, 500px); margin-left: 24px; display: flex; flex-direction: column; }
.chooser .picker { flex: 1 1 0; min-height: 120px; height: auto; margin: 12px 0 0; }
.cmp-grid { flex: 1; display: grid; grid-template-rows: auto auto 1fr; grid-template-columns: repeat(var(--n), minmax(var(--colmin), 1fr)); --colmin: 360px; --gap: 28px; column-gap: var(--gap); min-width: calc(var(--n) * var(--colmin) + (var(--n) - 1) * var(--gap)); }   /* as wide as its columns: the sticky reference column moves along the whole grid */
.c-head { padding-bottom: 12px; }
/* the reference column: as wide as one column, it sticks to the left edge of the scrolled area and the other columns pass behind it */
/* it spans the whole grid (a sticky element moves only inside its grid area) and starts at its own place (--i: its column), as wide as one column */
.cmp-grid .is-ref { grid-column: 1 / -1 !important; justify-self: start; min-width: var(--colmin); width: calc((100% - (var(--n) - 1) * var(--gap)) / var(--n));
  margin-left: calc(var(--i, 0) * ((100% - (var(--n) - 1) * var(--gap)) / var(--n) + var(--gap))); position: sticky; left: 0; z-index: 2; background: var(--bg); box-shadow: 10px 0 10px -6px #000; }
.c-title { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
.c-title b { font-size: 28px; font-weight: 700; letter-spacing: -1px; color: var(--accent-text); }
.c-tools { display: flex; align-items: center; gap: 8px; padding: 6px 0 4px; }
/* the grip at the left, the tools together at the right: Versions, Counters, Counterparts, Ref and the X right of Ref */
.c-tools .tool.counters { margin-left: auto; }   /* the grip at the left, the tools together at the right */
.c-tools .x { color: #ff8a80; border-color: #6b2a2a; background: #2a1010; }
.c-tools .x:hover { background: #4a1818; border-color: #a33; color: #ffb3ac; }
.ref:hover, .counters:hover:not(:disabled), .versions:hover:not(:disabled) { background: #222; }
.counters:disabled, .versions:disabled { color: #4a4a4a; border-color: #222; border-style: dashed; background: none; cursor: not-allowed; }
.ref.active { background: var(--gold); border-color: var(--gold); color: #000; font-weight: 500; }
.chooser.collapsed { width: 44px; margin-left: 12px; }
.chooser.collapsed .toggle-pick { flex: 1; width: 44px; background: #0b0b0b; color: var(--muted); font-size: 14px; }
.chooser.collapsed .toggle-pick:hover { background: #161616; color: #fff; }
.cmp-clear { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; padding: 6px 12px 0; }
.cmp-clear .btn:disabled, .cmp-clear .btn:disabled:hover { color: #4a4a4a; border-color: #222; border-style: dashed; background: none; cursor: not-allowed; }
.c-searchrow { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.c-search { position: relative; flex: 1; }
.c-searchrow .toggle-pick { padding: 7px 11px; color: var(--muted); font-size: 14px; background: #0e0e0e; }
.c-searchrow .toggle-pick:hover { color: #fff; background: #222; }
.c-search .search { width: 100%; padding-right: 46px; }
.clear { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 14px; color: var(--muted); }
.search:placeholder-shown + .clear { display: none; }
.clear:hover { background: #222; color: var(--text); }
.x { width: 34px; height: 34px; flex: none; border-radius: 50%; border: 1px solid var(--line); background: #0b0b0b; font-size: 15px; display: grid; place-items: center; }
.x:hover { background: #222; }

.picker { display: grid; grid-template-columns: repeat(3, 1fr); align-content: start; gap: 2px; overflow-y: auto; background: #060606; }
.pick { padding: 4px; text-align: center; font-size: 13px; line-height: 1.15; position: relative; }
.pick:hover { background: #1a1a1a; }
.pick.chosen { opacity: .35; cursor: default; }
.pick.chosen:hover { background: none; }
.pick img { width: 100%; max-width: 150px; aspect-ratio: 1; height: auto; object-fit: contain; margin: 0 auto; }
.pick .tier { position: absolute; top: 3px; left: 3px; font-size: 10px; padding: 1px 4px; }

.c-unit { text-align: center; }
/* the picture shrinks with the height of the window, so that the stats and the footer fit without a scrollbar */
.c-pic { position: relative; width: var(--pic, 300px); max-width: 100%; margin: 0 auto; }
.c-pic img { width: 100%; aspect-ratio: 1; object-fit: contain; }   /* square, also before it is loaded: the layout is fitted to the window at once */
.c-name { font-size: 26px; font-weight: 300; letter-spacing: -.5px; }
.c-desc { color: var(--gold); font-size: 16px; letter-spacing: -.3px; }
.c-desc .tier { margin-left: 8px; vertical-align: 2px; }
.c-eq { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; padding: 10px 0 2px; font-size: 12px; color: var(--muted); align-items: center; }
.c-eq button { padding: 2px 10px; background: #111; border: 1px solid var(--accent-line); color: var(--accent-text); }
.c-eq .c-eq-all { border-color: #333; color: var(--muted); }
.c-eq .c-eq-all:hover { color: var(--text); border-color: #777; }
.c-eq button:hover { background: #222; }

.stats { padding-top: 14px; }
.stat { display: grid; grid-template-columns: 112px 1fr; gap: 16px; align-items: center; height: 28px; color: var(--muted); font-size: 14px; font-weight: 300; }
.stat label { text-align: right; white-space: nowrap; }
.bar { position: relative; height: 15px; border-radius: 8px; overflow: hidden; background: linear-gradient(90deg, #6a6a6a, #2a2a2a 55%, #1c1c1c); }
.fill { position: absolute; top: 0; bottom: 0; left: 0; min-width: 3px; }
.val { position: absolute; left: 3px; top: 1px; height: 13px; padding: 0 5px; border-radius: 6px; background: rgba(0, 0, 0, .85); font-size: 12px; line-height: 13px; color: #fff; font-weight: 400; font-variant-numeric: tabular-nums; }
.fill-metal { background: #d6d6d6; }
.fill-energy { background: #ffd48a; }
.fill-time { background: repeating-linear-gradient(135deg, #e6d24a 0 4px, #111 4px 8px); }
.fill-power { background: #7fd0c0; }
.fill-make { background: #f4e04d; }
.fill-hp { background: #79d969; }
.fill-radar { background: #b79cf0; }
.fill-speed { background: #3da5e8; }
.fill-dps { background: #ef5b5b; }
.fill.diff-good { background: #3fbf5f; }
.fill.diff-bad { background: #e0443c; }
/* equal to the reference: greyed out, so that only the differences stand out */
.fill.diff-same { background: #3a3a3a; }
.weapons.same { color: #666; }
.fill.diff-same + .val { color: #8a8a8a; background: rgba(0, 0, 0, .5); }
/* with a Ref the number is the difference to it, in the colour of its bar */
.fill.diff-good + .val { color: #7dec97; font-weight: 700; } .fill.diff-bad + .val { color: #ff8a82; font-weight: 700; }
.fill-range { background: repeating-linear-gradient(90deg, #d94a4a 0 2px, #6e2626 2px 4px); }
/* the reference column: every bar in one colour (yellow, as Energy), so that the red and green of the other columns stand out */
.stats.is-ref .fill { background: #ffd48a; }
.stats.is-ref .weapons, .cmp-table td.ref-col { color: #ffd48a; }
.weapons { color: #ee3b3b; font-weight: 400; font-size: 14px; letter-spacing: -.3px; }

/* exactly two columns: mirrored, the bars meet in the middle */
.two { --gap: 2px; }
.two .left.c-head { padding-right: 24px; }
.two .right.c-head { padding-left: 24px; }
.two .left .c-pic { margin-right: 0; }
.two .right .c-pic { margin-left: 0; }
.two .left.c-unit { text-align: right; padding-right: 22px; }
.two .right.c-unit { text-align: left; padding-left: 22px; }
.two .left .c-eq { justify-content: flex-end; }
.two .right .c-eq { justify-content: flex-start; }
.two .left .bar { background: linear-gradient(270deg, #6a6a6a, #2a2a2a 55%, #1c1c1c); }
.two .left .fill { left: auto; right: 0; }
.two .left .val { left: auto; right: 3px; }
.two .left .weapons { text-align: right; }
.two .right .stat { grid-template-columns: 1fr 112px; }
.two .right .stat label { text-align: left; order: 2; }

@media (max-width: 900px) {
  .cmp-body { flex-direction: column; } .chooser { width: auto; margin: 16px 0 0; } .chooser .picker { height: 360px; flex: none; }
  .title h1 { font-size: 44px; } .title b { font-size: 28px; } .tabs :is(a, button) { padding: 0 12px 8px; font-size: 16px; }
  .card { width: 170px; min-height: 180px; } .card .pic { width: 130px; height: 130px; } .card .name { font-size: 15px; } .card .desc { font-size: 12px; }
  .row { grid-template-columns: 30px 24px 44px 1fr 60px; } .row .desc, .row .opt { display: none; } .row .pic { width: 40px; height: 40px; }
  .cmp-grid { --colmin: 320px; } .stat { grid-template-columns: 92px 1fr; gap: 8px; font-size: 13px; } .two .right .stat { grid-template-columns: 1fr 92px; }
}
/* phones: everything a step smaller and closer together; the header in two lines (brand, version, GitHub; then the links) */
@media (max-width: 600px) {
  body { font-size: 14px; }
  .nav { flex-wrap: wrap; gap: 4px 12px; padding: 8px 12px; }
  .brand { margin-right: auto; }
  .brand { font-size: 14px; } #version, .gh { font-size: 11px; } .gh span, .v-label { display: none; }
  #nav-links { order: 5; flex: 1 0 100%; margin: 0 -10px; }
  #nav-links a, .fav-open { padding: 4px 10px; }
  .legal { font-size: 11px; padding: 16px 12px; }
  .title { padding: 12px 12px 4px; gap: 4px 14px; } .title h1 { font-size: 34px; } .title b { font-size: 22px; } .switch { font-size: 14px; gap: 4px 12px; }
  .tabs { padding: 8px; } .tabs :is(a, button) { padding: 0 8px 6px; font-size: 14px; } .tabs :is(a, button) svg { width: 13px; height: 13px; }
  .controls { gap: 10px 14px; padding: 8px 12px; }
  .seg button { padding: 6px 12px; font-size: 14px; } .seg button svg { width: 18px; height: 14px; }
  .toggle { font-size: 14px; } .search { font-size: 13px; padding: 7px 16px; }
  .grid { padding: 8px 8px 100px; } .card { width: calc(50% - 1px); min-height: 160px; } .card .pic { width: 110px; height: 110px; } .card .name { margin-top: -20px; }
  .list { padding: 8px 8px 100px; } .row { font-size: 13px; gap: 8px; padding: 4px 6px; }
  .tray { gap: 8px; padding: 6px 10px; font-size: 13px; } .tray img { width: 32px; height: 32px; } .btn { padding: 6px 12px; }
  .cmp-kicker { font-size: 22px; margin-top: 8px; }
  .cmp-clear { gap: 4px; } .cmp-clear .btn { padding: 4px 10px; font-size: 13px; }
  .cmp-body { padding: 8px 12px; }
  .cmp-grid { --colmin: 280px; --gap: 20px; }
  .more { width: 44px; font-size: 34px; }
  .c-title b { font-size: 22px; } .c-tools { gap: 6px; } .x { width: 30px; height: 30px; font-size: 13px; }
  .c-name { font-size: 20px; } .c-desc { font-size: 14px; } .c-eq { font-size: 11px; } .c-eq button { padding: 1px 7px; }
  .stats { padding-top: 10px; } .stat { grid-template-columns: 94px 1fr; height: 26px; font-size: 12px; } .two .right .stat { grid-template-columns: 1fr 94px; } .weapons { font-size: 13px; }
  .c-searchrow .toggle-pick { font-size: 13px; padding: 4px 9px; } .pick { font-size: 12px; }
  .cmp-table { font-size: 13px; } .cmp-table th, .cmp-table td { padding: 4px 8px; } .cmp-table thead th { min-width: 150px; } .cmp-table .t-pic img { width: 48px; height: 48px; }
  .cmp-table .t-name { font-size: 14px; }
}
.cmp-table { border-collapse: collapse; font-size: 14px; }
.cmp-table th, .cmp-table td { padding: 5px 14px; border-bottom: 1px solid #1c1c1c; text-align: left; vertical-align: top; }
.cmp-table thead th { border-bottom: 1px solid #444; min-width: 210px; font-weight: 400; }
.cmp-table tbody th { color: var(--muted); font-weight: 300; white-space: nowrap; position: sticky; left: 0; background: var(--bg); z-index: 2; }
.cmp-table .t-corner { position: sticky; left: 0; background: var(--bg); z-index: 3; min-width: 0; }
.cmp-table .t-fac { color: var(--accent-text); font-size: 12px; }
.cmp-table .t-name { font-weight: 500; font-size: 15px; }
.cmp-table .t-desc { color: var(--muted); font-size: 12px; }
.cmp-table .c-tools { padding: 6px 0 2px; flex-wrap: nowrap; gap: 6px; }
.cmp-table .c-tools .x { width: 28px; height: 28px; font-size: 13px; }
.cmp-table .ref, .cmp-table .counters { padding: 3px 8px; font-size: 12px; }
.cmp-table td.num { font-variant-numeric: tabular-nums; }
.cmp-table td.diff-good { color: #5fdc7e; }
.cmp-table td.diff-bad { color: #ff6b62; }
.cmp-table td.diff-same { color: #555; font-weight: 400; }
.cmp-table td.top { font-weight: 600; }
.cmp-table th.is-ref { box-shadow: inset 0 -2px var(--gold); }
/* the reference column of the table sticks next to the value names: its values stay in view while the other columns are scrolled (--lw: width of the names, set in updateMore) */
.cmp-table .ref-col { position: sticky; left: var(--lw, 0px); z-index: 1; background: var(--bg); box-shadow: 8px 0 8px -6px #000; }
.cmp-table thead th.ref-col { z-index: 2; box-shadow: inset 0 -2px var(--gold), 8px 0 8px -6px #000; }
.grip { cursor: grab; color: var(--muted); letter-spacing: -3px; padding: 6px 8px 6px 4px; user-select: none; font-size: 16px; line-height: 1; }
.grip:hover { color: var(--text); }
.drop-before { box-shadow: inset 4px 0 var(--gold); }
.drop-after { box-shadow: inset -4px 0 var(--gold); }
.fav-wrap { position: relative; }
.fav-open { padding: 4px 14px; color: var(--muted); }
.fav-open:hover, .fav-open.active { color: var(--text); background: var(--panel); }
.fav-panel { position: absolute; top: calc(100% + 8px); left: 0; z-index: 20; width: max-content; min-width: 280px; max-width: min(560px, 90vw); background: #0d0d0d; border: 1px solid #444; box-shadow: 0 8px 24px #000a; }
.fav-panel .empty { padding: 12px 14px; color: var(--muted); font-size: 13px; }
.fav-item { display: flex; align-items: stretch; border-bottom: 1px solid #1c1c1c; }
.fav-load { flex: 1; text-align: left; padding: 8px 14px; font-size: 14px; }
.fav-load:hover { background: #1a1a1a; }
.fav-del { padding: 0 12px; color: #c66; font-size: 13px; }
.fav-del:hover { background: #3a1414; }
.fav-star { color: var(--gold); font-size: 18px; line-height: 1.2; }
.fav-star.on { background: #3a2c10; }
.cmp-table .t-pic img { width: 64px; height: 64px; object-fit: contain; }
.search.code { border-color: #3f8f55; background: #0b1a10; color: #9be3ae; }
.fav-load span { color: var(--accent-text); }
.fav-extra { color: var(--muted); font-style: normal; font-size: 12px; margin-left: 6px; white-space: nowrap; }
#nav-links a, .fav-open { white-space: nowrap; }
/* game versions: the version of a column, the units that differ from the base version, the values that changed */
/* the version of a column: on a line of its own between the name of the faction and the tools */
.c-title .c-ver, th .c-ver { margin-left: 0; width: 100%; min-width: 0; max-width: 100%; background: var(--panel); border: 1px solid var(--line); color: var(--muted); font-size: 12px; padding: 2px 4px; }
th .c-ver { margin: 4px 0 0; display: block; }
span.c-ver { border: 0; background: none; }
.chg { position: absolute; top: 34px; left: 8px; z-index: 1; font-size: 10px; padding: 1px 5px; background: #3a2c10; color: var(--gold); }
.row .chg { position: static; margin-left: 6px; }
.pick-ver { position: absolute; top: 3px; right: 3px; font-size: 10px; padding: 1px 5px; background: #3a2c10; color: var(--gold); border-radius: 6px; }
.stat.changed label { color: var(--gold); }
.stat.changed label::before { content: "\25CF  "; font-size: 9px; vertical-align: 2px; }
.cmp-table th.changed { color: var(--gold); }
.cmp-table td.changed { background: #2a210d; }

/* the page "Changes": what changed between two game versions */
.changes { max-width: 1400px; margin: 0 auto; padding: 0 16px 40px; }
.chg-intro, .chg-sum, .chg-note { color: var(--muted); font-size: 13px; margin: 8px 24px; }
.chg-sum b { color: var(--text); }
.chg-note { color: var(--gold); }
.controls label { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.controls select { background: #0b0b0b; color: var(--text); border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; max-width: 240px; }
.chg-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 520px), 1fr)); gap: 6px; padding: 8px 0; }
.chg-row { display: grid; grid-template-columns: 56px 1fr; align-items: center; gap: 12px; padding: 6px 12px; background: var(--card); border: 1px solid var(--line); border-left: 3px solid var(--accent-line, var(--line)); color: var(--text); text-decoration: none; }
.chg-row:hover, .chg-row:focus-visible { background: var(--panel); outline: none; border-color: #555; }
.chg-row .pic { width: 56px; height: 56px; object-fit: contain; }
.chg-main { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.chg-name { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.chg-name b { color: var(--accent-text, var(--text)); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chg-name small { color: var(--muted); font-size: 11px; }
.chg-kind { font-size: 10px; text-transform: uppercase; letter-spacing: .04em; margin-left: auto; }
.k-new { color: #7bd88f; } .k-gone { color: #e0776b; }
.pills { display: flex; flex-wrap: wrap; gap: 4px 6px; }
.pill { font-size: 12px; background: #1a1a1a; border: 1px solid var(--line); border-radius: 12px; padding: 1px 9px; white-space: nowrap; }
.pill s { color: var(--muted); } .pill b { color: var(--gold); font-weight: 500; } .pill.muted { color: var(--muted); }
b.good { color: #5fdc7e; } b.bad { color: #ff6b62; }
.chg-intro b { color: var(--text); font-weight: 500; } .chg-intro b.good { color: #5fdc7e; } .chg-intro b.bad { color: #ff6b62; }
@media (max-width: 700px) { .chg-row { grid-template-columns: 48px 1fr; } .chg-row .pic { width: 48px; height: 48px; } }

.toggle.small { font-size: 13px; color: var(--muted); letter-spacing: 0; } .toggle.small i { width: 34px; height: 18px; } .toggle.small i::after { width: 12px; height: 12px; } .toggle.small input:checked + i { background: var(--gold); } .toggle.small input:checked + i::after { left: 19px; }

/* the line for the first visit (catalog), the code name of units with the same name */
.intro { display: flex; align-items: center; gap: 12px; width: fit-content; max-width: calc(100% - 32px); margin: 4px auto 0; padding: 8px 10px 8px 16px; background: #14110a; border: 1px solid #4a3a1a; border-radius: 8px; color: #d8d8d8; font-size: 14px; }
.intro b { color: var(--gold); font-weight: 500; } .intro a { color: var(--gold); font-weight: 500; text-decoration: underline; white-space: nowrap; }
.intro button { color: var(--muted); padding: 2px 6px; } .intro button:hover { color: var(--text); }
.code { display: block; color: var(--muted); font-size: 11px; font-weight: 400; } .row .code { display: inline; margin-left: 4px; }

/* the page Help */
.help { max-width: 820px; margin: 0 auto; padding: 0 20px 60px; color: #cfcfcf; line-height: 1.5; }
.help h2 { color: var(--gold); font-size: 20px; font-weight: 400; margin: 30px 0 8px; }
.help .lead { font-size: 16px; } .help a:not(.btn) { text-decoration: underline; }
.help ul { list-style: none; padding: 0; margin: 0; } .help ul li { padding: 7px 0; border-bottom: 1px solid #161616; }
.help ul li { display: grid; grid-template-columns: 170px 1fr; gap: 12px; }
.help .btn { display: inline-block; margin: 4px 6px 0 0; }
@media (max-width: 600px) { .help ul li { grid-template-columns: 1fr; gap: 0; } .intro { font-size: 13px; } }

/* ------------------------------------------------ phones and narrow windows: compact, made for a finger */
.fab, .mv { display: none; }
@media (max-width: 900px) {
  /* a swipe stops with a column right beside the strip of the reference column. Only with a finger (the class touch: app.js): while the bar is dragged with the
     mouse the browser pulled the columns back to the last column again and again, the view jumped to and fro */
  .touch .cmp-scroll { scroll-snap-type: x proximity; }   /* scroll-padding-left: set in updateMore (behind the stuck reference column) */
  .cmp-grid > .c-head:not(.is-ref) { scroll-snap-align: start; }
  /* the unit selection: a sheet that comes up from the bottom edge (button "+ Add units"), so that it is always at hand */
  .chooser.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; width: auto; height: 72vh; margin: 0; padding: 10px 10px 0; background: #0c0c0c; border-top: 2px solid var(--gold); box-shadow: 0 -12px 30px #000; transform: translateY(105%); transition: transform .18s; visibility: hidden; }
  .chooser.sheet.open { transform: none; visibility: visible; }
  .chooser.sheet .picker { flex: 1 1 0; height: auto; min-height: 0; margin-top: 8px; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
  .chooser.sheet .toggle-pick { background: var(--gold); color: #000; font-weight: 500; padding: 7px 14px; }
  .fab { display: block; position: fixed; right: 12px; bottom: 12px; z-index: 30; background: var(--gold); color: #000; font-weight: 500; padding: 11px 18px; border-radius: 24px; box-shadow: 0 4px 16px #000; }
  .cmp-body { padding-bottom: 70px; }
  .legal { padding-bottom: 76px; }
  .mv { display: block; width: 28px; height: 28px; border: 1px solid #444; background: #0b0b0b; font-size: 18px; line-height: 1; }
}
@media (max-width: 600px) {
  /* header: the links fit in one line */
  #nav-links { margin: 0 -6px; gap: 0; } #nav-links a, .fav-open { padding: 5px 9px; font-size: 13px; } .fav-word { display: none; }
  #version select { max-width: 60vw; }
  /* catalog: title and factions in one line each, the categories in one row that is scrolled sideways, three units per row */
  .title { padding: 8px 10px 0; gap: 2px 10px; } .title h1 { font-size: 26px; } .title b { font-size: 20px; } .switch { font-size: 13px; gap: 2px 10px; width: 100%; justify-content: center; }
  .tabs { flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; padding: 8px 8px 4px; scrollbar-width: none; } .tabs::-webkit-scrollbar { display: none; }
  .tabs :is(a, button) { flex: none; flex-direction: row; gap: 6px; padding: 6px 10px; font-size: 14px; } .tabs :is(a, button) svg { margin: 0; }
  .intro { margin: 6px 8px 0; max-width: none; width: auto; padding: 6px 6px 6px 10px; font-size: 12px; gap: 6px; }
  .controls { gap: 8px; padding: 8px; } .controls .search { order: -1; width: 100%; }
  .seg button { padding: 6px 10px; font-size: 13px; gap: 6px; } .seg.small button { padding: 6px 10px; } .toggle { font-size: 13px; gap: 6px; } .controls .btn { padding: 5px 10px; font-size: 13px; }
  .grid { padding: 4px 4px 90px; gap: 2px; } .card { width: calc(33.33% - 2px); min-height: 0; padding: 4px 2px 6px; } .card .pic { width: 100%; height: auto; aspect-ratio: 1; max-width: 120px; }
  .card .name { margin-top: -14px; font-size: 12px; line-height: 1.15; } .card .desc { display: none; } .card .tier { top: 4px; left: 4px; font-size: 10px; padding: 1px 4px; } .card .role { top: 4px; right: 4px; width: 16px; height: 16px; } .check { top: 22px; right: 5px; } .chg { top: 22px; left: 4px; }
  /* compare: two columns fit on the screen; the name of a value is above its bar */
  .cmp-kicker { display: none; } .cmp-clear { padding-top: 8px; }
  .cmp-body { padding: 8px 8px 70px; }
  .cmp-grid { --colmin: calc(50vw - 16px); --gap: 10px; }
  .c-head { padding-bottom: 6px; } .c-title { gap: 2px 6px; } .c-title b { font-size: 17px; letter-spacing: -.5px; } .c-title .c-ver { margin-left: 0; width: 100%; font-size: 11px; }
  .c-tools { flex-wrap: wrap; gap: 4px; padding: 4px 0 2px; } .x { width: 28px; height: 28px; font-size: 12px; } .mv { width: 26px; height: 26px; }
  .c-name { font-size: 16px; line-height: 1.15; } .c-desc { font-size: 12px; } .c-desc .tier { margin-left: 4px; font-size: 10px; padding: 1px 4px; }
  .c-eq { gap: 3px; padding-top: 6px; font-size: 10px; } .c-eq button { padding: 1px 5px; }
  .stats { padding-top: 8px; }
  .stat, .two .right .stat { display: block; height: auto; margin-bottom: 5px; font-size: 11px; } .stat label { display: block; text-align: left; line-height: 1.3; }
  .two .left .stat label { text-align: right; } .two .right .stat label { text-align: left; }
  .two .left.c-head { padding-right: 4px; } .two .right.c-head { padding-left: 4px; } .two .left.c-unit { padding-right: 4px; } .two .right.c-unit { padding-left: 4px; }
  .weapons { font-size: 12px; line-height: 15px; min-height: 15px; }
  .more { width: 30px; font-size: 30px; }
  .cmp-table thead th { min-width: 118px; } .cmp-table th, .cmp-table td { padding: 4px 6px; } .cmp-table .c-tools { flex-wrap: wrap; }
  .cmp-empty { padding: 20px 8px; } .cmp-empty h3 { font-size: 20px; }
  /* changes */
  .changes { padding: 0 8px 30px; } .changes .title h1 { font-size: 30px; } .chg-intro, .chg-sum, .chg-note { margin: 6px 4px; font-size: 12px; }
  .changes .controls { justify-content: flex-start; } .changes .controls label { flex: 1 1 45%; } .changes .controls select { flex: 1; min-width: 0; max-width: none; } .changes .controls label.toggle { flex: none; }
  .chg-row { padding: 5px 8px; gap: 8px; }
  .help { padding: 0 12px 40px; } .help .title h1 { font-size: 30px; }
}

/* scrolled sideways: the reference column shrinks to a narrow strip with its values only, the names of the table rows get smaller (the class is set in updateMore) */
.cmp-scroll { --strip: 88px; }
.cmp-scroll.scrolled .cmp-grid .is-ref { width: var(--refw, 88px); min-width: 0; }
.scrolled .cmp-grid .c-head.is-ref .c-title, .scrolled .cmp-grid .c-head.is-ref .c-tools > :not(.ref),
.scrolled .cmp-grid .c-unit.is-ref .c-name, .scrolled .cmp-grid .c-unit.is-ref .c-desc, .scrolled .cmp-grid .c-unit.is-ref .c-eq { display: none; }
.scrolled .cmp-grid .c-unit.is-ref .c-pic { width: 60px; }
.scrolled .cmp-grid .stats.is-ref .stat { grid-template-columns: 0 1fr; gap: 0; }
.scrolled .cmp-grid .stats.is-ref .stat label { visibility: hidden; overflow: hidden; }
.scrolled .cmp-grid .stats.is-ref .weapons { font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.scrolled .cmp-table thead th.ref-col { min-width: 0; width: 64px; max-width: 64px; padding: 4px; }
.scrolled .cmp-table th.ref-col .t-fac, .scrolled .cmp-table th.ref-col .t-name, .scrolled .cmp-table th.ref-col .t-desc, .scrolled .cmp-table th.ref-col .c-ver, .scrolled .cmp-table th.ref-col .c-tools > :not(.ref) { display: none; }
.scrolled .cmp-table th.ref-col .t-pic img { width: 44px; height: 44px; }
.scrolled .cmp-table td.ref-col { width: 64px; max-width: 64px; padding: 4px; font-size: 12px; overflow-wrap: anywhere; }
.scrolled .cmp-table tbody th { font-size: 11px; padding: 4px 6px; }
@media (max-width: 600px) {
  .cmp-scroll { --strip: 76px; }
  .scrolled .cmp-grid .stats.is-ref .stat { display: block; } .scrolled .cmp-grid .stats.is-ref .stat label { height: 15px; }
  .scrolled .cmp-table thead th.ref-col, .scrolled .cmp-table td.ref-col { width: 56px; max-width: 56px; }
}

/* the tools of a column: icon buttons with a tooltip; lit (gold) while what they added is shown, pressed again they take it out */
.c-tools .tool, .c-verrow .tool { width: 32px; height: 32px; padding: 0; display: grid; place-items: center; border: 1px solid #444; background: #0b0b0b; color: #ddd; font-size: 0; }
.c-tools .tool svg, .c-verrow .tool svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.c-tools .tool:hover:not(:disabled), .c-verrow .tool:hover:not(:disabled) { background: #222; color: #fff; }
.c-tools .tool:disabled, .c-verrow .tool:disabled { color: #444; border-color: #222; border-style: dashed; background: none; cursor: not-allowed; }
.c-tools .tool.active, .c-verrow .tool.active { border-color: var(--gold); color: var(--gold); background: #2a210d; }
.c-tools .tool.ref.active { background: var(--gold); color: #000; }
.cmp-table .c-tools .tool { width: 28px; height: 28px; } .cmp-table .c-tools .tool svg { width: 15px; height: 15px; }
.help li b svg { width: 15px; height: 15px; fill: none; stroke: var(--gold); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; vertical-align: -2px; margin-right: 4px; }
@media (max-width: 600px) {   /* a phone: all tools of a column in one line */
  .c-tools { gap: 2px; flex-wrap: nowrap; } .c-tools .tool, .c-tools .mv, .c-tools .x { width: 24px; height: 24px; } .c-tools .tool svg { width: 14px; height: 14px; } .c-tools .mv { font-size: 15px; } .c-tools .x { font-size: 11px; }
  .cmp-table .c-tools { flex-wrap: nowrap; gap: 2px; } .cmp-table .c-tools .tool, .cmp-table .c-tools .x { width: 24px; height: 24px; } .cmp-table .c-tools .tool svg { width: 14px; height: 14px; }
  /* the examples of the empty compare: as wide as the screen, the last one not under the button + Add units */
  .examples { flex-direction: column; margin-bottom: 80px; } .example { width: 100%; }
}

/* a unit with more than one version: its Versions icon carries the number of versions (data-n: 2 to 9, above 9 ">"); the note of a button that has nothing to do */
.c-tools .tool.versions.has, .c-verrow .tool.versions.has { position: relative; }
.c-tools .tool.versions.has::after, .c-verrow .tool.versions.has::after { content: attr(data-n); position: absolute; top: -6px; right: -6px; min-width: 14px; height: 14px; padding: 0 2px; box-sizing: border-box; border-radius: 7px;
  background: var(--gold); color: #000; font: 700 10px/14px sans-serif; text-align: center; pointer-events: none; }
.note-pop { position: fixed; z-index: 60; max-width: 260px; padding: 7px 11px; background: #1b1508; border: 1px solid #6b5420; color: #f0dca8; font-size: 13px; border-radius: 6px; box-shadow: 0 6px 18px #000; pointer-events: none; }
/* a difference to the Ref: a click shows the value itself */
.val [title], .cmp-table td [title] { cursor: help; }

/* ------------------------------------------------ the bar at the bottom of the catalog lies over the cards (their tech level and role icon have a z-index) */
#tray { z-index: 30; }
.btn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; vertical-align: -2px; }
.c-tools .tool.menu svg { stroke-width: 2.8; }
.c-filter { padding: 0 0 6px; } .c-filter .btn { font-size: 13px; padding: 6px 10px; }

/* with a Ref: the value itself, small, at the other end of the bar (the table: behind the difference) */
.abs { position: absolute; right: 3px; top: 1px; height: 13px; padding: 0 5px; border-radius: 6px; background: rgba(0, 0, 0, .6); color: #b5b5b5; font-size: 11px; line-height: 13px; font-variant-numeric: tabular-nums; }
.two .left .abs { right: auto; left: 3px; }
.cmp-table td .abs { position: static; height: auto; padding: 0; margin-left: 8px; background: none; color: #777; font-weight: 400; line-height: inherit; }
/* the weapons of the reference column as a strip: one line, cut off (not broken in the middle of a word) */
.scrolled .cmp-table td.ref-col.wpn { font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; overflow-wrap: normal; }

/* a click on the name of a value sorts the columns by it */
[data-a="sort"] { cursor: pointer; }
.stat label[data-a="sort"]:hover, .cmp-table tbody th[data-a="sort"]:hover { color: var(--text); }
.sorted { font-style: normal; color: var(--gold); margin-left: 4px; }

/* scrolled down: the names of the units in a line at the top of the window, above their columns (updatePin) */
.pin { position: fixed; top: 0; height: 36px; z-index: 25; overflow: hidden; background: rgba(0, 0, 0, .95); border-bottom: 1px solid #333; pointer-events: none; }
.pin[hidden] { display: none; }
.pin-u { position: absolute; top: 0; bottom: 0; box-sizing: border-box; display: flex; align-items: center; gap: 6px; padding: 0 4px; overflow: hidden; white-space: nowrap; font-size: 13px; color: var(--accent-text); }
.pin-u img { width: 30px; height: 30px; object-fit: contain; flex: none; }
.pin-u span { overflow: hidden; text-overflow: ellipsis; }
.pin-u.is-ref { z-index: 1; background: #000; color: var(--gold); box-shadow: 8px 0 8px -6px #000; }

/* over the page: the menu of a column (a sheet from the bottom edge) and all values of one unit (a card in the middle) */
#overlay:empty { display: none; }
body.modal { overflow: hidden; }
.sheet-back { position: fixed; inset: 0; z-index: 50; background: rgba(0, 0, 0, .65); }
.col-menu, .detail { position: fixed; z-index: 51; box-sizing: border-box; background: #0e0e0e; border: 1px solid #444; box-shadow: 0 12px 40px #000; overflow-y: auto; }
.col-menu { left: 0; right: 0; bottom: 0; max-height: 90vh; padding: 10px; border-width: 2px 0 0; border-top-color: var(--gold); display: flex; flex-direction: column; gap: 4px; }
.m-head { display: flex; align-items: center; gap: 10px; padding-bottom: 6px; }
.m-head img { width: 48px; height: 48px; object-fit: contain; flex: none; }
.m-text { display: flex; flex-direction: column; flex: 1; min-width: 0; text-align: left; }
.m-text b { font-weight: 500; } .m-head .m-text b { color: var(--accent-text); font-size: 16px; }
.m-text small { color: var(--muted); font-size: 12px; line-height: 1.3; }
.m-item { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 6px 10px; background: #161616; border: 1px solid #262626; text-align: left; font-size: 14px; }
.m-item:disabled { opacity: .4; }
.m-item.on { border-color: var(--gold); background: #2a210d; }
.m-item.danger, .m-item.danger b { color: #ff8a80; } .m-item.danger { border-color: #6b2a2a; background: #2a1010; }
.m-icon { width: 24px; flex: none; display: grid; place-items: center; font-size: 15px; }
.m-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.m-row { display: flex; gap: 4px; } .m-row .m-item { flex: 1; justify-content: center; }
.m-ver { display: flex; flex-direction: column; gap: 4px; padding: 6px 2px; color: var(--muted); font-size: 12px; }
.m-ver select.c-ver { width: 100%; min-height: 40px; padding: 6px 8px; background: var(--panel); border: 1px solid var(--line); color: var(--text); font-size: 14px; }
.detail { left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(460px, calc(100vw - 16px)); max-height: calc(100vh - 16px); padding: 16px; border-radius: 8px; }
.d-close { position: absolute; top: 8px; right: 8px; width: 36px; height: 36px; border-radius: 50%; background: #1a1a1a; border: 1px solid #333; }
.d-head { display: flex; align-items: center; gap: 12px; padding-right: 36px; }
.d-pic { width: 110px; height: 110px; object-fit: contain; flex: none; }
.d-fac { color: var(--accent-text); font-weight: 700; } .d-head h3 { margin: 2px 0; font-size: 22px; font-weight: 300; } .d-head p { margin: 0; color: var(--gold); font-size: 14px; }
.d-rows { margin: 12px 0; }
.d-row { display: flex; justify-content: space-between; gap: 16px; padding: 5px 2px; border-bottom: 1px solid #1c1c1c; font-size: 14px; }
.d-row span { color: var(--muted); } .d-row b { font-weight: 500; text-align: right; font-variant-numeric: tabular-nums; }
.d-more { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding: 4px 0; font-size: 12px; color: var(--muted); } .d-more span { width: 100%; }
.d-more button { padding: 4px 10px; background: #111; border: 1px solid var(--accent-line); color: var(--accent-text); font-size: 13px; }
.d-actions { display: flex; gap: 8px; padding-top: 12px; } .d-actions .btn { flex: 1; min-height: 40px; } .d-actions .btn:disabled { opacity: .4; }
/* a unit that is held shows its values: no text selection, no picture menu of the phone */
.card, .row, .pick { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }

@media (max-width: 600px) {
  /* header: brand, game version and GitHub in one line */
  #version select { max-width: 44vw; font-size: 11px; }
  /* catalog: the row of categories fades out at the right edge (there is more to swipe to) */
  .tabs { padding-right: 40px; -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 44px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 44px), transparent); }
  /* compare: the buttons above the columns in one line, big enough for a finger */
  .cmp-clear { flex-wrap: nowrap; gap: 4px; padding: 8px 8px 0; } .cmp-clear .lb { display: none; }
  .cmp-clear .btn { min-width: 38px; min-height: 36px; padding: 4px 9px; font-size: 13px; white-space: nowrap; }
  /* the head of a column: the faction at the left, Ref and the menu at the right; the values start on the first screen */
  .cmp-grid .c-head { display: flex; align-items: center; justify-content: space-between; gap: 4px; }
  .c-title { min-width: 0; flex-direction: column; flex-wrap: nowrap; align-items: flex-start; gap: 0; } .c-title b { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .c-title span.c-ver, th span.c-ver { width: auto; padding: 0; font-size: 10px; }
  .c-tools, .cmp-table .c-tools { flex: none; gap: 6px; padding: 0; } .cmp-table .c-tools { padding-top: 6px; }
  .c-tools .tool, .cmp-table .c-tools .tool { width: 36px; height: 36px; } .c-tools .tool svg, .cmp-table .c-tools .tool svg { width: 18px; height: 18px; }
  .c-eq { display: none; }   /* the counterparts are in the menu of the column */
  .stat label { padding-top: 2px; }
}
/* a low window (a phone held sideways): less above the columns */
@media (max-height: 500px) and (max-width: 900px) {
  .nav { padding: 4px 12px; } .cmp-kicker { display: none; } .cmp-clear { padding-top: 6px; } .cmp-clear .lb { display: none; }
  .c-name { font-size: 16px; } .c-desc { font-size: 12px; } .c-eq { display: none; }
}
/* the table on a narrow window with a Ref: room behind the last column, so that it can be scrolled right beside the strip of the reference column */
.cmp-table thead th.t-pad { min-width: 0; padding: 0; border: 0; }   /* its width: updateMore */

/* ------------------------------------------------ Changes: the buttons above the list, and one column per faction (a unit and its counterparts in one row) */
.changes { max-width: 1800px; }
.chg-grid { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 6px 10px; padding: 8px 0; }
.chg-head { position: sticky; top: 0; z-index: 3; padding: 6px 12px; background: var(--bg); border-bottom: 2px solid var(--accent-line); color: var(--accent-text); font-size: 18px; font-weight: 300; }
.chg-head small { color: var(--muted); font-size: 12px; }
.chg-cell { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.chg-cell .chg-row { flex: 1; align-items: start; }
.chg-cell:empty { border: 1px dashed #1c1c1c; }
.chg-cell .pill { white-space: normal; }
@media (max-width: 1500px) { .chg-grid .chg-row { grid-template-columns: 44px 1fr; gap: 8px; padding: 6px 8px; } .chg-grid .chg-row .pic { width: 44px; height: 44px; } .chg-grid .chg-name small { display: none; } }
/* a narrow window: one column; the units of a row follow each other (their colour says the faction) */
@media (max-width: 900px) {
  .chg-grid { grid-template-columns: 1fr; } .chg-head, .chg-cell:empty { display: none; }
  .chg-grid .chg-name small { display: inline; }
}

/* ------------------------------------------------ the choice of units, the same on every page (filterHtml): the factions and the tech levels, below them the kinds of units */
.filt { display: flex; flex-direction: column; align-items: center; }
.filt-row { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px 28px; padding: 4px 24px 0; }
.filt-fac { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px; }
.filt-fac :is(a, button) { padding: 5px 14px; font-size: 17px; font-weight: 700; letter-spacing: -.3px; color: var(--accent-text); white-space: nowrap; }
.filt-fac :is(a, button):hover { background: #161616; }
.filt-fac .active, .filt-fac .active:hover { background: var(--accent); color: var(--on-accent); box-shadow: inset 0 0 0 1px var(--accent-line); }
.filt-fac .zero:not(.active) { opacity: .45; }
.filt small { font-size: 11px; font-weight: 400; opacity: .7; }
.filt .tabs { align-self: stretch; }
.f-none { --accent: var(--gold); --accent-text: var(--text); --on-accent: #000; --accent-line: var(--gold); }
.f-none .tabs .active svg { fill: #000; }
/* the unit selection of the compare: the same, smaller and from the left */
.filt.small { align-items: stretch; }
.filt.small .filt-row { justify-content: space-between; padding: 0; gap: 4px 8px; } .filt.small .filt-fac { justify-content: flex-start; }
.filt.small .filt-fac button { padding: 4px 8px; font-size: 14px; }
.filt.small .seg.small button { padding: 4px 9px; font-size: 12px; }
.filt.small .tabs { justify-content: flex-start; padding: 8px 0 0; } .filt.small .tabs button { padding: 0 9px 6px; font-size: 14px; } .filt.small .tabs svg { width: 12px; height: 12px; }
@media (max-width: 600px) {
  .filt-row { padding: 4px 8px 0; gap: 4px 10px; } .filt-fac :is(a, button) { padding: 5px 9px; font-size: 14px; }
  .filt.small .tabs { padding: 6px 0 2px; }
}
.f-none .tabs .active { font-weight: 500; }

/* ------------------------------------------------ the toolbar of the compare (toolbarHtml): groups of buttons with icons, a lit button is a switch that is on */
.cmp-clear { align-items: center; gap: 10px; padding-top: 10px; }
.tb-group { display: inline-flex; }
.tb-group .btn { display: inline-flex; align-items: center; gap: 7px; min-height: 36px; padding: 6px 13px; background: #111; border: 1px solid #2e2e2e; border-radius: 0; font-size: 14px; color: #ddd; }
.tb-group .btn + .btn { margin-left: -1px; }   /* the frames overlap: one line between two buttons, a lit one draws its whole frame on top */
.tb-group .btn.on { position: relative; z-index: 1; }
.tb-group .btn:first-child { border-radius: 8px 0 0 8px; } .tb-group .btn:last-child { border-radius: 0 8px 8px 0; } .tb-group .btn:only-child { border-radius: 8px; }
.tb-group .btn:hover:not(:disabled) { background: #1d1d1d; color: #fff; }
.tb-group .btn svg { width: 16px; height: 16px; vertical-align: 0; flex: none; }
.tb-group .btn.on { background: #2a210d; border-color: var(--gold); color: var(--gold); }
.tb-group .btn:not([data-a]).on { cursor: default; }
.tb-group .btn.fav-star { font-size: 14px; color: #ddd; } .tb-group .btn.fav-star svg { color: var(--gold); } .tb-group .btn.fav-star.on svg { fill: var(--gold); }
.tb-group .btn.danger:not(:disabled):hover { background: #2a1010; border-color: #6b2a2a; color: #ff8a80; }
.tb-group .btn:disabled, .tb-group .btn:disabled:hover { cursor: not-allowed; } .cmp-clear .tb-group .btn:disabled, .cmp-clear .tb-group .btn:disabled:hover, .tb-group .btn:disabled { background: #0b0b0b; border-style: solid; border-color: #222; color: #4a4a4a; }
.tb-group .btn:disabled svg { color: inherit; }
@media (max-width: 600px) {
  .cmp-clear { gap: 6px; justify-content: center; }
  .tb-group .btn { min-width: 38px; justify-content: center; padding: 4px 9px; }
}
.chg-step .btn { min-height: 34px; padding: 5px 12px; font-size: 13px; }

/* ------------------------------------------------ the header: an icon before each page */
#nav-links a { display: inline-flex; align-items: center; gap: 7px; }
#nav-links a svg { width: 15px; height: 15px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
/* the versions of a unit: the list (white with several versions, grey with one) and the button Versions right of it */
.c-verrow { display: flex; align-items: center; gap: 6px; width: 100%; min-width: 0; }
.c-verrow .c-ver { flex: 1; width: auto; }
th .c-verrow { margin-top: 4px; } th .c-verrow .c-ver { margin: 0; }
.c-verrow .tool { flex: none; width: 30px; height: 26px; } .c-verrow .tool svg { width: 15px; height: 15px; }
select.c-ver.many { color: var(--text); border-color: #555; cursor: pointer; }
select.c-ver:disabled { color: #666; }
.scrolled .cmp-table th.ref-col .c-verrow { display: none; }
.c-verrow { box-sizing: border-box; padding-right: 6px; }   /* room for the number on the clock (it sticks out at the top right) */
@media (max-width: 600px) { #nav-links a { gap: 4px; padding: 5px 7px; } #nav-links a svg { width: 13px; height: 13px; } }
/* a switch button outside the toolbar (Changed units only in the catalog and the unit selection): icon and word, lit while on */
.btn.tg { display: inline-flex; align-items: center; gap: 7px; }
.btn.tg.on { background: #2a210d; border-color: var(--gold); color: var(--gold); }
/* Undo / Redo: a badge with the number of steps (no step: no badge) */
.tb-group .btn.n-steps { position: relative; overflow: visible; }
.tb-group .btn.n-steps::after { content: attr(data-n); position: absolute; top: -7px; right: -6px; z-index: 2; min-width: 16px; height: 16px; padding: 0 4px; box-sizing: border-box; border-radius: 8px; background: var(--gold); color: #000; font-size: 10px; font-weight: 700; line-height: 16px; text-align: center; pointer-events: none; }
/* the heading of the unit selection of the compare: bold like the names of the factions above the columns, in gold */
.c-pick-title { margin: 0 0 10px; color: var(--gold); font-size: 28px; font-weight: 700; letter-spacing: -1px; line-height: 1.2; }
@media (max-width: 900px) { .c-pick-title { font-size: 20px; letter-spacing: -.5px; margin-bottom: 6px; } }
/* the unit selection can be folded away to the right: Hide next to its heading; folded, a strip with the word Select units brings it back */
.c-pick-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.c-pick-head .c-pick-title { margin: 0; }
.c-pick-head .toggle-pick { padding: 6px 12px; border: 1px solid #333; border-radius: 8px; background: #111; color: #ddd; font-size: 13px; white-space: nowrap; }
.c-pick-head .toggle-pick:hover { background: #1d1d1d; color: #fff; border-color: #555; }
.chooser.collapsed { width: 48px; }
.chooser.collapsed .toggle-pick { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 14px; width: 48px; padding: 14px 0; border: 1px solid #2e2e2e; border-radius: 8px; background: #0e0e0e; color: var(--gold); }
.chooser.collapsed .toggle-pick:hover { background: #1a1a1a; border-color: var(--gold); }
.tp-arrow { font-size: 14px; } .tp-word { writing-mode: vertical-rl; transform: rotate(180deg); font-size: 18px; font-weight: 700; letter-spacing: -.3px; white-space: nowrap; }

/* Clear asks first */
.detail.ask { width: min(400px, calc(100vw - 16px)); }
.ask h3 { margin: 0 0 8px; font-size: 22px; font-weight: 500; } .ask p { margin: 0; color: #ccc; font-size: 14px; line-height: 1.5; }
.ask .btn.danger { display: inline-flex; align-items: center; justify-content: center; gap: 7px; background: #3a1212; border-color: #8a3030; color: #ff9a90; }
.ask .btn.danger:hover, .ask .btn.danger:focus-visible { background: #5a1a1a; color: #fff; }
