/* -------------------------------------------------------------------------
   Items — the item database.

   Only what the shared tool styles (theme.css + hero-pages.css) do not already
   cover: the card grid, one item's page, and the "who buys it" rows.
   ------------------------------------------------------------------------- */

.item-page { padding-bottom: 64px; }

.item-sort {
  padding: 7px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: var(--paper-2, rgba(255, 255, 255, .06));
  /* An opaque popup: the native list is white-on-white otherwise. */
  color: var(--text);
  color-scheme: dark;
  font-family: inherit;
  font-size: 12px;
}

.item-sort option {
  background: #0d0c12;
  color: var(--text);
}

/* ---------- the grid ---------- */

.item-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(228px, 1fr));
  gap: 8px;
  margin-top: 18px;
}

.item-card {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, .03);
  color: var(--text);
  text-decoration: none;
  transition: border-color .12s, background .12s;
}

.item-card:hover {
  border-color: rgba(255, 179, 71, .55);
  background: rgba(255, 179, 71, .07);
}

.item-card img {
  width: 64px;
  height: 48px;
  object-fit: contain;
  border-radius: 4px;
  background: rgba(0, 0, 0, .35);
}

.item-card-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.item-card-name {
  font-size: 13px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.item-card-meta {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .03em;
  color: var(--muted);
}

.item-badge {
  padding: 1px 6px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

.item-badge--neutral { color: var(--amber); border-color: rgba(255, 179, 71, .5); }
.item-badge--consumable { color: var(--live); border-color: rgba(90, 200, 140, .45); }
.item-badge--component { color: var(--dim); }
.item-badge--common { color: var(--text-soft, var(--muted)); }
.item-badge--rare { color: #6cb6ff; border-color: rgba(108, 182, 255, .45); }
.item-badge--epic { color: #c9a0ff; border-color: rgba(201, 160, 255, .45); }
.item-badge--artifact { color: var(--copper); border-color: rgba(194, 106, 46, .55); }
.item-badge--secret_shop { color: var(--bad); border-color: rgba(220, 90, 90, .5); }

/* ---------- one item ---------- */

.item-detail { margin-top: 22px; }

.item-back {
  display: inline-block;
  margin-bottom: 14px;
  font-size: 12px;
  color: var(--muted);
  text-decoration: none;
}

.item-back:hover { color: var(--amber); }

.item-hero {
  display: grid;
  grid-template-columns: 128px minmax(0, 1fr);
  align-items: center;
  gap: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.item-portrait {
  width: 128px;
  height: 96px;
  object-fit: contain;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: rgba(0, 0, 0, .4);
}

.item-hero-text .display { margin: 2px 0 0; }

.item-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.item-cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.item-block {
  min-width: 0;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, .025);
}

.item-block h3 {
  margin: 0 0 10px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--muted);
}

.item-block ul {
  margin: 0;
  padding-left: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.item-block li {
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-soft, var(--muted));
}

.item-block--attrib li { color: var(--text); }

.item-block-note {
  margin: -4px 0 10px;
  font-size: 11.5px;
  color: var(--dim);
}

.item-lore {
  margin: 0;
  font-size: 12.5px;
  font-style: italic;
  line-height: 1.6;
  color: var(--muted);
}

.item-mini-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.item-mini {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 3px 9px 3px 4px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: rgba(0, 0, 0, .22);
  color: var(--text);
  font-size: 11.5px;
  text-decoration: none;
  transition: border-color .12s, background .12s;
}

.item-mini:hover {
  border-color: rgba(255, 179, 71, .6);
  background: rgba(255, 179, 71, .1);
}

.item-mini img {
  width: 40px;
  height: 30px;
  object-fit: contain;
  border-radius: 3px;
  background: rgba(0, 0, 0, .3);
}

/* ---------- how it is beaten ---------- */

.item-block--beat li { color: var(--text); }

.item-block--beat .item-block-note { margin: 12px 0 0; }

/* A full-width block that follows the two-column guide pair. */
.item-block--wide { margin-top: 14px; }

.counter-items {
  display: flex;
  flex-direction: column;
}

.counter-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.counter-item:first-child { border-top: 0; padding-top: 0; }

.counter-why {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--muted);
}

/* ---------- who buys it ---------- */

.buyers { display: flex; flex-direction: column; }

.buyer-row {
  display: grid;
  grid-template-columns: 22px 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  border-top: 1px solid var(--line);
  color: var(--text);
  text-decoration: none;
}

.buyer-row:first-child { border-top: 0; }

.buyer-rank {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--dim);
}

.buyer-row img {
  width: 44px;
  height: 25px;
  object-fit: cover;
  border-radius: 4px;
  background: rgba(255, 255, 255, .06);
}

.buyer-name {
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.buyer-name small {
  display: block;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .04em;
  color: var(--dim);
}

.buyer-row:hover .buyer-name { color: var(--amber); }

.buyer-count {
  font-family: var(--font-mono);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: var(--amber);
}

.item-back-row { margin-top: 14px; }

@media (max-width: 560px) {
  .item-grid { grid-template-columns: 1fr; }
  .item-hero { grid-template-columns: 84px minmax(0, 1fr); gap: 12px; }
  .item-portrait { width: 84px; height: 63px; }
  .item-cols { grid-template-columns: 1fr; }
  .buyer-row { grid-template-columns: 16px 38px minmax(0, 1fr) auto; gap: 8px; }
  .buyer-row img { width: 38px; height: 22px; }
}
