:root {
  --hf-safe-top: env(safe-area-inset-top, 0px);
  --hf-safe-right: env(safe-area-inset-right, 0px);
  --hf-safe-bottom: env(safe-area-inset-bottom, 0px);
  --hf-safe-left: env(safe-area-inset-left, 0px);
  --hf-bg: #080a09;
  --hf-bg-glow: #17130e;
  --hf-wood: #17130f;
  --hf-wood-deep: #0d100f;
  --hf-panel: #111514;
  --hf-panel-light: #181918;
  --hf-slot: #151918;
  --hf-slot-hover: #26231c;
  --hf-ink: #e9dcc3;
  --hf-muted: #9e9585;
  --hf-dim: #6c675d;
  --hf-gold: #b58a4a;
  --hf-gold-bright: #f0c879;
  --hf-gold-soft: #765a35;
  --hf-line: #514432;
  --hf-line-soft: rgba(153, 119, 67, .34);
  --hf-red: #b75d58;
  --hf-blue: #87a6aa;
  --hf-green: #95a881;
  --hf-purple: #a887b1;
  --hf-common: #7b817c;
  --hf-uncommon: #8ca469;
  --hf-rare: #8ba1a1;
  --hf-epic: #ad82b6;
  --hf-special: #d3a253;
  --hf-danger: #c36d5e;
  --hf-sans: "Segoe UI", Arial, sans-serif;
  --hf-serif: Georgia, "Times New Roman", serif;
  --hf-mono: Consolas, "Courier New", monospace;
}

@view-transition {
  /* Разные страницы имели разные размеры шапки; общий snapshot растягивался в VK WebView. */
  navigation: none;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--hf-bg);
}

body {
  min-width: 320px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  overflow-x: hidden;
  color: var(--hf-ink);
  background:
    radial-gradient(circle at 50% -16%, rgba(151, 103, 48, .2), transparent 35rem),
    linear-gradient(115deg, rgba(107, 73, 39, .08), transparent 31%),
    var(--hf-bg);
  font-family: var(--hf-sans);
  -webkit-font-smoothing: antialiased;
}

button {
  color: inherit;
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--hf-gold-bright);
  outline-offset: 3px;
}

.reference-app {
  width: min(100%, 1510px);
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  padding: calc(22px + var(--hf-safe-top)) max(17px, var(--hf-safe-right)) calc(45px + var(--hf-safe-bottom)) max(17px, var(--hf-safe-left));
}

.profile-status {
  position: relative;
  z-index: 5;
  margin: 0 0 9px;
  padding: 9px 13px;
  border: 1px solid rgba(181, 138, 74, .46);
  color: var(--hf-gold-bright);
  background: rgba(31, 23, 14, .88);
  font: 700 10px/1.35 var(--hf-mono);
  text-align: center;
}

.profile-status.is-error {
  border-color: rgba(195, 109, 94, .72);
  color: #f0b2a5;
  background: rgba(55, 20, 19, .9);
}

.profile-status.is-hidden {
  display: none;
}

.reference-frame {
  position: relative;
  border: 1px solid var(--hf-line);
  background:
    linear-gradient(133deg, rgba(151, 100, 44, .12), transparent 23%),
    linear-gradient(302deg, rgba(51, 76, 61, .06), transparent 31%),
    repeating-linear-gradient(163deg, rgba(255, 224, 169, .026) 0 1px, transparent 1px 15px),
    var(--hf-panel);
  box-shadow:
    0 20px 45px rgba(0, 0, 0, .4),
    inset 0 0 0 1px rgba(255, 230, 177, .035);
}

.reference-frame::before {
  position: absolute;
  inset: 7px;
  z-index: 0;
  pointer-events: none;
  content: "";
  border: 1px solid rgba(184, 139, 73, .21);
}

.reference-frame::after {
  position: absolute;
  top: 9px;
  left: 9px;
  width: 16px;
  height: 16px;
  z-index: 0;
  pointer-events: none;
  content: "";
  border-top: 1px solid var(--hf-gold-soft);
  border-left: 1px solid var(--hf-gold-soft);
  transform: skew(-16deg);
  opacity: .95;
}

.header-frame {
  display: grid;
  grid-template-columns: 250px minmax(385px, 1fr) minmax(360px, 465px);
  min-height: 132px;
  overflow: hidden;
}

.profile-summary,
.reference-tabs,
.resource-strip {
  position: relative;
  z-index: 1;
  min-width: 0;
}

.profile-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px 9px 11px;
  border-right: 1px solid var(--hf-line);
  background:
    linear-gradient(90deg, rgba(146, 96, 37, .1), transparent 74%),
    var(--hf-wood-deep);
}

.portrait-medallion {
  position: relative;
  display: grid;
  width: 133px;
  height: 115px;
  flex: 0 0 auto;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--hf-gold-soft);
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(115, 98, 74, .25), transparent 68%),
    #151818;
  box-shadow:
    0 0 0 5px rgba(48, 36, 23, .92),
    0 0 0 6px rgba(145, 104, 51, .47),
    inset 0 0 0 1px rgba(245, 207, 135, .2);
}

.portrait-medallion::before,
.portrait-medallion::after {
  position: absolute;
  width: 21px;
  height: 21px;
  content: "";
  border-color: var(--hf-gold-soft);
  opacity: .9;
}

.portrait-medallion::before {
  top: -1px;
  left: -1px;
  border-top: 1px solid;
  border-left: 1px solid;
}

.portrait-medallion::after {
  right: -1px;
  bottom: -1px;
  border-right: 1px solid;
  border-bottom: 1px solid;
}

.portrait-medallion img {
  display: block;
  width: 109px;
  height: 109px;
  object-fit: cover;
  object-position: center;
  border-radius: 50%;
  filter: saturate(.82) contrast(1.05);
}

.profile-meters {
  display: grid;
  min-width: 0;
  flex: 1;
  gap: 10px;
}

.meter-row {
  display: grid;
  grid-template-columns: 19px minmax(42px, 1fr) auto;
  align-items: center;
  gap: 7px;
  min-width: 0;
  color: var(--hf-muted);
  font: 700 9px/1 var(--hf-mono);
}

