/*
 * Boxes, laid out the way the catalogue they came from lays them out.
 *
 * A shelf of cards with the picture, the name and the price. Inside a box, a
 * strip that rolls past a marker, the controls under it, and then every item
 * with its share of the ten million tickets printed in the corner. The rarity
 * of an item is a colour and nothing else: it is set once per tile as a custom
 * property, so a new rarity is a line in the catalogue and nothing here
 * changes.
 */

.box-shelf-panel,
.box-panel,
.box-drops-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 12px;
}

.box-shelf-panel[hidden],
.box-panel[hidden] {
  display: none;
}

.ed-search {
  height: 30px;
  min-width: 190px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #0a1120;
  color: var(--text);
  font: inherit;
  font-size: 12px;
}

.ed-search:focus {
  outline: none;
  border-color: var(--line-2);
}

/* ------------------------------------------------------------- the shelf */

/*
 * A card is the picture, the name and a violet pill with the price. No frame
 * around it: the artwork is the frame. Resting the pointer on a card turns the
 * pill into an invitation, which is the one piece of motion the shelf has.
 */

.ed-shelf {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 26px 18px;
  margin: 0;
  padding: 18px 16px 6px;
  list-style: none;
}

.ed-card {
  display: flex;
}

.ed-card-open {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  color: var(--text);
  font: inherit;
  cursor: pointer;
}

.ed-card-art {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 1 / 1;
  transition: transform 180ms ease;
}

.ed-card-art img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 10px 22px rgba(0, 0, 0, 0.55));
}

.ed-card-open:hover .ed-card-art {
  transform: translateY(-4px) scale(1.04);
}

.ed-card-name {
  font-size: 13px;
  font-weight: 500;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.ed-card-price {
  display: grid;
  place-items: center;
  width: 100%;
  height: 32px;
  padding: 0 10px;
  border-radius: 9px;
  background: var(--gold);
  color: var(--on-lime);
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  overflow: hidden;
  transition: background-color 160ms ease;
}

.ed-card-price::after {
  content: attr(data-open);
  grid-area: 1 / 1;
  transform: translateY(22px);
  white-space: nowrap;
  font-size: 12px;
}

.ed-card-euros {
  grid-area: 1 / 1;
}

.ed-card-euros,
.ed-card-price::after {
  transition: transform 180ms ease;
}

.ed-card-open:hover .ed-card-price {
  background: var(--gold-soft);
}

.ed-card-open:hover .ed-card-euros {
  transform: translateY(-22px);
}

.ed-card-open:hover .ed-card-price::after {
  transform: translateY(0);
}

.ed-card-eth {
  font-size: 11px;
  color: var(--text-faint);
}

/* ------------------------------------------------------------- the pages */

.ed-pager {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 6px;
  padding: 10px 16px 18px;
}

.ed-page {
  min-width: 32px;
  height: 32px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: transparent;
  color: var(--text-dim);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  transition:
    background-color 140ms ease,
    color 140ms ease,
    border-color 140ms ease;
}

.ed-page:hover:not(:disabled) {
  color: #fff;
  border-color: var(--gold);
}

.ed-page.is-on {
  background: var(--lime);
  border-color: var(--lime-dark);
  color: var(--on-lime);
  font-weight: 600;
}

.ed-page:disabled {
  opacity: 0.35;
  cursor: default;
}

.ed-gap {
  color: var(--text-faint);
  padding: 0 2px;
}

/* --------------------------------------------------------------- the box */

.ed-head {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.box-back {
  border: 1px solid var(--line-2);
  border-radius: 6px;
  background: transparent;
  color: var(--text-dim);
  font: inherit;
  font-size: 12px;
  padding: 6px 10px;
  cursor: pointer;
}

.box-back:hover {
  color: var(--text);
  border-color: var(--gold-dark);
}

.ed-head-art {
  width: 56px;
  height: 56px;
  object-fit: contain;
}

.ed-head-text {
  display: flex;
  flex-direction: column;
}

.ed-head-name {
  font-family: var(--display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.ed-head-sub {
  font-size: 12px;
  color: var(--text-faint);
}

.ed-head-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  margin-left: auto;
  font-size: 12px;
  color: var(--text-dim);
}

/* ------------------------------------------------------------- the strip */

.ed-strip {
  position: relative;
  overflow: hidden;
  height: 178px;
  margin: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: radial-gradient(70% 120% at 50% 50%, #16223a, #070c15);
}

.ed-track {
  display: flex;
  gap: 8px;
  align-items: center;
  height: 100%;
  margin: 0;
  padding: 0 8px;
  list-style: none;
  will-change: transform;
}

.ed-tile {
  position: relative;
  flex: none;
  width: 132px;
  height: 152px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 10px 8px 8px;
  border: 1px solid color-mix(in srgb, var(--tier) 40%, var(--line));
  border-radius: 8px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--tier) 18%, #0b1424), #0b1424);
  opacity: 0.92;
  overflow: hidden;
}

.ed-tile-bar,
.ed-item-bar {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 3px;
  background: var(--tier);
}

.ed-tile img {
  width: 70px;
  height: 70px;
  object-fit: contain;
}

.ed-tile-name {
  width: 100%;
  font-size: 11px;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-dim);
}

.ed-tile-value {
  font-size: 12px;
  font-weight: 600;
  color: var(--gold);
}

.ed-track.is-done .ed-tile.is-winner {
  opacity: 1;
  box-shadow: 0 0 0 2px var(--tier);
}

.ed-marker {
  position: absolute;
  left: 50%;
  top: 4px;
  bottom: 4px;
  width: 2px;
  background: var(--gold);
  box-shadow: 0 0 12px rgba(245, 185, 66, 0.6);
  pointer-events: none;
}

/* ---------------------------------------------------------- the controls */

.ed-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 0 14px 12px;
}

.ed-buy {
  min-width: 170px;
  height: 42px;
  font-size: 15px;
}

.ed-eth {
  font-size: 12px;
  color: var(--text-faint);
}

.box-note {
  margin-left: auto;
  font-size: 12px;
  color: var(--text-faint);
}

.ed-warning {
  margin: 0 14px 12px;
  padding: 10px 12px;
  border: 1px solid #6b2230;
  border-radius: 6px;
  background: #1b0f14;
  color: #f7a2a2;
  font-size: 12px;
}

/* ---------------------------------------------------------- the contents */

.ed-contents {
  padding: 0 14px 14px;
}

.ed-contents h3 {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 0 0 10px;
  font-family: var(--display);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.ed-contents-count {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--gold);
}

.ed-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ed-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 14px 8px 10px;
  border: 1px solid color-mix(in srgb, var(--tier) 34%, var(--line));
  border-radius: 8px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--tier) 14%, #0b1424), #0b1424);
  overflow: hidden;
}

