/* Champions, a champion's page and Items (ui/front/explore/) in layout A (Tyler, 2026-10-28: "A is best"; the
   accepted mockups a-champions, a-champion, a-items and a-world). Built from the kit: .ms panels, .socket, .kit-chip,
   .kit-plate, .kit-label and .btn. Tokens only, except the map's own ground, camp and ice colours. */

/* Every page starts with its content: the tab names the page (Tyler, 29 October 2026: "get rid of these useless titles
   in every tab"). */
.explore-page { display: flex; flex-direction: column; gap: 16px; }
.explore-search { display: flex; align-items: center; gap: 10px; padding: 9px 12px; color: var(--text-faint); background: var(--field); border: 2px solid var(--steel-line); box-shadow: inset 0 2px 0 var(--steel-dark); }
.explore-search:focus-within { border-color: var(--you); }
.explore-search .pico { width: 16px; height: 16px; }
.explore-search input { flex: 1; min-width: 0; padding: 0; color: var(--text); background: none; border: 0; outline: none; font-size: var(--t-s); }
.explore-search input::placeholder { color: var(--text-faint); }
.difficulty-pips { display: inline-flex; gap: 3px; vertical-align: middle; }
/* An unlit square is a steel slot with a light edge and a lit one solid gold with a bright top, so 2 of 3 reads at a
   glance over the scene (client council round 14: the pips were small and low-contrast; round 17: the empty squares
   were still faint). */
.difficulty-pips i { width: 10px; height: 10px; background: var(--steel-line); box-shadow: 0 0 0 1px var(--steel-dark), inset 0 0 0 2px var(--text-dim); }
.difficulty-pips i.on { background: var(--you); box-shadow: 0 0 0 1px var(--steel-dark), inset 0 3px 0 var(--you-light), inset 0 0 0 2px var(--you-deep); }
.item-cost { font: 700 var(--t-xs)/1.1 var(--font-body); color: var(--you-light); }
:is(.roster-class, .roster-tile, .champion-slot, .champion-item, .item-tile, .item-link, .recipe-node):focus-visible { outline: 3px solid var(--you-light); outline-offset: 2px; }

/* Champions: the filter column beside the portrait grid. The column stays in view while the grid scrolls. */
.roster-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 24px; align-items: start; }
.roster-filters { position: sticky; top: 0; display: flex; flex-direction: column; gap: 14px; min-height: min(700px, calc(100cqh * var(--cq-fix, 1))); padding: 18px 16px; }
.roster-filters > .kit-label { margin-top: 6px; }
.roster-classes { display: flex; flex-direction: column; gap: 2px; }
.roster-class { display: flex; justify-content: space-between; gap: 12px; padding: 9px 12px; color: var(--text-dim); background: none; border: 0; border-left: 3px solid transparent; font: 700 var(--t-s)/1.2 var(--font-body); text-align: left; cursor: pointer; }
.roster-class:is(:hover, .virtual-hover) { color: var(--text); }
.roster-class > .faint { color: var(--text-dim); font-variant-numeric: tabular-nums; }
.roster-class[aria-pressed="true"] { color: var(--you-light); border-left-color: var(--you); background: linear-gradient(90deg, var(--you-soft), transparent); }
/* One option a row, the name at the left and its pips at the right, so Medium never runs into its pips (Sol, round 12).
   A short window keeps two columns with the pips under each name. */
