/* core.css: structure only. Every colour, font and decorative frame comes from theme tokens (see themes/base-dark-gold.css).
   Layout: one reading column. A console panel (date scrubber + picker), a vertical patch rail, then one card per chosen entity.
   The baseline is deliberately quiet (unslop pass): one accent used for the few chosen things, no glows or gradients,
   sentence case, spacing on a 4px grid. A game theme sets tokens and adds its own signature detail; it should not need
   to undo anything here. */
* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
}
.wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding-block: 40px 64px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
a { color: var(--fg); }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
h1, h2, h3, h4, h5, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }


/* masthead */
.masthead { position: relative; display: grid; gap: 16px; padding-bottom: 32px; }
h1 { font-family: var(--font-headline); font-weight: 600; font-size: clamp(36px, 5vw, 56px); line-height: 1.08; max-width: 18ch; text-wrap: balance; }
.intro { max-width: 62ch; color: var(--muted); }


/* console */
.console { clip-path: var(--frame-clip); box-shadow: var(--bevel); background: var(--panel-bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px clamp(16px, 3vw, 32px) 32px; display: grid; gap: 16px; }
.when-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; }
h2 { font-family: var(--font-display); font-weight: 500; font-size: clamp(22px, 2.6vw, 28px); line-height: 1.2; text-wrap: balance; }
.when { font-family: var(--font-display); font-weight: 500; font-size: clamp(24px, 3vw, 32px); color: var(--fg); font-variant-numeric: tabular-nums; }

.scrub { position: relative; height: 96px; margin-top: 4px; }
.track { position: absolute; left: 14px; right: 14px; top: 46px; height: 6px; background: var(--line); border-radius: 3px; }
.fill { position: absolute; top: 0; bottom: 0; background: var(--accent); border-radius: 3px; }
.tick { position: absolute; top: 10px; width: 0; }
.tick i { position: absolute; left: -.5px; top: 0; width: 1px; height: 8px; background: var(--muted); opacity: .6; }
.tick b { position: absolute; left: 0; top: 14px; transform: translateX(-50%); font-family: var(--font-label); font-weight: 500; font-size: 13px; color: var(--muted); white-space: nowrap; }
.mark { position: absolute; top: -9px; width: 0; }
.mark i { position: absolute; left: -5px; top: 0; width: 10px; height: 10px; background: var(--bg); border: 2px solid var(--muted); transform: rotate(45deg) scale(.85); }
.mark b { position: absolute; left: 0; top: -22px; transform: translateX(-50%); font-family: var(--font-label); font-weight: 500; font-size: 13px; color: var(--muted); white-space: nowrap; }
.track .mark { top: -3px; }
.track .tick { top: 6px; }
.track .tick b { top: 22px; }
.track .mark b { top: -30px; }
.scrub input[type=range] { position: absolute; left: 0; right: 0; top: 30px; width: 100%; height: 40px; margin: 0; background: transparent; -webkit-appearance: none; appearance: none; cursor: grab; }
.scrub input[type=range]::-webkit-slider-runnable-track { height: 40px; background: transparent; }
.scrub input[type=range]::-moz-range-track { height: 40px; background: transparent; }
.scrub input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 28px; height: 28px; margin-top: 6px; background: var(--accent); border: 0; clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); }
.scrub input[type=range]::-moz-range-thumb { width: 28px; height: 28px; background: var(--accent); border: 0; clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); }
.scrub input[type=range]:focus-visible { outline: none; }
.scrub input[type=range]:focus-visible::-webkit-slider-thumb { background: var(--accent-bright); }