.ed-item-chance {
  position: absolute;
  right: 8px;
  top: 7px;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-dim);
}

.ed-item img {
  width: 72px;
  height: 72px;
  object-fit: contain;
}

.ed-item-name {
  width: 100%;
  font-size: 11px;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
}

.ed-item-value {
  font-size: 12px;
  font-weight: 600;
  color: var(--gold);
}

/* ------------------------------------------------------------ the drops */

.ed-drops {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 12px 14px;
  list-style: none;
}

.ed-drop {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px 5px 6px;
  border: 1px solid color-mix(in srgb, var(--tier) 40%, var(--line));
  border-radius: 8px;
  background: #0b1424;
}

.ed-drop img {
  width: 30px;
  height: 30px;
  object-fit: contain;
}

.ed-drop-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  max-width: 130px;
}

.ed-drop-name {
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-dim);
}

.ed-drop-value {
  font-size: 11px;
  font-weight: 600;
  color: var(--gold);
}

/* ------------------------------------------------------- the fairness */

.box-history {
  margin: 10px 0;
  padding: 0;
  list-style: none;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
}

.box-history li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 90px 90px;
  gap: 8px;
  align-items: center;
  padding: 7px 10px;
  border-bottom: 1px solid var(--line);
  background: #0b1424;
  font-size: 12px;
}

.box-history li:last-child {
  border-bottom: 0;
}

.box-history li span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 720px) {
  .ed-shelf {
    grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
    gap: 18px 12px;
  }

  .ed-grid {
    grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  }

  .ed-search {
    min-width: 0;
    width: 100%;
  }
}

/* ------------------------------------------------------------ the labels */

/*
 * A box can be new, hot, freshly updated, featured or a streamer's. The
 * catalogue says which; the corner of the artwork says it to the player, and
 * the row above the shelf turns each one into a filter.
 */

.ed-tag {
  position: absolute;
  left: 0;
  top: 0;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--gold);
  color: var(--on-lime);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  pointer-events: none;
}

.ed-tag[data-tag='hot'] {
  background: #d8352a;
}

.ed-tag[data-tag='new'] {
  background: #1f9d55;
}

.ed-tag[data-tag='updated'] {
  background: #1f6fd8;
}

.ed-tag[data-tag='streamer'] {
  background: #111827;
  border: 1px solid var(--gold);
}

.ed-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 16px 0;
}

.ed-chip {
  height: 28px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: transparent;
  color: var(--text-dim);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  transition:
    background-color 140ms ease,
    color 140ms ease,
    border-color 140ms ease;
}

.ed-chip:hover {
  color: #fff;
  border-color: var(--gold);
}

.ed-chip.is-on {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--on-lime);
  font-weight: 600;
}

/* The dollar reading, which sits under every ether figure. */
.ed-tile-usd,
.ed-item-usd,
.ed-drop-usd {
  font-size: 10px;
  color: var(--text-faint);
}

.ed-item-value,
.ed-tile-value {
  font-size: 12px;
  font-weight: 600;
  color: var(--gold);
}
