/* Profile page. */

/* Profile page */
.profile-page {
  display: flex;
  flex-direction: column;
  gap: var(--gutter);
}

.profile-label {
  color: var(--ash);
  font-size: var(--text-sm);
}

.profile-amount {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.6rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.profile-amount .coin {
  width: 24px;
  height: 24px;
}

.profile-sub {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--ash);
  font-size: var(--text-sm);
  font-variant-numeric: tabular-nums;
}

.profile-sub .coin {
  width: 15px;
  height: 15px;
}

/* The top row (after caser.gg's profile): the player, the best drop, what was withdrawn; all the same height */
.profile-top {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1.1fr) minmax(0, 0.85fr);
  gap: var(--gutter);
}

.profile-top > .panel {
  min-height: 300px;
}

/* The player: avatar, name and actions; the balance with Deposit; three counts as chips. Its parts share hairlines. */
.profile-card {
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}

.profile-head {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
}

.profile-avatar {
  width: 68px;
  height: 68px;
  border-radius: var(--radius);
  box-shadow: 0 0 0 2px var(--ember);
}

.profile-avatar .avatar-initial {
  font-size: 1.9rem;
}

.profile-identity {
  flex: 1;
  min-width: 0;
}

.profile-name {
  margin-bottom: 4px;
  overflow: hidden;
  font-size: 1.5rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-link {
  color: var(--ash);
  font-size: var(--text-sm);
  text-decoration: none;
}

.profile-link:hover {
  color: var(--ember-light);
}

.profile-actions {
  display: flex;
  align-self: flex-start;
  gap: 6px;
}

.profile-actions .icon-button {
  height: var(--control-height);
}

.profile-actions .icon-button[aria-expanded="true"] {
  background: var(--tint-ember);
  border-color: var(--ember);
  color: var(--ember-light);
}

.profile-balance {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  border-top: var(--border);
  background: color-mix(in srgb, var(--soot) 55%, transparent);
}

.profile-balance > div {
  display: grid;
  gap: 4px;
}

.profile-balance .profile-amount {
  color: var(--ember-light);
}

.profile-deposit {
  gap: 10px;
  min-height: 48px;
  padding: 0 22px;
  font-size: 1rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.profile-deposit span {
  font-size: 1.3rem;
  line-height: 1;
}

.profile-chips {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: auto 0 0;
  border-top: var(--border);
}

.profile-chips > div {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px 8px;
}

.profile-chips > div + div {
  border-left: var(--border);
}

.profile-chips dt {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--ash);
  font-size: var(--text-xs);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.profile-chips dt .icon {
  width: 18px;
  height: 18px;
  color: var(--ember-light);
}

.profile-chips dd {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

/* The best drop: the label on top, the name and price at the bottom left, the skin large on the right over a glow
   in its rarity colour, a thin rarity bar along the bottom */
.best-drop-box {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 20px;
  overflow: hidden;
  box-shadow: inset 0 -3px 0 var(--rarity, var(--iron-lighter)), var(--shadow);
}

.best-drop-box::before {
  content: "";
  position: absolute;
  top: 10%;
  right: -10%;
  width: 70%;
  height: 80%;
  border-radius: 50%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--rarity, var(--ember)) 30%, transparent), transparent);
  pointer-events: none;
}

.best-drop {
  position: relative;
  flex: 1;
  display: flex;
  align-items: flex-end;
}

.best-drop-image {
  position: absolute;
  top: 0;
  right: -4%;
  width: 72%;
  height: 82%;
  object-fit: contain;
  filter: drop-shadow(0 10px 16px rgba(0, 0, 0, 0.6));
}

.best-drop-info {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 62%;
  min-width: 0;
}

.best-drop-name {
  font-size: 1.15rem;
  font-weight: 800;
  line-height: 1.25;
}

.best-drop-info .skin-price {
  font-size: 1.05rem;
}

.best-drop-box .profile-note {
  margin-top: auto;
}

/* Withdrawn: the total sent to Steam, its count, a large faint Steam mark */
.profile-withdrawn {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 20px;
  overflow: hidden;
}

.profile-withdrawn .profile-sub {
  margin-top: auto;
  font-size: var(--text-md);
  color: var(--white-hot);
}

.profile-withdrawn-mark {
  position: absolute;
  right: -50px;
  bottom: -50px;
  width: 250px;
  height: 250px;
  fill: none;
  stroke: rgba(255, 236, 222, 0.11);
  stroke-width: 1.2;
  pointer-events: none;
}