.years { display: flex; flex-wrap: wrap; gap: 6px; }
.yr { background: var(--raise); border: 1px solid var(--line); border-radius: var(--radius); padding: 4px 12px; font-weight: 500; font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.yr:hover { color: var(--fg); border-color: var(--hover-line); }
.yr[aria-pressed=true] { color: var(--on-accent); background: var(--accent); border-color: var(--accent); }

/* picker */
.picker { display: grid; gap: 12px; border-top: 1px solid var(--line); padding-top: 24px; margin-top: 8px; }
.picker-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.picker-head .hint { color: var(--muted); font-size: 14px; }
.textbtn { background: none; border: 0; color: var(--fg); padding: 4px 0; text-decoration: underline; text-decoration-color: var(--link-line); text-underline-offset: 3px; font-size: 14px; }
.picker-head .textbtn { margin-left: auto; }
.chosen { display: flex; flex-wrap: wrap; gap: 8px; min-height: 32px; align-items: center; }
.chosen .hint { color: var(--muted); font-size: 14px; }
.pill { border: 1px solid var(--line); background: var(--raise); border-left: 3px solid var(--muted); border-radius: var(--radius); padding: 4px 12px; font-weight: 500; }
.pill:hover { border-color: var(--hover-line); }
.pill.a-str { border-left-color: var(--attr-1); } .pill.a-agi { border-left-color: var(--attr-2); } .pill.a-int { border-left-color: var(--attr-3); } .pill.a-all { border-left-color: var(--attr-4); }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.filters input[type=search] { flex: 1 1 200px; min-width: 0; background: var(--bg); color: var(--fg); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 12px; font: inherit; }
.filters input[type=search]::placeholder { color: var(--muted); }
.attrs { display: flex; flex-wrap: wrap; gap: 6px; }
.attrs button { display: inline-flex; align-items: center; background: var(--raise); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 12px; font-size: 14px; color: var(--muted); }
.attrs button[aria-pressed=true] { color: var(--fg); border-color: var(--fg); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 8px; max-height: 328px; overflow-y: auto; padding: 2px 4px 2px 2px; }
.empty { color: var(--muted); padding: 12px 0; }
.tile { position: relative; overflow: hidden; display: block; height: 64px; background: var(--raise); border: 1px solid var(--line); border-radius: var(--radius); padding: 0; text-align: left; isolation: isolate; }
.tile::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--c, var(--muted)); z-index: 3; }
.tile.a-str, .hero.a-str { --c: var(--attr-1); } .tile.a-agi, .hero.a-agi { --c: var(--attr-2); } .tile.a-int, .hero.a-int { --c: var(--attr-3); } .tile.a-all, .hero.a-all { --c: var(--attr-4); }
.tile .mono { position: absolute; right: 8px; top: 4px; font-family: var(--font-label); font-weight: 600; font-size: 24px; color: var(--c); opacity: .5; z-index: 0; }
.tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1; opacity: .85; }
.tile::after { content: ""; position: absolute; inset: 0; z-index: 2; background: linear-gradient(to top, var(--shade-strong) 0%, var(--shade-none) 70%); }
.tile .nm { position: absolute; left: 8px; right: 4px; bottom: 4px; z-index: 4; font-size: 13px; font-weight: 600; line-height: 1.15; text-shadow: 0 1px 2px var(--shade-text); }
.tile:hover { border-color: var(--hover-line); }
.tile[aria-pressed=true] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.dot.rw { display: inline-block; width: 9px; height: 9px; background: var(--accent); transform: rotate(45deg); }
.tile .dot { position: absolute; left: 12px; top: 8px; z-index: 4; }
.newtag { font-family: var(--font-label); font-weight: 600; font-size: 11px; letter-spacing: .04em; background: var(--good); color: var(--on-good); padding: 0 4px; border-radius: 2px; font-style: normal; }
.tile .newtag { position: absolute; right: 4px; top: 4px; z-index: 4; }
.legend { color: var(--muted); font-size: 13px; display: flex; gap: 8px 16px; flex-wrap: wrap; align-items: center; }
.movers h3 { font-size: 15px; font-weight: 600; margin-bottom: 8px; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: grid; text-align: left; background: var(--raise); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 12px; line-height: 1.25; }
.chip:hover { border-color: var(--hover-line); }
.chip span { color: var(--muted); font-size: 13px; }