.meter-symbol {
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
  font: 18px/1 var(--hf-serif);
}

.meter-symbol.hp {
  color: #d16d67;
}

.meter-symbol.shard {
  color: #a8bdca;
}

.meter-symbol.xp {
  color: #e4bf70;
}

.meter-track {
  display: block;
  height: 8px;
  overflow: hidden;
  border: 1px solid rgba(92, 83, 68, .72);
  border-radius: 5px;
  background: #0a0d0c;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .6);
}

.meter-track.is-unavailable {
  opacity: .32;
}

.meter-fill {
  display: block;
  width: var(--value);
  height: 100%;
  background: var(--hf-gold);
  box-shadow: 0 0 8px rgba(226, 167, 80, .15);
}

.hp-fill {
  background: var(--hf-red);
}

.shard-fill {
  background: var(--hf-blue);
}

.xp-fill {
  background: var(--hf-green);
}

.meter-row strong {
  color: var(--hf-ink);
  font-size: 9px;
  font-weight: 700;
  white-space: nowrap;
}

.reference-tabs {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 0;
  padding: 13px 10px;
  border-right: 1px solid var(--hf-line);
  background:
    linear-gradient(90deg, rgba(131, 88, 41, .06), transparent 22%, rgba(131, 88, 41, .06)),
    var(--hf-wood-deep);
}

.reference-tab {
  position: relative;
  display: grid;
  min-width: 68px;
  flex: 1 1 82px;
  place-items: center;
  align-content: center;
  gap: 8px;
  padding: 8px 6px 7px;
  border: 1px solid transparent;
  border-radius: 2px;
  color: #9b907c;
  background: transparent;
  cursor: pointer;
  text-decoration: none;
  transition: color .18s ease, border-color .18s ease, background .18s ease;
}

.reference-tab svg {
  width: 27px;
  height: 27px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.55;
}

.reference-tab span {
  color: inherit;
  font: 700 8px/1 var(--hf-mono);
  letter-spacing: .07em;
  text-transform: uppercase;
  white-space: nowrap;
}

.reference-tab:hover,
.reference-tab.is-active {
  border-color: var(--hf-gold);
  color: var(--hf-gold-bright);
  background:
    linear-gradient(135deg, rgba(214, 160, 77, .2), transparent 58%),
    rgba(122, 82, 34, .19);
  box-shadow: inset 0 0 15px rgba(221, 167, 80, .08), 0 0 12px rgba(204, 139, 48, .07);
}

.reference-tab.is-active::after {
  position: absolute;
  right: 8px;
  bottom: -14px;
  left: 8px;
  height: 2px;
  content: "";
  background: var(--hf-gold-bright);
  box-shadow: 0 0 8px rgba(238, 186, 87, .52);
}

.resource-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
  padding: 14px 10px;
  gap: 7px;
  background: rgba(8, 11, 10, .38);
}

.resource-cell {
  display: grid;
  min-width: 0;
  place-items: center;
  align-content: center;
  gap: 7px;
  padding: 7px 4px;
  border: 1px solid var(--hf-line);
  color: var(--hf-muted);
  background:
    linear-gradient(135deg, rgba(184, 142, 73, .1), transparent 55%),
    rgba(18, 21, 20, .7);
  cursor: pointer;
  transition: border-color .18s ease, color .18s ease, background .18s ease;
}

.resource-cell:hover,
.resource-cell:focus-visible {
  border-color: var(--hf-gold);
  color: var(--hf-gold-bright);
  background: rgba(133, 90, 36, .25);
}

.resource-icon {
  display: block;
  height: 21px;
  color: var(--hf-gold);
  font: 24px/20px var(--hf-serif);
}

.resource-icon.coin {
  color: #d5a856;
}

.resource-icon.sack {
  color: #bca581;
}

.resource-icon.leaf {
  color: #b3ba77;
}

.resource-icon.diamond {
  color: #b8a3c0;
}

.resource-cell strong {
  color: var(--hf-ink);
  font: 700 10px/1 var(--hf-mono);
}

.menu-cell .resource-icon {
  font-size: 28px;
}

.reference-main {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr) minmax(340px, 390px);
  min-height: 620px;
  margin-top: 10px;
  overflow: hidden;
}

.equipment-rail,
.inventory-board,
.detail-panel {
  position: relative;
  z-index: 1;
  min-width: 0;
}

.equipment-rail {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 20px 13px 13px;
  border-right: 1px solid var(--hf-line);
  background:
    linear-gradient(90deg, rgba(135, 84, 31, .08), transparent 90%),
    var(--hf-wood);
}

.character-stats {
  flex: 0 0 auto;
  padding: 0 7px 15px;
  border-bottom: 1px solid var(--hf-line-soft);
}

.character-stats-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 8px;
  padding: 0 0 10px;
}

.character-stats-heading h2 {
  margin-top: 5px;
  color: var(--hf-ink);
  font: 700 15px/1 var(--hf-serif);
}

.stats-level {
  padding-bottom: 1px;
  color: var(--hf-gold);
  font: 700 9px/1 var(--hf-mono);
  white-space: nowrap;
}

.stats-heading-meta {
  display: flex;
  flex-direction: column;
  align-items: end;
  gap: 5px;
}

.attribute-points {
  padding: 4px 6px;
  border: 1px solid rgba(214, 170, 86, .46);
  color: var(--hf-gold-bright);
  background: rgba(99, 64, 21, .22);
  font: 700 9px/1 var(--hf-mono);
  white-space: nowrap;
}

.attribute-points[hidden] {
  display: none;
}

.attribute-reset-button {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 6px;
  border: 1px solid rgba(170, 70, 70, .5);
  border-radius: 3px;
  color: #d9969c;
  background: rgba(45, 18, 22, .6);
  font: 700 9px/1 var(--hf-mono);
  white-space: nowrap;
  cursor: pointer;
  transition: border-color .16s ease, filter .16s ease, transform .16s ease;
}

.attribute-reset-button:hover:not(:disabled),
.attribute-reset-button:focus-visible {
  border-color: rgba(220, 110, 110, .8);
  color: #ffb8bf;
  filter: brightness(1.15);
  transform: translateY(-1px);
}