.roster-difficulty { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; }
.roster-difficulty .kit-chip { justify-content: space-between; min-width: 0; min-height: 38px; gap: 12px; padding: 7px 12px; }
.roster-difficulty .difficulty-pips { flex: none; gap: 3px; }
.roster-difficulty .difficulty-pips i { width: 10px; height: 10px; }
.roster-clear { align-self: flex-start; margin-top: auto; }
@container (max-height: 799.98px) {
  .roster-filters { gap: 10px; }
  .roster-difficulty { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .roster-difficulty .kit-chip { flex-direction: column; justify-content: center; gap: 5px; min-height: 48px; padding: 6px 8px; }
}
.roster-grid { display: grid; grid-template-columns: repeat(auto-fill, 164px); gap: 12px 8px; align-content: start; }
.roster-tile { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 0; color: var(--text); font: inherit; cursor: pointer; }
/* The second reading level stays comfortable over the scene: the class in body colour, the pips spaced (Sol, round 11). */
.roster-tile > b { font-size: var(--t-name); line-height: 1.2; }
.roster-meta { display: flex; align-items: center; gap: 10px; font-size: var(--t-s); line-height: 1.25; }
.roster-meta > .dim { color: var(--text); }
.roster-meta .difficulty-pips { gap: 4px; }
.roster-meta .difficulty-pips i { width: 14px; height: 14px; }
.roster-tile:is(:hover, .virtual-hover, :focus-visible) { border-color: var(--trim); background: var(--face-steel); box-shadow: 0 0 24px var(--you-soft); }
.roster-tile:is(:hover, .virtual-hover, :focus-visible) > .socket { border-image-source: url('/c/4054d4a674bdb554cd1c93aea296707690854c1e934830690e4178df43ab41eb.png'); box-shadow: 0 0 0 2px var(--you-soft), 0 0 18px var(--you-glow); }
/* The champion in the details panel keeps a gold rim, the one Items gives its open item, a lit plate and a gold
   socket while the pointer is elsewhere (client council round 17: a slightly lighter plate did not mark it). */
.roster-tile.shown { border-color: var(--you-light); background: linear-gradient(var(--you-soft), transparent 70%), var(--face-steel);
  box-shadow: 0 0 0 2px var(--steel-dark), 0 0 0 5px var(--you), 0 0 26px var(--you-glow); }
.roster-tile.shown > .socket { border-image-source: url('/c/4054d4a674bdb554cd1c93aea296707690854c1e934830690e4178df43ab41eb.png'); }
.roster-tile.shown > b { color: var(--you-light); }
/* The details panel. By default a strip under the grid: where the grid is taller than the window the strip stays at the
   window's foot while the grid scrolls behind it, and rests under the last row. The idle stands at its left over two
   rows, the words and Open beside it, and the five abilities in a row under the words, each its picture beside its key
   over its name. A name never breaks inside a word (client council round 20, both judges: five 100px columns broke
   "Thunderstrike" as "Thunderstrik / e" and pressed the summary into a narrow strip). */
.roster-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.roster-detail { position: sticky; bottom: 0; z-index: 3; display: grid; grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-areas: "figure info open" "figure kit kit"; align-items: start; gap: 10px 24px; padding: 12px 20px 14px 12px; box-shadow: 0 -12px 30px var(--shadow); }
/* The shown champion's idle stands on the panel's floor at one height for every champion (FitIdle fits it to this
   box), lit from below as on Results (client council round 17, Opus: the portrait was small beside the references).
   Its head may rise into the gold rim; the box keeps the panel's height, so the grid above never moves. */
.roster-detail-figure { grid-area: figure; position: relative; align-self: end; width: 160px; height: 196px; margin: -20px 0 -12px;
  background: radial-gradient(46% 30% at 50% 88%, var(--ally-soft), transparent 75%); }
.roster-detail-figure::before { content: ''; position: absolute; left: 10%; right: 10%; bottom: 2px; height: 24px;
  background: radial-gradient(closest-side, var(--you-glow), transparent); pointer-events: none; }
.roster-detail-figure > .idle-fit { position: relative; z-index: 1; width: 100%; height: 100%; }
.roster-detail-info { grid-area: info; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.roster-detail-name { margin: 0; font: 400 var(--t-xl-sm)/1 var(--font-head); letter-spacing: 3px; text-transform: uppercase; color: var(--you-light); }
.roster-detail-open { grid-area: open; flex: none; }
.roster-detail-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; font-size: var(--t-m); }
.roster-detail-difficulty { display: inline-flex; align-items: center; gap: 8px; }
.roster-detail-difficulty .difficulty-pips { gap: 4px; }
.roster-detail-difficulty .difficulty-pips i { width: 14px; height: 14px; }
.roster-detail-summary { font-size: var(--t-m); line-height: 1.35; color: var(--text); }
.roster-detail-abilities { grid-area: kit; display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 0; padding: 0; list-style: none; }
.roster-detail-abilities > li { display: flex; align-items: center; gap: 10px; min-width: 0; color: var(--text); }
.roster-detail-abilities .socket > img { display: block; width: 40px; height: 40px; }
.roster-ability-text { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-width: 0; }
.roster-detail-abilities .ability-key { margin-top: 0; }
/* Each ability's name is read at body size, as the details are (client council round 17, Sol: they were small print),
   and whole: in the strip on one line. */
.roster-detail-abilities .ability-name { font-size: var(--t-s); font-weight: 700; line-height: 1.2; color: var(--text); text-align: left; white-space: nowrap; }
/* A narrower grid (1366 and 1280 wide): a smaller idle and words, and the abilities wrap to a second row. */
@container (max-width: 1300px) {
  .roster-detail { gap: 8px 20px; padding: 12px 16px 12px 8px; }
  .roster-detail-figure { width: 124px; height: 156px; margin: 0 0 -12px; }
  .roster-detail-name { font-size: var(--t-l); }
  .roster-detail-summary { font-size: var(--t-s); }
  .roster-detail-abilities { gap: 6px 18px; }
  .roster-detail-abilities .socket > img { width: 32px; height: 32px; }
}
/* 1920x1080 (client council round 20): the panel becomes a tall column beside the grid, as a pick screen's hero stands
   beside its roster, and the filters, the grid and the panel end on one line. The grid holds any number of champions
   (Tyler, 18 November 2026: "figure out the grid", when 22 no longer made rows of five): its track takes as many
   portraits a row as fit at 136px or more, six here at 140px, so 22 stand in four rows with the last one short, and a
   roster that outgrows four rows scrolls inside the grid's own column (its scrollbar still leaves six a row) while the
   filters and the panel stay put. A 140px tile is the 128px portrait in its socket. The scroll box reaches 6px past
   the track on every side, padded back, so the shown tile's 5px gold ring is not cut at the grid's edge. The
   arithmetic, which explore/champions.rs checks for any roster: 240 + 20 + (6 x 140 + 5 x 6 = 870) + 20 + at least
   360 = 1510 wide, and 4 x 220 + 3 x 10 = 910 high, the page's 932px less its spare. The panel stacks the idle at one
   height (260px), the name, the class and range over the difficulty, the summary, the five abilities as rows pinned
   to its foot, each name whole at 18px, and Open across its width. Should a long summary need the room, only the
   idle's box gives way, to no less than 220px. */
@container (min-width: 1510px) and (min-height: 910px) {
  .roster-layout { grid-template-columns: 240px 870px minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); gap: 20px; align-items: stretch; height: 910px; }
  .roster-filters { position: static; min-height: 0; gap: 18px; }
  .roster-class { padding-block: 12px; }
  .roster-difficulty .kit-chip { min-height: 44px; }
  .roster-main { display: contents; }
  .roster-grid { grid-template-columns: repeat(auto-fill, minmax(136px, 1fr)); grid-auto-rows: 220px; gap: 10px 6px; min-height: 0; overflow-y: auto; scrollbar-width: thin;
    margin: -6px; padding: 6px; }
  .roster-tile { padding: 12px 0 10px; }
  .roster-meta { gap: 8px; }
  .roster-meta .difficulty-pips { gap: 3px; }
  .roster-meta .difficulty-pips i { width: 12px; height: 12px; }
  .roster-detail { position: relative; bottom: auto; display: flex; flex-direction: column; gap: 0; min-width: 0; padding: 14px 22px 20px;
    box-shadow: 0 12px 30px var(--shadow); }
  .roster-detail-figure { flex: 0 1 260px; align-self: stretch; width: auto; height: auto; min-height: 220px; margin: 0 0 12px;
    background: radial-gradient(50% 24% at 50% 90%, var(--ally-soft), transparent 75%); }
  /* Filled by position, not percentage, so FitIdle measures the flexed box (round 18: a percentage height did not
     resolve inside the first-match alcoves and the figure drew nothing). */
  .roster-detail-figure > .idle-fit { position: absolute; inset: 0; width: auto; height: auto; }
  .roster-detail-info { gap: 8px; }
  .roster-detail-line { flex-direction: column; align-items: flex-start; gap: 6px; }
  .roster-detail-abilities { flex-direction: column; flex-wrap: nowrap; gap: 6px; margin-top: auto; padding-top: 14px; border-top: 2px solid var(--column-edge); }
  .roster-detail-abilities > li { gap: 14px; }
  .roster-detail-abilities .socket > img { width: 36px; height: 36px; }
  .roster-detail-abilities .ability-name { font-size: var(--t-m); white-space: normal; }
  .roster-detail-open { align-self: stretch; margin-top: 14px; }
}
@container (max-width: 860px) {
  .roster-layout { grid-template-columns: minmax(0, 1fr); }
  .roster-filters { position: static; min-height: 0; }
  .roster-classes { flex-direction: row; flex-wrap: wrap; }
  .roster-grid { grid-template-columns: repeat(auto-fill, minmax(144px, 1fr)); }
}

/* A champion: the details on the left, the idle in the middle, recommended items and the look on the right. */
/* The page is the window's height and nothing sits below it: the chosen ability's text takes what the column leaves. */
.champion-page { gap: 12px; height: calc(100cqh * var(--cq-fix, 1)); min-height: 560px; }
/* As tall as the page, so the idle's stage is too. */
.champion-layout { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 600px) minmax(200px, 1fr) minmax(260px, 320px); gap: 24px; }
.champion-main { display: flex; flex-direction: column; gap: 12px; min-width: 0; min-height: 0; }
.champion-title { display: flex; align-items: center; gap: 18px; }
.champion-name { margin: 0; font: 400 var(--t-banner)/1 var(--font-head); letter-spacing: 4px; text-transform: uppercase; color: var(--you-light); }
.champion-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.champion-line b, .champion-summary { font-size: var(--t-m); }
.champion-stats { padding: 8px 4px 4px; }
.champion-stats > p { padding: 0 10px; font: 700 var(--t-xs) var(--font-body); }
.champion-stats dl { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); margin: 0; }
.champion-stats dl > div { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 0; }
.champion-stats dl > div + div { border-left: 2px solid var(--column-edge); }
.champion-stats dt { font: 700 var(--t-xs) var(--font-body); color: var(--text-faint); }
.champion-stats abbr { text-decoration: none; cursor: help; }
.champion-stats dd { margin: 0; font: 700 var(--t-l)/1 var(--font-body); font-variant-numeric: tabular-nums; }
.champion-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 4px; }
.champion-actions .btn { height: 56px; padding-block: 0; }
.champion-actions .btn.primary.big { padding-inline: 28px; font-size: var(--t-l); }
.champion-kit { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 6px; }
/* A slot is at least 96px and as wide as its name's longest word, so a name wraps only between words (client council
   round 20: "Thunderstrike" broke inside the word in a 100px column). */