/* Settings, opened with the gear: the trade link and provably fair */
.profile-settings {
  padding: 16px;
}

.profile-extras {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.profile-box {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 10px;
  padding: 16px;
  background: var(--iron-light);
  border: var(--border);
  border-radius: var(--radius);
}

.profile-box h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
}

.profile-box .field:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* A small link in a box's title: "How it works", "Find yours" */
.box-tag-link {
  margin-left: auto;
  padding: 2px 8px;
  background: var(--soot);
  border: 1px solid transparent;
  border-radius: var(--radius-inner);
  color: var(--ember-light);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  text-decoration: none;
}

.box-tag-link:hover {
  border-color: var(--ember-dark);
}

.profile-note {
  margin: 0;
  color: var(--ash);
  font-size: 0.85rem;
}

/* My items on the profile have room for more columns */
.profile-tabs-panel .skin-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.profile-tabs-panel .catalog-scroll {
  max-height: none;
  overflow: visible;
}

/* A skin on its way to Steam: the card goes quiet, a dashed edge says "in transit",
   and a label with a slowly pulsing dot sits over the picture */
.skin-card-withdrawing {
  border-style: dashed;
  border-color: var(--steel);
}

.skin-card-withdrawing > :not(.skin-withdrawing-label) {
  opacity: 0.4;
  filter: grayscale(1);
}

.skin-withdrawing-label {
  position: absolute;
  top: 34%;
  left: 50%;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 7px;
  transform: translate(-50%, -50%);
  padding: 5px 12px 5px 10px;
  color: var(--white-hot);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  background: rgba(18, 16, 17, 0.9);
  border: 1px solid var(--steel);
  border-radius: var(--radius-inner);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.45);
}

.skin-withdrawing-label::before {
  content: "";
  width: 7px;
  height: 7px;
  background: var(--ember-light);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--ember);
  animation: transit-pulse 1.6s ease-in-out infinite;
}

@keyframes transit-pulse {
  50% { opacity: 0.3; }
}

/* Withdrawals tab: name and price on the left, the status on the right.
   Rows without a won/lost class are still on their way. */
#profile-withdrawals-list .history-row {
  /* Fixed columns, so every price and status sits on the same line from row to row */
  grid-template-columns: minmax(0, 1fr) 120px 340px;
  gap: 24px;
  padding: 16px 20px;
  border-left-color: var(--ember);
  background: linear-gradient(90deg, rgba(255, 107, 26, 0.08), var(--iron-light) 35%);
}

#profile-withdrawals-list .history-row-won {
  border-left-color: var(--success);
  background: linear-gradient(90deg, rgba(31, 138, 76, 0.1), var(--iron-light) 35%);
}

#profile-withdrawals-list .history-row-lost {
  border-left-color: var(--danger);
  background: linear-gradient(90deg, rgba(179, 54, 43, 0.1), var(--iron-light) 35%);
}

#profile-withdrawals-list .history-row > span:empty {
  display: none;
}

#profile-withdrawals-list .history-skin-name {
  overflow: hidden;
  font-size: var(--text-md);
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#profile-withdrawals-list .skin-price {
  justify-self: end;
  font-size: var(--text-md);
}

#profile-withdrawals-list .skin-price .coin {
  width: 20px;
  height: 20px;
}

.withdrawal-status {
  color: var(--ember-light);
}

.history-row-won .withdrawal-status {
  color: var(--success-text);
}

.history-row-lost .withdrawal-status {
  color: var(--danger-text);
}

.withdrawal-reason {
  max-width: 320px;
  color: var(--white-hot);
  font-size: var(--text-xs);
  text-align: right;
  text-wrap: pretty;
}


/* Withdraw and Sell side by side under an item */
.skin-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-top: 8px;
}

.skin-actions .skin-action {
  margin-top: 0;
  padding: 7px 4px;
}

/* A sold case drop: grey and quiet, like a line of history, with what it sold for */
.skin-card-sold {
  border-color: var(--iron-lighter);
}

.skin-card-sold > :not(.skin-sold-label) {
  opacity: 0.35;
  filter: grayscale(1);
}

.skin-sold-label {
  position: absolute;
  top: 34%;
  left: 50%;
  z-index: 2;
  padding: 3px 10px;
  color: var(--ash);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--iron);
  border: var(--border);
  border-radius: var(--radius-inner);
  transform: translate(-50%, -50%);
}

/* Sell all above the Available items */
.profile-available-tools {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 12px;
}

.profile-sell-all {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.profile-sell-all .coin {
  width: 18px;
  height: 18px;
}