.attribute-reset-button[data-confirm="pending"] {
  border-color: rgba(255, 120, 120, .9);
  background: rgba(80, 20, 25, .85);
  color: #fff;
}

.attribute-reset-button[hidden] {
  display: none;
}

.character-stats-grid,
.derived-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.character-stat,
.derived-stats > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px;
  min-width: 0;
  padding: 8px 8px 7px;
  border: 1px solid rgba(184, 139, 73, .24);
  background: rgba(12, 15, 14, .34);
}

.character-stat span,
.derived-stats span {
  overflow: hidden;
  color: var(--hf-muted);
  font: 700 8px/1.1 var(--hf-mono);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.character-stat strong,
.derived-stats strong {
  flex: 0 0 auto;
  color: var(--hf-ink);
  font: 700 13px/1 var(--hf-mono);
}

.stat-value-control {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 4px;
  overflow: visible !important;
}

.attribute-upgrade {
  display: none;
  width: 19px;
  height: 19px;
  align-items: center;
  justify-content: center;
  padding: 0 0 1px;
  border: 1px solid rgba(222, 176, 92, .62);
  border-radius: 3px;
  color: #ffe0a0;
  background: linear-gradient(180deg, rgba(126, 83, 30, .86), rgba(57, 36, 15, .92));
  box-shadow: inset 0 0 0 1px rgba(255, 226, 164, .08);
  font: 700 15px/1 var(--hf-mono);
  cursor: pointer;
  transition: border-color .16s ease, filter .16s ease, transform .16s ease;
}

.reference-app[data-attribute-points="available"] .attribute-upgrade {
  display: inline-flex;
}

.attribute-upgrade:hover:not(:disabled),
.attribute-upgrade:focus-visible {
  border-color: rgba(255, 215, 132, .92);
  filter: brightness(1.18) drop-shadow(0 0 4px rgba(225, 172, 76, .34));
  transform: translateY(-1px);
}

.attribute-upgrade:disabled {
  cursor: wait;
  opacity: .45;
}

.character-stat.is-future {
  border-style: dashed;
  opacity: .68;
}

.character-stat.is-future small {
  flex: 0 0 auto;
  color: var(--hf-dim);
  font: 700 7px/1 var(--hf-mono);
  text-transform: uppercase;
}

.derived-stats {
  margin-top: 6px;
}

.derived-stats > div {
  border-color: rgba(210, 168, 97, .34);
  background: rgba(116, 77, 29, .13);
}

.derived-stats strong {
  color: var(--hf-gold-bright);
}

.equipment-heading {
  margin-top: 17px;
}

.rail-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 31px;
  padding: 0 7px 10px;
  border-bottom: 1px solid var(--hf-line-soft);
}

.section-mark {
  color: var(--hf-gold-bright);
  font: 21px/1 var(--hf-serif);
}

.rail-heading h1 {
  min-width: 0;
  flex: 1;
  color: var(--hf-ink);
  font: 700 14px/1 var(--hf-serif);
  letter-spacing: .04em;
  text-transform: uppercase;
}

.rail-count {
  color: var(--hf-gold);
  font: 700 10px/1 var(--hf-mono);
}

.gear-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  padding: 10px 0 8px;
}

.gear-slot,
.hf-slot {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--slot-border, #61533e);
  background:
    linear-gradient(135deg, rgba(255, 230, 171, .04), transparent 25%),
    repeating-linear-gradient(145deg, rgba(239, 207, 153, .024) 0 1px, transparent 1px 12px),
    var(--hf-slot);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .45);
}

.gear-slot::before,
.hf-slot::before {
  position: absolute;
  inset: 4px;
  pointer-events: none;
  content: "";
  border-top: 1px solid rgba(245, 202, 126, .32);
  border-left: 1px solid rgba(245, 202, 126, .32);
  clip-path: polygon(0 0, 22px 0, 13px 2px, 2px 13px, 0 22px);
}

.gear-slot::after,
.hf-slot::after {
  position: absolute;
  right: 4px;
  bottom: 4px;
  width: 19px;
  height: 19px;
  pointer-events: none;
  content: "";
  border-right: 1px solid rgba(245, 202, 126, .34);
  border-bottom: 1px solid rgba(245, 202, 126, .34);
  clip-path: polygon(100% 100%, 78% 100%, 87% 98%, 98% 87%, 100% 78%);
}

.gear-slot {
  display: grid;
  min-height: 72px;
  place-items: center;
  align-content: center;
  gap: 4px;
  padding: 6px 2px 4px;
  cursor: pointer;
  transition: background .18s ease, border-color .18s ease, transform .18s ease;
}

.gear-slot.is-empty {
  cursor: default;
  opacity: .76;
}

.gear-slot .gear-art {
  position: relative;
  display: grid;
  width: 55%;
  height: 55%;
  place-items: center;
}

.gear-slot .gear-art img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  mix-blend-mode: multiply;
  filter: saturate(.78) contrast(1.06) brightness(.82);
}

.gear-slot:hover,
.gear-slot.is-selected {
  border-color: var(--hf-gold-bright);
  background:
    linear-gradient(135deg, rgba(183, 135, 53, .18), transparent 55%),
    var(--hf-slot-hover);
  transform: translateY(-1px);
}

.gear-label {
  color: var(--hf-muted);
  font: 700 8px/1 var(--hf-mono);
  text-transform: uppercase;
  transition: color .18s ease;
}

.gear-state {
  color: var(--hf-dim);
  font: 700 8px/1 var(--hf-mono);
  transition: color .18s ease;
}

.rail-actions {
  display: flex;
  justify-content: space-around;
  gap: 10px;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--hf-line-soft);
}

.round-action {
  display: grid;
  min-width: 82px;
  min-height: 34px;
  place-items: center;
  border: 1px solid var(--hf-gold-soft);
  border-radius: 2px;
  color: var(--hf-muted);
  background: #121514;
  cursor: pointer;
  transition: color .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.round-action span {
  font: 700 8px/1 var(--hf-mono);
  text-transform: uppercase;
}

.round-action:hover,
.round-action.is-active {
  color: var(--hf-gold-bright);
  border-color: var(--hf-gold);
  box-shadow: 0 0 0 3px rgba(184, 136, 52, .12), inset 0 0 10px rgba(209, 153, 57, .12);
}

.inventory-board {
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--hf-line);
  background: var(--hf-panel);
}