.champion-slot { display: flex; flex-direction: column; align-items: center; gap: 4px; width: min-content; min-width: 96px; padding: 0; color: var(--text-dim); background: none; border: 0; font: inherit; cursor: pointer; }
.champion-slot .socket > img { width: 72px; height: 72px; }
.ability-key { margin-top: 6px; font: 400 var(--t-s)/1 var(--font-head); letter-spacing: 1px; text-transform: uppercase; color: var(--trim); }
.ability-name { font: 700 var(--t-s)/1.15 var(--font-body); text-align: center; overflow-wrap: normal; hyphens: manual; }
.champion-slot:is(:hover, .virtual-hover) .ability-name { color: var(--text); }
.champion-slot[aria-pressed="true"] :is(.ability-key, .ability-name) { color: var(--you-light); }
/* The chosen ability's panel fills the column's foot at one size whichever ability it shows (Tyler, 2026-10-29: nothing
   moves when something changes), tall enough for the longest text, Druid's R with its forms. */
.champion-ability { flex: 1 1 0; display: flex; flex-direction: column; gap: 10px; min-height: 120px; overflow: hidden auto; padding: 16px 20px; }
.champion-ability .kit-label { color: var(--you-light); }
.champion-ability .dim { font-size: var(--t-s); }
.champion-ability .champion-note { margin-top: auto; font-size: var(--t-xs); }
.champion-forms { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.champion-forms p { flex-basis: 100%; font-size: var(--t-xs); }
/* The well is the room the layout leaves: the figure's scale is measured from it (explore/champion.rs). */
.champion-stage { position: relative; display: flex; align-items: flex-end; justify-content: center; min-width: 0; min-height: 0; padding-top: 4%; background: radial-gradient(48% 42% at 50% 55%, var(--ally-soft), transparent 75%); }
.champion-stage::before { content: ''; position: absolute; left: 10%; right: 10%; bottom: -28px; height: 64px; background: radial-gradient(closest-side, var(--you-glow), transparent); pointer-events: none; }
.champion-side { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.champion-items { display: flex; flex-direction: column; gap: 4px; padding: 18px 18px 14px; }
.champion-items .kit-rule { margin: 8px 0 4px; }
.champion-items ul { list-style: none; margin: 0; padding: 0; }
.champion-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 6px 0; color: var(--text); background: none; border: 0; font: inherit; text-align: left; cursor: pointer; }
.champion-item b { display: block; font-size: var(--t-s); }
.champion-item .item-cost { font-size: var(--t-s); }
.champion-item:is(:hover, .virtual-hover) b { color: var(--you-light); }
.champion-items > .btn.quiet { align-self: flex-start; margin-top: 8px; padding-inline: 0; color: var(--you-light); }
.champion-look { padding: 14px 18px; }
.champion-look:not(:has(.look-picker)) { display: none; }
.champion-look .look-picker { margin: 0; }
@container (max-width: 1100px) {
  .champion-layout { grid-template-columns: minmax(0, 1fr) minmax(240px, 320px); }
  .champion-page { height: auto; }
  /* The page scrolls here, so the panel no longer fills the column: stretched to the side column's height it put the
     chosen ability's last line below a 1024x768 window (browser_shell, 11 November 2026). */
  .champion-ability { flex: none; }
  .champion-stage { grid-column: 1 / -1; grid-row: 2; height: 420px; }
}
/* A short window (1366x768): tighter rows and smaller slots, so the chosen ability's text shows under them (Ibara walk,
   28 October 2026: it sat below the screen). */
@container (max-height: 720px) {
  .champion-page, .champion-main { gap: 8px; }
  .champion-name { font-size: var(--t-xl); }
  .champion-stats dl > div { gap: 2px; padding: 4px 0; }
  .champion-actions { margin-top: 0; }
  .champion-actions .btn { height: 44px; }
  .champion-slot { min-width: 100px; }
  .champion-slot .socket > img { width: 60px; height: 60px; }
  .ability-key { margin-top: 2px; }
  .champion-ability { gap: 6px; padding: 10px 16px; }
}
@container (max-width: 700px) {
  .champion-layout { grid-template-columns: minmax(0, 1fr); }
  .champion-stage { grid-row: auto; height: 360px; }
  .champion-name { font-size: var(--t-xl); }
}

/* Items: the framed grid beside the open item, both as tall as the page, each scrolling on its own. */
.items-page { display: grid; grid-template-columns: minmax(0, 1fr) minmax(380px, 512px); grid-template-rows: minmax(0, 1fr); gap: 12px; height: calc(100cqh * var(--cq-fix, 1)); min-height: 560px; }
.items-browse { position: relative; grid-column: 1; grid-row: 1; display: flex; flex-direction: column; min-height: 0; padding: 12px 6px; }
.items-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 4px 8px 12px; }
.items-categories { flex: 1; display: flex; flex-wrap: wrap; gap: 8px; }
.items-filters .explore-search { width: 300px; max-width: 100%; }
/* The currency note, the tile colours' toggle and a button for each tier share the row over the grid (client council
   round 17: Upgrade sat cut off at the panel's foot, easy to miss). Each tier button brings its heading to the top of
   the grid. Where the row is too narrow (1366 and 1280 wide) the tier buttons take a second line, still at the right. */
.items-subhead { position: relative; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding: 0 8px 10px; }
.items-currency-note { margin: 0; font-size: var(--t-s); }
.items-tiers { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-left: auto; font-size: var(--t-s); }
.items-tier { display: inline-flex; align-items: center; gap: 8px; }
.items-tier-count { color: var(--text-dim); font-variant-numeric: tabular-nums; }
.items-tier:disabled .items-tier-count { color: inherit; }
/* The grid's foot fades, so a row that continues below reads as more to scroll, not as names cut off. */
.items-scroll { position: relative; flex: 1; min-height: 0; overflow: auto; padding: 0 8px 64px; scroll-padding-bottom: 64px; scroll-behavior: smooth;
  mask-image: linear-gradient(black calc(100% - 56px), transparent); }
/* A tier's heading stands clear of the last row above it (client council round 14: Upgrade sat 8px under it), without
   the long pause round 17 found before the next tier (Sol). */
.items-scroll > .kit-label { margin: 6px 0 12px; }
.items-scroll > .item-grid + .kit-label { margin-top: 18px; padding-top: 14px; border-top: 2px solid var(--column-edge); }
/* What each tile's colour means, behind one toggle beside the currency note (client council round 19, both judges: as a
   band at the panel's foot the key took a row of tiles). The toggle shows four of the colours as one small tile. Open,
   the key lies over the grid's top rows in a steel-edged panel, its words at the grid's own 16px: four colours a row
   (attack, magic, then defense and movement) at 1920 wide, where it is 800px; three a row in the 584px it has at 1280. */
.items-key { display: contents; }
.items-key-toggle { flex: none; }
.items-key-icon { flex: none; width: 14px; height: 14px; box-shadow: 0 0 0 2px var(--steel-dark); image-rendering: pixelated;
  background: linear-gradient(var(--a) 0 0) 0 0 / 7px 7px no-repeat, linear-gradient(var(--b) 0 0) 7px 0 / 7px 7px no-repeat,
    linear-gradient(var(--c) 0 0) 0 7px / 7px 7px no-repeat, linear-gradient(var(--d) 0 0) 7px 7px / 7px 7px no-repeat; }
.items-key-panel { position: absolute; top: calc(100% - 4px); left: 0; z-index: 5; box-sizing: border-box; width: min(100%, 800px); display: grid; gap: 8px; padding: 12px 8px;
  background: var(--bg-1); border: 2px solid var(--steel-line); box-shadow: 0 0 0 2px var(--steel-dark), 0 14px 30px var(--shadow); }
