#lootPanel { max-width: 820px; height: min(100%, 600px); gap: 8px; align-items: stretch; }
#lootPanel > .msg:empty { display: none; }
#lootPanel > .final-note { flex: 0 0 auto; }

.lp-head { display: flex; gap: 8px; flex: 0 0 auto; }
.lp-shop, .lp-pick, .lp-pick-item { font: inherit; color: inherit; cursor: pointer; border: 1px solid rgba(255,255,255,.08); }
.lp-shop { min-width: 44px; min-height: 44px; padding: 0 12px; border-radius: 12px; background: rgba(255,255,255,.05); color: #a3a8cc; font-size: 13px; }
.lp-pick-wrap { flex: 1 1 auto; min-width: 0; position: relative; }
.lp-pick { width: 100%; min-height: 44px; display: flex; align-items: center; gap: 8px; padding: 0 14px; border-radius: 12px; background: rgba(255,255,255,.05); text-align: left; }
.lp-pick b { font-size: 15px; color: #fff; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lp-pick small { margin-left: auto; font-size: 11px; color: #8a90b5; white-space: nowrap; }
.lp-pick::after { content: ""; flex: 0 0 auto; width: 7px; height: 7px; border-right: 2px solid #a3a8cc; border-bottom: 2px solid #a3a8cc; transform: translateY(-2px) rotate(45deg); transition: transform 140ms cubic-bezier(.4,0,.2,1); }
.lp-pick[aria-expanded="true"]::after { transform: translateY(2px) rotate(225deg); }
.lp-pick-list { position: absolute; z-index: 40; top: calc(100% + 6px); left: 0; right: 0; display: flex; flex-direction: column; gap: 2px; padding: 4px;
  border-radius: 12px; background: #20243f; border: 1px solid rgba(255,255,255,.12); box-shadow: 0 12px 30px rgba(0,0,0,.45); }
.lp-pick-list[hidden] { display: none; }
.lp-pick-item { min-height: 44px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 12px; border-radius: 9px; border-color: transparent; background: none; font-size: 14px; }
.lp-pick-item b { color: #ffe27a; font-size: 13px; white-space: nowrap; }
.lp-pick-item:hover { background: rgba(255,255,255,.06); }
.lp-pick-item[aria-selected="true"] { background: rgba(92,155,255,.16); border-color: rgba(150,180,255,.4); }

#lootStage.loot-stage { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; align-items: stretch; gap: 8px; padding: 0; border: 0; background: none; }
.lp-card { flex: 1 1 auto; min-height: 0; position: relative; perspective: 1400px; container: lpcard / size; }
.lp-faces { position: absolute; inset: 0; transform-style: preserve-3d; transition: transform 380ms cubic-bezier(.16,1,.3,1); }
.flipped .lp-faces { transform: rotateY(180deg); }
.lp-face { position: absolute; inset: 0; display: flex; flex-direction: column; min-height: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.lp-back { transform: rotateY(180deg); }
.flipped .lp-front, #lootStage:not(.flipped) .lp-back { visibility: hidden; transition: visibility 0s linear 190ms; }
@media (prefers-reduced-motion: reduce) {
  .lp-faces, .flipped .lp-faces, .lp-back { transform: none; transition: none; }
  .lp-face { transition: opacity 220ms cubic-bezier(.4,0,.2,1), visibility 0s linear 220ms; }
  .flipped .lp-front, #lootStage:not(.flipped) .lp-back { opacity: 0; }
}

.lp-front { align-items: center; justify-content: center; gap: 2px; overflow: hidden; }
.lp-front .loot-wheel { --wz: 1; height: calc(128px * var(--wz)); margin: 0; flex: 0 0 auto; }
.lp-front .loot-wheel-track { inset: 0 calc(50% - 50% / var(--wz)); transform: scale(var(--wz)); }
.lp-front .loot-nav { width: 44px; height: 44px; }
.lp-front .loot-cur { height: auto; min-height: 44px; }

.lp-back-head { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 8px; flex: 0 0 auto; margin-bottom: 5px; white-space: nowrap; }
.lp-title { font-size: 14px; font-weight: 800; color: #fff; }
.lp-count { margin-left: auto; font-size: 10.5px; color: #8a90b5; }
.lp-rows { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; gap: 4px; }
.lp-row { --t: 22px; flex: 1 1 0; min-height: 0; display: flex; flex-direction: column; justify-content: center; gap: 3px;
  padding: 3px 8px; border-radius: 10px; background: rgba(255,255,255,.05); border-left: 3px solid var(--c); overflow: hidden; }
.lp-label { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 6px; line-height: 1.15; min-width: 0; }
.lp-label b { font-size: 10.5px; letter-spacing: .05em; text-transform: uppercase; color: var(--c); }
.lp-pct { font-size: 14px; font-weight: 800; color: #fff; font-variant-numeric: tabular-nums; }
.lp-label small { font-size: 10px; color: #a3a8cc; }
.lp-label .lp-melt { color: #8a90b5; }
.lp-art { display: flex; flex-wrap: wrap; align-items: center; gap: 3px; min-width: 0; }
@container lpcard (min-width: 420px) {
  .lp-row { display: grid; grid-template-columns: 104px minmax(0,1fr); align-items: center; gap: 8px; padding: 4px 10px; }
  .lp-label { display: block; line-height: 1.12; }
  .lp-pct { margin-left: 5px; font-size: 15px; }
  .lp-label small { display: block; }
}
@container lpcard (min-width: 420px) and (min-height: 300px) { .lp-row { --t: 34px; } .lp-pct { font-size: 17px; } .lp-label small { font-size: 11px; } .lp-title { font-size: 15px; } }
@container lpcard (max-width: 419px) and (min-height: 260px) { .lp-row { --t: 26px; } }
@container lpcard (max-height: 220px) { .lp-row { --t: 18px; gap: 2px; } }
@container lpcard (max-height: 175px) { .lp-art { display: none; } .lp-row { padding: 1px 8px; } }
@container lpcard (max-height: 230px) { .lp-front .loot-wheel { --wz: .8; } }
@container lpcard (max-height: 190px) { .lp-front .loot-wheel { --wz: .6; } .lp-front .loot-cur-name { font-size: 15px; } }
@container lpcard (max-height: 150px) { .lp-front .loot-wheel { --wz: .5; } .lp-front .loot-cur { min-height: 0; } .lp-front .loot-cur-meta { margin-top: 0; } }
@container lpcard (max-height: 130px) { .lp-front .loot-wheel { --wz: .36; } .lp-front .loot-odds-fx, .lp-front .loot-cur-melt, .lp-front .loot-demo-btn { display: none; } .lp-front .loot-cur-name { font-size: 14px; } }
.lp-art .lp-thumb { width: var(--t); height: var(--t); flex: 0 0 auto; box-shadow: 0 0 0 2px color-mix(in srgb, var(--c) 75%, transparent); }
.lp-one { margin-left: 6px; font-size: 12.5px; font-weight: 700; color: #fff; }

.lp-receipt { flex: 0 0 auto; display: flex; flex-direction: column; gap: 6px; padding-top: 8px; border-top: 1px solid rgba(255,255,255,.08); }
.lp-tiers { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; border-radius: 10px; transition: box-shadow 220ms cubic-bezier(.4,0,.2,1); }
.flipped .lp-tiers { display: none; }
.lp-tier { padding: 5px 2px; border-radius: 8px; background: rgba(255,255,255,.05); text-align: center; line-height: 1.15; }
.lp-tier span { display: block; font-size: 10px; font-weight: 700; color: var(--c); }
.lp-tier b { font-size: 14px; color: #fff; font-variant-numeric: tabular-nums; }
.lp-line { display: flex; align-items: center; gap: 8px; min-height: 44px; }
.lp-turn { min-height: 44px; padding: 0 2px; border: 0; background: none; font: inherit; font-size: 12.5px; font-weight: 600; color: #9cc8ff; cursor: pointer; text-align: left; }
.lp-turn:hover { color: #cfe4ff; }
.lp-price { margin-left: auto; font-size: 16px; font-weight: 800; color: #fff; white-space: nowrap; font-variant-numeric: tabular-nums; }
#lootStage .loot-buy { width: 100%; min-height: 48px; margin: 0; padding: 8px 16px; border-radius: 14px; font-weight: 800; box-shadow: 0 4px 0 #b9811a; transition: transform 140ms cubic-bezier(.4,0,.2,1), box-shadow 140ms cubic-bezier(.4,0,.2,1), filter 140ms ease; }
#lootStage .loot-buy:active { transform: translateY(3px); box-shadow: 0 1px 0 #b9811a; }
#lootStage .loot-buy.armed { box-shadow: 0 0 0 3px rgba(255,201,60,.35), 0 4px 0 #b9811a; }
#lootStage:has(.loot-buy.armed) .lp-tiers { box-shadow: 0 0 0 2px rgba(255,201,60,.55); }
.lp-armnote { font-size: 11px; color: #ffc93c; text-align: center; }
#lootStage .loot-owned { margin: 0; justify-content: space-between; }
#lootStage .loot-open { min-height: 44px; padding: 0 18px; }
#lootStage .loot-tickets { max-width: none; margin: 0; justify-content: center; }
#lootStage .loot-redeem { min-height: 44px; }

@container lpcard (min-height: 280px) { .lp-front .loot-wheel { --wz: 1.15; } }
@container lpcard (min-height: 280px) and (min-width: 400px) { .lp-front .loot-wheel { --wz: 1.3; } }
@container lpcard (min-height: 340px) and (min-width: 420px) { .lp-front .loot-wheel { --wz: 1.5; } }
@media (max-height: 620px) and (orientation: portrait) {
  #lootPanel { gap: 6px; }
  .lp-receipt { gap: 4px; padding-top: 6px; }
  .lp-tier { padding: 3px 2px; }
  .lp-tier b { font-size: 13px; }
  #lootStage .loot-buy { min-height: 44px; padding: 6px 16px; }
}
.flipped .loot-tickets { display: none; }

@media (min-width: 900px), (min-width: 700px) and (orientation: landscape) {
  #lootStage.loot-stage { display: grid; grid-template-columns: minmax(0, 1fr) 270px; gap: 16px; }
  .lp-receipt { padding: 0 0 0 16px; border-top: 0; border-left: 1px solid rgba(255,255,255,.08); justify-content: center; gap: 8px; }
  .lp-tiers { grid-template-columns: 1fr 1fr; }
  .lp-tier { padding: 7px 4px; }
}