.inventory-toolbar {
  flex: 0 0 auto;
  border-bottom: 1px solid var(--hf-line);
  background:
    linear-gradient(180deg, rgba(155, 106, 44, .09), transparent 65%),
    var(--hf-wood-deep);
}

.category-tabs {
  display: flex;
  align-items: stretch;
  min-height: 57px;
  padding: 7px 12px 0;
  border-bottom: 1px solid var(--hf-line-soft);
}

.category-tab,
.category-next {
  position: relative;
  display: grid;
  min-width: 52px;
  flex: 1;
  place-items: center;
  border: 1px solid transparent;
  color: #9a9485;
  background: transparent;
  cursor: pointer;
  transition: color .18s ease, border-color .18s ease, background .18s ease;
}

.category-tab svg,
.category-next svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.55;
}

.category-tab:hover,
.category-tab.is-active,
.category-next:hover {
  border-color: var(--hf-gold-soft);
  color: var(--hf-gold-bright);
  background: rgba(138, 91, 33, .2);
}

.category-tab.is-active::after {
  position: absolute;
  right: 9px;
  bottom: -8px;
  left: 9px;
  height: 2px;
  content: "";
  background: var(--hf-gold-bright);
  box-shadow: 0 0 8px rgba(229, 171, 71, .56);
}

.category-next {
  flex: 0 0 48px;
  margin-left: 7px;
  border-color: var(--hf-line);
}

.inventory-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 15px 12px;
}

.section-kicker {
  color: var(--hf-gold);
  font: 700 9px/1.2 var(--hf-mono);
  letter-spacing: .16em;
  text-transform: uppercase;
}

.inventory-heading h2 {
  margin: 5px 0 0;
  color: var(--hf-ink);
  font: 700 19px/1 var(--hf-serif);
}

.capacity-badge {
  flex: 0 0 auto;
  color: var(--hf-muted);
  font: 700 9px/1 var(--hf-mono);
  white-space: nowrap;
}

.capacity-badge span {
  color: var(--hf-gold-bright);
}

.inventory-grid {
  display: grid;
  --inventory-cell-width: 90px;
  --inventory-cell-height: 205px;
  grid-template-columns: repeat(8, var(--inventory-cell-width));
  grid-auto-rows: var(--inventory-cell-height);
  align-content: start;
  justify-content: start;
  gap: 2px;
  height: min(680px, max(300px, calc(100dvh - 260px)));
  min-height: 300px;
  max-height: 680px;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 14px 10px 12px;
  scrollbar-color: rgba(181, 138, 74, .7) rgba(12, 14, 13, .72);
  scrollbar-width: thin;
}

.inventory-grid::-webkit-scrollbar {
  width: 7px;
}

.inventory-grid::-webkit-scrollbar-track {
  background: rgba(12, 14, 13, .72);
}

.inventory-grid::-webkit-scrollbar-thumb {
  border: 1px solid rgba(42, 31, 18, .8);
  background: rgba(181, 138, 74, .7);
}

.hf-slot {
  display: grid;
  min-width: 0;
  min-height: 0;
  place-items: center;
  cursor: pointer;
  transition: border-color .16s ease, background .16s ease, box-shadow .16s ease, transform .16s ease;
}

.hf-slot:hover,
.hf-slot[aria-selected="true"] {
  border-color: var(--hf-gold-bright);
  background:
    linear-gradient(135deg, rgba(202, 154, 69, .2), transparent 60%),
    var(--hf-slot-hover);
  box-shadow: inset 0 0 18px rgba(210, 150, 54, .1), 0 0 8px rgba(202, 148, 59, .1);
  transform: translateY(-1px);
}

.hf-slot[data-rarity="common"] {
  --slot-border: var(--hf-common);
}

.hf-slot[data-rarity="uncommon"] {
  --slot-border: var(--hf-uncommon);
}

.hf-slot[data-rarity="rare"] {
  --slot-border: #6f8e88;
}

.hf-slot[data-rarity="epic"] {
  --slot-border: var(--hf-epic);
}

.hf-slot[data-rarity="special"] {
  --slot-border: var(--hf-special);
}

.hf-slot[data-rarity="legendary"] {
  --slot-border: #d17b61;
}

.hf-slot.is-empty {
  cursor: default;
  opacity: .72;
}

.hf-slot.is-empty::before,
.hf-slot.is-empty::after {
  opacity: .52;
}

.hf-slot.is-locked {
  cursor: not-allowed;
  background:
    linear-gradient(45deg, transparent 49%, rgba(112, 116, 111, .11) 50%, transparent 51%),
    linear-gradient(-45deg, transparent 49%, rgba(112, 116, 111, .11) 50%, transparent 51%),
    #111514;
}

.hf-slot.is-locked:hover {
  border-color: var(--slot-border);
  background:
    linear-gradient(45deg, transparent 49%, rgba(112, 116, 111, .11) 50%, transparent 51%),
    linear-gradient(-45deg, transparent 49%, rgba(112, 116, 111, .11) 50%, transparent 51%),
    #111514;
  box-shadow: none;
  transform: none;
}

.slot-art {
  display: grid;
  width: 74%;
  height: 74%;
  place-items: center;
}

.slot-art img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  mix-blend-mode: screen;
  filter: saturate(.77) contrast(1.08) brightness(.92);
  image-rendering: auto;
}

.slot-quantity {
  position: absolute;
  right: 5px;
  bottom: 4px;
  min-width: 18px;
  padding: 3px 4px 2px;
  border: 1px solid rgba(211, 170, 100, .7);
  border-radius: 2px;
  color: var(--hf-ink);
  background: rgba(8, 10, 9, .92);
  font: 700 9px/1 var(--hf-mono);
}

.slot-name {
  position: absolute;
  top: 4px;
  right: 5px;
  left: 5px;
  overflow: hidden;
  color: var(--hf-muted);
  font: 700 7px/1 var(--hf-mono);
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
  opacity: 0;
  transition: opacity .16s ease;
}