.items-key-panel[hidden] { display: none; }
.items-key-lead { margin: 0; color: var(--text-dim); font: 700 var(--t-s)/1.3 var(--font-body); }
.items-key-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 4px 8px; margin: 0; padding: 0; list-style: none; }
.items-key-list > li { display: flex; align-items: center; gap: 8px; min-width: 0; color: var(--text); font: 700 var(--t-s)/1.2 var(--font-body); }
/* Each swatch is a small tile, square bands of the tile's glow on its ink as art/moonforge/items.py `Icon` draws them,
   with the stat's own colour at the core and a rim of it, so twelve colours that are subtle on the tiles stay apart. */
.items-key-swatch { flex: none; box-sizing: border-box; width: 22px; height: 22px;
  border: 2px solid color-mix(in srgb, var(--stat) 70%, var(--bg-1)); box-shadow: 0 0 0 2px var(--steel-dark);
  background: linear-gradient(var(--stat) 0 0) center / 6px 6px no-repeat,
    linear-gradient(color-mix(in srgb, var(--stat) 48%, var(--bg-1)) 0 0) center / 12px 12px no-repeat,
    color-mix(in srgb, var(--stat) 24%, var(--bg-1)); }
@media (prefers-reduced-motion: reduce) { .items-scroll { scroll-behavior: auto; } }
/* Each tile spans three of the grid's rows (picture, name, price), so a row's prices share one line however many lines
   its names take (client council round 14: Woodsman's Machete pushed its price below the others). */
.item-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 4px 10px; }
.item-tile { display: grid; grid-row: span 3; grid-template-rows: subgrid; justify-items: center; align-content: start; min-width: 0; padding: 3px 0 8px; color: var(--text); background: none; border: 0; text-align: center; cursor: pointer; }
.item-tile-name { width: 100%; font: 700 var(--t-s)/1.15 var(--font-body); overflow-wrap: anywhere; }
.item-tile > .item-cost { align-self: start; font-size: var(--t-s); white-space: nowrap; }
.item-tile img, .item-heading > img, .item-link > img, .recipe-node img { display: block; image-rendering: pixelated; box-shadow: 0 0 0 2px var(--steel-dark); }
.item-tile img { width: 96px; height: 96px; }
.item-tile:not(.part, [aria-pressed="true"]):is(:hover, .virtual-hover) img { box-shadow: 0 0 0 2px var(--steel-dark), 0 0 0 4px var(--trim); }
.item-tile.part img { box-shadow: 0 0 0 2px var(--steel-dark), 0 0 0 4px var(--ally); }
.item-tile[aria-pressed="true"] img { box-shadow: 0 0 0 2px var(--steel-dark), 0 0 0 5px var(--you), 0 0 22px var(--you-glow); }
.item-detail { grid-column: 2; grid-row: 1; display: flex; flex-direction: column; gap: 14px; min-width: 0; min-height: 0; overflow: auto; overflow-wrap: anywhere; padding: 22px 24px; }
.item-heading { display: flex; align-items: center; gap: 18px; }
.item-heading > img { flex: none; width: 96px; height: 96px; }
.item-heading > div { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
/* Names are Atkinson: Silkscreen wrapped "Greatsword of Slaying" over three lines. */
.item-name { margin: 0; font: 700 var(--t-l)/1.2 var(--font-body); color: var(--text); }
.item-heading .item-cost { font-size: var(--t-m); }
.item-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.item-tags .kit-chip { padding: 4px 8px; font-size: var(--t-xs); }
.item-stats { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: var(--t-m); }
.item-stats b { color: var(--you-light); }
.item-passive { padding: 10px 12px; font-size: var(--t-s); }
.item-detail h4.kit-label { margin-top: 8px; }
.item-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; }
.item-row > .dim { font-size: var(--t-s); }
.item-links { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 10px 16px; }
.item-link { display: inline-flex; align-items: center; gap: 8px; padding: 0; color: var(--text); background: none; border: 0; font: 700 var(--t-s) var(--font-body); cursor: pointer; }
.item-link > img { width: 32px; height: 32px; }
.item-link:is(:hover, .virtual-hover) { color: var(--you-light); }
/* Builds into: one row per upgrade with its price and what it gives. */
.item-upgrades { flex-basis: 100%; display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
/* The row grows with its stats: the name, then one stat a line at the stats list's size, the price on the name's line
   (client council round 14, Sol: upgrade stats were small wrapped lines). */
.item-upgrade { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; align-items: start; gap: 14px; width: 100%; padding: 10px 12px; text-align: left; background: var(--plate); border: 1px solid var(--plate-edge); }
.item-upgrade > img { width: 48px; height: 48px; }
.item-upgrade:is(:hover, .virtual-hover) { border-color: var(--trim); background: var(--face-steel); }
.item-upgrade-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.item-upgrade-text > b { font-size: var(--t-m); line-height: 1.25; overflow-wrap: anywhere; }
.item-upgrade-stats { display: flex; flex-direction: column; gap: 2px; color: var(--text); font: 400 var(--t-m)/1.3 var(--font-body); }
.item-upgrade-stats b { color: var(--you-light); }
.item-upgrade > .item-cost { font-size: var(--t-m); line-height: 1.25; white-space: nowrap; }
.item-plan { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: auto; padding-top: 14px; border-top: 2px solid var(--column-edge); }
.item-plan label { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--text-dim); }
.item-plan select { width: 170px; max-width: 100%; font-weight: 700; }
.item-detail p[role="status"]:empty { display: none; }
/* The recipe: each part hangs from the item it builds, a stem down, a bar across the parts and a drop to each. */
.recipe { display: flex; justify-content: space-around; gap: 16px; margin: 0; padding: 0; list-style: none; }
.recipe > li { display: flex; flex-direction: column; align-items: center; }
.recipe-node { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 0; color: var(--text); background: none; border: 0; font: 700 var(--t-xs)/1.1 var(--font-body); cursor: pointer; }
.recipe-node img { width: 48px; height: 48px; }
.recipe-node:is(:hover, .virtual-hover) { color: var(--you-light); }
.recipe .recipe { position: relative; justify-content: center; gap: 0; padding-top: 12px; }
.recipe .recipe::before { content: ''; position: absolute; top: 0; left: calc(50% - 1px); height: 12px; border-left: 2px solid var(--trim); }
.recipe .recipe > li { position: relative; padding: 12px 8px 0; }
.recipe .recipe > li::before, .recipe .recipe > li::after { content: ''; position: absolute; top: 0; width: 50%; height: 12px; border-top: 2px solid var(--trim); }
.recipe .recipe > li::before { right: 50%; }
.recipe .recipe > li::after { left: calc(50% - 1px); border-left: 2px solid var(--trim); }
.recipe .recipe > li:first-child::before, .recipe .recipe > li:last-child::after { border-top: 0; }
@container (max-width: 980px) {
  .items-page { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; height: auto; min-height: 0; }
  .items-browse, .item-detail { grid-column: 1; grid-row: auto; }
  .items-scroll, .item-detail { overflow: visible; }
  .items-scroll { padding-bottom: 8px; mask-image: none; }
}

/* A phone (Tyler, 2026-11-17: "a lot of the menus are kind of squished and they're not optimized for mobile"; measured
   by tests/browser_phone_menus.cjs). Desktop windows are laid out at 1100 wide or more, so none of this reaches them.
   A tap on a portrait opens the champion's page, so on a phone the details panel only ever shows the first champion:
   it rests in the flow under the grid instead of docking over it, and no portrait wears its gold ring (mobile council
   round 1, Opus: Wizard looked chosen when nothing was). The filters are one band over the grid, both ways round: the
   search, the difficulty as four named buttons (round 1, both judges: bare pips said nothing), Any, Easy, Medium and
   Hard, each over its pips, and the classes in a row that scrolls sideways and fades at its right edge. The group
   names stay for screen readers. Every button is a thumb's 44px as drawn: on its side the frame is zoomed to 0.8 to 1
   (kit/scale.rs `touch_client_scale`; round 1, Sol: 44px buttons were drawn at 35 to 38). */