/* sections */
.block { margin-top: 56px; display: grid; gap: 16px; }
.lead { font-size: 18px; max-width: 60ch; }
.lead strong { color: var(--fg); font-weight: 600; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.stats div { background: var(--panel-bg); padding: 16px; display: grid; gap: 2px; }
.stats b { font-family: var(--font-display); font-size: 28px; font-weight: 500; color: var(--fg); font-variant-numeric: tabular-nums; line-height: 1.1; }
.stats span { color: var(--muted); font-size: 14px; }
.note { background: var(--raise); border-left: 2px solid var(--muted); padding: 12px 16px; border-radius: 0 var(--radius) var(--radius) 0; max-width: 70ch; }
.toggle-row { display: flex; }

/* the short version: biggest changes since the chosen date */
.brief { gap: 12px; }
.brief-list { list-style: none; padding: 0; margin: 0; display: grid; background: var(--panel-bg); border: 1px solid var(--line); border-radius: var(--radius); clip-path: var(--frame-clip); }
.brief-list li + li { border-top: 1px solid var(--line); }
.brief-item { display: grid; grid-template-columns: 88px 1fr; gap: 16px; padding: 12px 20px; color: var(--fg); text-decoration: none; transition: background-color .15s var(--ease); }
a.brief-item:hover { background: var(--raise); }
.bv { display: grid; align-content: start; gap: 0; }
.bv b { font-family: var(--font-label); font-weight: 600; font-size: 18px; line-height: 1.3; font-variant-numeric: tabular-nums; color: var(--muted); }
.brief-item.t-landmark .bv b { color: var(--accent-ink); }
.bv time { color: var(--muted); font-size: 13px; }
.bt { display: grid; gap: 2px; min-width: 0; }
.bt b { font-weight: 600; }
.bt span { color: var(--muted); font-size: 14px; max-width: 72ch; }
@media (max-width: 640px) { .brief-item { grid-template-columns: 64px 1fr; gap: 12px; padding: 12px 16px; } }

/* patch rail */
.eras { position: relative; display: grid; gap: 16px; padding-left: 28px; }
.eras::before { content: ""; position: absolute; left: 6px; top: 8px; bottom: 8px; width: 2px; background: var(--line); }
.year { font-family: var(--font-display); font-size: 20px; color: var(--fg); font-weight: 500; margin-top: 8px; }
.era-row { position: relative; min-width: 0; scroll-margin-top: 16px; }
.era-row .node { position: absolute; left: -28px; top: 22px; width: 11px; height: 11px; transform: rotate(45deg); background: var(--bg); border: 2px solid var(--muted); z-index: 2; }
.era-row.t-landmark .node { background: var(--accent); border-color: var(--accent); width: 15px; height: 15px; left: -30px; top: 20px; }
.era-row.t-big .node { border-color: var(--fg); }
.era { position: relative; background: var(--panel-bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 20px; display: grid; gap: 12px; min-width: 0; clip-path: var(--frame-clip); box-shadow: var(--bevel); }
.era header { display: flex; gap: 16px; align-items: center; }
.era .ver { font-family: var(--font-label); font-weight: 600; font-size: 20px; color: var(--fg); background: var(--raise); padding: 0 12px; border-radius: var(--radius); min-width: 56px; text-align: center; font-variant-numeric: tabular-nums; }
.era.t-landmark .ver { background: var(--accent); color: var(--on-accent); }
.era h4 { font-family: var(--font-display); font-size: clamp(17px, 2.2vw, 21px); font-weight: 600; line-height: 1.2; }
.era time { color: var(--muted); font-size: 14px; }
.era .tier { margin-left: auto; font-weight: 500; font-size: 13px; color: var(--muted); }
.era.t-landmark .tier { color: var(--accent-ink); }
.sum { max-width: 70ch; }
details summary { cursor: pointer; color: var(--fg); font-weight: 500; width: fit-content; }
details ul { margin-top: 8px; display: grid; gap: 8px; max-width: 74ch; }
.era details li { position: relative; padding-left: 16px; }
.era details li::before { content: ""; position: absolute; left: 2px; top: .62em; width: 5px; height: 5px; background: var(--muted); transform: rotate(45deg); }
.meta { color: var(--muted); font-size: 14px; }
.meta b { color: var(--fg); font-weight: 500; }
.lnk { background: none; border: 0; padding: 0; color: var(--fg); text-decoration: underline; text-decoration-color: var(--link-line); text-underline-offset: 3px; }
.lnk:hover { text-decoration-color: var(--fg); }

/* hero cards */
.how { color: var(--muted); max-width: 72ch; font-size: 15px; }
.heroes { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 460px), 1fr)); gap: 16px; align-items: start; }
.hero { clip-path: var(--frame-clip); box-shadow: var(--bevel); background: var(--panel-bg); border: 1px solid var(--line); border-top: 2px solid var(--c, var(--muted)); border-radius: var(--radius); min-width: 0; }
.hero > header { position: relative; display: grid; grid-template-columns: auto 1fr auto; gap: 4px 16px; align-items: center; padding: 16px 48px 12px 16px; border-bottom: 1px solid var(--line); overflow: hidden; }
.hero .mono.big { grid-row: span 2; width: 88px; height: 50px; display: grid; place-items: center; background: var(--raise); border-radius: var(--radius); font-family: var(--font-label); font-weight: 600; font-size: 24px; color: var(--c); }
.hero > header img { position: absolute; left: 16px; top: 16px; width: 88px; height: 50px; object-fit: cover; border-radius: var(--radius); }
.who { min-width: 0; }
.who h4, .who .h4 { font-family: var(--font-display); font-size: 22px; font-weight: 600; line-height: 1.15; }
.who p { display: flex; align-items: center; flex-wrap: wrap; color: var(--muted); font-size: 14px; }
.status { grid-column: 2 / span 2; justify-self: start; font-weight: 500; font-size: 13px; padding: 0 8px; border-radius: var(--radius); border: 1px solid var(--line); }
.s-rw .status, .status.st-rw { border-color: var(--accent-line); color: var(--accent-ink); }
.s-new .status, .status.st-new { border-color: var(--good-line); color: var(--good); }
.s-heavy .status, .status.st-heavy { border-color: var(--bad); color: var(--bad); }
.s-none .status, .status.st-none { color: var(--muted); }
.hero .x { position: absolute; right: 8px; top: 8px; width: 32px; height: 32px; background: none; border: 0; border-radius: var(--radius); color: var(--muted); font-size: 22px; line-height: 1; }
.hero .x:hover { color: var(--fg); background: var(--raise); }
.hero .body { padding: 16px 16px 20px; display: grid; gap: 16px; }
.lede { max-width: 62ch; }
.hero h5, .hero .h5, .plog .h5 { font-size: 15px; font-weight: 600; margin-bottom: 8px; }
.hero h5 small, .hero .h5 small, .plog .h5 time { color: var(--muted); font-weight: 400; margin-left: 6px; }
.rwblock { background: var(--accent-soft); border: 1px solid var(--accent-line); border-radius: var(--radius); padding: 12px 16px; display: grid; gap: 8px; }
.rwblock h5, .rwblock .h5 { font-family: var(--font-display); font-size: 17px; margin: 0; color: var(--fg); font-weight: 600; }
.lines { display: grid; gap: 8px; }
.lines li { display: grid; grid-template-columns: 14px 1fr; gap: 8px; align-items: start; font-size: 15px; }
.lines li > div { min-width: 0; overflow-wrap: anywhere; }
.lines b { font-weight: 600; }
.lines small { display: block; color: var(--muted); font-size: 13px; }
.lines i { font-style: normal; font-size: 11px; line-height: 22px; text-align: center; }
.up { color: var(--good); } .dn { color: var(--bad); } .eq { color: var(--muted); }
.small { color: var(--muted); font-size: 13px; }
.trend { display: grid; gap: 6px; }
.trend .bar { height: 6px; background: var(--bad); border-radius: 3px; overflow: hidden; }
.trend .bar span { display: block; height: 100%; background: var(--good); }
.trend p { font-size: 14px; color: var(--muted); }
.trend b { color: var(--fg); font-weight: 500; }
.more summary, .kit summary { font-size: 15px; }
.latest { border-top: 1px dashed var(--line); padding-top: 12px; }
.kit { border-top: 1px solid var(--line); padding-top: 12px; }
.kitlist { display: grid; gap: 8px; margin-top: 8px; }
.kitlist li { display: grid; gap: 2px; }
.kitlist b { font-weight: 600; }
.kitlist span { color: var(--muted); font-size: 14px; }
.innate { font-size: 12px; font-weight: 500; color: var(--muted); border: 1px solid var(--line); border-radius: 2px; padding: 0 4px; margin-left: 4px; }

