/* CrateMarket 1.1.29 R29 — collision-safe discounted crate prices. */

/*
  Production conveyor recycling requires a 154px card width. R28's 222px
  height left a zero-height label track on seven-rarity discount cards, so R29
  adds vertical room without changing the recycling width: 58 icon + 58 rates
  + a real two-line label track + 48 prices + 20 line badge. The conveyor and
  belt move down by the same 28px, preserving their original relationship.
*/
html.cm-ui-refresh.cm-ui-page-game .cm-game-conveyor {
  height: 314px !important;
  min-height: 314px !important;
}

html.cm-ui-refresh.cm-ui-page-game .cm-game-conveyor .moving-crate {
  width: 154px !important;
  height: 250px !important;
  min-height: 250px !important;
  grid-template-rows: auto auto minmax(28px, 1fr) auto auto !important;
}

html.cm-ui-refresh.cm-ui-page-game .cm-game-conveyor .moving-crate.cm-r29-discount-card {
  width: 154px !important;
  height: 250px !important;
  min-height: 250px !important;
  grid-template-rows: 58px 58px minmax(28px, 1fr) 48px 20px !important;
  gap: 4px !important;
  padding: 10px !important;
}

html.cm-ui-refresh.cm-ui-page-game .cm-game-conveyor .moving-crate.cm-r29-discount-card .crate-icon {
  width: 58px !important;
  height: 58px !important;
  margin: 0 auto !important;
  border-radius: 13px;
  font-size: 1.75rem !important;
}

html.cm-ui-refresh.cm-ui-page-game .cm-game-conveyor .moving-crate.cm-r29-discount-card .moving-rate-grid {
  width: 100%;
  height: 58px;
  min-height: 0;
  max-height: 58px;
  gap: 2px;
  align-content: center;
  overflow: hidden;
}

html.cm-ui-refresh.cm-ui-page-game .cm-game-conveyor .moving-crate.cm-r29-discount-card .moving-rate {
  padding: 1px 2px;
  font-size: .52rem;
  line-height: 1.05;
}

html.cm-ui-refresh.cm-ui-page-game .cm-game-conveyor .moving-crate.cm-r29-discount-card .crate-label {
  display: -webkit-box;
  min-height: 0;
  align-self: center;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  line-height: 1.15;
  text-overflow: ellipsis;
}

html.cm-ui-refresh.cm-ui-page-game .cm-game-conveyor .moving-crate.cm-r29-discount-card .line-badge {
  align-self: center;
  max-height: 20px;
  margin: 0;
}

html.cm-ui-refresh.cm-ui-page-game .cm-game-conveyor .crate-cost.cm-r29-discount-price-host {
  display: block !important;
  box-sizing: border-box;
  width: 100% !important;
  height: 48px;
  min-height: 48px;
  max-width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  white-space: normal !important;
}

.cm-r29-price-comparison {
  box-sizing: border-box;
  min-width: 0;
  max-width: 100%;
  color: #f7f8ff;
  font-variant-numeric: tabular-nums;
}

html.cm-ui-refresh.cm-ui-page-game .cm-game-conveyor .cm-r29-price-comparison--conveyor {
  display: grid !important;
  width: 100%;
  height: 48px;
  grid-template-rows: 18px 28px;
  gap: 2px;
  overflow: hidden;
}

html.cm-ui-refresh.cm-ui-page-game .cm-game-conveyor .cm-r29-price-comparison--conveyor .cm-r29-price-row {
  display: grid;
  min-width: 0;
  max-width: 100%;
  justify-items: center;
  align-content: center;
  gap: 0;
  overflow: hidden;
  white-space: nowrap;
}

html.cm-ui-refresh.cm-ui-page-game .cm-game-conveyor .cm-r29-price-comparison--conveyor .cm-r29-price-caption {
  display: block;
  max-width: 100%;
  overflow: hidden;
  color: #c8cfe1;
  font-size: .48rem;
  font-weight: 950;
  line-height: 1;
  letter-spacing: .04em;
  text-overflow: clip;
  text-transform: uppercase;
  white-space: nowrap;
}