@media (max-width: 600px), (orientation: landscape) and (max-width: 1099.98px) {
  html.touch .roster-filters { --tap: calc(44px / var(--client-scale, 1)); position: static; flex-direction: row; align-items: center; gap: 8px; min-height: 0; padding: 8px; }
  html.touch .roster-filters > .kit-label { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  html.touch .roster-filters > .explore-search { order: 1; min-width: 0; min-height: var(--tap); padding-block: 0; }
  html.touch .roster-difficulty { order: 2; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
  html.touch .roster-difficulty .kit-chip { flex-direction: column; justify-content: center; gap: 4px; min-width: 0; min-height: var(--tap); padding: 2px 6px; font-size: var(--t-s); line-height: 1; }
  html.touch .roster-difficulty .kit-chip .difficulty-pips { gap: 2px; }
  html.touch .roster-difficulty .kit-chip .difficulty-pips i { width: 8px; height: 8px; }
  /* The classes take the next place, with Clear filters beside them once something is filtered. */
  html.touch .roster-classes { order: 3; flex-direction: row; flex-wrap: nowrap; min-width: 0; gap: 6px; overflow-x: auto; scrollbar-width: none; }
  html.touch .roster-class { flex: none; align-items: center; gap: 8px; min-height: var(--tap); padding: 0 12px; border: 2px solid var(--steel-line); background: var(--chip-face); white-space: nowrap; }
  html.touch .roster-class[aria-pressed="true"] { border-color: var(--you); background: var(--you-soft); }
  /* More classes lie to the right (mobile council round 4, both judges: a soft fade alone did not say the row scrolls):
     a gold pixel chevron held at the row's right edge over a shadow the next chip runs under, gone at the row's end. */
  html.touch .roster-classes::after { content: ''; position: sticky; right: 0; flex: none; align-self: stretch; width: 40px; margin-left: -6px; pointer-events: none;
    background: linear-gradient(var(--trim) 0 4px, transparent 4px 10px, var(--trim) 10px) right 12px center / 2px 14px no-repeat,
      linear-gradient(transparent 2px, var(--trim) 2px 6px, transparent 6px 8px, var(--trim) 8px 12px, transparent 12px) right 10px center / 2px 14px no-repeat,
      linear-gradient(transparent 4px, var(--trim) 4px 10px, transparent 10px) right 8px center / 2px 14px no-repeat,
      linear-gradient(transparent 6px, var(--trim) 6px 8px, transparent 8px) right 6px center / 2px 14px no-repeat,
      linear-gradient(90deg, transparent, var(--chip-face) 55%); }
  @supports (animation-timeline: scroll()) {
    html.touch .roster-classes { scroll-timeline: --roster-classes inline; }
    html.touch .roster-classes::after { animation: roster-classes-end linear both; animation-timeline: --roster-classes; }
  }
  html.touch .roster-clear { order: 4; flex: none; align-self: stretch; min-height: var(--tap); margin: 0; }
  /* Each tile on a quiet opaque navy, so the castle behind does not run through the names (mobile council round 4, Sol);
     the arena still shows between the tiles, and the portraits keep their gold sockets. */
  html.touch .roster-tile { gap: 4px; padding: 8px 4px; background: var(--bg-1); }
  html.touch .roster-meta { flex-direction: column; gap: 4px; }
  html.touch .roster-tile.shown { border-color: var(--plate-edge); background: var(--bg-1); box-shadow: inset 0 1px 0 var(--plate-sheen); }
  html.touch .roster-tile.shown > .socket { border-image-source: url('/c/8bc02bcbba9193539b6f4a27d5f15eb52bdd7c3d38357d3badb9645d0baaa5e4.png'); }
  html.touch .roster-tile.shown > b { color: inherit; }
  html.touch .roster-detail { position: static; box-shadow: none; }
}
/* Upright the band is two rows that hold at the top of the page while the roster scrolls under them (mobile council
   round 2, Sol: three framed rows of filters came before the first portrait): the search beside the four difficulty
   buttons, the classes under both. A plain steel band, not a gold frame, so the portraits are the page's art. Three
   portraits a row. The band holds at -12px, the page's upright padding (client.css), so it meets the screen's top edge. */
@media (max-width: 600px) and (orientation: portrait) {
  html.touch .roster-layout { gap: 10px; }
  html.touch .roster-filters { position: sticky; top: -12px; z-index: 3; flex-wrap: wrap; gap: 6px; padding: 8px; border: 0; border-image: none;
    background: var(--bg-1); box-shadow: 0 0 0 1px var(--steel-line), 0 10px 14px -6px var(--shadow); }
  html.touch .roster-filters > .explore-search { flex: 1 1 96px; gap: 8px; padding-inline: 10px; }
  html.touch .roster-difficulty { flex: none; grid-template-columns: repeat(4, 60px); }
  html.touch .roster-difficulty .kit-chip { padding-inline: 2px; font-size: var(--t-xs); }
  html.touch .roster-classes { flex: 1 1 100%; }
  html.touch .roster-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 6px; }
  html.touch .roster-tile > .socket { width: 92px !important; height: 92px !important; }
  html.touch .roster-tile > .socket > img { width: 80px !important; height: 80px !important; }
  html.touch .roster-meta .difficulty-pips i { width: 12px; height: 12px; }
  /* The panel: the idle beside the name and summary, the abilities under both and Open across the foot. */
  html.touch .roster-detail { grid-template-columns: 104px minmax(0, 1fr); grid-template-areas: "figure info" "kit kit" "open open"; gap: 12px; padding: 12px; }
  html.touch .roster-detail-figure { align-self: start; width: 104px; height: 136px; margin: 0; }
  html.touch .roster-detail-name { font-size: var(--t-l); }
  html.touch .roster-detail-summary { font-size: var(--t-s); }
  html.touch .roster-detail-abilities { gap: 8px 16px; }
  html.touch .roster-detail-abilities .socket > img { width: 32px; height: 32px; }
}
/* Clear filters stands only once something is filtered: with nothing to clear it was the band's loudest button. */
html.touch .roster-filters .roster-clear { display: none; }
html.touch .roster-filters:has(.roster-classes > [aria-pressed="true"]:not(:first-child), .roster-difficulty > [aria-pressed="true"]:not(:first-child), input:not(:placeholder-shown)) .roster-clear { display: inline-flex; }
@keyframes roster-classes-end { 0%, 92% { opacity: 1; } 100% { opacity: 0; } }
/* On its side the band is one row over the grid (mobile council round 1, Sol: the class column filled the first screen
   and Difficulty sat under it): the search, the difficulty and the classes side by side, so the portraits take the
   page's width, five or six a row. The panel rests under the grid. */
@media (orientation: landscape) and (max-width: 1099.98px) {
  html.touch .roster-layout { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  html.touch .roster-filters { flex-wrap: nowrap; padding: 8px 10px; }
  html.touch .roster-filters > .explore-search { flex: 0 1 200px; }
  html.touch .roster-difficulty { flex: none; grid-template-columns: repeat(4, 76px); }
  html.touch .roster-classes { flex: 1 1 0; }
  html.touch .roster-grid { grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 8px 6px; }
  html.touch .roster-tile > .socket { width: 104px !important; height: 104px !important; }
  html.touch .roster-tile > .socket > img { width: 92px !important; height: 92px !important; }
}
/* A small phone on its side (568x320): the classes take a row of their own under the search and difficulty, where more
   than one shows. */
@media (orientation: landscape) and (max-width: 699.98px) {
  html.touch .roster-filters { flex-wrap: wrap; }
  html.touch .roster-classes { flex: 1 1 100%; }
}
/* The stats' full names, which a phone shows in place of the short ones (it has no hover for their tooltips). */
.champion-stat-name { display: none; }
/* A champion's page on a phone (mobile council round 0: its first screen had no figure, the abilities floated over the
   castle three and two, and the stats read AD, MR and MS). The page's parts are placed on one grid: the idle beside the
   class line and summary under the name, the level-1 stats by their full names (WRITING.md), Try in Sandbox and Plan
   items on one row, the five abilities in one row on a steel plate with the chosen one's text right under them. The
   abilities keep their Q, W, E and R: the match's ability buttons show those letters on a phone too (touch.css). Each
   ability's short name stands under its key on up to two lines (mobile council round 2, Sol: only the chosen one was
   named), wrapping only between words (client council round 20: "Thunderstrik / e"): a slot with a long word takes the
   width it needs from the others. Every button is 44px as drawn. */
@media (max-width: 600px), (orientation: landscape) and (max-width: 1099.98px) {
  html.touch .champion-main { display: contents; }
  html.touch .champion-title { grid-area: title; gap: 12px; }
  html.touch .champion-title .btn { min-height: calc(44px / var(--client-scale, 1)); }
  html.touch .champion-line { grid-area: line; align-self: end; gap: 4px 10px; }
  html.touch .champion-summary { grid-area: summary; align-self: start; line-height: 1.35; }
  /* On opaque navy, so the castle behind does not muddy the names (mobile council round 2, both judges). */
  html.touch .champion-stats { grid-area: stats; padding: 6px 2px 2px; background: var(--panel-flat); border: 2px solid var(--plate-edge); }
  html.touch .champion-stats dt { color: var(--text-dim); }
  html.touch .champion-stats dl { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  html.touch .champion-stats dl > div { gap: 2px; padding: 6px 2px; text-align: center; }
  html.touch .champion-stats dl > div:nth-child(4) { border-left: 0; }
  html.touch .champion-stats dl > div:nth-child(n + 4) { border-top: 2px solid var(--column-edge); }
  html.touch .champion-stats abbr { display: none; }
  html.touch .champion-stat-name { display: inline; }
  html.touch .champion-stats dd { font-size: var(--t-m); }
  html.touch .champion-actions { grid-area: actions; flex-wrap: nowrap; margin: 0; }
  html.touch .champion-actions .btn { height: calc(48px / var(--client-scale, 1)); }
  html.touch .champion-actions .btn.primary.big { flex: 1 1 auto; min-width: 0; padding-inline: 12px; font-size: var(--t-m); }
  html.touch .champion-kit { grid-area: kit; display: grid; grid-template-columns: repeat(5, minmax(min-content, 1fr)); gap: 4px; margin: 0; padding: 10px 6px 8px;
    background: var(--plate); border: 2px solid var(--plate-edge); box-shadow: inset 0 1px 0 var(--plate-sheen); }
  html.touch .champion-slot { justify-content: flex-start; width: auto; min-width: 0; min-height: 44px; }
  html.touch .champion-slot .socket > img { width: 48px; height: 48px; }
  html.touch .champion-slot .ability-key { margin-top: 4px; font-size: var(--t-xs); }
  html.touch .champion-slot .ability-name { margin-top: 2px; font-size: var(--t-xs); color: var(--text-dim); }
  html.touch .champion-slot[aria-pressed="true"] .ability-name { color: var(--you-light); }
  html.touch .champion-ability { grid-area: ability; flex: none; gap: 8px; min-height: 0; padding: 12px 14px; }
  /* The chosen ability's name is the panel's heading at a title's size (mobile council round 1, Sol). */
  html.touch .champion-ability > .kit-label { font-size: var(--t-m); letter-spacing: 2px; line-height: 1.2; }
  html.touch .champion-side { grid-area: side; }
}
/* Upright the champion leads (mobile council round 2, Sol: the tall stat column left the Wizard low beside empty space;
   both judges: the stats muddied on the castle behind them): the idle on its stage beside the class line and summary,
   Try in Sandbox and Plan items, the abilities and the chosen one's text, then the level-1 stats as a compact plate of
   three by two on opaque navy. */
@media (max-width: 600px) and (orientation: portrait) {
  html.touch .champion-page { height: auto; min-height: 0; }
  /* The introduction is one compact block under the name (mobile council round 4, Sol: the figure and the plate started
     well below the title): the plate at the top of its column, the figure's stage as tall as the column's width lets it
     stand (menu_art.rs `fit_scale`: no taller than its width over 0.9), and any height the figure takes beyond the plate
     falls in an empty row under the plate, not over it. */
  html.touch .champion-layout { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1fr); grid-template-rows: auto auto auto minmax(0, 1fr);
    grid-template-areas: "title title" "stage line" "stage summary" "stage ." "actions actions" "kit kit" "ability ability" "stats stats" "side side"; gap: 8px 12px; }
  /* Mobile council round 3: the class line and summary on one opaque navy plate, so the castle behind does not cross the
     words (Sol); the line's shadow fills the row gap between them. */
  html.touch .champion-stage { grid-area: stage; align-self: stretch; height: auto; min-height: 198px; padding-top: 0; }
  html.touch .champion-stage::before { bottom: -12px; }
  html.touch :is(.champion-line, .champion-summary) { margin: 0; padding-inline: 12px; background: var(--bg-1); }
  html.touch .champion-line { align-self: stretch; padding-top: 12px; padding-bottom: 2px; box-shadow: 0 8px 0 var(--bg-1), inset 0 1px 0 var(--steel-line); }
  html.touch .champion-summary { align-self: start; padding-bottom: 12px; font-size: var(--t-s); box-shadow: inset 0 -1px 0 var(--steel-line); }
  html.touch .champion-name { font-size: var(--t-xl-sm); letter-spacing: 3px; }
  html.touch .champion-slot .ability-name { font-size: var(--t-badge); }
}
/* On its side the chosen ability's text stands in the right column beside the name, figure, stats and abilities, so a
   tap on an ability shows its text in the same screen; Recommended items and the look follow under both. */
@media (orientation: landscape) and (max-width: 1099.98px) {
  html.touch .champion-page { height: auto; min-height: 0; }
  html.touch .champion-layout { grid-template-columns: 132px minmax(0, 1fr) minmax(0, 0.9fr); grid-template-rows: auto auto auto minmax(0, 1fr);
    grid-template-areas: "title title ability" "stage line ability" "stage summary ability" "stage stats ability" "actions actions ability" "kit kit ability" "side side side";
    gap: 10px 14px; }
  html.touch .champion-stage { grid-area: stage; height: 170px; padding-top: 0; }
  html.touch .champion-name { font-size: var(--t-xl-sm); letter-spacing: 3px; }
  html.touch .champion-line b, html.touch .champion-summary { font-size: var(--t-s); }
  html.touch .champion-slot { min-height: calc(44px / var(--client-scale, 1)); }
  html.touch .champion-ability { align-self: start; }
  html.touch .champion-side { flex-direction: row; align-items: start; }
  html.touch .champion-side > * { flex: 1 1 0; min-width: 0; }
}
/* Items on a phone, both ways round. The tier buttons are jumps, not filters (mobile council round 4, Opus: as steel
   buttons under the category chips they read as a second filter row, though a press scrolls): "Go to" in the labels'
   pixel face, then each tier as a quiet link with its count and a gold arrow down, between thin rules, every one a
   thumb's 44px tall. Each tile is a card on a quiet opaque navy, so the castle behind does not run through the names and
   prices (round 4, Sol). An upgrade the item builds into is one compact row (round 4, Sol: one stat a line made four
   boots fill the sheet): the picture beside the name and price, every stat under both on one line that wraps between
   stats, each led by its gold number. */
@media (max-width: 600px), (orientation: landscape) and (max-width: 1099.98px) {
  html.touch .items-tiers > .dim { padding-right: 4px; color: var(--trim); font: 400 var(--t-xs)/1 var(--font-head); letter-spacing: 1px; text-transform: uppercase; }
  html.touch .items-tiers .items-tier { position: relative; justify-content: center; gap: 6px; padding: 0 8px; color: var(--text); background: none; border: 0; border-image: none;
    box-shadow: none; }
  html.touch .items-tiers .items-tier + .items-tier::before { content: ''; position: absolute; left: -1px; top: 12px; bottom: 12px; border-left: 2px solid var(--steel-line); }
  html.touch .items-tiers .items-tier::after { content: ''; flex: none; width: 14px; height: 8px;
    background: linear-gradient(90deg, var(--trim) 0 4px, transparent 4px 10px, var(--trim) 10px) 0 0 / 14px 2px no-repeat,
      linear-gradient(90deg, transparent 2px, var(--trim) 2px 6px, transparent 6px 8px, var(--trim) 8px 12px, transparent 12px) 0 2px / 14px 2px no-repeat,
      linear-gradient(90deg, transparent 4px, var(--trim) 4px 10px, transparent 10px) 0 4px / 14px 2px no-repeat,
      linear-gradient(90deg, transparent 6px, var(--trim) 6px 8px, transparent 8px) 0 6px / 14px 2px no-repeat; }
  html.touch .items-tiers .items-tier:is(:hover, .virtual-hover):not(:disabled) { color: var(--you-light); }
  html.touch .item-grid { gap: 6px; }
  html.touch .item-tile { padding: 6px 4px 8px; background: var(--bg-1); border: 2px solid var(--plate-edge); box-shadow: inset 0 1px 0 var(--plate-sheen); }
  html.touch .item-upgrades { gap: 6px; }
  html.touch .item-upgrade { grid-template-columns: 40px minmax(0, 1fr) auto; grid-template-areas: "art name cost" "art stats stats"; align-items: center; gap: 2px 10px;
    padding: 8px 10px; }
  html.touch .item-upgrade > img { grid-area: art; width: 40px; height: 40px; }
  html.touch .item-upgrade-text { display: contents; }
  html.touch .item-upgrade-text > b { grid-area: name; font-size: var(--t-s); }
  html.touch .item-upgrade-stats { grid-area: stats; flex-direction: row; flex-wrap: wrap; gap: 0 12px; font-size: var(--t-s); }
  html.touch .item-upgrade > .item-cost { grid-area: cost; align-self: start; font-size: var(--t-s); }
}
/* Items upright. A tapped item opens in the sheet (explore/sheet.rs, styled below); the page is one column that scrolls
   as a whole (mobile council round 2, Opus: the grid scrolled in a framed box inside the page, its frame cutting the
   third row). The search and the colour key lead and scroll away; the categories and the tier buttons under them are a
   band that holds at the top, where Go to brings a tier's heading just under it (items.rs `show_tier`; the headings'
   scroll margin is the band's height). The tier links share the row in equal thirds after "Go to". No frame round the
   grid: the items are the art. With no sheet open no tile wears the open item's ring: nothing is open. */
@media (max-width: 600px) and (orientation: portrait) {
  html.touch .items-page { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto; gap: 0; height: auto; min-height: 0; }
  html.touch .items-page > .item-detail { display: none; }
  /* The filters' wrappers give their parts to the column's grid, so the search and the colour key share a row. */
  html.touch .items-browse { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "search key" "cats cats" "tiers tiers" "note note" "grid grid";
    gap: 0 8px; grid-row: 1; height: auto; min-height: 0; padding: 0; border: 0; border-image: none; background: none; }
  html.touch .items-filters, html.touch .items-subhead, html.touch .items-key { display: contents; }
  html.touch .items-filters .explore-search { grid-area: search; width: auto; min-width: 0; min-height: 44px; padding-block: 0; }
  /* What gold is, in one line over the grid (mobile council round 3, Sol: a newcomer saw 0 Silver over gold prices with
     nothing saying which pays for what); it scrolls away with the grid. */
  html.touch .items-currency-note { grid-area: note; margin: 0; padding: 8px 2px 0; color: var(--text-dim); font-size: var(--t-xs); line-height: 1.3; }
  html.touch .items-key-toggle { grid-area: key; min-height: 44px; }
  /* The band: two sticky rows on one opaque ground, the tiers held just under the categories. Held at -12px, the page's
     upright padding (client.css), so the band meets the screen's top edge and nothing shows above it. */
  html.touch :is(.items-categories, .items-tiers) { position: sticky; z-index: 3; padding: 6px 0 0; background: var(--bg-1); }
  /* The six categories share the row whole, in the chips' small face (mobile council round 3, Opus: the row scrolled
     and its fade cut Defense mid-word). A phone narrower than the six scrolls the row, fading at its right edge into the
     band's ground (a mask would fade the ground too, and show the grid). */
  html.touch .items-categories { grid-area: cats; top: -12px; flex-wrap: nowrap; gap: 4px; min-width: 0; margin-top: 6px; overflow-x: auto; scrollbar-width: none; }
  html.touch .items-categories .kit-chip { flex: 1 0 auto; justify-content: center; min-height: 44px; padding-inline: 5px; font-size: var(--t-xs); }
  html.touch .items-tiers { grid-area: tiers; top: 38px; display: grid; grid-template-columns: auto repeat(3, minmax(0, 1fr)); align-items: center; gap: 0; margin: 0; padding-bottom: 6px;
    white-space: nowrap; box-shadow: 0 1px 0 var(--steel-line), 0 10px 14px -6px var(--shadow); }
  html.touch .items-tiers .items-tier { min-width: 0; min-height: 44px; padding-inline: 4px; font-size: var(--t-xs); }
  /* The key opens over the grid's top rows, as on a desktop. */
  html.touch .items-key-panel { grid-area: grid; align-self: start; position: relative; z-index: 4; top: 0; width: 100%; }
  html.touch .items-key-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  html.touch .items-scroll { grid-area: grid; overflow: visible; padding: 0 0 8px; mask-image: none; }
  html.touch .items-scroll > .kit-label { scroll-margin-top: 110px; }
  html.touch .item-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  html.touch .item-tile img { width: 80px; height: 80px; }
  html.touch .items-page:not(:has(.phone-sheet[open])) .item-tile:is(.part, [aria-pressed="true"]) img { box-shadow: 0 0 0 2px var(--steel-dark); }
  /* In the sheet: the picture beside the name, price and tags. */
  html.touch .item-detail { gap: 10px; padding: 0 16px 14px; }
  html.touch .item-heading { gap: 12px; }
  html.touch .item-heading > img { width: 56px; height: 56px; }
}
@media (max-width: 409.98px) and (orientation: portrait) {
  html.touch .items-categories .kit-chip { padding-inline: 4px; font-size: var(--t-badge); }
}
@media (max-width: 379.98px) and (orientation: portrait) {
  html.touch .items-categories::after { content: ''; position: sticky; right: 0; flex: none; align-self: stretch; width: 28px; margin-left: -4px; pointer-events: none;
    background: linear-gradient(90deg, transparent, var(--bg-1)); }
}
/* An item with no components says nothing under Components (mobile council round 2, Sol: the empty section took a band
   before the upgrades), so a phone leaves the heading and its "No components." out; a finished item's empty Builds into
   likewise. */
html.touch .item-detail > h4.kit-label:has(+ p.dim), html.touch .item-detail > h4.kit-label + p.dim,
html.touch .item-detail > .item-row:has(> h4.kit-label + p.dim) { display: none; }
/* The sheet (explore/sheet.rs): a touch page held upright draws it, Items and the Store alike. A modal dialog the
   screen's size, transparent, with the page dimmed under it; the panel stands at its foot no taller than four fifths of
   the screen, so the page above still shows where it came from, and scrolls on its own (the page under it is inert
   and does not move). Mobile council round 2 (Opus: Close floated on the dimmed page over what lay behind): the panel
   wears the gold frame and holds its own header, a grab handle centred at the top (a drag down on it closes the sheet),
   then Feedback and Close, then the item's heading, which stays at the top while the rest scrolls. The panel rises in. */
html.touch dialog.phone-sheet[open] { position: fixed; inset: 0; box-sizing: border-box; display: flex; flex-direction: column; justify-content: flex-end;
  width: 100%; max-width: none; height: 100%; max-height: none; margin: 0; overflow: hidden; color: var(--text); background: transparent; border: 0;
  padding: max(12px, env(safe-area-inset-top, 0px)) env(safe-area-inset-right, 0px) 0 env(safe-area-inset-left, 0px); /* client.css, The safe area. */
  overscroll-behavior: contain; }
html.touch dialog.phone-sheet::backdrop { background: rgb(3 7 15 / 66%); }
html.touch .phone-sheet-panel { position: relative; display: flex; flex-direction: column; min-height: 0; max-height: 82%; padding-top: 16px;
  border: 10px solid transparent; border-bottom-width: 0; border-image: url('/c/9cd69333dc17ed5ade6bb46d5efcec31312af5d14fe544a36a658f159be82b62.png') 8 / 16px stretch; background: var(--panel-steel) padding-box;
  box-shadow: 0 -12px 28px var(--shadow); image-rendering: pixelated; }
html.touch .phone-sheet-panel::before { content: ''; position: absolute; top: 4px; left: 50%; width: 48px; height: 4px; margin-left: -24px; background: var(--steel-line);
  box-shadow: 0 2px 0 var(--bg-0); pointer-events: none; }
/* The handle's strip, where a drag down closes the sheet. */
html.touch .phone-sheet-grip { position: absolute; top: -10px; left: 72px; right: 72px; height: 30px; touch-action: none; }
/* No scrollbar gutter: it drew a dark strip beside the sticky heading (mobile council round 5, Opus); a touch scroll needs none. */
html.touch .phone-sheet-panel > .ms { flex: 0 1 auto; min-height: 0; overflow: hidden auto; overscroll-behavior: contain; scrollbar-width: none; margin: 0; border: 0; border-image: none; background: none;
  box-shadow: none; padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px)); }