.hint-line { margin-top: -4px; }
.console h2.h-sm { font-size: clamp(18px, 2.2vw, 22px); }
.console.picker-only .picker { border-top: 0; padding-top: 0; margin-top: 0; }

/* hand-off cards on the patch page */
.deeper { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 16px; }
.deep { background: var(--panel-bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; display: grid; gap: 12px; align-content: start; clip-path: var(--frame-clip); box-shadow: var(--bevel); }
.deep h3 { font-family: var(--font-display); font-size: 20px; font-weight: 600; }
.deep b { font-weight: 600; }
.btn { justify-self: start; display: inline-block; text-decoration: none; color: var(--on-accent); background: var(--accent); padding: 10px 16px; border-radius: var(--radius); font-weight: 500; transition: background-color .15s var(--ease); }
.btn:hover { background: var(--accent-bright); }

/* item overview */
.overview { display: grid; gap: 16px; }
.ovblock h3 { font-size: 15px; font-weight: 600; margin-bottom: 8px; color: var(--muted); }
.more-note { color: var(--muted); font-size: 13px; align-self: center; }

/* item suggestions on a hero card */
.syn { border-top: 1px solid var(--line); padding-top: 16px; display: grid; gap: 8px; }
.syn h5, .syn .h5 { font-family: var(--font-display); font-size: 18px; color: var(--fg); font-weight: 600; margin: 0; }
.syn h6, .syn .h6 { margin: 4px 0 0; font-weight: 500; font-size: 13px; color: var(--muted); }
.plans { display: flex; flex-wrap: wrap; gap: 6px; }
.plans button { background: var(--raise); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 12px; font-size: 14px; font-weight: 500; color: var(--muted); }
.plans button[aria-pressed=true] { color: var(--bg); background: var(--fg); border-color: var(--fg); }
.plan-one { font-weight: 600; }
.itemlist { display: grid; gap: 8px; }
.itemlist li { display: grid; gap: 2px; padding-left: 12px; border-left: 2px solid var(--line); }
.itemlist .ih { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; }
.itemlist p { color: var(--muted); font-size: 14px; max-width: 62ch; }
.itemlist small { display: block; font-size: 13px; opacity: .85; }
.itemlink { display: inline-flex; align-items: center; gap: 12px; font-weight: 600; color: var(--fg); text-decoration-color: var(--link-line); text-underline-offset: 3px; }
.itemlink:hover { text-decoration-color: var(--fg); }
.ic { position: relative; flex: none; width: 44px; height: 32px; display: grid; place-items: center; background: var(--raise); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.ic .mono { font-family: var(--font-label); font-weight: 600; font-size: 13px; color: var(--muted); }
.ic img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
/* item art is 88x64, so item cards use that shape instead of the wide hero portrait */
.hero.item .mono.big, .hero.item > header img { width: 66px; height: 48px; }
/* weapon art and map emblems are cut-outs on transparency: show them whole instead of cropping like a portrait */
[data-page=weapons] .tile img, [data-page=maps] .tile img { object-fit: contain; padding: 6px 10px 20px; opacity: 1; }
[data-page=weapons] .hero > header img, [data-page=weapons] .ic img, [data-page=maps] .hero > header img, [data-page=maps] .ic img { object-fit: contain; padding: 3px; }
.cost { font-family: var(--font-label); font-weight: 600; color: var(--price); font-size: 14px; font-variant-numeric: tabular-nums; }
.badge { font-style: normal; font-weight: 500; font-size: 12px; padding: 0 8px; border-radius: 2px; border: 1px solid var(--line); color: var(--muted); }
.badge.b-new, .badge.b-back { border-color: var(--good-line); color: var(--good); }
.badge.b-rework { border-color: var(--accent-line); color: var(--accent-ink); }
.badge.b-removed { border-color: var(--bad); color: var(--bad); }

/* item tiles and cards: shop items are the default kind, so a neutral edge */
.tile.c-shop, .item.c-shop { --c: var(--muted); }
.tile.c-neutral, .item.c-neutral { --c: var(--attr-4); }
.tile .cost { position: absolute; left: 8px; top: 4px; z-index: 4; font-size: 12px; line-height: 1.3; color: var(--fg); padding: 0 4px; border-radius: 2px; background: var(--shade-strong); }
/* once an icon is in place, the initials underneath are only a fallback */
.tile:has(img) .mono, .hero > header:has(img) .mono.big, .ic:has(img) .mono { visibility: hidden; }
.tile.c-shop .dot, .tile.c-neutral .dot { left: auto; right: 8px; top: 36px; }
.newtag.gone { background: var(--bad); color: var(--on-good); }
.item .statline { color: var(--fg); font-size: 14px; }

/* footer */
.foot { margin-top: 64px; padding-top: 24px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; display: grid; gap: 8px; max-width: 78ch; }
.foot h3 { font-family: var(--font-display); color: var(--fg); font-size: 17px; font-weight: 600; }
.foot ul { display: grid; gap: 4px; padding-left: 18px; list-style: disc; }

/* picture strips on the landing page */
.thumbrow { display: grid; gap: 8px; }
.thumbs { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; }
.th { display: grid; gap: 4px; justify-items: start; text-decoration: none; color: var(--fg); }
.th .ph { position: relative; display: grid; place-items: center; overflow: hidden; background: var(--raise); border: 1px solid var(--line); border-radius: var(--radius); transition: border-color .15s var(--ease); }
.th .ph .mono { font-family: var(--font-label); font-weight: 600; font-size: 14px; color: var(--muted); }
.th .ph img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.th .ph:has(img) .mono { visibility: hidden; }
.th .nm { font-size: 12px; line-height: 1.2; color: var(--muted); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.th:hover .ph, .th:focus-visible .ph { border-color: var(--hover-line); }
.th:hover .nm { color: var(--fg); }
.th-hero .th { width: 76px; } .th-hero .ph { width: 76px; height: 43px; }
.th-item .th { width: 56px; } .th-item .ph { width: 56px; height: 41px; }
.th-weapon .th { width: 84px; } .th-weapon .ph { width: 84px; height: 40px; } .th-weapon .ph img { object-fit: contain; padding: 4px 6px; }
.th-map .th { width: 64px; } .th-map .ph { width: 64px; height: 64px; } .th-map .ph img { object-fit: contain; padding: 4px; }
.th-more { align-self: start; font-family: var(--font-label); font-size: 13px; color: var(--muted); padding: 10px 4px; }

/* landing page: picture block beside the heading */
.mosaic { position: absolute; right: 0; top: 0; width: min(44%, 500px); margin: 0; display: grid; gap: 8px; pointer-events: none; }
.mo-grid { display: grid; gap: 4px; }
.mo-grid > span { min-width: 0; }   /* let images shrink to their column instead of pushing the grid wider */
.mo-heroes .mo-grid { grid-template-columns: repeat(4, 1fr); }
.mo-heroes .mo-grid span { aspect-ratio: 16 / 9; overflow: hidden; border: 1px solid var(--line); background: var(--raise); }
.mo-heroes .mo-grid img { width: 100%; height: 100%; object-fit: cover; }
.mo-maps .mo-grid { grid-template-columns: repeat(4, minmax(0, 88px)); justify-content: end; justify-items: center; gap: 12px; }
.mo-maps .mo-grid span { width: 100%; aspect-ratio: 1; display: grid; place-items: center; }
.mo-maps .mo-grid img { width: 88%; height: 88%; object-fit: contain; filter: drop-shadow(0 6px 14px rgba(0, 0, 0, .6)); }
@media (min-width: 1001px) { .masthead:has(.mosaic:not([hidden])) > h1, .masthead:has(.mosaic:not([hidden])) > .intro { max-width: 54%; } }
.mosaic figcaption { justify-self: end; font-size: 13px; color: var(--muted); }
@media (max-width: 1000px) {
  .mosaic { position: static; width: 100%; }
  .mo-heroes .mo-grid { grid-template-columns: repeat(6, 1fr); }
  .mo-maps .mo-grid { grid-template-columns: repeat(7, 1fr); }
  .mosaic figcaption { justify-self: start; }
}

@media (max-width: 640px) {
  .wrap { padding-block: 24px 48px; }
  .mo-heroes .mo-grid { grid-template-columns: repeat(4, 1fr); }
  .mo-heroes .mo-grid span:nth-child(n+9) { display: none; }
  .tick b { font-size: 12px; }
  .era header { flex-wrap: wrap; }
  .era .tier { margin-left: 0; }
  .hero > header { grid-template-columns: auto 1fr; }
  .status { grid-column: 1 / -1; }
  .hero .mono.big, .hero > header img { width: 72px; height: 42px; }
  .hero.item .mono.big, .hero.item > header img { width: 55px; height: 40px; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; animation: none !important; } }

/* theme hooks: hidden until a theme styles them */
.deco { display: none; }
.gem { display: none; }
.era-row, .hero, .console { --cut: var(--cut-size, 0px); }

/* build-time pages: the date hides parts of the HTML; nothing may override that */
[hidden] { display: none !important; }
.mark:not(.lab) b { display: none; }
.eras:not(.show-all) .era-row.t-notable { display: none; }

/* a hero's own page: the full log, patch by patch; patches older than the chosen month fold away */
.hlog { display: grid; gap: 16px; }
.hlog:not(.show-old) .plog.old { display: none; }
.plog { padding-top: 16px; border-top: 1px solid var(--line); }
.plog .h5 { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; }
.plog .h5 time { margin-left: 0; color: var(--muted); font-weight: 400; }
.hero .since { display: grid; gap: 16px; }
/* hero page: the hero's render on the right of the heading, with the primary attribute's mark */
.mo-render { top: 8px; width: min(36%, 320px); justify-items: end; align-self: center; gap: 8px; }
@media (min-width: 1001px) {      /* split: name and role line centred against the render */
  .masthead:has(.mo-render) { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 320px); grid-template-rows: auto 1fr auto auto 1fr; column-gap: 32px; }
  .masthead:has(.mo-render) > .crumbs { grid-area: 1 / 1; }
  .masthead:has(.mo-render) > h1 { grid-area: 3 / 1; }
  .masthead:has(.mo-render) > .intro { grid-area: 4 / 1; }
  .masthead:has(.mo-render:not([hidden])) > h1, .masthead:has(.mo-render:not([hidden])) > .intro { max-width: 60ch; }
  .masthead .mo-render { position: static; grid-area: 1 / 2 / 6 / 3; width: 100%; }
}
.mo-render .portrait { width: 100%; max-width: 320px; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border: 1px solid var(--line); border-radius: var(--radius); background: var(--raise); }
.attr-mark { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 500; color: var(--fg); justify-self: end; }
.attr-mark img { width: 24px; height: 24px; }
.hero.hero-page { border-top: 1px solid var(--line); }
.hero-page > header.hh { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding: 16px; }
.hero-page > header.hh .status { grid-column: auto; }
@media (max-width: 1000px) { .mo-render { width: 100%; justify-items: start; } .mo-render .portrait { max-width: 256px; } .attr-mark { justify-self: start; } }

/* hero page: where the page sits instead of the page tabs */
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--fg); }
.crumbs [aria-current] { color: var(--fg); }

