/* item-card.css (2026-10-17)
   1. PS1 skin: the field inspector and the record windows take the Nocturne look of the full-screen menu
      (tokens come from skin-nocturne.css, whose token block also targets these two windows).
   2. The item card (src/ui/itemCard.js): hero with the item's own art, icon stat tiles, effect lines, traits, flavor.
      Its base rules read semantic variables only, so the GB skin draws the same structure in its four tones.
   3. The stair card's short omens and tags. */

/* ==== 1. inspector / record windows: obsidian glass instead of notebook paper ==== */
:root[data-skin="ps1"] body > :is(#tapInspectPanel.ui-inspect, .ui-record-popup):not([hidden]):not(.nx-paper) {
  --vp-ps1-paper: none;
  color: var(--nx-ivory); background-color: rgb(16 18 24 / 0.94); background-image: var(--nx-grain), var(--nx-backdrop);
  background-size: 180px 180px, 100% 100%; background-attachment: scroll;
  border: 1px solid var(--nx-line-2); border-radius: var(--nx-radius); box-shadow: var(--nx-shadow);
  -webkit-backdrop-filter: var(--nx-blur); backdrop-filter: var(--nx-blur);
  font-family: var(--ff-ui); text-shadow: none;
}
:root[data-skin="ps1"] body > :is(#tapInspectPanel, .ui-record-popup) > .inspect-body { background: none; scrollbar-color: var(--nx-line-2) transparent; scrollbar-width: thin; }
:root[data-skin="ps1"] body > :is(#tapInspectPanel, .ui-record-popup):not(.nx-paper) .tap-inspect-head {
  background: transparent; color: var(--nx-ivory); border-bottom: 1px solid var(--nx-line); box-shadow: none; text-shadow: none;
}
:root[data-skin="ps1"] body > :is(#tapInspectPanel, .ui-record-popup):not(.nx-paper) .tap-inspect-head > b { font-family: var(--ff-mincho); font-weight: 600; letter-spacing: .04em; color: var(--nx-ivory); }
:root[data-skin="ps1"] body > :is(#tapInspectPanel, .ui-record-popup):not(.nx-paper) .tap-inspect-head > span { color: var(--nx-ivory-3); font-size: 12px; letter-spacing: .08em; }
:root[data-skin="ps1"] body > :is(#tapInspectPanel, .ui-record-popup):not(.nx-paper) .ui-popup-x {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; align-self: center; height: 36px; min-height: 36px; padding: 0 12px;
  color: var(--nx-ivory-2); border: 1px solid var(--nx-line-2); border-radius: var(--nx-radius); background: rgb(236 230 218 / 0.04);
  font: 13px/1 var(--ff-ui); letter-spacing: .06em; text-decoration: none;
}
:root[data-skin="ps1"] body > :is(#tapInspectPanel, .ui-record-popup):not(.nx-paper) .ui-popup-x:is(:hover, :active, :focus-visible) { color: var(--nx-ivory); border-color: var(--nx-lantern); box-shadow: var(--nx-lantern-glow); outline: 0; text-decoration: none; }
:root[data-skin="ps1"] body > :is(#tapInspectPanel, .ui-record-popup):not(.nx-paper) :is(.inspect-block, .tap-inspect-empty) { color: var(--nx-ivory); border-color: var(--nx-line); }
:root[data-skin="ps1"] body > :is(#tapInspectPanel, .ui-record-popup):not(.nx-paper) .inspect-block > b { color: var(--nx-ivory); font-family: var(--ff-mincho); }
:root[data-skin="ps1"] body > :is(#tapInspectPanel, .ui-record-popup):not(.nx-paper) :is(.inspect-block > span, .inspect-block small, .inspect-tile__text span) { color: var(--nx-ivory-2); }
:root[data-skin="ps1"] body > :is(#tapInspectPanel, .ui-record-popup):not(.nx-paper) :is(.mechanics-row b, .mechanics-section-title, .mechanics-facts b) { color: var(--nx-ivory-3); }
:root[data-skin="ps1"] body > :is(#tapInspectPanel, .ui-record-popup):not(.nx-paper) :is(.mechanics-row span, .mechanics-note span) { color: var(--nx-ivory); }
:root[data-skin="ps1"] body > :is(#tapInspectPanel, .ui-record-popup):not(.nx-paper) .inspect-swatch { background: rgb(236 230 218 / 0.05); border-color: var(--nx-line-2); color: var(--nx-ivory); }
:root[data-skin="ps1"] body > :is(#tapInspectPanel, .ui-record-popup):not(.nx-paper) :is(.ui-btn, button.inspect-survey) { color: var(--nx-ivory); background: rgb(236 230 218 / 0.04); border: 1px solid var(--nx-line-2); border-radius: var(--nx-radius); }
:root[data-skin="ps1"] body > :is(#tapInspectPanel, .ui-record-popup):not(.nx-paper) :is(.route-compare, .route-compare-card) { background: none; border-color: var(--nx-line); color: var(--nx-ivory); box-shadow: none; }
:root[data-skin="ps1"] body > :is(#tapInspectPanel, .ui-record-popup):not(.nx-paper) :is(hr, .actor-sheet > *) { border-color: var(--nx-line); }

/* ==== 2. item card ==== */
.item-card, .ic-body {
  --ic-ink: var(--nx-ivory, var(--c-ink-1, currentColor));
  --ic-ink-2: var(--nx-ivory-2, var(--c-ink-2, currentColor));
  --ic-ink-3: var(--nx-ivory-3, var(--c-ink-3, currentColor));
  --ic-line: var(--nx-line, var(--c-line-soft, currentColor));
  --ic-line-2: var(--nx-line-2, var(--c-line, currentColor));
  --ic-accent: var(--nx-lantern, var(--c-ink-1, currentColor));
  --ic-tile: rgb(236 230 218 / 0.035);
  --ic-rarity: var(--ic-ink);
  display: grid; gap: 12px; min-width: 0; color: var(--ic-ink); font-size: 14px; line-height: 1.6;
}
.item-card > .ic-body { display: grid; gap: 12px; }
.item-card[data-rarity="uncommon"], .ic-name[data-rarity="uncommon"], [data-rarity="uncommon"] > .ui-detail__name { --ic-rarity: #9fcf9a; }
.item-card[data-rarity="rare"], .ic-name[data-rarity="rare"] { --ic-rarity: #8fb3e8; }
.item-card[data-rarity="epic"], .ic-name[data-rarity="epic"] { --ic-rarity: #c6a4f2; }
.item-card[data-rarity="legendary"], .ic-name[data-rarity="legendary"] { --ic-rarity: #e9b872; }
.item-card[data-rarity="unique"], .ic-name[data-rarity="unique"] { --ic-rarity: #f08a6c; }
.item-card[data-rarity="relic"], .ic-name[data-rarity="relic"] { --ic-rarity: #7fd0e6; }
.ic-art[data-rarity="uncommon"] { --ic-rarity: #9fcf9a; } .ic-art[data-rarity="rare"] { --ic-rarity: #8fb3e8; } .ic-art[data-rarity="epic"] { --ic-rarity: #c6a4f2; }
.ic-art[data-rarity="legendary"] { --ic-rarity: #e9b872; } .ic-art[data-rarity="unique"] { --ic-rarity: #f08a6c; } .ic-art[data-rarity="relic"] { --ic-rarity: #7fd0e6; }

.ic-ico { flex: none; width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }

/* art frame: a dark well lit from below in the rarity colour, the floor raster on top; the kind symbol shows until it is painted */
.ic-art {
  --ic-rarity: var(--nx-ivory-2, currentColor);
  position: relative; flex: none; display: grid; place-items: center; width: var(--ic-size, 56px); height: var(--ic-size, 56px);
  border: 1px solid color-mix(in srgb, var(--ic-rarity) 70%, transparent); border-radius: 3px;
  background: radial-gradient(circle at 50% 72%, color-mix(in srgb, var(--ic-rarity) 30%, transparent), transparent 70%), rgb(8 9 12 / 0.65);
  box-shadow: inset 0 0 0 1px rgb(0 0 0 / 0.5), 0 0 14px -4px color-mix(in srgb, var(--ic-rarity) 60%, transparent);
  overflow: hidden;
}
.ic-art > .ui-sym { width: 45%; height: 45%; opacity: .55; }
.ic-art__q { font: 600 calc(var(--ic-size, 56px) * .5)/1 var(--ff-mincho, serif); color: var(--ic-rarity); opacity: .8; }
.ic-art__img { position: absolute; inset: 6%; width: 88%; height: 88%; image-rendering: pixelated; filter: drop-shadow(0 2px 2px rgb(0 0 0 / 0.6)); }
.ic-art[data-painted="true"] > .ui-sym { display: none; }
.ic-art[data-painted="false"] > .ic-art__img { display: none; }

.ic-hero { display: flex; align-items: center; gap: 12px; min-width: 0; padding-bottom: 12px; border-bottom: 1px solid var(--ic-line); }
.ic-hero__text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.ic-name { color: var(--ic-rarity); font: 600 18px/1.3 var(--ff-mincho, serif); letter-spacing: .03em; overflow-wrap: anywhere; text-shadow: 0 0 12px color-mix(in srgb, var(--ic-rarity) 35%, transparent); }
.ic-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; color: var(--ic-ink-3); font-size: 12px; letter-spacing: .06em; }
.ic-meta > i { font-style: normal; opacity: .6; }
.ic-hero__els { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 2px; }
.ic-el { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px 1px 5px; border: 1px solid var(--ic-line-2); border-radius: 999px; font-size: 12px; color: var(--ic-ink-2); }
.ic-el > .ui-sym { width: 13px; height: 13px; }

.ic-body { display: grid; gap: 12px; min-width: 0; }

.ic-stats { display: grid; grid-template-columns: repeat(var(--ic-cols, 2), minmax(0, 1fr)); gap: 6px; }
.ic-stat {
  display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 6px; align-items: center; min-width: 0;
  padding: 7px 9px 8px; border: 1px solid var(--ic-line); border-radius: 3px; background: var(--ic-tile);
}
.ic-stat > .ic-ico { grid-row: 1; color: var(--ic-accent); }
.ic-stat__label { grid-row: 1; color: var(--ic-ink-3); font-size: 11px; letter-spacing: .08em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ic-stat__value { grid-column: 1 / -1; display: flex; align-items: baseline; gap: 6px; color: var(--ic-ink); font: 600 21px/1.15 var(--ff-mincho, serif); font-variant-numeric: tabular-nums; }
.ic-stat[data-tone="risk"] .ic-stat__value { color: var(--nx-danger, currentColor); }
.ic-delta { font: 700 12px/1 var(--ff-ui, sans-serif); font-style: normal; color: var(--ic-ink-3); }
.ic-delta[data-dir="up"] { color: var(--nx-ok, #9fcf9a); } .ic-delta[data-dir="down"] { color: var(--nx-danger, #e0796a); }
.ic-pips { grid-column: 1 / -1; display: flex; gap: 3px; margin-top: 4px; }
.ic-pips > i { width: 10px; height: 4px; border-radius: 999px; background: var(--ic-line-2); }
.ic-pips > i[data-on="true"] { background: var(--ic-accent); box-shadow: 0 0 6px color-mix(in srgb, var(--ic-accent) 60%, transparent); }

.ic-compare { display: flex; flex-wrap: wrap; gap: 2px 8px; margin: 0; padding: 6px 10px; border-left: 2px solid var(--ic-line-2); color: var(--ic-ink-2); font-size: 12.5px; background: var(--ic-tile); }
.ic-compare > span { color: var(--ic-ink-3); font-size: 11px; letter-spacing: .08em; }
.ic-compare[data-dir="up"] { border-left-color: var(--nx-ok, currentColor); } .ic-compare[data-dir="down"] { border-left-color: var(--nx-danger, currentColor); }

.ic-sub { display: flex; align-items: center; gap: 6px; margin: 0 0 6px; color: var(--ic-ink-3); font: 500 11px/1.4 var(--ff-ui, sans-serif); letter-spacing: .1em; }
.ic-sub > .ic-ico { color: var(--ic-accent); width: 14px; height: 14px; }
.ic-sub > b { margin-left: auto; color: var(--ic-ink); font: 600 13px var(--ff-mincho, serif); letter-spacing: .04em; }

.ic-ring { flex: none; width: 18px; height: 18px; border-radius: 50%; border: 1px dashed var(--ic-line-2); }

.ic-lines, .ic-traits, .ic-risks { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }
.ic-line, .ic-trait, .ic-risks > li { display: grid; grid-template-columns: 16px minmax(0, 1fr); gap: 8px; align-items: start; padding: 6px 0; border-bottom: 1px solid var(--ic-line); }
.ic-lines > li:last-child, .ic-traits > li:last-child, .ic-risks > li:last-child { border-bottom: 0; }
.ic-line > .ic-ico, .ic-trait > .ic-ico, .ic-risks .ic-ico { margin-top: 3px; }
.ic-line p, .ic-trait p, .ic-risks p { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.ic-line__tag { display: inline-block; margin-right: 6px; padding: 0 6px; border: 1px solid var(--ic-line-2); border-radius: 2px; color: var(--ic-ink-3); font-size: 11px; line-height: 17px; vertical-align: 1px; letter-spacing: .04em; }
.ic-line > .ic-ico { color: var(--ic-ink-3); }
.ic-line[data-tone="primary"] > .ic-ico { color: var(--nx-lantern, currentColor); }
.ic-line[data-tone="control"] > .ic-ico { color: var(--nx-mp, currentColor); }
.ic-line[data-tone="terrain"] > .ic-ico { color: var(--sym-oil, currentColor); }
.ic-line[data-tone="synergy"] > .ic-ico { color: var(--sym-arcane, currentColor); }
.ic-line[data-tone="utility"] > .ic-ico { color: var(--nx-ok, currentColor); }
.ic-line[data-tone="risk"] > .ic-ico { color: var(--nx-danger, currentColor); }

.ic-trait { padding: 8px 10px; margin-bottom: 4px; border: 1px solid var(--ic-line); border-radius: 3px; background: linear-gradient(90deg, rgb(198 164 242 / 0.08), transparent 70%); }
.ic-trait > .ic-ico { color: var(--sym-arcane, currentColor); }
.ic-trait[data-rune] { background: linear-gradient(90deg, rgb(233 184 114 / 0.08), transparent 70%); }
.ic-trait[data-rune] > .ic-ico { color: var(--ic-accent); }
.ic-trait b { display: block; color: var(--ic-ink); font: 600 13.5px/1.5 var(--ff-mincho, serif); letter-spacing: .03em; }
.ic-trait p > span { display: block; color: var(--ic-ink-2); font-size: 13px; }
.ic-risks > li { color: var(--nx-danger, currentColor); }
.ic-risks .ic-line__tag { border-color: currentColor; color: inherit; }

.ic-spell { padding: 10px; border: 1px solid var(--ic-line); border-radius: 3px; background: var(--ic-tile); }
/* the contained spell reads like a spellbook row: element / glyph icon, name-less body (brief or description, numbers, features), range grid */
.ic-spell__book { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: start; gap: 8px 10px; }
.ic-spell__book > .ui-spell-main { color: var(--ic-ink-2); font-size: 13px; }
.ic-spell__book .ui-spell-range .ui-range__grid { display: block; width: 56px; height: 56px; margin: 0; padding: 0; border: 1px solid var(--ic-line); box-sizing: border-box; }
@media (max-width: 360px) { .ic-spell__book { grid-template-columns: auto minmax(0, 1fr); } .ic-spell__book > .ui-spell-range { grid-column: 1 / -1; justify-self: start; } }

.ic-flavor { margin: 0; padding-top: 10px; border-top: 1px solid var(--ic-line); color: var(--ic-ink-3); font: 13px/1.85 var(--ff-mincho, serif); letter-spacing: .02em; white-space: pre-line; }
.ic-throw { display: grid; grid-template-columns: 16px auto minmax(0, 1fr); align-items: start; gap: 8px; margin: 0; color: var(--ic-ink-3); font-size: 12px; line-height: 1.6; }
.ic-throw > .ic-ico { margin-top: 2px; }
.ic-throw > span { padding: 0 6px; border: 1px solid var(--ic-line); border-radius: 2px; font-size: 11px; white-space: nowrap; }
.ic-throw > em { font-style: normal; min-width: 0; overflow-wrap: anywhere; }

/* the inspector gives the card its own margins; the old block chrome steps aside */
body > #tapInspectPanel .inspect-block.inspect-item { display: block; padding-bottom: 4px; border-bottom: 0; }

/* menu: art icons in list rows and the detail head */
.ui-chip.ui-chip--art { display: inline-grid; place-items: center; padding: 0; border: 0; background: none; box-shadow: none; width: auto; height: auto; }
:root[data-skin="ps1"] body #actionSidebar.ui-menu:not([data-hand="1"]) .ui-chip.ui-chip--art { width: auto; height: auto; padding: 0; border: 0; }
:root[data-skin="ps1"] body #actionSidebar.ui-menu:not([data-hand="1"]) .ui-detail__head:has(> .ui-chip--art) { flex-wrap: nowrap; align-items: center; }
:root[data-skin="ps1"] body #actionSidebar.ui-menu:not([data-hand="1"]) .ui-detail__head:has(> .ui-chip--art) .ui-detail__en { flex: 1 1 100%; }
:root[data-skin="ps1"] body #actionSidebar.ui-menu:not([data-hand="1"]) .ui-detail__head[data-rarity] { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 12px; }
:root[data-skin="ps1"] body #actionSidebar.ui-menu:not([data-hand="1"]) .ui-detail__head[data-rarity] > .ui-chip { grid-row: 1 / span 2; }
:root[data-skin="ps1"] body #actionSidebar.ui-menu:not([data-hand="1"]) .ui-detail__head[data-rarity="uncommon"] .ui-detail__name { color: #9fcf9a; }
:root[data-skin="ps1"] body #actionSidebar.ui-menu:not([data-hand="1"]) .ui-detail__head[data-rarity="rare"] .ui-detail__name { color: #8fb3e8; }
:root[data-skin="ps1"] body #actionSidebar.ui-menu:not([data-hand="1"]) .ui-detail__head[data-rarity="epic"] .ui-detail__name { color: #c6a4f2; }
:root[data-skin="ps1"] body #actionSidebar.ui-menu:not([data-hand="1"]) .ui-detail__head[data-rarity="legendary"] .ui-detail__name { color: #e9b872; }
:root[data-skin="ps1"] body #actionSidebar.ui-menu:not([data-hand="1"]) .ui-detail__head[data-rarity="unique"] .ui-detail__name { color: #f08a6c; }
:root[data-skin="ps1"] body #actionSidebar.ui-menu:not([data-hand="1"]) .ui-detail__head[data-rarity="relic"] .ui-detail__name { color: #7fd0e6; }
:root[data-skin="ps1"] body #actionSidebar.ui-menu:not([data-hand="1"]) .ui-detail__content > .ic-body { padding: 2px 10px 0 0; }

/* GB: the same structure in the four tones; no glow, no raster */
:root[data-skin="gb"] :is(.item-card, .ic-body) { --ic-ink: var(--gb-3); --ic-ink-2: var(--gb-3); --ic-ink-3: var(--gb-2); --ic-line: var(--gb-2); --ic-line-2: var(--gb-3); --ic-accent: var(--gb-3); --ic-tile: transparent; --ic-rarity: var(--gb-3); }
:root[data-skin="gb"] :is(.ic-art, .ic-name, .ic-pips > i) { box-shadow: none; text-shadow: none; }
:root[data-skin="gb"] .item-card .ic-name { color: var(--gb-3); }
:root[data-skin="gb"] .ic-art { background: var(--gb-0); border-color: var(--gb-3); }
:root[data-skin="gb"] :is(.ic-trait, .ic-spell) { background: none; }

/* ==== 3. stair card: a few short omens and small tags ==== */
.route-omens { display: grid; gap: 2px; margin: 8px 0 8px; color: var(--nx-ivory, var(--c-ink-1, currentColor)); font: 400 14px/1.7 var(--ff-mincho, serif); letter-spacing: .02em; }
.route-omens > span { display: block; font: inherit; }
.route-tags { display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 6px; padding: 0; list-style: none; }
.route-tags > li { padding: 0 8px; border: 1px solid var(--nx-line-2, var(--c-line, currentColor)); border-radius: 999px; color: var(--nx-ivory-2, var(--c-ink-2, currentColor)); font-size: 11.5px; line-height: 20px; }
:root[data-skin="ps1"] body > #tapInspectPanel .route-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding-bottom: 6px; border-bottom: 1px solid var(--nx-line); }
:root[data-skin="ps1"] body > #tapInspectPanel .route-head > b { color: var(--nx-ivory); font: 600 16px var(--ff-mincho); }
:root[data-skin="ps1"] body > #tapInspectPanel .route-head > span { color: var(--nx-ivory-3); font-size: 12px; }
:root[data-skin="ps1"] body > #tapInspectPanel .route-detail-hint { color: var(--nx-ivory-3); font-size: 11.5px; }
:root[data-skin="ps1"] body > :is(#tapInspectPanel, .ui-record-popup):not(.nx-paper) .ui-popup-x > span { align-self: center; font-size: 13px; line-height: 1; color: inherit; }
:root[data-skin="ps1"] body #actionSidebar.ui-menu:not([data-hand="1"]) .ui-detail__head[data-rarity] > .ui-detail__en { display: block; margin: 0; color: var(--nx-ivory-3); font: 12px var(--ff-ui); letter-spacing: .08em; }
:root[data-skin="ps1"] body #actionSidebar.ui-menu:not([data-hand="1"]) .ui-detail__head[data-rarity] > .ui-detail__name { align-self: end; }

/* signed modifiers: one stat row each, green when it helps, red when it hurts (the sign alone never decides: damage taken / costs read inverted) */
.ic-mods { display: grid; gap: 2px; margin: 0; padding: 6px 10px; list-style: none; border: 1px solid var(--ic-line); border-radius: 3px; background: var(--ic-tile); }
.ic-mods > li { --ic-mod: var(--nx-ok, #9fcf9a); display: grid; grid-template-columns: 16px minmax(0, 1fr) auto; align-items: center; gap: 8px; min-height: 26px; padding: 2px 0; border-bottom: 1px solid var(--ic-line); }
.ic-mods > li:last-child { border-bottom: 0; }
.ic-mods > li[data-good="false"] { --ic-mod: var(--nx-danger, #e0796a); }
.ic-mods > li > :is(.ui-sym, .ic-ico) { width: 14px; height: 14px; }
.ic-mods > li > .ic-ico { color: var(--ic-mod); fill: currentColor; stroke: none; }
.ic-mod__label { min-width: 0; color: color-mix(in srgb, var(--ic-mod) 55%, var(--ic-ink)); font-size: 13px; overflow-wrap: anywhere; }
.ic-mod__value { color: var(--ic-mod); font: 600 16px/1.2 var(--ff-mincho, serif); font-variant-numeric: tabular-nums; white-space: nowrap; text-shadow: 0 0 10px color-mix(in srgb, var(--ic-mod) 35%, transparent); }
.ic-trait > .ic-mods { grid-column: 1 / -1; margin-top: 4px; padding: 4px 8px; background: rgb(0 0 0 / 0.18); }
:root[data-skin="gb"] .ic-mods > li { --ic-mod: var(--gb-3); }
:root[data-skin="gb"] .ic-mods > li[data-good="false"] .ic-mod__value::after { content: " ▼"; }
:root[data-skin="gb"] .ic-mod__value { text-shadow: none; }
.ic-mods > li > .ic-mod__value { display: inline; color: var(--ic-mod); font: 600 16px/1.2 var(--ff-mincho, serif); letter-spacing: 0; }