.hf-slot:hover .slot-name,
.hf-slot[aria-selected="true"] .slot-name {
  opacity: 1;
}

.inventory-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding: 10px 14px 13px;
  border-top: 1px solid var(--hf-line);
  color: var(--hf-dim);
  font: 700 8px/1.2 var(--hf-mono);
  text-transform: uppercase;
}

.inventory-footer b {
  color: var(--hf-gold);
}

.detail-panel {
  display: flex;
  flex-direction: column;
  padding: 13px 13px 16px;
  background:
    linear-gradient(160deg, rgba(147, 96, 36, .11), transparent 37%),
    var(--hf-wood);
}

.detail-stage {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-height: 289px;
  place-items: center;
  padding: 12px;
  border: 1px solid var(--hf-line);
  background:
    linear-gradient(135deg, rgba(169, 129, 76, .13), transparent 35%),
    repeating-linear-gradient(145deg, rgba(255, 226, 176, .035) 0 1px, transparent 1px 17px),
    #111413;
}

.detail-stage::before {
  position: absolute;
  inset: 7px;
  pointer-events: none;
  content: "";
  border: 1px solid rgba(228, 193, 132, .35);
  clip-path: polygon(0 0, 24px 0, 14px 2px, 2px 14px, 0 24px, 0 calc(100% - 24px), 2px calc(100% - 14px), 14px calc(100% - 2px), 24px 100%, calc(100% - 24px) 100%, calc(100% - 14px) calc(100% - 2px), 100% calc(100% - 24px), 100% 24px, calc(100% - 2px) 14px, calc(100% - 14px) 2px, calc(100% - 24px) 0);
}

.detail-art-corner {
  position: absolute;
  top: 13px;
  left: 13px;
  z-index: 1;
  color: var(--hf-gold-bright);
  font: 28px/1 var(--hf-serif);
}

.detail-art {
  display: grid;
  width: min(210px, 70%);
  aspect-ratio: 1;
  place-items: center;
  border: 1px solid rgba(210, 168, 97, .38);
  background:
    radial-gradient(circle at 50% 42%, rgba(202, 159, 83, .24), transparent 59%),
    #131615;
  box-shadow: inset 0 0 23px rgba(0, 0, 0, .4);
}

.detail-art img {
  display: block;
  width: 84%;
  height: 84%;
  object-fit: contain;
  mix-blend-mode: screen;
  filter: saturate(.72) contrast(1.08) brightness(.96);
  image-rendering: auto;
}

.detail-art-pending {
  max-width: 150px;
  color: var(--hf-dim);
  font: 700 9px/1.45 var(--hf-mono);
  text-align: center;
  text-transform: uppercase;
}

.detail-nameplate {
  position: absolute;
  right: 12px;
  bottom: 11px;
  left: 12px;
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 8px;
  align-items: end;
  padding: 9px 10px 0;
  border-top: 1px solid rgba(210, 168, 97, .25);
  background: linear-gradient(180deg, transparent, rgba(14, 15, 14, .84));
}

.rarity-mark {
  color: var(--hf-gold-bright);
  font: 21px/1 var(--hf-serif);
}

.detail-nameplate h2 {
  min-width: 0;
  color: var(--hf-ink);
  font: 700 18px/1 var(--hf-serif);
  white-space: nowrap;
}

.detail-nameplate p {
  grid-column: 2;
  margin-top: 4px;
  color: var(--hf-gold);
  font: 700 8px/1.2 var(--hf-mono);
  letter-spacing: .13em;
  text-transform: uppercase;
}

.detail-stat-list {
  display: grid;
  gap: 8px;
  padding: 16px 11px 12px;
  border-bottom: 1px solid var(--hf-line);
}

.detail-stat {
  display: grid;
  grid-template-columns: 20px 1fr 102px;
  align-items: center;
  gap: 8px;
}

.detail-stat-icon {
  color: var(--hf-gold-bright);
  font: 21px/1 var(--hf-serif);
  text-align: center;
}

.detail-stat-label {
  color: var(--hf-muted);
  font: 700 9px/1 var(--hf-mono);
}

.detail-stat-bar {
  height: 7px;
  overflow: hidden;
  border: 1px solid rgba(111, 102, 87, .72);
  border-radius: 5px;
  background: #0a0d0c;
}

.detail-stat-bar span {
  display: block;
  width: var(--value);
  height: 100%;
  background: var(--bar-color, var(--hf-gold));
}

.detail-rank {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 55px;
  padding: 0 16px;
  border-bottom: 1px solid var(--hf-line);
}

.detail-rank i {
  display: block;
  width: 13px;
  height: 13px;
  border: 1px solid #7e765f;
  border-radius: 50%;
  background: #25241e;
}

.detail-rank i.is-on {
  border-color: #e1b568;
  background: #e2b66a;
  box-shadow: 0 0 4px rgba(234, 184, 92, .3);
}

.rank-symbol {
  margin-right: 3px;
  color: var(--hf-gold);
  font: 21px/1 var(--hf-serif);
}

.detail-description {
  min-height: 76px;
  padding: 16px 16px 11px;
  color: var(--hf-muted);
  font: 400 12px/1.45 var(--hf-serif);
}

.detail-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 4px 4px 11px;
}

.detail-button {
  display: grid;
  min-height: 52px;
  place-items: center;
  align-content: center;
  gap: 5px;
  border: 1px solid var(--hf-line);
  color: var(--hf-muted);
  background:
    linear-gradient(135deg, rgba(194, 151, 77, .08), transparent 65%),
    #171a19;
  cursor: pointer;
  transition: border-color .18s ease, color .18s ease, background .18s ease;
}

.detail-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.55;
}

.detail-button span {
  color: inherit;
  font: 700 8px/1 var(--hf-mono);
  text-transform: uppercase;
}

.detail-button:hover {
  border-color: var(--hf-gold);
  color: var(--hf-gold-bright);
  background: rgba(139, 94, 34, .24);
}