html.cm-ui-refresh.cm-ui-page-game .cm-game-conveyor .cm-r29-price-comparison--conveyor .cm-r29-price-was s {
  display: block;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  color: #b4bdd2 !important;
  font-size: .58rem !important;
  font-weight: 750;
  line-height: 1;
  text-decoration-color: #ff8e99;
  text-decoration-thickness: 2px;
  text-overflow: clip;
  white-space: nowrap;
}

html.cm-ui-refresh.cm-ui-page-game .cm-game-conveyor .cm-r29-price-comparison--conveyor .cm-r29-price-now {
  box-sizing: border-box;
  padding: 2px 4px;
  border: 1px solid rgba(255, 220, 94, .8);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(255, 221, 91, .3), rgba(255, 184, 37, .18));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.05), 0 3px 9px rgba(0,0,0,.22);
}

html.cm-ui-refresh.cm-ui-page-game .cm-game-conveyor .cm-r29-price-comparison--conveyor .cm-r29-price-now .cm-r29-price-caption {
  color: #fff0a9;
}

html.cm-ui-refresh.cm-ui-page-game .cm-game-conveyor .cm-r29-price-comparison--conveyor .cm-r29-price-now strong {
  display: block;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  color: #ffe66e !important;
  font-size: .66rem !important;
  font-weight: 950;
  line-height: 1;
  text-overflow: clip;
  text-shadow: 0 0 12px rgba(255, 214, 82, .2);
  white-space: nowrap;
}

/* R30: progression discounts keep only the current value in the highlighted row.
   The complete Was/Now/discount description remains on the semantic group. */
html.cm-ui-refresh.cm-ui-page-game .cm-game-conveyor
  .cm-r29-price-comparison--conveyor[data-price-kind="progression-discount"]
  .cm-r29-price-now {
  place-content: center;
}

/* Selected-crate details have room for full values and reflow at narrow widths. */
.selected-main .cm-r29-price-comparison--selected {
  display: inline-grid;
  width: min(100%, 25rem);
  grid-template-columns: repeat(2, minmax(0, max-content));
  align-items: stretch;
  gap: 6px;
  margin: 5px 4px;
  vertical-align: middle;
}

.selected-main .cm-r29-price-comparison--selected .cm-r29-price-row {
  display: grid;
  min-width: 0;
  justify-items: start;
  gap: 2px;
  padding: 5px 8px;
  border: 1px solid rgba(170, 179, 205, .28);
  border-radius: 9px;
  background: rgba(170, 179, 205, .07);
}

.selected-main .cm-r29-price-comparison--selected .cm-r29-price-caption {
  color: #b8c1d7;
  font-size: .62rem;
  font-weight: 950;
  line-height: 1;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.selected-main .cm-r29-price-comparison--selected s,
.selected-main .cm-r29-price-comparison--selected strong {
  max-width: 100%;
  overflow-wrap: anywhere;
  white-space: normal;
}

.selected-main .cm-r29-price-comparison--selected s {
  color: #b7bfd2;
  font-size: .8rem;
  text-decoration-color: #ff8e99;
  text-decoration-thickness: 2px;
}

.selected-main .cm-r29-price-comparison--selected .cm-r29-price-now {
  border-color: rgba(255, 220, 94, .68);
  background: linear-gradient(180deg, rgba(255, 221, 91, .2), rgba(255, 184, 37, .11));
}

.selected-main .cm-r29-price-comparison--selected .cm-r29-price-now .cm-r29-price-caption,
.selected-main .cm-r29-price-comparison--selected .cm-r29-price-now strong {
  color: #ffe66e;
}

.selected-main .cm-r29-price-comparison--selected strong {
  font-size: .95rem;
  font-weight: 950;
}

@media (max-width: 520px) {
  .selected-main .cm-r29-price-comparison--selected {
    display: grid;
    width: 100%;
    grid-template-columns: minmax(0, 1fr);
    margin-inline: 0;
  }
}
