/* The site's store and wardrobe (H1468) in the game's menu colours, sampled from our renderer's menu
   (heroes\captures\m4\main_menu_preview_emote.png): the red top bar #903631 over the black sub-bar #141414, the
   olive panel head #495122 on the khaki body #a49987 with a #1a1a16 ink frame, the light-grey bottom bar #d9dcde,
   and the stage in the menu scene's dusk (#584d5a sky, #daba97 haze, #ad8c4c ground). */
:root {
  --m-red: #903631; --m-red-2: #6e2622; --m-black: #141414; --m-frame: #262626; --m-ink: #1a1a16;
  --m-olive: #495122; --m-olive-2: #5d6830; --m-khaki: #a49987; --m-khaki-2: #b8ae9b; --m-khaki-3: #8d8371;
  --m-tile: #c9c0ad; --m-strip: #ede6d6; --m-grey: #d9dcde; --m-yellow: #f2b400; --m-green: #7c9a2c;
  --m-text: #2a2418; --bar-h: 56px; --tabs-h: 40px; --foot-h: 44px;
}
html, body { margin: 0; height: 100%; }
body { background: var(--m-frame); color: var(--m-text); font: 14px/1.4 var(--bfh-font-body); overflow: hidden;
  display: grid; grid-template-rows: var(--bar-h) var(--tabs-h) 1fr var(--foot-h); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.grow { flex: 1; }
button { font: inherit; }

/* The red bar and the dark tab bar of the game's menu. */
#bar { display: flex; align-items: center; gap: 18px; padding: 0 16px; background: linear-gradient(180deg, #a03d37, var(--m-red) 60%, var(--m-red-2));
  border-bottom: 2px solid #000; color: #fff; text-shadow: var(--bfh-outline-thin); }
#brand img { display: block; height: 44px; width: auto; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.5)); }
#nav { display: flex; gap: 18px; font: 600 18px/1 var(--bfh-font-ui); text-transform: lowercase; }
#nav a { color: #fff; text-decoration: none; }
#nav a:hover, #nav .on { color: var(--bfh-hover); }
#hero-box select { font: 600 15px var(--bfh-font-ui); background: var(--m-black); color: #fff; border: 2px solid #000; border-radius: 6px; padding: 5px 8px; }
#tabs { display: flex; align-items: center; gap: 4px; padding: 0 16px; background: var(--m-black); border-bottom: 2px solid #000; }
#tabs button { font: 600 15px/1 var(--bfh-font-ui); text-transform: lowercase; color: #e8e2d2; background: none; border: 0; border-radius: 6px; padding: 8px 12px; cursor: pointer; }
#tabs button:hover { color: #fff; background: #2a2a2a; }
#tabs button.on { background: #3a3a3a; color: #fff; box-shadow: inset 0 0 0 1px #555; }

/* The room: slot column | stage | slot column | store panel. */
#room { display: grid; grid-template-columns: 150px minmax(320px, 1fr) 150px minmax(360px, 34vw); gap: 10px; padding: 10px; min-height: 0; }
.slots { display: flex; flex-direction: column; gap: 6px; min-height: 0; overflow: auto; scrollbar-width: none; }
.slot { display: grid; grid-template-columns: 46px 1fr; align-items: center; gap: 6px; padding: 4px; text-align: left; cursor: pointer;
  background: linear-gradient(180deg, var(--m-khaki-2), var(--m-khaki)); border: 2px solid var(--m-ink); border-radius: 7px; color: var(--m-text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35); transition: transform 0.1s, box-shadow 0.1s; flex: 1 1 0; min-height: 52px; max-height: 76px; }
.slot:hover, .slot:focus-visible { transform: translateX(2px); box-shadow: 0 0 0 3px var(--m-yellow); outline: none; }
.slot.on { background: linear-gradient(180deg, #e4c96a, var(--m-yellow)); }
.slot .ic { width: 46px; height: 46px; border-radius: 5px; background: var(--m-strip) center / contain no-repeat; border: 1px solid rgba(0, 0, 0, 0.35); }
.slot .ic.none { background: repeating-linear-gradient(135deg, #cfc6b3 0 6px, #c4baa5 6px 12px); }
.slot .tx { min-width: 0; }
.slot .k { display: block; font: 600 11px/1 var(--bfh-font-ui); text-transform: lowercase; color: #4c4436; }
.slot .v { display: block; font: 600 13px/1.15 var(--bfh-font-ui); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
#slots-r .slot { grid-template-columns: 1fr 46px; text-align: right; }
#slots-r .slot .ic { order: 2; }
#slots-r .slot:hover { transform: translateX(-2px); }

/* The stage: the menu scene's dusk, the hero filling its height. */
#stage { position: relative; min-height: 0; border: 2px solid #000; border-radius: 10px; overflow: hidden;
  background: radial-gradient(ellipse 60% 14% at 50% 88%, rgba(60, 40, 15, 0.45), rgba(60, 40, 15, 0) 70%),
    linear-gradient(180deg, #584d5a 0%, #8a6a66 24%, #c99a76 46%, #daba97 60%, #b8935a 66%, #ad8c4c 82%, #8a6c39 100%); }
#stage::after { content: ''; position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 0 90px rgba(20, 10, 0, 0.45); }
#hero3d, #sprite { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: grab; outline: none; }
#hero3d:active { cursor: grabbing; }
#hero3d { opacity: 0; transition: opacity 0.6s; }
#stage.three #hero3d { opacity: 1; }
#stage.three #sprite { opacity: 0; transition: opacity 0.6s; pointer-events: none; }
#sprite { object-fit: contain; padding: 6% 0 4%; box-sizing: border-box; filter: drop-shadow(0 10px 10px rgba(30, 15, 0, 0.4)); }
#stage-top { position: absolute; left: 0; right: 0; top: 10px; text-align: center; color: #fff; text-shadow: var(--bfh-outline-thin); pointer-events: none; z-index: 1; }
#hero-name { display: block; font: 400 26px/1 var(--bfh-font-display); letter-spacing: 1px; text-shadow: var(--bfh-outline); }
#hero-kind { font: 600 14px/1.4 var(--bfh-font-ui); }
#view-note { position: absolute; left: 0; right: 0; bottom: 64px; text-align: center; font: 600 13px/1.3 var(--bfh-font-ui); color: #fff; text-shadow: var(--bfh-outline-thin); pointer-events: none; z-index: 1; }
#emotes { position: absolute; left: 0; right: 0; bottom: 12px; display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; z-index: 1; }
#emotes button { font: 600 14px/1 var(--bfh-font-ui); text-transform: lowercase; padding: 8px 12px; border: 2px solid var(--m-ink); border-radius: 999px; cursor: pointer;
  background: linear-gradient(180deg, #fff6d8, #e9d8a6); color: var(--m-text); box-shadow: 0 2px 0 var(--m-ink); }
#emotes button:hover, #emotes button:focus-visible { background: linear-gradient(180deg, #ffe680, var(--m-yellow)); outline: none; }
#emotes button.on { background: linear-gradient(180deg, #c6e07a, var(--m-green)); color: #fff; text-shadow: var(--bfh-outline-thin); }
#emotes button:active { transform: translateY(2px); box-shadow: none; }
#stage:not(.three) #emotes .clip { display: none; }
#stage.loading3d #view-note::before { content: ''; display: inline-block; width: 14px; height: 14px; margin-right: 8px; vertical-align: -2px;
  border: 3px solid rgba(255, 255, 255, 0.35); border-top-color: #fff; border-radius: 50%; animation: spin3d 0.8s linear infinite; }
#stage.no3d #view-note { background: rgba(20, 12, 4, 0.7); padding: 6px 10px; border-radius: 8px; margin: 0 14px; }
@keyframes spin3d { to { transform: rotate(360deg); } }

/* The store panel: olive head, khaki body, the grid scrolls, the buy bar stays put under it. */
#shop { display: flex; flex-direction: column; min-height: 0; border: 2px solid #000; border-radius: 10px; overflow: hidden; background: var(--m-khaki); }
#shop-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 12px; background: linear-gradient(180deg, var(--m-olive-2), var(--m-olive)); border-bottom: 2px solid #000; }
#shop-title { font: 600 20px/1 var(--bfh-font-ui); color: #fff; text-shadow: var(--bfh-outline-thin); text-transform: lowercase; }
#filters { display: flex; flex-wrap: wrap; gap: 4px; }
#filters button { font: 600 12px/1 var(--bfh-font-ui); text-transform: lowercase; padding: 5px 8px; border: 1px solid #000; border-radius: 999px; background: rgba(0, 0, 0, 0.25); color: #f2eddc; cursor: pointer; }
#filters button.on { background: var(--m-yellow); color: var(--m-text); }
#grid { flex: 1; min-height: 0; overflow: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); grid-auto-rows: min-content; gap: 6px; padding: 8px; align-content: start; }
#grid .empty { grid-column: 1 / -1; padding: 24px 0; text-align: center; color: #4c4436; }
.tile { position: relative; display: flex; flex-direction: column; align-items: stretch; padding: 0; border: 2px solid var(--m-ink); border-radius: 6px; overflow: hidden; cursor: pointer;
  background: linear-gradient(180deg, #d8d0bf, var(--m-tile)); color: var(--m-text); text-align: center; transition: transform 0.08s; }
.tile:hover { transform: translateY(-2px); }
.tile:focus-visible { outline: 3px solid var(--m-yellow); outline-offset: 0; }
.tile.sel { box-shadow: 0 0 0 3px var(--m-yellow); }
.tile img { width: 56px; height: 56px; object-fit: contain; margin: 5px auto 2px; }
.tile .nm { font: 600 11px/1.1 var(--bfh-font-ui); padding: 3px 3px 0; min-height: 2.2em; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; background: var(--m-strip); }
.tile .pr { font: 600 11px/1 var(--bfh-font-ui); padding: 2px 3px 4px; background: var(--m-strip); color: #6e2622; }
.tile .badge { position: absolute; top: 3px; left: 3px; font: 600 9px/1 var(--bfh-font-ui); padding: 2px 4px; border-radius: 4px; background: var(--m-yellow); color: var(--m-text); text-transform: uppercase; }
.tile .badge.owned { background: #b8d86a; }
.tile .badge.worn { background: #fff; }
.tile .td { position: absolute; top: 3px; right: 3px; font: 600 9px/1 var(--bfh-font-ui); color: #fff; background: #2f6fb3; border-radius: 3px; padding: 2px 3px; }
.tile.locked { opacity: 0.55; }
#detail { flex: none; display: grid; grid-template-columns: 64px 1fr auto; gap: 10px; align-items: center; padding: 8px 10px; background: linear-gradient(180deg, #ece5d3, #d9cfb9);
  border-top: 2px solid #000; box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.25); }
#detail .pic img { width: 64px; height: 64px; object-fit: contain; display: block; }
#d-name { font: 600 16px/1.15 var(--bfh-font-ui); }
#d-facts { font-size: 12px; color: #5b5142; }
#d-opts { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; }
#d-opts button { font: 600 12px/1 var(--bfh-font-ui); padding: 5px 7px; border: 1px solid #000; border-radius: 5px; background: var(--m-strip); cursor: pointer; }
#d-opts button.on { background: var(--m-yellow); }
#detail .acts { display: flex; flex-direction: column; gap: 5px; min-width: 112px; }
#detail .acts .bfh-btn { width: 100%; }
#detail .acts .pay { font: 600 11px/1.2 var(--bfh-font-ui); text-align: center; color: #5b5142; }
#msg { flex: none; min-height: 0; padding: 0 10px; font: 600 13px/1.4 var(--bfh-font-ui); background: #d9cfb9; }
#msg:not(:empty) { padding: 4px 10px 6px; }
#msg.ok { color: #3c6a12; } #msg.error { color: #8b322e; }

/* The bottom bar: level, name, the wallets with the game's currency icons. */
#foot { display: flex; align-items: center; gap: 10px; padding: 0 16px; background: linear-gradient(180deg, #eef0f1, var(--m-grey)); border-top: 2px solid #000; }
#lvl { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 6px; background: #8d7b5e; color: #fff; font: 600 15px var(--bfh-font-ui); border: 2px solid #000; text-shadow: var(--bfh-outline-thin); }
#foot-name { font: 600 15px var(--bfh-font-ui); padding: 4px 26px; border-radius: 6px; border: 2px solid #000; color: #fff; text-shadow: var(--bfh-outline-thin); background: linear-gradient(180deg, #a9cf4a, #6f9a1f); }
#wallet { display: flex; gap: 14px; }
#wallet .cur { display: inline-flex; align-items: center; gap: 4px; font: 600 16px var(--bfh-font-ui); color: var(--m-text); }
#wallet .cur img { width: 26px; height: 26px; }

@media (max-width: 1180px) { #room { grid-template-columns: 120px minmax(280px, 1fr) 120px minmax(320px, 38vw); } .slot { grid-template-columns: 38px 1fr; } .slot .ic { width: 38px; height: 38px; } #slots-r .slot { grid-template-columns: 1fr 38px; } }
/* A phone: the stage, the slot columns as strips under it, the store; the page scrolls, the buy bar sticks. */
@media (max-width: 900px) {
  body { overflow: auto; display: block; height: auto; }
  #bar { position: sticky; top: 0; z-index: 5; gap: 10px; }
  #nav { gap: 10px; font-size: 15px; }
  #nav span.on, #nav a:last-child { display: none; }
  #tabs { overflow-x: auto; position: sticky; top: var(--bar-h); z-index: 5; height: var(--tabs-h); }
  #room { display: flex; flex-direction: column; padding: 8px; }
  #stage { height: 64vh; order: 1; }
  #slots-l, #slots-r { order: 2; flex-direction: row; overflow-x: auto; }
  .slot, #slots-r .slot { flex: 0 0 150px; min-height: 52px; grid-template-columns: 38px 1fr; text-align: left; }
  #slots-r .slot .ic { order: 0; }
  #shop { order: 3; overflow: visible; }
  #grid { max-height: none; overflow: visible; }
  #detail { position: sticky; bottom: var(--foot-h); z-index: 4; grid-template-columns: 52px 1fr auto; }
  #detail .pic img { width: 52px; height: 52px; }
  #foot { position: sticky; bottom: 0; z-index: 3; }
  #foot-name { display: none; }
}
@media (prefers-reduced-motion: reduce) { .tile, .slot { transition: none; } }

/* ---- The theme from the game menu's own art (H1468, owner 10-27 "more images and thematics"; ui/img/menu/*,
   tools/bfheroes/site_assets.py --only menu from Menu_client.zip): the menu's village at sunset behind the hero
   with a spotlight and the faction's flag as a watermark, the faction general's parchment banner over the store,
   the menu's slot frames as cards, the picture and the price as the only things on a tile. ---- */
:root { --tabs-h: 66px; }
#tabs { gap: 6px; padding: 6px 16px; }
#tabs button { display: flex; align-items: center; gap: 8px; height: 52px; padding: 4px 14px 4px 6px; border: 2px solid #000; border-radius: 10px;
  background: linear-gradient(180deg, #3a3a34, #22221e); color: #efe8d6; font-size: 15px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12); transition: transform 0.12s, background 0.12s; }
#tabs button img { width: 44px; height: 44px; object-fit: contain; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.6)); transition: transform 0.15s; }
#tabs button:hover { transform: translateY(-2px); background: linear-gradient(180deg, #4a4a42, #2a2a24); }
#tabs button:hover img { transform: scale(1.12) rotate(-4deg); }
#tabs button.on { background: linear-gradient(180deg, #6c7a32, var(--m-olive)); color: #fff; box-shadow: 0 0 0 2px var(--m-yellow), inset 0 1px 0 rgba(255, 255, 255, 0.25); }

/* The stage: the game menu's village (bg_menu) as the room, a spotlight on the hero, the faction flag watermark. */
#stage { background: #8a6a3e url(/play/heroes/ui/img/menu/stage_bg.webp) center bottom / cover no-repeat; border: 3px solid #000;
  box-shadow: inset 0 0 0 3px #6b5232, 0 6px 18px rgba(0, 0, 0, 0.5); }
#stage::before { content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 0;
  background: radial-gradient(ellipse 34% 52% at 50% 52%, rgba(255, 236, 190, 0.32), rgba(255, 236, 190, 0) 70%),
    radial-gradient(ellipse 30% 7% at 50% 90%, rgba(30, 18, 6, 0.55), rgba(30, 18, 6, 0) 75%); }
#stage::after { box-shadow: inset 0 0 120px rgba(18, 8, 0, 0.75); }
#stage .crest { position: absolute; right: 4%; top: 8%; width: 22%; aspect-ratio: 1; background: center / contain no-repeat; opacity: 0.12;
  filter: grayscale(0.3) blur(0.6px); pointer-events: none; z-index: 0; transform: rotate(-8deg); }
#stage .rotate { position: absolute; left: 50%; bottom: 66px; width: 180px; height: 77px; margin-left: -90px; background: url(/play/heroes/ui/img/menu/rotate.webp) center / contain no-repeat;
  opacity: 0; pointer-events: none; z-index: 1; transition: opacity 0.6s; }
#stage.three:not(.turned) .rotate { opacity: 0.85; animation: nudge 2.4s ease-in-out infinite; }
@keyframes nudge { 50% { transform: translateX(10px); } }
#hero3d, #sprite { z-index: 1; }
#stage-top, #view-note, #emotes { z-index: 2; }

/* The store panel: the faction general on his parchment banner as the head; the paper behind the cards. */
#shop { background: #b9ad92 url(/play/heroes/ui/img/menu/paper.webp) center / cover; }
#shop-head { position: relative; min-height: 92px; align-content: flex-end; padding: 10px 12px 8px 30%; border-bottom: 3px solid #000;
  background: #d6c9a6 url(/play/heroes/ui/img/menu/banner_royal.webp) left bottom / auto 118% no-repeat; }
body.team-1 #shop-head { background-image: url(/play/heroes/ui/img/menu/banner_national.webp); }
#shop-title { width: 100%; font: 400 30px/1 var(--bfh-font-display); color: #3b2e1a; text-shadow: 0 2px 0 rgba(255, 255, 255, 0.5); letter-spacing: 0.5px; }
#filters button { background: rgba(255, 252, 240, 0.85); color: #3b2e1a; border: 2px solid #3b2e1a; font-size: 12px; transition: transform 0.1s; }
#filters button:hover { transform: translateY(-1px); }
#filters button.on { background: var(--m-yellow); color: #2a2418; }

/* Tiles: the menu slot frame, the item's picture big, the price as the only text; the name on hover / in the bar. */
#grid { grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 10px; padding: 12px; }
.tile { aspect-ratio: 1 / 1.08; border: 0; border-radius: 9px; background: url(/play/heroes/ui/img/menu/slot.webp) center / 100% 100%; padding: 0;
  box-shadow: 0 3px 6px rgba(40, 25, 5, 0.45); transition: transform 0.14s cubic-bezier(0.2, 1.4, 0.4, 1), box-shadow 0.14s, filter 0.14s; overflow: visible; }
.tile.owned { background-image: url(/play/heroes/ui/img/menu/slot_green.webp); }
.tile .pic { flex: 1; display: grid; place-items: center; padding: 8px 8px 0; min-height: 0; }
.tile img { width: 100%; height: 100%; max-height: 92px; object-fit: contain; margin: 0; filter: drop-shadow(0 4px 3px rgba(0, 0, 0, 0.45)); transition: transform 0.18s; }
.tile:hover { transform: translateY(-4px) scale(1.04); box-shadow: 0 10px 16px rgba(40, 25, 5, 0.5); z-index: 2; }
.tile:hover img { transform: scale(1.08); }
.tile.sel { box-shadow: 0 0 0 3px var(--m-yellow), 0 0 22px rgba(255, 200, 40, 0.75); }
.tile .price { display: flex; align-items: center; justify-content: center; gap: 4px; margin: 0 8px 7px; padding: 3px 6px; border-radius: 999px; min-height: 22px;
  background: rgba(20, 14, 6, 0.78); color: #fff4d8; font: 600 14px/1 var(--bfh-font-ui); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15); }
.tile .price img { width: 20px; height: 20px; max-height: none; filter: none; }
.tile .price.mine { background: rgba(60, 106, 18, 0.9); font-size: 12px; text-transform: lowercase; }
.tile .worn { position: absolute; top: -6px; right: -6px; width: 24px; height: 24px; border-radius: 50%; background: #3c6a12; color: #fff; border: 2px solid #000;
  display: grid; place-items: center; font: 700 13px/1 var(--bfh-font-body); }
.tile .newr { position: absolute; top: -4px; right: -4px; width: 48px; height: 50px; background: url(/play/heroes/ui/img/menu/ribbon_new.webp) right top / contain no-repeat; }
.tile .td { top: auto; bottom: 34px; right: 7px; font-size: 9px; opacity: 0.9; }
.tile .nm, .tile .pr, .tile .badge { display: none; }
.tile[data-name]:hover::after { content: attr(data-name); position: absolute; left: 50%; bottom: calc(100% + 6px); transform: translateX(-50%); white-space: nowrap; z-index: 5;
  font: 600 12px/1 var(--bfh-font-ui); color: #fff; background: #1a1a16; border: 2px solid var(--m-yellow); border-radius: 6px; padding: 5px 8px; pointer-events: none; }
.tile.locked { filter: grayscale(0.6) brightness(0.8); }

/* The buy bar on the menu's paper card; the price with its currency's icon. */
#detail { background: #e4d6b2 url(/play/heroes/ui/img/menu/papercard.webp) center / 100% 100%; border-top: 3px solid #000; }
#detail .pic { background: url(/play/heroes/ui/img/menu/slot.webp) center / 100% 100%; border-radius: 8px; padding: 4px; }
#d-name { font: 400 20px/1.05 var(--bfh-font-display); color: #3b2e1a; }
.cur-ic { width: 18px; height: 18px; vertical-align: -4px; margin-right: 2px; }

/* The slot columns: the menu's slot frames. */
.slot { background: url(/play/heroes/ui/img/menu/slot.webp) center / 100% 100%; border: 0; box-shadow: 0 3px 6px rgba(0, 0, 0, 0.45); }
.slot.on { background-image: url(/play/heroes/ui/img/menu/slot_green.webp); color: #fff; text-shadow: var(--bfh-outline-thin); }
.slot.on .k { color: #f2edd8; }
.slot .ic { background-color: rgba(255, 250, 235, 0.55); }

@media (prefers-reduced-motion: reduce) { .tile, .tile img, #tabs button, #tabs button img { transition: none; } #stage .rotate { animation: none; } }
@media (max-width: 900px) { #tabs { height: var(--tabs-h); } #shop-head { padding-left: 34%; min-height: 78px; } #grid { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); } }

/* ---- On the site's shell (phase 3, notes/bfheroes/site_design.md): the game's my stuff / store screen
   (heroes/captures/m4/w64_live_mystuff.png, w75_menu_store_768.png). The shell draws the bars; the hero stands on
   the menu's village with no frame, the slots are the blue cards (03_bgFrame_blue), the inventory is the olive
   panel (01_bgFrameLarge / 01_fgTabWide) with the slot tabs (icons/button*.png), the store tiles are the blue
   picture over the white price strip with the cart (buttonStoreBuy). */
body.bfh-shell { display: block; overflow: auto; height: auto; }
body.bfh-shell #tabs { display: none; }
body.bfh-shell #room {
  height: calc(100vh - var(--m-top) - var(--m-foot-h)); min-height: 520px; padding: 16px 18px 12px;
  grid-template-columns: 118px minmax(280px, 1fr) 118px minmax(420px, 40vw); gap: 12px;
}
body.bfh-shell #stage { background: none; border: 0; box-shadow: none; border-radius: 0; overflow: visible; }
body.bfh-shell #stage::before, body.bfh-shell #stage::after, body.bfh-shell #stage .crest { display: none; }
body.bfh-shell #stage-top { top: 0; }
body.bfh-shell #hero-name { font: 600 24px/1 var(--m-font); text-shadow: var(--m-out); letter-spacing: 0; }
body.bfh-shell #hero-kind { font: 600 14px/1.4 var(--m-font); text-shadow: var(--m-out); }
body.bfh-shell #view-note, body.bfh-shell #emotes button { font-family: var(--m-font); }

/* The slot cards: blue, a black edge, the item's picture, the slot's name under it. */
body.bfh-shell .slots { gap: 8px; padding: 4px 2px; }
body.bfh-shell .slot, body.bfh-shell #slots-r .slot {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 70px; padding: 6px 4px 4px;
  background: linear-gradient(#7ab9d6, #3d86a8 45%, var(--m-slot)); border: 2px solid #000; border-radius: 8px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), 0 3px 6px rgba(0, 0, 0, .45); color: #fff; text-align: center;
}
body.bfh-shell .slot .tx { order: 0; }
body.bfh-shell .slot .ic, body.bfh-shell #slots-r .slot .ic { order: 1; }
body.bfh-shell .slot .ic { width: 52px; height: 42px; border-radius: 4px; background-color: transparent; background-size: contain; }
body.bfh-shell .slot .ic.none { background: none; }
body.bfh-shell .slot .tx { width: 100%; }
body.bfh-shell .slot .k { color: #e6f3fa; font: 600 11px/1 var(--m-font); text-shadow: 0 1px 0 #000; }
body.bfh-shell .slot .v { color: #fff; font: 600 12px/1.15 var(--m-font); text-shadow: 0 1px 0 #000; }
body.bfh-shell .slot.on { background: linear-gradient(#ffe48a, #f0c64a 45%, #c99a12); color: #2a1e04; }
body.bfh-shell .slot.on .k, body.bfh-shell .slot.on .v { color: #2a1e04; text-shadow: none; }
body.bfh-shell .slot:hover, body.bfh-shell .slot:focus-visible { transform: translateY(-2px); box-shadow: 0 0 0 3px #ffd24a, 0 6px 10px rgba(0, 0, 0, .45); }

/* The inventory panel. */
body.bfh-shell #shop { background: var(--m-taupe); border: 2px solid #000; border-radius: 10px; box-shadow: 0 6px 18px rgba(0, 0, 0, .45); overflow: visible; }
body.bfh-shell #shop-head {
  position: relative; min-height: 0; height: 52px; padding: 0 10px 0 104px; display: flex; align-items: center; gap: 10px; flex-wrap: nowrap;
  background: linear-gradient(#56602a, var(--m-olive)); border-bottom: 2px solid #000; border-radius: 8px 8px 0 0;
}
body.bfh-shell #shop-head::before {
  content: ''; position: absolute; left: -2px; top: -2px; bottom: -2px; width: 92px;
  background: var(--m-olive-dark); border: 2px solid #000; border-radius: 10px 0 0 0; clip-path: polygon(0 0, 78% 0, 100% 100%, 0 100%);
}
body.bfh-shell #shop-head .pi { position: absolute; left: -8px; top: -22px; width: 74px; height: 74px; object-fit: contain; z-index: 1; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .6)); }
body.bfh-shell #shop-title { width: auto; flex: none; font: 600 24px/1 var(--m-font); color: #fff; text-shadow: var(--m-out); text-transform: lowercase; }
body.bfh-shell #filters { flex: 1; display: flex; flex-wrap: nowrap; gap: 2px; overflow-x: auto; scrollbar-width: none; align-self: flex-end; }
/* With the slot tabs the panel's icon names it (the game's inventory shows the tabs only). */
body.bfh-shell #shop-head:has(#filters button) #shop-title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
body.bfh-shell .slot .ic.none { opacity: .45; background: center / 70% no-repeat; }
body.bfh-shell .slot[data-slot=head] .ic.none { background-image: url(/play/heroes/ui/img/menu/tab_head.webp); }
body.bfh-shell .slot[data-slot=face] .ic.none { background-image: url(/play/heroes/ui/img/menu/tab_face.webp); }
body.bfh-shell .slot[data-slot=neck] .ic.none { background-image: url(/play/heroes/ui/img/menu/tab_neck.webp); }
body.bfh-shell .slot[data-slot=body] .ic.none { background-image: url(/play/heroes/ui/img/menu/tab_body.webp); }
body.bfh-shell .slot[data-slot=chest] .ic.none { background-image: url(/play/heroes/ui/img/menu/tab_chest.webp); }
body.bfh-shell .slot[data-slot=waist] .ic.none { background-image: url(/play/heroes/ui/img/menu/tab_waist.webp); }
body.bfh-shell .slot[data-slot=hands] .ic.none { background-image: url(/play/heroes/ui/img/menu/tab_hands.webp); }
body.bfh-shell .slot[data-slot=legs] .ic.none { background-image: url(/play/heroes/ui/img/menu/tab_legs.webp); }
body.bfh-shell .slot[data-slot=feet] .ic.none { background-image: url(/play/heroes/ui/img/menu/tab_feet.webp); }
body.bfh-shell .slot[data-slot=weapons] .ic.none { background-image: url(/play/heroes/ui/img/menu/tab_weapons.webp); }
body.bfh-shell .slot[data-slot=abilities] .ic.none { background-image: url(/play/heroes/ui/img/menu/p_abilities.webp); }
body.bfh-shell .slot[data-slot=widgets] .ic.none { background-image: url(/play/heroes/ui/img/menu/tab_explosives.webp); }
body.bfh-shell .slot[data-slot=emotes] .ic.none { background-image: url(/play/heroes/ui/img/menu/p_emotes.webp); }
body.bfh-shell #emotes button { background: linear-gradient(#4b4b4b, #1d1d1d); color: #fff; text-shadow: var(--m-out); border: 2px solid #000; }
body.bfh-shell #emotes button:hover { background: linear-gradient(#5c9ac6, var(--m-blue) 55%, #1d4a6b); }
body.bfh-shell #filters button {
  height: 38px; min-width: 34px; padding: 0 6px; border: 2px solid #000; border-bottom: 0; border-radius: 8px 8px 0 0;
  background: linear-gradient(#3a3d2a, #23251b); color: #f3ecd8; font: 600 13px/1 var(--m-font); text-transform: lowercase;
}
body.bfh-shell #filters button.ic { padding: 0 4px; }
body.bfh-shell #filters button img { width: 30px; height: 30px; display: block; }
body.bfh-shell #filters button:hover { background: linear-gradient(#4c5036, #2e3122); transform: none; }
body.bfh-shell #filters button.on { background: linear-gradient(#a49987, #8f846f); color: #1b1712; }

/* The tiles as the game's (w75_menu_store_768.png): five to a row, the picture filling the box, under it the white
   strip. Owned items: the green box and "owned" (H8034: the site sells nothing: no price, no cart). */
body.bfh-shell #grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; padding: 10px; align-content: start; }
body.bfh-shell .tile {
  aspect-ratio: 1 / 1.16; height: auto; border: 2px solid #000; border-radius: 7px; overflow: visible; display: flex; flex-direction: column;
  background: linear-gradient(#7ab9d6, #3d86a8 45%, var(--m-slot)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4);
}
body.bfh-shell .tile.owned { background: linear-gradient(#a8d36a, #6f9f2c 50%, #4d7a16); }
body.bfh-shell .tile .pic { flex: 1; min-height: 0; padding: 4px 4px 0; display: grid; place-items: center; }
body.bfh-shell .tile img { width: 100%; height: 100%; max-height: none; object-fit: contain; }
body.bfh-shell .tile::before {
  content: ''; order: 2; flex: none; height: 20px; border-top: 1px solid #000; border-radius: 0 0 5px 5px;
  background: linear-gradient(#ffffff, #dfe5e8);
}
body.bfh-shell .tile .price {
  position: absolute; left: 4px; bottom: 23px; z-index: 1; height: auto; margin: 0; padding: 0; border: 0; background: none;
  color: #fff; text-shadow: var(--m-out); font: 600 15px/1 var(--m-font); display: flex; align-items: center; gap: 2px;
}
body.bfh-shell .tile .price::after { display: none; }
body.bfh-shell .tile .price.mine { padding: 2px 6px; border: 1px solid #000; border-radius: 9px; font-size: 12px; text-transform: lowercase; }
body.bfh-shell .tile .price.mine { background: linear-gradient(#7fae38, #557f1e); }
body.bfh-shell .tile .td { bottom: 26px; }
body.bfh-shell .tile:hover { transform: translateY(-3px); box-shadow: 0 0 0 2px #ffd24a, 0 8px 14px rgba(0, 0, 0, .45); z-index: 3; }
body.bfh-shell .tile.sel { box-shadow: 0 0 0 3px #ffd24a, 0 0 18px rgba(255, 210, 74, .7); }
body.bfh-shell #grid .empty { grid-column: 1 / -1; color: #1b1712; font: 600 15px/1.4 var(--m-font); }
@media (max-width: 900px) { body.bfh-shell #grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 420px) { body.bfh-shell #grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* The dice and clear under the hero (buttonRandom, buttonClear), the emotes over them. */
body.bfh-shell #stage-tools { position: absolute; left: 0; right: 0; bottom: 8px; z-index: 2; display: flex; justify-content: center; gap: 10px; }
body.bfh-shell #stage-tools button { position: relative; padding: 0; border: 0; background: none; cursor: pointer; transition: transform .12s ease, filter .12s ease; }
body.bfh-shell #stage-tools button img { display: block; height: 34px; width: auto; }
body.bfh-shell #stage-tools #clear span { position: absolute; left: 34px; right: 6px; top: 50%; transform: translateY(-50%); color: #fff; font: 600 14px/1 var(--m-font); text-shadow: 0 1px 0 #000; }
body.bfh-shell #stage-tools button:hover { transform: translateY(-2px); filter: brightness(1.15); }
body.bfh-shell #stage-tools button:active { transform: translateY(1px); }
body.bfh-shell #emotes { bottom: 52px; }
body.bfh-shell #view-note { bottom: 92px; }

/* The buy bar: the cream card with the red title bar's colours. */
body.bfh-shell #detail { background: var(--m-card); border-top: 2px solid #000; border-radius: 0 0 8px 8px; }
body.bfh-shell #d-pic:not([src]) { visibility: hidden; }
body.bfh-shell #detail .pic { background: linear-gradient(#7ab9d6, var(--m-slot)); border: 2px solid #000; border-radius: 7px; }
body.bfh-shell #d-name { font: 600 18px/1.1 var(--m-font); color: var(--m-title); }
body.bfh-shell #d-facts, body.bfh-shell #detail .acts .pay, body.bfh-shell #msg { font-family: var(--m-font); }
body.bfh-shell #msg { background: var(--m-card); border-radius: 0 0 8px 8px; }

/* H1764: the game's my stuff tabs. Appearance: the slot cards beside the hero, each worn or tried item with its x.
   Weapons / widgets / emotes: no slot cards, the equipment bar (emote slots) under the hero, the inventory beside. */
body.bfh-shell #room { grid-template-rows: minmax(0, 1fr) auto; }
body.bfh-shell #slots-l { grid-column: 1; grid-row: 1; }
body.bfh-shell #stage { grid-column: 2; grid-row: 1; }
body.bfh-shell #slots-r { grid-column: 3; grid-row: 1; }
body.bfh-shell #shop { grid-column: 4; grid-row: 1 / span 2; }
body.bfh-shell #bar-panel { grid-column: 1 / 4; grid-row: 2; }
#bar-panel[hidden] { display: none !important; }
body.bar-on .slots { display: none; }
body.bar-on #stage { grid-column: 1 / 4; }
body.bfh-shell .slot { position: relative; }
body.bfh-shell .slot .x {
  position: absolute; top: -7px; right: -7px; z-index: 2; width: 22px; height: 22px; display: grid; place-items: center;
  border: 2px solid #000; border-radius: 50%; background: linear-gradient(#c0544c, #8b322e); color: #fff;
  font: 600 15px/1 var(--m-font); text-shadow: 0 1px 0 #000; opacity: 0; transform: scale(.7); transition: opacity .12s ease, transform .12s ease;
}
body.bfh-shell .slot:hover .x, body.bfh-shell .slot:focus-visible .x, body.bfh-shell .slot.trying .x { opacity: 1; transform: none; }
body.bfh-shell .slot .x:hover { filter: brightness(1.2); transform: scale(1.12); }
body.bfh-shell .slot.trying { background: linear-gradient(#8fd0ec, #4f9dc2 45%, #2a7598); box-shadow: 0 0 0 2px #ffd24a, 0 3px 6px rgba(0, 0, 0, .45); }
.tile[draggable=true] { cursor: grab; }

@media (max-width: 1180px) {
  body.bfh-shell #room { grid-template-columns: 96px minmax(240px, 1fr) 96px minmax(360px, 42vw); }
}
@media (max-width: 900px) {
  body.bfh-shell #stage { order: 1; }
  body.bfh-shell #bar-panel { order: 2; }
  body.bfh-shell .slots { order: 3; }
  body.bfh-shell #shop { order: 4; }
  body.bfh-shell #room { height: auto; display: flex; flex-direction: column; padding: 8px; }
  body.bfh-shell #stage { height: 56vh; }
  body.bfh-shell .slot, body.bfh-shell #slots-r .slot { flex: 0 0 96px; min-height: 64px; }
  body.bfh-shell #detail { bottom: var(--m-foot-h); }
}

/* ---- One scale (H8005, the owner's report R-0100: "all the UI elements are just all over the place, some are tiny,
   some are large"; Not retail: ours). Measured before (analysis/scratch/bfheroes/coordread/r0100/measure_before.md):
   fourteen text sizes from 9 to 26 px and cards, tabs, chips and bars of fixed sizes, none of which changed with the
   window, beside item tiles that did (142 px wide at 1920, 194 px at 2560). The owner first chose his picture of
   the page at 150 % browser zoom (the screen used, text that can be read), then, 2026-11-19, the claw's scale as
   the measure for all pages. So (shell.css "One scale") everything of a fixed size is multiplied by --m-z, the
   claw's own factor: the slot cards, the panel's head and tabs, the chips, the bar under the grid, the hint and
   the buttons under the hero; the texts are of four sizes, 12 / 14 / 20 / 26 px times --m-z; the bars are the
   shell's own. Every icon stands in one box (--m-icon), from the largest file the game has of it (wardrobe.js
   pic): the item tiles fill the panel in whole rows (six to a row at 1920 x 1080). On a tile "owned" and "3D"
   stand on the white strip, left and right. The layout is the same: slot cards | hero | slot cards | inventory,
   the bar under the hero. */
@media (min-width: 901px) {
  body.bfh-shell.m-one #room {
    min-height: calc(520px * var(--m-z, 1));
    /* 26 px over the panels: the inventory's round icon stands 22 px over its panel, clear of the bar or the band. */
    padding: calc(26px * var(--m-z, 1)) calc(18px * var(--m-z, 1)) calc(12px * var(--m-z, 1)); gap: calc(12px * var(--m-z, 1));
    grid-template-columns: calc(104px * var(--m-z, 1)) minmax(280px, 1fr) calc(104px * var(--m-z, 1)) minmax(calc(420px * var(--m-z, 1)), 46vw);
  }
  /* A window of 1180 px and under (the factor is 1 there): the narrower columns it had. */
  @media (max-width: 1180px) { body.bfh-shell.m-one #room { grid-template-columns: 96px minmax(240px, 1fr) 96px minmax(360px, 42vw); } }
  body.m-one .slots, body.m-one #shop, body.m-one #bar-panel, body.m-one #stage-top, body.m-one #view-note, body.m-one #emotes,
  body.m-one #stage-tools, body.m-one #stage .rotate { zoom: var(--m-z, 1); }

  /* The slot cards: the slot's name, the item's name and the item's icon, nothing boxed inside the card (the owner:
     "remove that ugly thin black rectangle and just make it the icon with the name"). A card is a fifth of its
     column high (five on the left, four of the same height on the right), so the columns are filled as the
     inventory is; the icon stands in the one box (--m-icon), as on an item tile; an empty slot's icon keeps its
     own 34 px. */
  body.bfh-shell.m-one .slots { gap: 5px; }
  body.bfh-shell.m-one .slot, body.bfh-shell.m-one #slots-r .slot { flex: 0 1 calc((100% - 20px) / 5); max-height: 150px; padding: 3px 4px 2px; justify-content: space-between; }
  /* A name of two lines is never cut: in a window too low for both, the icon gives way by a few px. */
  body.bfh-shell.m-one .slot .tx { flex: none; }
  body.bfh-shell.m-one .slot .ic { flex: 0 1 var(--m-icon); min-height: 36px; width: var(--m-icon); height: auto; border: 0; border-radius: 0; }
  body.bfh-shell.m-one .slot .ic.none { background-size: 34px; }
  body.bfh-shell.m-one .slot .k { font: 600 var(--t-s)/1 var(--m-font); }
  body.bfh-shell.m-one .slot .v { font: 600 var(--t-s)/1.1 var(--m-font); }
  body.bfh-shell.m-one .slot .x { font-size: var(--t-m); }

  /* The inventory: the tiles fill the panel in whole rows, each icon in the one box (--m-icon), centred. */
  body.bfh-shell.m-one #grid { grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); }
  body.bfh-shell.m-one .tile { aspect-ratio: 1 / 1.05; }
  body.bfh-shell.m-one .tile img, body.bfh-shell.m-one #detail .pic img { width: var(--m-icon); height: var(--m-icon); }
  body.bfh-shell.m-one #shop-title { font: 600 var(--t-xl)/1 var(--m-font); }
  body.bfh-shell.m-one #filters button { font: 600 var(--t-s)/1 var(--m-font); }
  body.bfh-shell.m-one .tile::before { height: 22px; }
  /* The chip "owned" and the 3D badge are a pair inside the white strip (the owner, R-0100, 2026-11-19: "make change
     it to "owned" and also make it fit nicer, it looks a little out of place": the chip read "yours", stood 7 px
     higher than the badge and over the edge between the picture and the strip). One line, one height (15 px), one
     corner, each 3 px from its side of the strip and from the strip's lower edge; neither reaches into the picture,
     neither touches the other. On a tile without a badge the chip sits the same way. */
  body.bfh-shell.m-one .tile .price.mine, body.bfh-shell.m-one .tile .td {
    top: auto; bottom: 3px; z-index: 1; min-height: 0; height: auto; margin: 0; padding: 1px 3px 2px; border: 0; border-radius: 3px;
    color: #fff; text-shadow: none; font: 600 var(--t-s)/1 var(--m-font); white-space: nowrap; opacity: 1;
  }
  body.bfh-shell.m-one .tile .price.mine { left: 3px; right: auto; background: #3c6a12; }
  body.bfh-shell.m-one .tile .td { left: auto; right: 3px; }
  body.bfh-shell.m-one .tile .worn { font-size: var(--t-m); }
  body.bfh-shell.m-one .tile[data-name]:hover::after { font: 600 var(--t-s)/1 var(--m-font); }
  body.bfh-shell.m-one #grid .empty { font: 600 var(--t-m)/1.4 var(--m-font); }

  /* The bar under the grid: the picked item's name, its facts, the buttons. */
  body.bfh-shell.m-one #d-name { font: 600 var(--t-l)/1.1 var(--m-font); }
  body.bfh-shell.m-one #d-facts { font-size: var(--t-s); }
  body.bfh-shell.m-one #detail .acts .bfh-btn { font-size: var(--t-m); }
  body.bfh-shell.m-one #msg { font: 600 var(--t-s)/1.3 var(--m-font); }

  /* Over and under the hero: his name, his class and level, the hint, the emote buttons, clear. */
  body.bfh-shell.m-one #hero-name { font: 600 var(--t-xl)/1 var(--m-font); }
  body.bfh-shell.m-one #hero-kind { font: 600 var(--t-m)/1.4 var(--m-font); }
  body.bfh-shell.m-one #view-note { font: 600 var(--t-s)/1.3 var(--m-font); }
  body.bfh-shell.m-one #emotes button { font: 600 var(--t-m)/1 var(--m-font); }
  body.bfh-shell.m-one #stage-tools #clear span { font: 600 var(--t-m)/1 var(--m-font); }
  /* Where a bar takes the stage's lower part (weapons, emotes, widgets) the buttons under the hero stand in one row
     at the stage's foot and the hint line is appearance's alone, so the hero shows down to his feet. */
  body.bar-on.m-one #view-note { display: none; }
  body.bar-on.m-one #emotes { left: 0; right: 50%; bottom: 8px; justify-content: flex-end; flex-wrap: nowrap; padding-right: 5px; }
  body.bar-on.m-one #stage-tools { left: 50%; right: 0; justify-content: flex-start; padding-left: 5px; }
}