/* The header: a bar under the handle with Feedback at its left and Close at its right (mobile council round 3, Sol: the
   inert page's Feedback could not be pressed while the sheet was open), then the item's heading the panel's width,
   which stays at the top while the rest scrolls. The bar stands above the handle's drag strip. */
html.touch .phone-sheet-bar { position: relative; z-index: 3; flex: none; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 2px 10px 8px; background: var(--steel-flat); }
html.touch .phone-sheet-bar > .btn { flex: none; min-width: 88px; min-height: 44px; margin: 0; padding: 0 16px; }
html.touch .phone-sheet-panel > .ms > :is(.item-heading, .cosmetic-detail-head) { position: sticky; top: 0; z-index: 2; flex: none; align-items: center; min-height: 56px;
  margin: 0 -16px; padding: 0 16px 10px; background: var(--steel-flat); box-shadow: 0 1px 0 var(--steel-line); }
html.touch .client-content:has(.phone-sheet[open]) { overflow: hidden; }
@media (prefers-reduced-motion: no-preference) {
  html.touch dialog.phone-sheet[open] > .phone-sheet-panel { animation: phone-sheet-rise 180ms cubic-bezier(.2, .8, .3, 1); }
  html.touch dialog.phone-sheet[open]::backdrop { animation: phone-sheet-dim 180ms linear; }
}
@keyframes phone-sheet-rise { from { transform: translateY(32%); opacity: .4; } }
@keyframes phone-sheet-dim { from { opacity: 0; } }
/* On its side: the grid at the left, the open item in a column at the right, the categories scrolling sideways beside
   the search. The open item keeps its ring here, where its panel shows it. */
