.equipment-board {
  display: grid;
  grid-template-columns: 1.2fr repeat(5, minmax(0, 1fr)) 1.2fr;
  grid-template-rows: repeat(6, minmax(0, 1fr)) clamp(20px, 4dvh, 43px);
  position: relative;
  min-width: 0;
  min-height: 0;
  gap: 2px;
  padding: 3px;
  background: #8b8d84;
  border: 1px solid #757b78;
  box-shadow: inset 0 0 0 1px #e0ded4;
}
.equipment-effigy {
  grid-area: 1 / 2 / 7 / 7;
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: clip;
  background: radial-gradient(ellipse at 50% 55%, #393b40, #231f28 78%);
  border: 1px solid #31363b;
}
.equipment-effigy img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.gear-slot {
  display: grid;
  min-width: 0;
  min-height: 0;
  place-items: center;
  overflow: clip;
  padding: 0;
  border: 1px solid #a0a39b;
  box-shadow: inset 1px 1px #f0eee6, inset -1px -1px #a4a59b;
  background: #d8d9d0;
}
.gear-slot.equipped {
  background: #c1c6bb;
  border-color: #566b62;
  box-shadow: inset 1px 1px #e3e5d7;
}
button.gear-slot { cursor: pointer; }
button.gear-slot:hover { border-color: #3b596f; background: #edf1e8; }
.gear-art {
  display: block;
  width: 100%;
  height: 100%;
  background-repeat: no-repeat;
  background-position: var(--item-x) var(--item-y);
  mix-blend-mode: multiply;
}
.gear-art--item { background-image: url("/assets/equipment-atlas.jpg"); background-size: 700% 400%; }
.gear-art--slot { background-image: url("/assets/slot-atlas.jpg"); background-size: 600% 500%; }
.gear-slot:not(.equipped) .gear-art { filter: grayscale(1); opacity: .42; }
.gear-slot-placeholder { display: block; width: 100%; height: 100%; min-height: 0; object-fit: contain; }
.gear-slot--helmet, .gear-slot--gloves, .gear-slot--weapon,
.gear-slot--coat, .gear-slot--belt, .gear-slot--cloak { grid-column: 1; }
.gear-slot--amulet, .gear-slot--bracers, .gear-slot--offhand,
.gear-slot--shirt, .gear-slot--legs, .gear-slot--boots { grid-column: 7; }
.gear-slot--helmet, .gear-slot--amulet { grid-row: 1; }
.gear-slot--gloves, .gear-slot--bracers { grid-row: 2; }
.gear-slot--weapon, .gear-slot--offhand { grid-row: 3; }
.gear-slot--coat, .gear-slot--shirt { grid-row: 4; }
.gear-slot--belt, .gear-slot--legs { grid-row: 5; }
.gear-slot--cloak, .gear-slot--boots { grid-row: 6; }
.gear-slot--ear-1, .gear-slot--ear-2, .gear-slot--ring-1, .gear-slot--ring-2,
.gear-slot--pocket-1, .gear-slot--pocket-2, .gear-slot--pocket-3 { grid-row: 7; }
.item-heading { display: flex; gap: 8px; align-items: center; }
.item-heading .gear-art { flex: 0 0 57px; height: 57px; border: 1px solid #969e93; }
.item-heading .potion-icon {
  flex: 0 0 57px;
  width: 57px;
  height: 57px;
  padding: 3px;
  border: 1px solid #969e93;
  background: #dcddd4;
  object-fit: contain;
}
.world-layout .item-heading :is(h2,h3,p) { margin: 0; }
.world-layout .item-card h3 { font-size: 1rem; }
.world-layout .catalog-panel { display: flex; flex-direction: column; overflow: hidden; }
.catalog-panel > :not(.shop-scroll):not(.inventory-pane) { flex-shrink: 0; }
.shop-scroll, .inventory-pane {
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}
.shop-scroll { border: 1px solid #87948b; background: #e6e8de; }
.inventory-pane { padding: 3px; }
.shop-filters { display: flex; align-items: end; flex-wrap: wrap; gap: 5px 9px; }
.shop-filters label { display: grid; gap: 2px; color: #40524e; font-size: .75rem; }
.shop-filters :is(select,input) { display: block; width: 100%; min-width: 0; }
.shop-search { flex: 1 1 135px; }
.shop-count { align-self: end; padding: 0 3px 6px; font-size: .75rem; }
.shop-section h2 { margin: 0; padding: 5px 8px; background: #c6cdc2; color: #293e47; font-size: .92rem; }
.shop-section h2 small { opacity: .78; margin-inline-start: 4px; }
.shop-rows { display: grid; }
.world-layout .shop-row {
  display: grid; grid-template-columns: minmax(175px,1fr) minmax(220px,2fr) auto;
  align-items: center; gap: 3px 10px; padding: 6px 8px; border: 0; border-top: 1px solid #a9b2a8;
  content-visibility: auto; contain-intrinsic-block-size: auto 78px;
}
.world-layout .shop-row:nth-child(even) { background: #e4e7de; }
.shop-row .item-heading { min-width: 0; }
.shop-row .item-attributes { min-width: 0; }
.shop-row .actions { display: flex; flex-wrap: wrap; justify-content: flex-end; }
.stock-requirements { display: flex; flex-wrap: wrap; gap: 2px 7px; }
.stock-requirements .missing { color: #7f353b; }
.stock-icon { display: block; object-fit: contain; }
.item-heading .stock-icon { flex: 0 0 57px; width: 57px; height: 57px; border: 1px solid #969e93; background: #d9dcd3; }
.gear-slot .stock-icon { width: 100%; height: 100%; min-width: 0; min-height: 0; }
.stock-icon-empty { display: grid; place-items: center; color: #658078; }
.stock-description { white-space: pre-line; line-height: 1.45; }
@media (max-width: 760px) {
  .world-layout .shop-row { grid-template-columns: minmax(0,1fr) auto; }
  .world-layout .shop-row .item-attributes { grid-column: 1 / -1; grid-row: 2; }
  .shop-filters select { max-width: 180px; }
  .shop-filters .shop-search { order: 1; }
  .shop-count { display: none; }
}

.world-layout { --dock-size: clamp(167px, 29dvh, 290px); }
.world-layout .room-fighter { grid-template-rows: auto minmax(0, 1fr) auto; }
.world-layout .world-map-layout { grid-template-columns: minmax(320px, .65fr) minmax(0, 1.25fr); }
.world-layout .overview-grid { grid-template-columns: minmax(0, 1.35fr) minmax(112px, .75fr); }
.world-layout .world-overview { grid-template-rows: auto minmax(0, 1fr); gap: 4px; }
.world-layout .world-scene { grid-template-columns: minmax(200px, .75fr) minmax(0, 1.5fr) minmax(200px, .75fr); }
.world-layout .battle-grid {
  grid-template-columns: minmax(205px, .95fr) minmax(0, 1.6fr) minmax(205px, .95fr);
  gap: 7px;
}
.stage--battle, .stage--replay { grid-template-rows: auto minmax(0, 1fr); }
.world-layout .fighter-card, .world-layout .fighter-card.enemy {
  grid-template: auto minmax(0, 1fr) / minmax(0, 1fr);
  padding: 3px;
}
.world-layout .fighter-card.enemy .fighter-info { order: 0; }
.world-layout .fighter-info { padding: 0 3px 3px; }
.world-layout .fighter-info h2 { font-size: clamp(.95rem, 1.7vw, 1.5rem); overflow-wrap: anywhere; }
.fighter-title { display: flex; align-items: baseline; gap: 1px 5px; justify-content: space-between; flex-wrap: wrap; }
.fighter-flags { color: #4c5450; font-size: .69rem; white-space: nowrap; }
.fighter-vitals { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 5px; }
.world-layout .fighter-vitals .progress-copy { justify-content: flex-start; gap: 3px; font-size: .72rem; }
.world-layout .fighter-info .meter { margin-block: 2px; }
.world-layout .fighter-info .meter.focus { height: 7px; }
.world-layout .battle-console {
  background: linear-gradient(#e0e2da, #efeee5);
  border-color: #858f88;
  padding: 5px 7px;
  gap: 4px;
}
.world-layout .battle-head h1 { font-size: clamp(1.35rem, 2.2vw, 1.8rem); }
.battle-title { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 8px; }
.world-layout .battle-damage { font-size: .73rem; white-space: nowrap; }
.world-layout .battle-head .overline, .world-layout .turn-bar .overline { display: none; }
.world-layout .battle-console .turn-bar h2 { margin: 0; font-size: 1rem; }
.world-layout .battle-console .zones { gap: 6px; }
.world-layout .zones fieldset { gap: 2px; }
.world-layout .zones legend { margin-bottom: 1px; }
.world-layout .battle-console .zone-button { min-height: clamp(23px, 3.8dvh, 35px); }
.world-layout .battle-console .zone-button.block { overflow-wrap: anywhere; }
.world-layout .battle-console .zone-button:disabled { opacity: .52; }
.world-layout .battle-console .turn-submit { margin: 1px 0; }
.world-layout .battle-skills {
  width: min(100%,35rem);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2px;
  margin-top: 0;
}
.world-layout .battle-skills .button {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 4px;
  width: 100%;
  min-width: 0;
  min-height: 33px;
  padding: 2px 4px;
  text-align: left;
  line-height: 1.1;
}
.world-layout .battle-skills .button[aria-pressed="true"] { color: #fffdf0; box-shadow: none; }
.world-layout .battle-skills .button[aria-disabled="true"] { opacity: .55; }
.skill-label { display: grid; gap: 1px; min-width: 0; font-size: .69rem; overflow-wrap: anywhere; }
.skill-mark { font-size: .9rem; line-height: 1; color: #684c3b; }
.world-layout .battle-skills .button small { color: inherit; opacity: .89; font-size: .62rem; }
.world-layout .skill-caption {
  width: min(100%,35rem);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 1px 5px;
  margin: 0;
  font-size: .71rem;
  text-align: start;
}
.skill-cancel { background: none; border: 0; padding: 0; color: #254963; font: inherit; text-decoration: underline; cursor: pointer; }

.world-layout .room-dock { grid-template-columns: minmax(0,1fr) clamp(190px, 23%, 340px); background: #f4f2ee; }
.world-layout .dock-tabs { border-top: 1px solid #b6b9ae; }
.world-layout .dock-tabs button { font-size: .84rem; }
.world-layout .dock-messages { padding: 5px 9px; gap: 2px; }
.world-layout .dock-messages li { font-size: .89rem; line-height: 1.2; }
.dock-messages time { color: #386148; font-variant-numeric: tabular-nums; }
.world-layout .dock-presence h2 { color: #5c3337; }
.world-layout .dock-presence li, .dock-mobile-presence li {
  flex-wrap: nowrap;
  justify-content: flex-start;
  gap: 1px 3px;
  min-height: 19px;
  padding: 1px 0;
  font-size: .9rem;
}
.world-layout :is(.dock-presence,.dock-mobile-presence) li::before {
  content: "";
  flex: 0 0 6px;
  height: 6px;
  align-self: center;
  margin-inline-end: 3px;
  border: 1px solid #458362;
  background: #7ca18a;
  transform: rotate(45deg);
}
.world-layout :is(.dock-presence,.dock-mobile-presence) .button {
  padding: 0 1px;
  font-size: .89rem;
  text-decoration: none;
  overflow-wrap: anywhere;
}
.world-layout :is(.dock-presence,.dock-mobile-presence) .button:hover { text-decoration: underline; }
.world-layout .dock-input-row .button { min-height: 30px; }
.round-excerpt { padding-inline-start: 0; margin: 3px 0; list-style: none; color: #364744; }
.round-excerpt li { padding-block: 1px; }
.round-excerpt li strong { color: #284c6b; }

@media (max-width: 820px) {
  .world-layout .battle-grid { gap: 4px; }
  .world-layout .skill-mark { display: none; }
}
@media (max-width: 760px), (max-height: 575px) {
  .world-layout { --dock-size: 35px; }
  .world-layout .room-dock { grid-template-columns: minmax(0,1fr); }
}
@media (max-width: 760px) {
  .world-layout .world-map-layout { grid-template-columns: minmax(0,1fr); }
  .world-layout .world-scene { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .world-layout .battle-grid {
    grid-template: clamp(117px, 24dvh, 175px) minmax(0, 1fr) / repeat(2,minmax(0,1fr));
  }
  .world-layout .battle-console { grid-area: 2 / 1 / 3 / -1; padding: 4px; }
  .world-layout .fighter-card.enemy { grid-area: 1 / 2; }
  .world-layout .fighter-info { padding: 0 1px 2px; }
  .world-layout .fighter-info h2 { font-size: .92rem; }
  .fighter-flags { font-size: .62rem; }
  .world-layout .fighter-vitals .progress-copy { font-size: .67rem; }
  .world-layout .fighter-info .meter { margin: 1px 0; height: 5px; }
  .world-layout .fighter-info .meter.focus { height: 5px; }
  .world-layout .fighter-card .equipment-board {
    grid-template: repeat(2, minmax(0,1fr)) / minmax(19px, .24fr) minmax(0, 1fr) minmax(19px, .24fr);
    padding: 1px;
  }
  .fighter-card .equipment-effigy { grid-area: 1 / 2 / 3 / 3; }
  .fighter-card .gear-slot:not(:is(.gear-slot--weapon,.gear-slot--coat,.gear-slot--offhand,.gear-slot--boots)) { display: none; }
  .fighter-card .gear-slot--weapon { grid-area: 1 / 1; }
  .fighter-card .gear-slot--coat { grid-area: 2 / 1; }
  .fighter-card .gear-slot--offhand { grid-area: 1 / 3; }
  .fighter-card .gear-slot--boots { grid-area: 2 / 3; }
  .world-layout .battle-console .zone-button { min-height: 23px; font-size: .74rem; }
  .world-layout .battle-console [data-act="block-group"] {
    font-size: clamp(.60rem, 3.03vw, .75rem);
    white-space: nowrap;
  }
  .world-layout .battle-console [data-act="block-group"] .check { display: none; }
  .world-layout .battle-skills .button { min-height: 31px; padding-inline: 2px; }
  .skill-label { font-size: .64rem; }
  .world-layout .dock-tabs button { font-size: .78rem; }
}
@media (max-height: 510px) and (max-width: 760px) and (min-width: 500px) {
  .world-layout .battle-grid { grid-template: minmax(0,1fr) / minmax(96px,.55fr) minmax(0,1.6fr) minmax(96px,.55fr); }
  .world-layout .battle-console { grid-area: 1 / 2; }
  .world-layout .fighter-card.enemy { grid-area: 1 / 3; }
}
@media (max-height: 660px) {
  .world-layout .battle-head .button { min-height: 28px; }
  .world-layout .battle-console .zone-button { min-height: 23px; }
  .world-layout .battle-console .turn-submit { min-height: 28px; }
}
