/* Rivens page. Tokens and shared components (tiles, cards, chips, charts, tooltip, stacked tables) come from style.css. */

/* ---------- weapon list ---------- */

/* The table sits in a card; on phones each row is its own card instead */
.list-card { padding: 0 var(--sp-3) var(--sp-2); }
.list-card thead th { background: var(--surface-1); }
table.rivens thead th { white-space: nowrap; }
table.rivens .cell-name .no-thumb { margin: 0 0.25rem; }

.dispo { display: inline-flex; align-items: baseline; gap: 0.4rem; white-space: nowrap; }
.dispo .dots { color: var(--gold); letter-spacing: 1px; font-size: 0.7em; }
.dispo .dots .off { color: var(--line); }
.dispo .val { font-family: var(--num); color: var(--muted); font-size: var(--step--1); }

/* Stats as chips: the name, then the share of expensive rivens with it */
.stat-chips { display: flex; flex-wrap: wrap; gap: var(--sp-1); }
.stat-chips .chip { color: var(--ivory); font-weight: 500; letter-spacing: 0; }
.stat-chips .chip small { font: 500 var(--step--2) var(--num); font-variant-numeric: tabular-nums; color: var(--gold-hi); }

/* ---------- one weapon ---------- */

/* Stand-in for a weapon without artwork, the size of .thumb.big */
.no-thumb.thumb.big { display: grid; place-items: center; transform: none; border: 0; background: radial-gradient(circle at 50% 35%, var(--lapis-700), var(--lapis-900)); }
.no-thumb.thumb.big::before { content: ""; width: 1.4rem; height: 1.4rem; rotate: 45deg; border: 1px solid var(--gold); box-shadow: 0 0 12px var(--gold-soft); }

/* What expensive rivens have */
.stat-tables { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(22rem, 100%), 1fr)); gap: var(--sp-5); margin-top: var(--sp-3); }
.stat-table h4, .pairs h4 { margin: 0 0 var(--sp-2); font: 600 var(--step--2)/1.3 var(--ui); letter-spacing: 0.08em; text-transform: uppercase; color: var(--gold); }
.stat-table table { font-size: var(--step--1); }
.stat-table td, .stat-table th { padding: 0.35rem 0.5rem; }
.stat-table thead th { background: var(--surface-2); }
.stat-table td:nth-child(2) { display: flex; align-items: center; gap: 0.6rem; min-width: 10rem; }
.share {
  position: relative;
  flex: 1;
  height: 8px;
  border-radius: 1px;
  background: var(--line-soft);
}
.share .bar { position: absolute; inset: 0 auto 0 0; border-radius: 1px; background: var(--chart-sell); }
.share .tick { position: absolute; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; border-radius: 1px; background: var(--ivory); box-shadow: 0 0 0 1px var(--lapis-800); }
.share-v { width: 2.6rem; text-align: right; font-family: var(--num); font-variant-numeric: tabular-nums; }
.pairs { margin-top: var(--sp-5); }

/* Listings */
.book td.price { font-weight: 600; color: var(--gold-hi); white-space: nowrap; }
.riven-name { font-weight: 500; }
/* Stats flow onto as few lines as fit */
.riven-stats { display: flex; flex-wrap: wrap; gap: 0 var(--sp-3); margin: 0.15rem 0 0; padding: 0; list-style: none; font-size: var(--step--1); line-height: 1.45; }
.riven-stats li { white-space: nowrap; }
.riven-stats .buff { color: var(--ok); }
.riven-stats .curse { color: var(--danger); }
.book td { vertical-align: top; }

/* ---------- tablet and phone ---------- */

/* Between phone and tablet the secondary list columns give way to the rest */
@media (min-width: 40.0625rem) and (max-width: 64rem) {
  table.rivens .hide-md { display: none; }
}

/* The listing tables need more room than two side by side get on a tablet: one a row until the desktop */
#weapon .books { grid-template-columns: repeat(auto-fit, minmax(min(30rem, 100%), 1fr)); }
#weapon .books > * { min-width: 0; }

@media (max-width: 40rem) {
  /* Each weapon a card: name on top, figures in two columns, the stats it wants underneath */
  .list-card { --fill: none; padding: 0; border: 0; box-shadow: none; clip-path: none; }
  table.rivens.stack tr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: var(--sp-4); cursor: pointer; }
  table.rivens.stack td:first-child, table.rivens.stack td.wanted { grid-column: 1 / -1; }
  table.rivens.stack td.wanted { display: block; min-width: 0; padding-top: var(--sp-2); text-align: left; }
  table.rivens.stack td.wanted::before { display: block; margin-bottom: var(--sp-1); }
  table.rivens .variant { font-size: var(--step--2); }

  /* Artwork beside the name, the odd last tile full width, the ranges in an even grid */
  #weapon .item-head { gap: var(--sp-3); }
  #weapon .item-head .thumb.big { width: 3.5rem; height: 3.5rem; }
  #weapon .item-head > div:nth-child(2) { flex: 1 1 calc(100% - 3.5rem - var(--sp-3)); min-width: 0; }
  #weapon .item-actions { flex-basis: 100%; }
  #weapon .tiles > div:last-child:nth-child(odd) { grid-column: 1 / -1; }
  #weapon .chips.ranges { display: grid; grid-template-columns: repeat(3, 1fr); }

  .stat-table td:nth-child(2) { min-width: 6rem; }
  .stat-table td, .stat-table th { padding: 0.35rem 0.3rem; }

  /* A listing: price and whisper on top, the riven, then its seller */
  .book table.stack tr { display: grid; grid-template-columns: 1fr auto; align-items: center; }
  .book table.stack td.price { grid-column: 1; grid-row: 1; padding: 0; font-size: var(--step-1); }
  .book table.stack td.whisper { grid-column: 2; grid-row: 1; padding: 0; }
  .book table.stack td.riven, .book table.stack td.seller { grid-column: 1 / -1; display: block; text-align: left; }
  .book table.stack td.seller { padding-top: var(--sp-1); border-top: 1px solid var(--line-soft); margin-top: var(--sp-1); }
}