@media (orientation: landscape) and (max-width: 1099.98px) {
  html.touch .items-page { grid-template-columns: minmax(0, 1fr) minmax(300px, 38%); grid-template-rows: minmax(0, 1fr); height: calc(100cqh * var(--cq-fix, 1)); min-height: 0; }
  html.touch .items-browse { grid-column: 1; grid-row: 1; padding: 8px 4px 0; }
  html.touch .item-detail { grid-column: 2; grid-row: 1; overflow: auto; gap: 10px; padding: 14px 16px; }
  html.touch .items-filters { flex-wrap: nowrap; padding: 0 6px 8px; }
  html.touch .items-categories { flex: 1 1 auto; flex-wrap: nowrap; gap: 6px; min-width: 0; overflow-x: auto; padding-right: 28px; scrollbar-width: none;
    mask-image: linear-gradient(90deg, black calc(100% - 28px), transparent); }
  html.touch .items-categories .kit-chip { flex: none; }
  html.touch .items-filters .explore-search { flex: 0 1 220px; min-width: 160px; }
  html.touch .items-subhead { padding: 0 6px 8px; }
  /* A thumb's 44px as drawn, in the frame zoomed to 0.8 to 1 (mobile council round 1, Sol). */
  html.touch :is(.items-categories .kit-chip, .items-filters .explore-search, .items-key-toggle, .items-tier) { min-height: calc(44px / var(--client-scale, 1)); }
  html.touch .items-scroll { overflow: auto; padding: 0 6px 48px; scroll-padding-bottom: 48px; mask-image: linear-gradient(black calc(100% - 40px), transparent); }
  html.touch .item-grid { grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); }
  html.touch .item-tile img { width: 72px; height: 72px; }
  html.touch .item-heading > img { width: 72px; height: 72px; }
}
/* A small phone on its side (568x320): the open item's column narrower, and the filters in two rows so the grid starts
   in the first screen: the categories and the search, then the colour key and the tier buttons by name alone (each
   button still says its count to a screen reader). The currency note is left to the prices, which say gold. */
@media (orientation: landscape) and (max-width: 699.98px) {
  html.touch .items-page { grid-template-columns: minmax(0, 1fr) minmax(0, 0.62fr); }
  html.touch .items-filters .explore-search { flex: 0 0 150px; min-width: 0; }
  html.touch .items-subhead { flex-wrap: nowrap; gap: 4px; padding-inline: 4px; }
  html.touch :is(.items-currency-note, .items-tiers > .dim, .items-tier-count) { display: none; }
  html.touch .items-tiers { flex-wrap: nowrap; gap: 4px; margin-left: 0; }
  html.touch :is(.items-tier, .items-key-toggle) { padding-inline: 6px; font-size: var(--t-xs); }
  html.touch .items-tiers .items-tier { gap: 4px; padding-inline: 5px; }
  /* In the narrow column an upgrade's price goes under its name, as in the item's own heading, so the name keeps the
     row's width. */
  html.touch .item-upgrade { grid-template-columns: 32px minmax(0, 1fr); grid-template-areas: "art name" "art cost" "art stats"; gap: 2px 8px; padding: 6px 8px; }
  html.touch .item-upgrade > img { width: 32px; height: 32px; }
}