/* Heroes directory: tiles are links to each hero's page */
a.tile { color: inherit; text-decoration: none; }
a.tile:hover { border-color: var(--hover-line); }

/* hero page: current abilities with their icons */
.kitlist.abil li { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 12px; align-items: start; }
.kitlist.abil li > div { display: grid; gap: 2px; }
.ai { width: 40px; height: 40px; border-radius: var(--radius); overflow: hidden; background: var(--raise); border: 1px solid var(--line); }
.ai img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ai .mono { display: grid; place-items: center; height: 100%; font-size: 13px; font-weight: 600; color: var(--muted); }
/* item page: the item's icon framed beside its name, with its cost; the heroes that buy it */
.mo-item .portrait { width: 132px; max-width: 132px; aspect-ratio: 88 / 64; }
.mo-weapon .portrait { max-width: 280px; object-fit: contain; padding: 12px; background: var(--raise); }
.mo-map .portrait { width: 160px; max-width: 160px; aspect-ratio: 1; object-fit: contain; padding: 10px; background: var(--raise); }
.mo-item .attr-mark .cost { font-size: 18px; }
.buyers { display: flex; flex-wrap: wrap; gap: 8px; }
.buyers .nm.sub { color: var(--muted); opacity: .8; font-size: 11px; }
/* item abilities, coloured as in the game's tooltip: active is blue, passive grey */
:root { --ab-active: #4f8fc9; --ab-active-ink: #9cc6ee; --ab-active-soft: rgba(79, 143, 201, .14); --ab-passive: #6b6766; --ab-passive-soft: rgba(239, 233, 231, .06); }
.kitlist.abilities { gap: 8px; }
.kitlist .ab { padding: 8px 12px; border-left: 2px solid var(--ab-passive); background: var(--ab-passive-soft); border-radius: 0 var(--radius) var(--radius) 0; }
.kitlist .ab-active { border-left-color: var(--ab-active); background: var(--ab-active-soft); }
.ab-kind { display: inline-block; margin-left: 8px; padding: 0 6px; font-size: 12px; font-weight: 500; border-radius: 2px; color: var(--muted); border: 1px solid var(--line); vertical-align: 1px; }
.ab-active .ab-kind { color: var(--ab-active-ink); border-color: rgba(79, 143, 201, .45); }
.ab-cd { margin-left: 8px; font-size: 13px; font-weight: 400; color: var(--muted); }
.related { padding: 12px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--raise); font-size: 15px; }
.related a { margin-left: 4px; }

