.shop-dialog { width: min(620px, calc(100vw - 24px)); max-height: min(80vh, 720px); box-sizing: border-box; border: 1px solid #b79b75; border-radius: 22px; padding: 22px; background: #f7ecd5; color: #574835; box-shadow: 0 20px 70px #4a392c66; overflow-y: auto; }
.shop-dialog::backdrop { background: #382d25a8; }
.shop-header { display: flex; justify-content: space-between; gap: 18px; align-items: flex-start; }
.shop-header h2 { margin: 0; font-size: 1.45rem; }
.shop-header p { margin: 5px 0 0; color: #806f59; font-size: .9rem; }
.shop-close { border: 0; background: #e7d8bd; color: #574835; border-radius: 50%; width: 44px; height: 44px; font-size: 1.7rem; line-height: 1; cursor: pointer; flex: none; }
.shop-summary { margin: 18px 0 12px; padding: 12px 14px; background: #eadabe; border-radius: 12px; font-weight: 700; }
.shop-error { color: #9c3531; margin: 10px 0; }
.shop-items { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.shop-item { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 14px; border: 1px solid #dfcbae; border-radius: 13px; background: #fff9ec; }
.shop-item strong { font-size: 1rem; }
.shop-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 0 0 14px;
  padding: 0;
  border: 0;
}
.shop-categories span {
  display: grid;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 9px;
  color: #5c4936;
  background: #ecdfc7;
  cursor: pointer;
  font-weight: 650;
}
.shop-categories input:checked + span { background: #604c38; color: #fff9eb; }
.shop-categories input:focus-visible + span { outline: 2px solid #413b23; outline-offset: 2px; }
.shop-item-description, .shop-item-info { margin: 0; color: #6a5846; font-size: .9rem; line-height: 1.4; }
.shop-item-info { font-weight: 600; }
.shop-item button { margin-top: auto; min-height: 44px; width: 100%; padding: 8px 10px; border: 0; border-radius: 9px; color: #fff9eb; background: #806246; font: inherit; font-weight: 700; cursor: pointer; }
.shop-item button:disabled { background: #dbcfbb; color: #635747; cursor: default; }
.shop-unequip { margin-top: 12px; min-height: 44px; padding: 6px 12px; border: 1px solid #c5b294; border-radius: 9px; background: transparent; color: #604c38; cursor: pointer; }
.shop-unequip:disabled { opacity: .55; cursor: default; }
.shop-item-preview {
  position: relative;
  display: grid;
  place-items: center;
  align-self: stretch;
  height: 86px;
  border: 1px solid #e6d8c1;
  border-radius: 9px;
  background: radial-gradient(ellipse at 48% 78%, #dbc3a165, transparent 61%), #f3e6d1;
  overflow: hidden;
}
.shop-item-preview img {
  width: 100%;
  height: 100%;
  padding: 8px;
  object-fit: contain;
  filter: drop-shadow(2px 3px 2px #614a3d40);
}
.shop-item-preview-mark { color: #96795d; font-size: 1.6rem; }
.shop-item-stats {
  align-self: stretch;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  margin: 0;
  color: #59483b;
  font-size: .78rem;
}
.shop-item-stats > div { min-width: 0; padding: 4px 6px; border-radius: 5px; background: #f2e9d8; }
.shop-item-stats dt { color: #6a584a; overflow-wrap: anywhere; }
.shop-item-stats dd { margin: 1px 0 0; font-weight: 680; white-space: nowrap; }
@media (max-width: 500px) {
  .shop-dialog { max-height: 85dvh; padding: 16px; }
  .shop-items { grid-template-columns: 1fr; }
  .shop-categories label { flex: 1 0 auto; text-align: center; }
  .shop-categories span { padding: 0 9px; }
  .shop-item { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; align-items: center; padding: 10px; }
  .shop-item-preview { grid-column: 1; grid-row: 1; height: 48px; }
  .shop-item-preview img { padding: 4px; }
  .shop-item strong { grid-column: 2; grid-row: 1; overflow-wrap: break-word; }
  .shop-item-text-only strong { grid-column: 1 / 3; }
  .shop-item p, .shop-item-stats { grid-column: 1 / -1; }
  .shop-item button { grid-column: 3; grid-row: 1; width: auto; min-width: 0; max-width: 105px; margin-top: 0; }
}

@media (min-width: 621px) {
  .hud-top { grid-template-columns: auto 1fr auto auto auto; }
  .shop-open { grid-column: 4; grid-row: 1; }
  .look-button { grid-column: 5; grid-row: 1; }
}
@media (max-width: 620px) {
  .hud-top { grid-template-columns: 1fr auto auto; }
  .shop-open { grid-area: 1 / 2; min-height: 44px; }
  .hud-top .look-button { grid-area: 1 / 3; }
  .hud-top .presence { grid-column: 3; }
}
@media (max-width: 370px) {
  .hud-top[data-ready=true] .compass-mark { display: none; }
  .hud-top[data-ready=true] h1 { font-size: 16px; }
}
.shop-status { color: #64523c; font-size: .82rem; font-weight: 700; white-space: nowrap; }
@media (min-width: 621px) { .hud-top { grid-template-columns: auto 1fr auto auto auto auto; } .shop-status { grid-column: 4; grid-row: 1; align-self: center; } .shop-open { grid-column: 5; } .look-button { grid-column: 6; } }
@media (max-width: 620px) { .shop-status { grid-column: 1; grid-row: 3; align-self: center; } }

.shop-status { width: max-content; border-radius: 16px; background: #faf4e6ed; padding: 5px 10px; }