.detail-button.danger {
  border-color: rgba(175, 79, 65, .65);
  color: var(--hf-danger);
  background: rgba(87, 37, 31, .2);
}

.detail-button.danger:hover {
  border-color: var(--hf-danger);
  color: #eaa28d;
}

.detail-button.locked,
.detail-button:disabled {
  cursor: not-allowed;
  opacity: .58;
}

.detail-quantity {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 5px 10px;
  margin-top: auto;
  padding: 11px 12px 0;
  border-top: 1px solid var(--hf-line-soft);
  color: var(--hf-muted);
  font: 700 9px/1.15 var(--hf-mono);
}

.detail-quantity strong {
  color: var(--hf-gold-bright);
  font-size: 16px;
}

.trade-state {
  grid-column: 1 / -1;
  color: var(--hf-green);
  font-size: 8px;
  text-transform: uppercase;
}

.mobile-reference-nav {
  display: none;
}

.reference-toast {
  position: fixed;
  right: 25px;
  bottom: 24px;
  z-index: 20;
  max-width: min(360px, calc(100vw - 34px));
  padding: 11px 14px;
  border: 1px solid var(--hf-gold);
  color: var(--hf-gold-bright);
  background: #1a140e;
  box-shadow: 0 16px 30px rgba(0, 0, 0, .4);
  font: 700 10px/1.35 var(--hf-mono);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity .2s ease, transform .2s ease;
}

.reference-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1180px) {
  .header-frame {
    grid-template-columns: 225px minmax(320px, 1fr) 365px;
  }

  .profile-summary {
    padding-inline: 9px;
  }

  .portrait-medallion {
    width: 106px;
    height: 100px;
  }

  .portrait-medallion img {
    width: 94px;
    height: 94px;
  }

  .reference-main {
    grid-template-columns: 215px minmax(0, 1fr) 330px;
  }

  .gear-slot {
    min-height: 91px;
  }

  .detail-stage {
    min-height: 270px;
  }

  .detail-stat {
    grid-template-columns: 20px 1fr 76px;
  }

  .inventory-grid {
    grid-template-columns: repeat(6, var(--inventory-cell-width));
  }
}

@media (max-width: 1140px) {
  .inventory-grid {
    grid-template-columns: repeat(5, var(--inventory-cell-width));
  }
}

@media (max-width: 1080px) {
  .inventory-grid {
    grid-template-columns: repeat(4, var(--inventory-cell-width));
  }
}

@media (max-width: 900px) {
  .reference-app {
    padding: calc(10px + var(--hf-safe-top)) max(10px, var(--hf-safe-right)) calc(30px + var(--hf-safe-bottom)) max(10px, var(--hf-safe-left));
  }

  .header-frame {
    grid-template-columns: 1fr;
  }

  .profile-summary {
    min-height: 110px;
    padding: 9px 16px;
    border-right: 0;
    border-bottom: 1px solid var(--hf-line);
  }

  .portrait-medallion {
    width: 92px;
    height: 92px;
  }

  .portrait-medallion img {
    width: 84px;
    height: 84px;
  }

  .profile-meters {
    max-width: 320px;
    gap: 9px;
  }

  .reference-tabs {
    min-height: 63px;
    padding: 7px 8px;
    border-right: 0;
    border-bottom: 1px solid var(--hf-line);
  }

  .reference-tab {
    min-width: 54px;
  }

  .reference-tab span {
    font-size: 7px;
  }

  .reference-tab.is-active::after {
    bottom: -8px;
  }

  .resource-strip {
    min-height: 64px;
    padding: 7px 9px;
  }

  .resource-cell {
    grid-template-columns: auto 1fr;
    place-items: center start;
    gap: 5px;
    padding-inline: 10px;
  }

  .resource-icon {
    height: auto;
  }

  .reference-main {
    grid-template-columns: minmax(0, 1fr) minmax(285px, 36%);
    min-height: 0;
  }

  .equipment-rail {
    grid-column: 1 / -1;
    border-right: 0;
    border-bottom: 1px solid var(--hf-line);
  }

  .gear-grid {
    grid-template-columns: repeat(8, minmax(0, 1fr));
    padding-bottom: 0;
  }

  .gear-slot {
    min-height: 87px;
  }

  .rail-actions {
    display: none;
  }

  .inventory-board {
    grid-column: 1;
    border-right: 1px solid var(--hf-line);
  }

  .detail-panel {
    grid-column: 2;
  }

  .inventory-grid {
    grid-template-columns: repeat(5, var(--inventory-cell-width));
  }

  .category-tab {
    min-width: 42px;
  }
}

/* Планшет и горизонтальный телефон: панели идут одной колонкой, а клетки не сжимаются. */
@media (max-width: 760px) {
  .reference-main {
    display: flex;
    flex-direction: column;
    min-height: 0;
  }

  .equipment-rail,
  .inventory-board,
  .detail-panel {
    border-right: 0;
    border-left: 0;
  }

  .equipment-rail {
    border-bottom: 1px solid var(--hf-line);
  }

  .gear-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .inventory-board {
    border-bottom: 1px solid var(--hf-line);
  }

  .inventory-grid {
    grid-template-columns: repeat(3, var(--inventory-cell-width));
    height: min(680px, max(280px, calc(100dvh - 300px)));
    min-height: 280px;
  }
}