/* CS2 weapon and map pages: the picture at a size its source stays sharp at */
.mo-weapon .portrait { aspect-ratio: auto; object-fit: contain; padding: 12px 16px; max-width: 320px; }
.mo-map .portrait { width: 160px; max-width: 160px; aspect-ratio: 1; object-fit: contain; padding: 8px; }

/* CS2 map pages: loading-screen art beside the name, radar overview and the other loading screens below */
.mo-mapart .portrait { aspect-ratio: 16 / 9; object-fit: cover; max-width: 320px; }
.mo-mapart .attr-mark img { width: 24px; height: 24px; object-fit: contain; }
.map-radar img { display: block; width: 100%; max-width: 480px; height: auto; aspect-ratio: 1; object-fit: contain; background: var(--raise);
  border: 1px solid var(--line); border-radius: var(--radius); }
.shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.shots img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border: 1px solid var(--line); border-radius: var(--radius); }

/* CS2 Maps page: the pool and the rotated-out maps as two sections of emblem cards */
.mapsec { display: grid; gap: 12px; margin-top: 16px; }
.mapgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(136px, 1fr)); gap: 12px; }
.maptile { display: grid; justify-items: center; gap: 12px; padding: 20px 12px 16px; background: var(--raise); border: 1px solid var(--line);
  border-radius: var(--radius); color: var(--fg); text-decoration: none; transition: border-color .15s var(--ease); }
