/* The genesis market, on top of /style.css and /app.css.
   --cellpx  a portrait in the grid: 32 px at 4x, 3x on phones
   --bigpx   a portrait in the sheet: 8x, 6x on phones */

.market-page { --cellpx: 96px; --bigpx: 192px; }
@media (min-width: 700px) { .market-page { --cellpx: 128px; --bigpx: 256px; } }

/* ---------- head ---------- */
.mk-head { padding: 48px 0 24px; }
.mk-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2px;
  max-width: 900px;
  margin: 32px auto 0;
  padding: 4px;
  border: 12px solid transparent;
  border-image: var(--stone);
  background: var(--s2) padding-box;
}
.mk-stats div { padding: 10px 12px; background: var(--panel); text-align: center; }
.mk-stats div:last-child { grid-column: 1 / -1; }
.mk-stats dt { color: var(--muted); }
.mk-stats dd { margin: 4px 0 0; font-size: 24px; line-height: 1.2; color: var(--g2); overflow-wrap: anywhere; }
@media (min-width: 700px) {
  .mk-stats { grid-template-columns: repeat(5, 1fr); }
  .mk-stats div:last-child { grid-column: auto; }
}

/* ---------- tabs and filters ---------- */
.mk-body { padding: 24px 0 48px; }

.filters { display: flex; flex-wrap: wrap; align-items: end; justify-content: center; gap: 16px; margin: 28px auto 0; max-width: 900px; }
.filters .field:nth-child(1) { width: 220px; }
.filters .field:nth-child(2) { width: 110px; }
.more-filters { width: 100%; order: 5; text-align: center; }
.more-filters > summary { display: inline-block; cursor: pointer; color: var(--g2); list-style: none; }
.more-filters > summary::-webkit-details-marker { display: none; }
.more-filters > summary::before { content: ""; display: inline-block; width: 8px; height: 14px; margin-right: 10px; vertical-align: -2px; background: var(--arrow-r) 0 0 / 100% 100% no-repeat; }
.more-filters[open] > summary::before { width: 14px; height: 8px; vertical-align: 2px; background-image: var(--arrow-d); }
.traits { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px 16px; margin-top: 14px; }

.mine-bar { max-width: 900px; margin: 24px auto 0; text-align: center; }
.mine-bar p { margin: 12px 0 0; }
.mine-bar .warn { color: var(--lav); }
#mine-status:empty { display: none; }
#mine-status { max-width: 600px; margin: 16px auto 0; }

/* ---------- the grid ---------- */
.count { margin: 28px 0 12px; color: var(--muted); text-align: center; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(calc(var(--cellpx) + 20px), 1fr)); gap: 12px; margin: 0; padding: 0; list-style: none; }
.w-open {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 4px;
  width: 100%;
  padding: 10px 6px 10px;
  border: 0;
  cursor: pointer;
  background: var(--panel);
  color: var(--bone);
  font: 400 16px / 1.25 var(--body);
  box-shadow: inset 0 0 0 2px var(--s2);
}
.w-open:hover, .w-open:focus-visible { background: #241040; box-shadow: inset 0 0 0 2px var(--g2); }
.w-open img { width: var(--cellpx); height: var(--cellpx); }
.w-price { color: var(--g2); }
.w-price.none { color: var(--muted); }
.w-tag { position: absolute; top: 6px; left: 6px; padding: 0 6px; background: var(--g2); color: var(--deep); }
.empty { margin: 32px auto; color: var(--muted); text-align: center; }
.more-row { margin: 28px 0 0; text-align: center; }

/* ---------- activity ---------- */
.mk-activity { padding-top: 0; }
.mk-activity .subtitle { margin-top: 0; }
.sales { width: 100%; max-width: 900px; margin: 28px auto 0; border-collapse: collapse; border: 12px solid transparent; border-image: var(--stone); background: var(--panel) padding-box; }
.sales th, .sales td { padding: 8px 10px; text-align: left; }
.sales th { color: var(--muted); font-weight: 400; box-shadow: 0 2px 0 0 var(--s2); }
.sales .pts { color: var(--g2); }
@media (max-width: 479px) { .sales th:nth-child(3), .sales td:nth-child(3) { display: none; } }

/* ---------- one witch's sheet ---------- */
.sheet-body { display: grid; gap: 20px; }
@media (min-width: 700px) { .sheet-body { grid-template-columns: auto 1fr; align-items: start; } }
.sh-art { justify-self: center; padding: 8px; background: var(--deep); box-shadow: inset 0 0 0 2px var(--s2); }
.sh-art img { display: block; width: var(--bigpx); height: var(--bigpx); }
.sh-info { min-width: 0; }
.sh-owner { margin: 8px 0 0; color: var(--muted); }
.sh-price { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; margin: 16px 0 0; }
.sh-price b { font-size: 24px; font-weight: 400; color: var(--g2); }
.sh-price span { color: var(--muted); }
.sh-price.none { color: var(--muted); }
.sh-actions { display: flex; flex-wrap: wrap; gap: 16px; margin: 18px 4px 0; }
.sh-actions:empty { display: none; }
.sh-status { margin: 18px 0 0; }
.sh-status:empty { display: none; }
.sh-status .error { margin-top: 10px; }
.sh-traits { display: grid; grid-template-columns: auto 1fr; gap: 4px 16px; margin: 22px 0 0; padding: 12px 0 0; box-shadow: 0 -2px 0 0 var(--s2); }
.sh-traits dt { color: var(--muted); }
.sh-traits dd { margin: 0; }
.sh-traits .n { color: var(--lav2); }
.sh-sales h3 { margin: 20px 0 6px; font: 400 16px / 1.25 var(--body); color: var(--muted); }
.sh-sales ul { margin: 0; padding: 0; list-style: none; }
.sh-links { margin: 18px 0 0; }
.sheet-body > .loading, .sheet-body > .error { padding: 40px 0; text-align: center; }

.list-form { display: grid; gap: 14px; max-width: 420px; }
.split { display: grid; grid-template-columns: auto 1fr; gap: 4px 16px; margin: 0; }
.split dt { color: var(--muted); }
.split dd { margin: 0; text-align: right; }
.list-form .form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin-left: 4px; }
