:is(#local-menu-panel[data-m="shop"], #hp[data-m="shop"], #online-panel[data-view="shop"]) {
  --shop-ink:#0b3c69;
  --shop-card:linear-gradient(145deg,#fff1e2b8,#ffdfc3a6),url("art/map-panel-paper.jpg") center / 350px;
  box-sizing:border-box;
  width:min(1150px,calc(100vw - 32px));
  max-width:none;
  max-height:calc(100dvh - 28px);
  padding:clamp(12px,1.7vw,23px);
  border:1px solid #fffcf6;
  border-radius:15px;
  background:linear-gradient(120deg,#ffe6d3d9,#fff1e3d1),url("art/map-panel-paper.jpg") center / 440px;
  color:var(--shop-ink);
  box-shadow:0 5px 13px #271f1ae0, inset 0 0 0 1px #b9927852;
  font:16px/1.28 var(--font-ui);
  overflow:auto;
  overscroll-behavior:contain;
}
:is(#local-menu-panel[data-m="shop"], #online-panel[data-view="shop"])::backdrop {
  background:linear-gradient(#756b6124 1px,transparent 1px),linear-gradient(90deg,#756b6124 1px,transparent 1px),#ae9e90d2;
  background-size:26px 26px;
}
#hp[data-m="shop"] {
  inset:50% auto auto 50%;
  z-index:1600;
  transform:translate(-50%,-50%);
  box-shadow:0 5px 13px #271f1ae0, inset 0 0 0 1px #b9927852, 0 0 0 100vmax #3930269c;
}
.shop-title {display:flex;align-items:center;gap:clamp(10px,3.4vw,55px);margin-bottom:10px}
.shop-title h2 {margin:0 auto 0 0;font:750 clamp(25px,3.2vw,42px)/1.04 var(--font-ui)}
.shop-balance,.shop-parts-total {display:inline-flex;align-items:center;white-space:nowrap;gap:6px;font-size:clamp(16px,2vw,28px)}
.shop-currency {display:inline-grid;place-items:center;vertical-align:middle;width:1.28em;height:1.28em}
.shop-currency svg,.shop-symbol svg {display:block;width:100%;height:100%;fill:none;stroke:currentColor;stroke-width:1.65;stroke-linecap:round;stroke-linejoin:round}
.shop-currency[data-currency="go"] svg,.shop-currency[data-currency="s"] svg {stroke:#fff5e0;stroke-width:1.85;filter:drop-shadow(0 1px 1px #5946237d)}
.shop-currency[data-currency="go"] svg circle:first-child {stroke:#dc8b15;stroke-width:1.2}
.shop-currency[data-currency="s"] svg circle:first-child {stroke:#9397a1;stroke-width:1.2}
.shop-currency[data-currency="shield"] svg {fill:#90979e;stroke:#65717b}
.shop-tabs {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:5px;border-bottom:1px solid #b49680}
.shop-sections {display:flex;flex-direction:column;gap:clamp(6px,1vw,14px);padding-right:11px;border-right:1px solid #b4968052}
:is(#hp,#local-menu-panel,#online-panel) :is(.shop-tabs button,.shop-sections button,.shop-close,.shop-cta) {
  display:inline-flex;align-items:center;justify-content:center;gap:5px;
  min-width:0;min-height:0;margin:0;padding:0;
  font:700 clamp(14px,2vw,27px)/1.1 var(--font-ui);
  color:inherit;background:var(--shop-card);
  border:1px solid #fffcf4;border-radius:12px;box-shadow:0 2px 4px #62473057;
  text-shadow:none;white-space:normal;
}
:is(#hp,#local-menu-panel,#online-panel) :is(.shop-tabs button,.shop-sections button,.shop-close,.shop-cta):focus-visible {
  outline:2px solid #24669a;outline-offset:2px;
}
:is(#hp,#local-menu-panel,#online-panel) .shop-close {
  flex:0 0 auto;width:clamp(38px,4.2vw,48px);height:clamp(38px,4.2vw,48px);
  font-size:clamp(27px,3.1vw,39px);
}
:is(#hp,#local-menu-panel,#online-panel) .shop-tabs button {
  min-height:clamp(40px,4.5vw,58px);
  padding:4px;border-radius:15px 15px 0 0;border-bottom:0;box-shadow:0 -1px 4px #7b573630;
}
:is(#hp,#local-menu-panel,#online-panel) .shop-tabs button[aria-pressed="true"] {
  background:#f0d2b9;box-shadow:inset 0 1px 5px #95684d5c;
}
:is(#hp,#local-menu-panel,#online-panel) .shop-sections button {
  width:clamp(44px,7vw,90px);height:clamp(44px,6.6vw,84px);
}
:is(#hp,#local-menu-panel,#online-panel) .shop-sections button[aria-pressed="true"] {
  background:#e6bf9d;box-shadow:inset 0 1px 5px #95684d70,0 2px 4px #62473057;
}
:is(#hp,#local-menu-panel,#online-panel) .shop-cta {
  width:100%;min-height:clamp(39px,4vw,55px);padding:5px 8px;
  color:#fff8ee;background:linear-gradient(#094e8c,#06356b);
  border:1px solid #0b3660;box-shadow:inset 0 1px #5797c765;
  font-size:clamp(14px,1.85vw,26px);
}
:is(#hp,#local-menu-panel,#online-panel) .shop-cta:hover:not(:disabled) {background:#0e548d}
:is(#hp,#local-menu-panel,#online-panel) .shop-cta:disabled {opacity:.63}
.shop-body {margin-top:clamp(12px,1.5vw,23px)}
.shop-categories {display:grid;grid-template-columns:auto minmax(0,1fr);gap:clamp(8px,1vw,13px)}
.shop-offers {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:clamp(7px,.9vw,13px);align-items:stretch}
.shop-offers.shop-case-offers {grid-template-columns:repeat(4,minmax(0,1fr))}
.shop-offers.shop-gold-offers {grid-template-columns:repeat(2,minmax(0,1fr))}
.shop-offer,.shop-certificate,.shop-offer-empty {
  min-width:0;background:var(--shop-card);border:1px solid #fffaf2;border-radius:clamp(10px,1.25vw,19px);
  box-shadow:0 2px 5px #76593c65,inset 0 0 0 1px #bc987144;
}
.shop-offer {display:flex;flex-direction:column;align-items:center;gap:6px;text-align:center;padding:clamp(7px,1.15vw,16px)}
.shop-offer h3 {margin:0;font:730 clamp(14px,1.8vw,27px)/1.16 var(--font-ui)}
:is(#hp,#local-menu-panel,#online-panel) .shop-offer .shop-cta {margin-top:auto}
.shop-offer-empty {background:#d6ad8c38;box-shadow:inset 0 1px 4px #7a543849}
.shop-symbol {display:inline-block;flex:0 0 auto;width:clamp(36px,5.4vw,74px);height:clamp(36px,5.4vw,74px)}
.shop-symbol .shop-currency {width:100%;height:100%}
.shop-sections .shop-symbol {width:72%;height:72%}
.shop-offer-detail {font:600 clamp(12px,1.2vw,17px)/1.2 var(--font-ui);margin:0 0 5px}
.shop-certificate {
  display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;
  gap:clamp(7px,1.8vw,22px);padding:6px clamp(10px,1.6vw,21px);
  margin-bottom:clamp(11px,1.6vw,25px);font-size:clamp(15px,1.7vw,24px);
}
.shop-certificate progress {
  width:100%;height:clamp(10px,1.4vw,21px);appearance:none;border:0;border-radius:20px;
  background:#e2d7ca;box-shadow:inset 0 1px 4px #564b4680;overflow:hidden;accent-color:#d99530;
}
.shop-certificate progress::-webkit-progress-bar {background:transparent}
.shop-certificate progress::-webkit-progress-value {background:#d99530;border-radius:20px}
.shop-certificate progress::-moz-progress-bar {background:#d99530;border-radius:20px}
.shop-certificate .shop-symbol {width:1.8em;height:1.8em}
.shop-parts-total {font-weight:700;font-variant-numeric:tabular-nums}
.shop-gold-offers .shop-offer {
  display:grid;grid-template-columns:auto minmax(0,1fr);gap:9px;
  padding-inline:clamp(8px,1.8vw,28px);
}
.shop-gold-offers .shop-cta {grid-column:1/-1}
.shop-gold-offers h3 {margin-inline:auto}
.shop-symbol-pair {display:grid;grid-template-columns:repeat(2,1fr);width:clamp(66px,8vw,120px);padding:3px 0 12px}
.shop-symbol-pair .shop-symbol {width:100%;height:auto;aspect-ratio:1}
.shop-symbol-pair .shop-symbol:first-child {transform:rotate(-14deg) translateX(14%)}
.shop-symbol-pair .shop-symbol:last-child {transform:rotate(12deg) translate(-7%,17%)}
.shop-note-text,.shop-body [role="status"],.shop-extras {font:500 clamp(12px,1.1vw,15px)/1.35 var(--font-ui);margin:10px 0 0}
.shop-body [role="status"]:empty {display:none}
.shop-extras summary {width:fit-content;cursor:pointer}
.shop-extras .shop-offers {margin-top:10px}

/* The case art is sampled from the three supplied case sheets. */
.shop-crate {
  display:block;width:100%;aspect-ratio:220/162;filter:drop-shadow(0 2px 2px #5137262b);
}
.shop-crate::before {
  content:"";display:block;height:100%;background:var(--crate-sheet) var(--crate-x) var(--crate-y) / 760% auto no-repeat;
  clip-path:var(--crate-outline);
}
.shop-crate[data-category="mixed"] {
  --crate-sheet:url("art/shop-cases-mixed.jpg");--crate-y:55.84%;
  --crate-outline:polygon(3.5% 27%,12% 23%,16% 18%,34% 17%,39% 12.5%,55% 12%,61% 8%,73% 9%,99% 32%,99% 73%,35% 90%,23% 89%,4% 67%);
}
.shop-crate[data-category="military"] {
  --crate-sheet:url("art/shop-cases-military.jpg");--crate-y:58.02%;
  --crate-outline:polygon(1.5% 22%,15% 14%,32% 12%,37% 8%,55% 7%,61% 3%,74% 3%,99.5% 27%,99.5% 76%,35% 95%,24% 95%,2% 69%);
}
.shop-crate[data-category="cosmetic"] {
  --crate-sheet:url("art/shop-cases-cosmetic.jpg");--crate-y:57.64%;
  --crate-outline:polygon(3% 21%,15% 14%,32% 12%,37% 8%,55% 7%,61% 3%,75% 4%,99% 27%,99% 68%,37% 87%,24% 87%,3% 62%);
}
.shop-crate[data-rarity="common"] {--crate-x:28.1%}
.shop-crate[data-rarity="rare"] {--crate-x:45.35%}
.shop-crate[data-rarity="epic"] {--crate-x:62.6%}
.shop-crate[data-rarity="legendary"] {--crate-x:79.85%}
.shop-case-offers h3 {order:-1;font-size:clamp(13px,1.65vw,24px)}
.shop-case-detail-art {width:min(100%,360px);margin:14px auto}

@media(max-width:700px) {
  .shop-offers.shop-case-offers,.shop-offers {grid-template-columns:repeat(2,minmax(0,1fr))}
  .shop-offer-empty {display:none}
  .shop-gold-offers .shop-offer {grid-template-columns:1fr}
  .shop-gold-offers .shop-symbol-pair {justify-self:center}
  .shop-sections {padding-right:5px}
}
@media(max-width:420px) {
  :is(#local-menu-panel[data-m="shop"], #hp[data-m="shop"], #online-panel[data-view="shop"]) {
    width:calc(100vw - 16px);padding:9px;
  }
  .shop-certificate {grid-template-columns:minmax(0,1fr) auto}
  .shop-certificate progress {grid-row:2;grid-column:1/-1;margin-bottom:4px}
  .shop-offer h3 {overflow-wrap:anywhere}
}