@media (max-width: 650px) {
  .reference-app {
    padding: var(--hf-safe-top) 0 calc(68px + var(--hf-safe-bottom));
  }

  .reference-frame {
    border-right: 0;
    border-left: 0;
  }

  .reference-frame::before {
    inset: 5px;
  }

  .reference-main {
    display: flex;
    flex-direction: column;
    margin-top: 7px;
    border-right: 0;
    border-left: 0;
  }

  .profile-summary {
    min-height: 92px;
  }

  .portrait-medallion {
    width: 74px;
    height: 74px;
  }

  .portrait-medallion img {
    width: 68px;
    height: 68px;
  }

  .meter-row {
    grid-template-columns: 18px minmax(35px, 1fr) auto;
    gap: 5px;
  }

  .meter-row strong {
    font-size: 8px;
  }

  .reference-tabs {
    overflow-x: auto;
    justify-content: flex-start;
    scrollbar-width: none;
  }

  .reference-tabs::-webkit-scrollbar {
    display: none;
  }

  .reference-tab {
    min-width: 75px;
    flex: 0 0 75px;
  }

  .resource-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .resource-cell {
    display: flex;
    justify-content: center;
    padding: 6px 4px;
  }

  .resource-cell strong {
    font-size: 9px;
  }

  .resource-cell:nth-child(4) {
    display: none;
  }

  .menu-cell {
    display: grid !important;
  }

  .equipment-rail {
    border-bottom: 1px solid var(--hf-line);
  }

  .rail-heading {
    padding-inline: 12px;
  }

  .gear-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    padding: 10px 12px 12px;
  }

  .gear-slot {
    min-height: 73px;
  }

  .gear-state {
    display: none;
  }

  .inventory-board {
    border-right: 0;
    border-bottom: 1px solid var(--hf-line);
  }

  .category-tabs {
    overflow-x: auto;
    scrollbar-width: none;
  }

  .category-tabs::-webkit-scrollbar {
    display: none;
  }

  .category-tab {
    min-width: 49px;
    flex: 0 0 49px;
  }

  .inventory-heading {
    align-items: start;
    flex-direction: column;
    gap: 6px;
    padding-inline: 14px;
  }

  .inventory-heading h2 {
    font-size: 18px;
  }

  .inventory-grid {
    grid-template-columns: repeat(3, var(--inventory-cell-width));
    grid-auto-rows: var(--inventory-cell-height);
    height: min(680px, max(300px, calc(100dvh - 240px)));
    min-height: 300px;
    padding: 10px 10px 12px;
  }

  .slot-name {
    display: none;
  }

  .detail-panel {
    border-top: 0;
  }

  .detail-stage {
    min-height: 320px;
  }

  .detail-art {
    width: min(230px, 72%);
  }

  .detail-quantity {
    margin-top: 0;
  }

  .mobile-reference-nav {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 15;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    min-height: calc(60px + var(--hf-safe-bottom));
    padding-bottom: var(--hf-safe-bottom);
    border-top: 1px solid var(--hf-line);
    background: rgba(12, 15, 14, .96);
    box-shadow: 0 -10px 25px rgba(0, 0, 0, .35);
    backdrop-filter: blur(10px);
  }

  .mobile-reference-nav button {
    display: grid;
    place-items: center;
    align-content: center;
    gap: 4px;
    border: 0;
    color: var(--hf-muted);
    background: transparent;
  }

  .mobile-reference-nav button.is-active,
  .mobile-reference-nav button:hover {
    color: var(--hf-gold-bright);
    background: rgba(138, 91, 33, .16);
  }

  .mobile-reference-nav svg {
    width: 19px;
    height: 19px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.5;
  }

  .mobile-reference-nav span {
    font: 700 8px/1 var(--hf-mono);
    text-transform: uppercase;
  }

  .reference-toast {
    right: 12px;
    bottom: calc(72px + var(--hf-safe-bottom));
    left: 12px;
    max-width: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
  }
}

/* Декоративные фрагменты из исходного набора работают отдельными слоями, а не скриншотами. */
.reference-borderline {
  display: block;
  width: 100%;
  height: auto;
  object-fit: fill;
  pointer-events: none;
  user-select: none;
  opacity: .94;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .48));
}

.rail-borderline {
  width: min(calc(100% - 10px), 210px);
  height: 30px;
  margin: -3px auto -4px;
}

.inventory-borderline {
  width: min(calc(100% - 30px), 390px);
  height: 26px;
  margin: 2px auto 6px;
  object-fit: contain;
  opacity: .9;
}

.detail-borderline {
  width: min(calc(100% - 18px), 300px);
  height: 45px;
  margin: -7px auto -13px;
  opacity: .82;
}

.gear-slot,
.hf-slot {
  isolation: isolate;
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

.gear-slot::before,
.gear-slot::after,
.hf-slot::before,
.hf-slot::after {
  display: none;
  content: none;
}

.gear-slot {
  min-height: 0;
  aspect-ratio: 1 / 1;
  overflow: visible;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  transition: none;
}

.slot-frame {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: fill;
  pointer-events: none;
  user-select: none;
}

.gear-slot .slot-frame {
  object-fit: contain;
  transform-origin: center;
  transition: filter .24s ease, transform .24s cubic-bezier(.2, .8, .2, 1);
}

.gear-slot > :not(.slot-frame),
.hf-slot > :not(.slot-frame) {
  z-index: 1;
}

.hf-slot > .slot-art {
  position: relative;
}

.hf-slot > .slot-name,
.hf-slot > .slot-quantity,
.hf-slot > .rarity-icon,
.gear-slot > .rarity-icon {
  position: absolute;
}

.gear-slot:hover,
.gear-slot.is-selected,
.hf-slot:hover,
.hf-slot[aria-selected="true"] {
  border-color: transparent;
  background: transparent;
}

.gear-slot:hover,
.gear-slot.is-selected,
.gear-slot[aria-selected="true"] {
  box-shadow: none;
  transform: none;
}

/* Подсветка повторяет прозрачный силуэт PNG и не создаёт прямоугольного фона. */
.gear-slot:hover .slot-frame {
  transform: scale(1.025);
  filter: saturate(1.08) brightness(1.1) contrast(1.03) drop-shadow(0 0 7px rgba(227, 167, 69, .25));
}

.gear-slot.is-selected .slot-frame,
.gear-slot[aria-selected="true"] .slot-frame {
  transform: scale(1.025);
  filter: saturate(1.12) brightness(1.14) contrast(1.04) drop-shadow(0 0 9px rgba(227, 167, 69, .36));
}

.gear-slot.locked:hover .slot-frame {
  transform: none;
  filter: none;
}

.gear-slot .gear-label,
.gear-slot .gear-state {
  max-width: 76%;
  text-align: center;
  text-shadow: 0 1px 3px rgba(15, 10, 7, .95);
}

.gear-slot:hover .gear-label,
.gear-slot:hover .gear-state,
.gear-slot[aria-selected="true"] .gear-label,
.gear-slot[aria-selected="true"] .gear-state {
  color: #f1dfb6;
  text-shadow: 0 1px 4px rgba(15, 10, 7, 1), 0 0 8px rgba(240, 200, 121, .22);
}

.hf-slot:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 14px rgba(227, 167, 69, .18);
}

