.account-overview,.auth-dialog .account-overview {
  grid-template-columns:auto minmax(0,1fr) auto;
}

.account-items-button {
  grid-column:3;
  grid-row:1;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  min-height:48px;
  padding:10px 16px;
  border:1px solid var(--line);
  border-radius:10px;
  background:var(--input);
  color:var(--paper);
  font-weight:800;
  cursor:pointer;
}

.account-items-button svg,.item-shop-wallet svg,.primary-nav a>svg {
  width:22px;
  height:22px;
  flex-shrink:0;
}

.account-items-button:hover {
  border-color:var(--lime);
  color:var(--lime);
}

.item-shop {
  max-width:1200px;
  margin:40px auto 80px;
}

.item-shop-heading.page-title-banner {
  display:flex;
  align-items:center;
  min-height:300px;
  padding:40px 28px;
  margin-bottom:20px;
  border-bottom:1px solid var(--line);
}

.item-shop-heading-copy {
  width:60%;
  min-width:0;
}

.item-shop-heading h1 {
  font-size:clamp(36px,4.4vw,60px);
  max-width:100%;
  margin:16px 0 24px;
  letter-spacing:-.04em;
}

.item-shop-heading-copy>p:last-child {
  max-width:550px;
  margin-bottom:0;
}

.item-shop-heading p,.item-shop-note,.item-inventory-hint {
  color:var(--muted);
  line-height:1.6;
}

.item-shop-wallet {
  display:flex;
  flex-wrap:wrap;
  gap:12px;
  align-items:center;
  justify-content:flex-end;
  max-width:none;
  margin-bottom:24px;
}

.item-shop-wallet>span {
  font-size:13px;
  text-align:end;
  color:var(--muted);
}

.item-shop-wallet>strong {
  color:var(--pink);
  font-size:30px;
  line-height:1.2;
}

.item-shop-wallet .button {
  gap:8px;
}

.item-shop-filters {
  display:flex;
  gap:8px;
  border-bottom:1px solid var(--line);
  padding-bottom:16px;
}

.item-shop-filters button {
  min-height:44px;
  padding:10px 20px;
  background:transparent;
  color:var(--muted);
  border:1px solid var(--line);
  border-radius:8px;
  cursor:pointer;
  font-weight:800;
}

.item-shop-filters button[aria-pressed=true] {
  background:var(--lime);
  border-color:var(--lime);
  color:var(--on-lime);
}

.item-shop-grid {
  display:grid;
  grid-template-columns:repeat(6,minmax(0,1fr));
  gap:12px;
  margin-top:18px;
}

.shop-item {
  min-width:0;
  overflow:hidden;
  border:1px solid var(--line);
  border-radius:14px;
  background:var(--panel);
  padding:10px;
}

.shop-item-art {
  height:130px;
  padding-block-start:24px;
  display:flex;
  align-items:center;
  justify-content:center;
  position:relative;
  background:var(--input);
  border-radius:8px;
}

.shop-item-art>svg {
  width:96px;
  height:96px;
  image-rendering:pixelated;
}

.shop-item-type {
  position:absolute;
  top:10px;
  inset-inline-start:10px;
  color:var(--muted);
  font:700 11px/1.4 ui-monospace,monospace;
}

.shop-item-info {
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:8px;
  margin:10px 0;
}

.shop-item-info h2 {
  margin:0;
  font-size:14px;
  line-height:1.5;
  overflow-wrap:anywhere;
}

.shop-item-price {
  color:var(--lime);
  font-weight:800;
  white-space:nowrap;
}

.shop-item>.button {
  width:100%;
  min-height:44px;
  padding:10px 8px;
  font-size:14px;
}

.shop-item.is-owned {
  border-color:var(--line);
}

.shop-item.is-owned .shop-item-art>svg {
  opacity:.35;
  filter:grayscale(.85);
}

.shop-item.is-owned .shop-item-info {
  color:var(--muted);
}

.shop-item.is-owned .shop-item-price {
  color:var(--muted);
}

.shop-item.is-owned>.button:disabled {
  opacity:1;
  color:var(--muted);
  background:var(--panel-2);
  border-color:var(--line);
  cursor:default;
}