.maptile:hover { border-color: var(--hover-line); }
.maptile .emb { width: 104px; height: 104px; display: grid; place-items: center; overflow: hidden; }
.maptile img { width: 100%; height: 100%; max-width: 104px; max-height: 104px; object-fit: contain; }
.maptile .nm { font-size: 16px; font-weight: 500; }
@media (max-width: 640px) { .mapgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .maptile .emb { width: 88px; height: 88px; } }

/* directory pages: a small block pointing at the game's other section (heroes and items, weapons and maps) */
.xlink { border-top: 1px solid var(--line); padding-top: 32px; }
.xlink h2 { font-size: 20px; }

/* footer: About, Contact, Privacy on every game page */
.sitefoot { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 16px; font-size: 14px; }
.sitefoot a { color: var(--muted); text-decoration: none; }
.sitefoot a:hover { color: var(--fg); }

/* ---- guide pages (build/render_guide.py): hand-written points, each with the update it comes from ---- */
.g-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 12px; }
.g-item { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 20px; display: grid; gap: 8px; align-content: start; }
.g-item h3 { margin: 0; }
.g-item p { margin: 0; font-size: 15px; max-width: 64ch; }
.g-item .g-src { color: var(--muted); font-size: 13px; }
.g-pools { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 12px; }
.g-pool { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 20px; display: grid; gap: 8px; align-content: start; }
.g-pool h3 { margin: 0; }
.g-pool ul { display: grid; gap: 4px; font-size: 15px; }
.g-pool .g-moved { font-weight: 600; }
.g-pool.then .g-moved a { text-decoration: line-through; text-decoration-thickness: 1px; }
.g-pool.then .g-moved::after { content: " left"; color: var(--muted); font-weight: 400; font-size: 13px; }
.g-pool.now .g-moved::after { content: " new"; color: var(--accent); font-weight: 500; font-size: 13px; }
.g-tips { display: grid; gap: 8px; padding-left: 20px; list-style: decimal; font-size: 15px; max-width: 72ch; }
.g-go { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; }