.hf-slot[aria-selected="true"] {
  box-shadow: 0 0 17px rgba(227, 167, 69, .3);
}

.hf-slot.is-empty {
  opacity: .88;
}

.hf-slot.is-locked,
.hf-slot.is-locked:hover {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  transform: none;
}

.rarity-icon {
  position: absolute;
  top: 7px;
  right: 7px;
  z-index: 2;
  display: block;
  width: 15px;
  height: 28px;
  object-fit: fill;
  pointer-events: none;
  user-select: none;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .72));
}

.detail-rarity-icon {
  position: static;
  width: 22px;
  height: 36px;
  object-fit: fill;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .6));
}

.rarity-mark {
  display: grid;
  width: 25px;
  min-height: 36px;
  place-items: end center;
}

.detail-art-corner {
  display: none;
}

.item-card-slot {
  --item-card-art-top: 12%;
  --item-card-art-right: 11%;
  --item-card-art-bottom: 25%;
  --item-card-art-left: 11%;
  --item-card-label-top: 4%;
  --item-card-label-right: 11%;
  --item-card-label-left: 11%;
  --item-card-count-y: 89%;
  --item-card-count-width: 36%;
  --item-card-count-height: 12%;
  box-sizing: border-box;
  appearance: none;
  overflow: visible;
  padding: 0;
  border: 0;
  background: transparent;
}

.item-card-visual {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: block;
  pointer-events: none;
  transform-origin: center;
  transition: transform .18s ease;
}

.item-card-slot:hover,
.item-card-slot[aria-selected="true"] {
  background: transparent;
  box-shadow: none;
  transform: none;
  z-index: 2;
}

.item-card-slot > .item-card-visual {
  z-index: 0;
}

.item-card-slot .slot-frame {
  transform-origin: center;
  transition: filter .18s ease;
  filter: none;
}

/* Рамка и счётчик увеличиваются одним прозрачным слоем, поэтому число остаётся в ромбе. */
.item-card-slot:hover .item-card-visual,
.item-card-slot[aria-selected="true"] .item-card-visual {
  transform: scale(1.025);
}

.item-card-slot:hover .item-card-frame {
  filter: saturate(1.08) brightness(1.1) contrast(1.03);
}

.item-card-slot[aria-selected="true"] .item-card-frame {
  filter: saturate(1.12) brightness(1.14) contrast(1.04);
}

.item-card-slot.is-locked:hover .item-card-visual {
  transform: none;
}

.item-card-slot.is-locked:hover .item-card-frame {
  filter: none;
}

.item-card-slot .slot-art {
  width: 100%;
  height: 100%;
  margin-top: 0;
}

.item-card-region {
  position: absolute;
  pointer-events: none;
}

.item-card-art-region {
  top: var(--item-card-art-top);
  right: var(--item-card-art-right);
  bottom: var(--item-card-art-bottom);
  left: var(--item-card-art-left);
  z-index: 1;
  display: grid;
  place-items: center;
}

.item-card-slot .slot-art img {
  mix-blend-mode: multiply;
  filter: saturate(.84) contrast(1.08) brightness(.84);
}

.item-card-slot .slot-name {
  position: static;
  top: auto;
  right: auto;
  left: auto;
  display: block;
  overflow: hidden;
  width: 100%;
  color: var(--hf-muted);
  font: 700 7px/1 var(--hf-mono);
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color .18s ease, text-shadow .18s ease;
}

.item-card-label-region {
  top: var(--item-card-label-top);
  right: var(--item-card-label-right);
  left: var(--item-card-label-left);
  z-index: 3;
  display: none;
  place-items: center;
}

.item-card-slot:hover .item-card-label-region,
.item-card-slot[aria-selected="true"] .item-card-label-region {
  display: grid;
}

.item-card-slot:hover .slot-name,
.item-card-slot[aria-selected="true"] .slot-name {
  color: #f1dfb6;
  text-shadow: 0 1px 4px rgba(15, 10, 7, 1), 0 0 8px rgba(240, 200, 121, .22);
}

.item-card-slot .slot-quantity {
  position: static;
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  color: #f1dfb6;
  background: transparent;
  font-size: 9px;
  line-height: 1;
  text-align: center;
  text-shadow: 0 1px 2px rgba(15, 10, 7, .95);
}

.item-card-count-region {
  top: var(--item-card-count-y);
  left: 50%;
  z-index: 2;
  display: grid;
  width: var(--item-card-count-width);
  height: var(--item-card-count-height);
  place-items: center;
  transform: translate(-50%, -50%);
}

.gear-slot.locked .gear-label,
.gear-slot.locked .gear-state {
  position: absolute;
  z-index: 3;
  left: 4px;
  right: 4px;
  width: calc(100% - 8px);
  max-width: none;
  text-align: center;
}

.gear-slot.locked .gear-label {
  bottom: 15px;
}

.gear-slot.locked .gear-state {
  bottom: 7px;
}

.item-card-slot.is-locked-card {
  cursor: not-allowed;
  background: transparent;
  opacity: 1;
}

.item-card-slot.is-locked-card:hover {
  background: transparent;
  box-shadow: none;
  transform: none;
}

.item-card-slot.is-empty-rarity {
  cursor: default;
  opacity: 1;
  box-shadow: none;
  transform: none;
}

.item-card-slot.is-empty-rarity:hover {
  background: transparent;
  box-shadow: none;
  transform: none;
}

@media (max-width: 650px) {
  .rail-borderline {
    width: min(calc(100% - 22px), 210px);
    height: 27px;
  }

  .inventory-borderline {
    width: min(calc(100% - 24px), 360px);
    height: 24px;
    margin: 2px auto 6px;
    object-fit: contain;
  }

  .detail-borderline {
    width: min(calc(100% - 24px), 300px);
    height: 43px;
  }

  .rarity-icon {
    top: 6px;
    right: 6px;
    width: 13px;
    height: 24px;
  }

}