.item-shop-coming {
  display:grid;
  place-items:center;
  min-height:260px;
  color:var(--muted);
  font-size:20px;
  font-weight:700;
}

.item-shop-grid[hidden],.item-shop-coming[hidden] {
  display:none;
}

.item-shop button:disabled {
  opacity:.6;
  cursor:not-allowed;
}

.item-inventory-dialog,.item-purchase-dialog {
  width:min(850px,calc(100% - 24px));
  max-height:calc(100dvh - 32px);
  padding:24px;
  box-sizing:border-box;
  border:1px solid var(--line);
  border-radius:20px;
  color:var(--paper);
  background:var(--panel);
  overflow:auto;
  overscroll-behavior:contain;
  box-shadow:0 20px 80px #0008;
}

.item-inventory-dialog::backdrop,.item-purchase-dialog::backdrop {
  background:#000b;
  backdrop-filter:blur(6px);
}

.item-dialog-header {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}

.item-dialog-header h2 {
  margin:0;
  font-size:24px;
}

.item-dialog-header button {
  width:44px;
  height:44px;
  font-size:28px;
  line-height:1;
  background:var(--input);
  color:var(--paper);
  border:1px solid var(--line);
  border-radius:50%;
  cursor:pointer;
}

.item-equipment-layout {
  display:grid;
  grid-template-columns:210px minmax(0,1fr);
  gap:24px;
  margin:20px 0;
}

.equipped-slot {
  display:flex;
  align-items:center;
  flex-direction:column;
  gap:16px;
  padding:20px 14px;
  border:1px solid var(--pink);
  border-radius:12px;
  background:var(--input);
  text-align:center;
}

.equipment-art {
  position:relative;
  width:148px;
  height:148px;
  display:grid;
  place-items:center;
  border:1px solid var(--line);
  border-radius:8px;
  background:var(--panel);
}

.equipment-art svg {
  width:128px;
  height:128px;
  image-rendering:pixelated;
}

.equipped-slot strong {
  overflow-wrap:anywhere;
  max-width:100%;
}

.inventory-collection {
  min-width:0;
}

.inventory-slots {
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:8px;
}

.inventory-slot,.inventory-empty-slot {
  position:relative;
  display:grid;
  place-items:center;
  width:100%;
  aspect-ratio:1;
  min-height:0;
  padding:8px;
  box-sizing:border-box;
  border:1px solid var(--line);
  border-radius:6px;
  background:var(--input);
}

.inventory-slot {
  color:var(--paper);
  cursor:pointer;
}

.inventory-slot svg {
  width:80%;
  height:80%;
  image-rendering:pixelated;
}

.inventory-slot[aria-pressed=true] {
  border-color:var(--pink);
  box-shadow:inset 0 0 0 1px var(--pink);
}

.item-equipped-mark {
  position:absolute;
  inset-block-start:5px;
  inset-inline-end:5px;
  display:grid;
  place-items:center;
  width:24px;
  height:24px;
  border-radius:3px;
  background:var(--pink);
  color:var(--on-pink);
  font:950 18px/1 ui-monospace,monospace;
  box-shadow:0 1px 5px #0006;
}

.inventory-detail [data-item-equip]:disabled {
  opacity:1;
  color:var(--on-pink);
  background:var(--pink);
  border-color:var(--pink);
}

.inventory-detail .item-equipped-mark {
  position:static;
  box-shadow:none;
}

.inventory-detail {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  padding-top:18px;
  margin-top:18px;
  border-top:1px solid var(--line);
}

.inventory-detail strong {
  overflow-wrap:anywhere;
}

.inventory-empty {
  display:flex;
  flex-direction:column;
  gap:24px;
  align-items:center;
  justify-content:center;
  min-height:260px;
  text-align:center;
  color:var(--muted);
}

.item-inventory-shop {
  display:inline-block;
  min-height:44px;
  padding:12px 0;
  color:var(--lime);
}

.item-purchase-dialog {
  max-width:480px;
}

.purchase-art {
  display:flex;
  justify-content:center;
  margin:24px 0;
}

