/* After an open the reel turns into a row of the drops: each one a reel tile with its own Sell under it.
   Sell all and Open again stand where the Open button was (cases-view.css). */

.case-drops {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px 12px;
  margin: 0;
  padding: 20px 12px;
  list-style: none;
}

.case-drops[hidden] {
  display: none;
}

/* Read out by screen readers only: what dropped */
.case-drops-status {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* The cards come out of the reel one after another */
.case-drops.is-entering .case-drop {
  animation: case-drop-in 380ms var(--ease-out) backwards;
}

.case-drops.is-entering .case-drop:nth-child(2) { animation-delay: 50ms; }
.case-drops.is-entering .case-drop:nth-child(3) { animation-delay: 100ms; }
.case-drops.is-entering .case-drop:nth-child(4) { animation-delay: 150ms; }
.case-drops.is-entering .case-drop:nth-child(5) { animation-delay: 200ms; }
.case-drops.is-entering .case-drop:nth-child(6) { animation-delay: 250ms; }
.case-drops.is-entering .case-drop:nth-child(7) { animation-delay: 300ms; }
.case-drops.is-entering .case-drop:nth-child(8) { animation-delay: 350ms; }
.case-drops.is-entering .case-drop:nth-child(9) { animation-delay: 400ms; }
.case-drops.is-entering .case-drop:nth-child(10) { animation-delay: 450ms; }

@keyframes case-drop-in {
  from { opacity: 0; transform: translateY(12px) scale(0.94); }
}

.case-drop {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 156px;
}

.case-drop-tile {
  box-sizing: border-box;
  width: 100%;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--rarity, var(--steel)) 60%, transparent), 0 0 22px -6px var(--rarity, transparent);
}

.case-drop-sell {
  width: 100%;
  min-width: 0;
  min-height: 40px;
  padding: 0 10px;
  font-size: var(--text-sm);
  font-variant-numeric: tabular-nums;
}

.case-drop-sold {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  color: var(--success-text);
  font-size: var(--text-sm);
  font-weight: 700;
}

.case-drop.is-sold .case-drop-tile {
  opacity: 0.45;
  filter: saturate(0.4);
}

/* A lucky drop: one of the case's rarest skins (cases-results.js). It stands first in the row (owner, 2026-11-20),
   with a gold frame and a glow in its own rarity colour, a gold Sell and a small "Lucky · 1.20%" label. */
.case-drop.is-lucky {
  order: -1;
}

.case-drop.is-lucky .case-drop-tile {
  position: relative;
  background: linear-gradient(180deg, var(--iron-light) 35%, color-mix(in srgb, var(--rarity, var(--gold)) 22%, var(--iron-light)));
  border-bottom-color: var(--gold);
  box-shadow: 0 0 0 2px var(--gold), 0 0 28px -2px color-mix(in srgb, var(--rarity, var(--gold)) 80%, transparent);
}

.case-drop-lucky {
  justify-self: center;
  padding: 2px 8px;
  border-radius: var(--radius-inner);
  background: color-mix(in srgb, var(--gold) 16%, var(--soot));
  border: 1px solid color-mix(in srgb, var(--gold) 60%, transparent);
  color: var(--gold);
  font-size: var(--text-xs);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.case-drop.is-lucky .case-drop-sell {
  background: linear-gradient(180deg, var(--gold), var(--ember-light));
  border-color: var(--gold);
  color: var(--soot);
  font-weight: 700;
}

.case-drop.is-lucky .case-drop-sell:hover:not(:disabled) {
  background: linear-gradient(180deg, #fff0bf, var(--gold));
  border-color: var(--gold);
}

.case-drop.is-lucky.is-sold .case-drop-tile {
  box-shadow: none;
}

@media (max-width: 760px) {
  .case-drops {
    gap: 10px 8px;
    padding: 14px 8px;
  }

  .case-drop {
    width: calc((100% - 16px) / 3);
  }

  .case-drop-tile .case-reel-image {
    width: 100%;
  }
}
