.customize-shop {
  width: min(980px, 100%);
  margin: 0 auto 48px;
}
.shop-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: clamp(20px, 3vw, 34px);
  border: 2px solid #263529;
  border-bottom: 5px solid #ad8443;
  color: #fff4d2;
  background: #314c40;
}
.shop-head h1 { font: clamp(32px, 5vw, 50px)/1.06 var(--pixel); }
.shop-head p { max-width: 46ch; margin: 8px 0 0; color: #e5e6cd; font-size: 15px; }
.shop-balance {
  flex: 0 0 auto;
  padding: 9px clamp(10px, 2vw, 20px);
  border: 1px solid #c7a95e;
  box-shadow: inset 0 0 0 3px #304239;
  background: #485a43;
  color: #ffe499;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.shop-balance span { display: flex; align-items: center; justify-content: center; gap: 5px; font: 700 12px/1.3 var(--body); }
.shop-balance .icon { color: #ffdc78; }
.shop-balance strong { display: block; margin-top: 5px; color: #fff4ca; font: clamp(22px, 2.5vw, 30px)/1.05 var(--pixel); }
.shop-account > div {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px 15px;
  margin-top: 14px; padding: 9px 16px;
  background: #ecead5; border: 1px solid #c7c7ad;
}
.shop-account p { margin: 0 auto 0 0; color: #40543c; font-size: 14px; }
.shop-account button { min-height: 36px; font-size: 14px; }
.shop-login { padding: 4px 14px; background: #37583d; color: #fff8de; border: 1px solid #29472e; font-weight: 650; }
.gear-rack { margin-top: 20px; background: #fff9e9; border: 1px solid #bdc1a4; }
.gear-tabs { display: grid; grid-template-columns: repeat(6,minmax(0,1fr)); border-bottom: 1px solid #aab097; }
.gear-tabs button {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 53px; padding: 6px 8px; border: 0; border-right: 1px solid #bfc3a9;
  background: #e4e7d2; color: #42543d; font-weight: 700;
}
.gear-tabs button:last-child { border-right: 0; }
.gear-tabs button[aria-pressed="true"] { background: #fff9e9; box-shadow: inset 0 -4px #456844; color: #243e2b; }
.gear-tabs button:hover { background: #f1eed8; }
.gear-tabs button:focus-visible { outline-offset: -5px; }
.gear-tabs canvas { width: 40px; height: auto; image-rendering: pixelated; }
.gear-collection { padding: clamp(12px, 2.6vw, 28px); }
.gear-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 5px 14px; flex-wrap: wrap; margin: 0 0 15px; }
.gear-heading h2 { margin: 0; font: clamp(24px, 3.5vw, 32px)/1.15 var(--pixel); }
.gear-release { color: #60664e; font-size: 13px; }
.gear-description { margin: -4px 0 16px; color: #53604b; font-size: 14px; line-height: 1.45; }
.gear-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: clamp(9px,1.6vw,18px); list-style: none; padding: 0; margin: 0; }
.gear-card {
  display: flex; flex-direction: column; min-width: 0; border: 1px solid #c1ba9d;
  background: #fffdf3; box-shadow: 0 2px #c6bda0;
}
.gear-card.is-equipped { border-color: #6c8058; }
.gear-display {
  position: relative; display: grid; place-items: center; min-width: 0;
  padding: clamp(3px, .6vw, 8px); padding-bottom: 15px;
  background-color: #ebe1ba;
  background-image: radial-gradient(#b8aa79 1px, transparent 1.3px);
  background-size: 12px 12px;
  overflow: hidden;
}
.gear-display::after {
  content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 9px;
  background: linear-gradient(to bottom,#b59256 0 2px,#d9b977 2px 4px,#a17d47 4px 7px,#81663f 7px);
}
.gear-display canvas { display: block; width: 100%; max-width: 220px; height: auto; image-rendering: pixelated; }
.gear-display canvas[data-preview^="fork-"] { image-rendering: auto; }
.gear-caption { display: flex; flex: 1; flex-direction: column; align-items: flex-start; justify-content: space-between; gap: 9px; padding: 11px clamp(8px,1.15vw,14px) 12px; }
.gear-caption h3 { color: #35422e; font: 700 clamp(14px,1.6vw,17px)/1.25 var(--body); overflow-wrap: anywhere; }
.gear-state { display: inline-flex; align-items: center; gap: 5px; min-height: 22px; color: #505844; font: 650 12px/1.3 var(--body); }
.gear-state.equipped { color: #325839; }
.gear-state .icon { width: 14px; height: 14px; }
.gear-state.gear-cost { display: grid; gap: 0; }
.gear-unlock { display: grid; gap: 4px; }
.gear-unlock small { color: #62664f; font: 500 12px/1.4 var(--body); }
.gear-cost small { font-weight: 500; color: #62664f; }
.gear-caption button {
  min-height: 40px; padding: 6px 9px; background: #3c5b3d; color: #fff9da; border: 1px solid #324c31;
  font: 700 13px/1.35 var(--body);
}
.gear-caption button b { display: inline-block; padding-left: 2px; color: #ffe496; }
.gear-caption button:hover, .shop-login:hover { background: #29492f; }
.shop-message { margin: 0; }
.shop-message:not(:empty) { margin: 12px 0 0; color: #3c5238; font-weight: 650; }
.shop-return { margin-top: 17px; }
@media(max-width:740px) {
  .gear-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .gear-tabs { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .gear-tabs button:nth-child(2n) { border-right: 0; }
  .gear-tabs button:nth-last-child(n+3) { border-bottom: 1px solid #bfc3a9; }
  .gear-tabs button:last-child:nth-child(odd) { grid-column: 1 / -1; }
}
@media(max-width:520px) {
  .shop-head { align-items: flex-start; gap: 8px; padding: 17px 12px; }
  .shop-head p { font-size: 13px; }
  .shop-balance { padding: 8px; }
  .shop-balance span { font-size: 11px; white-space: nowrap; }
  .shop-account > div { gap: 5px 10px; padding: 8px 12px; }
  .shop-account p { flex: 1 0 100%; }
  .gear-tabs button { gap: 6px; padding: 6px; font-size: 13px; }
  .gear-tabs canvas { width: 40px; }
  .gear-collection { padding: 12px 9px; }
  .gear-heading { margin-bottom: 11px; }
  .gear-release { font-size: 12px; }
}
@media(max-width:345px) {
  .gear-grid { gap: 7px; }
}
@media(max-width:355px) {
  body:has(.customize-shop) .brand span { display: none; }
  body:has(.customize-shop) .brand img { width: 27px; height: 25px; }
}