.purchase-art svg {
  width:140px;
  height:140px;
  image-rendering:pixelated;
}

.purchase-actions {
  display:flex;
  gap:12px;
  justify-content:flex-end;
  margin-top:24px;
}

.item-purchase-dialog p {
  color:var(--muted);
  line-height:1.6;
}

.item-purchase-dialog .form-status {
  color:var(--paper);
}

.cursor-option:has(input:disabled) {
  opacity:.45;
}

.cursor-option:has(input:disabled):hover {
  border-color:var(--line);
  cursor:not-allowed;
}

.item-shop :focus-visible,.item-inventory-dialog :focus-visible,.item-purchase-dialog :focus-visible,.account-items-button:focus-visible {
  outline:2px solid var(--lime);
  outline-offset:3px;
}

.item-inventory-dialog button:disabled,.item-purchase-dialog button:disabled {
  opacity:.6;
  cursor:not-allowed;
}

@media(min-width:1280px) {
  .item-shop {
    display:grid;
    grid-template-columns:minmax(0,1fr) auto;
  }
  .item-shop> * {
    grid-column:1 / -1;
    min-width:0;
  }
  .item-shop-wallet {
    grid-column:2;
    grid-row:2;
    margin-bottom:0;
    padding-inline-start:24px;
    padding-bottom:16px;
    border-bottom:1px solid var(--line);
  }
  .item-shop-filters {
    grid-column:1;
    grid-row:2;
    align-items:center;
    flex-wrap:wrap;
  }
}

@media(max-width:1000px) {
  .item-shop-grid {
    grid-template-columns:repeat(4,minmax(0,1fr));
  }
}

@media(max-width:760px) {
  .account-overview,.auth-dialog .account-overview {
    grid-template-columns:auto minmax(0,1fr);
  }
  .account-items-button {
    grid-column:2;
    grid-row:2;
    justify-self:start;
    margin-top:12px;
  }
  .account-items-button svg {
    width:20px;
    height:20px;
  }
  .item-shop-heading.page-title-banner {
    align-items:flex-start;
    min-height:0;
    padding:160px 18px 28px;
  }
  .item-shop-heading-copy {
    width:100%;
  }
  .item-shop-wallet {
    justify-content:flex-start;
    max-width:none;
  }
  .item-shop-wallet>span {
    text-align:start;
  }
  .item-shop-grid {
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:10px;
  }
  .shop-item-art {
    height:90px;
  }
  .shop-item-art>svg {
    width:60px;
    height:60px;
  }
  .shop-item-info {
    flex-direction:column;
  }
  .item-inventory-dialog,.item-purchase-dialog {
    padding:18px 16px;
  }
  .item-equipment-layout {
    grid-template-columns:1fr;
    gap:18px;
  }
  .equipped-slot {
    display:grid;
    grid-template-columns:96px minmax(0,1fr);
    gap:8px 16px;
    text-align:start;
    padding:14px;
  }
  .equipped-slot .equipment-art {
    grid-column:1;
    grid-row:1/span 2;
    width:96px;
    height:96px;
  }
  .equipment-art svg {
    width:80px;
    height:80px;
  }
  .equipped-slot strong,.equipped-slot button {
    grid-column:2;
  }
  .inventory-slots {
    grid-template-columns:repeat(3,minmax(0,1fr));
  }
  .inventory-detail {
    gap:10px;
  }
  .item-inventory-hint {
    font-size:13px;
  }
}

@media(prefers-reduced-motion:reduce) {
  .item-inventory-dialog::backdrop,.item-purchase-dialog::backdrop {
    backdrop-filter:none;
  }
}

.inventory-empty-slot {
  opacity:.5;
}

@media (max-width:760px) {
  .item-shop-filters {
    flex-wrap:wrap;
  }
  .item-shop-filters button {
    white-space:nowrap;
    padding:10px 14px;
  }
  .shop-item>.button {
    padding:10px 8px;
    font-size:12px;
  }
  .equipped-slot .button {
    white-space:nowrap;
    padding:8px 10px;
    font-size:12px;
  }
  .inventory-empty-slot:nth-child(n+7) {
    display:none;
  }
}
