/* /u/<handle> — locker (Fortnite-style cards) and box opening (hold-to-open pixel scene) */
.locker { max-width: 1180px; margin: 0 auto; padding: 28px 24px 72px; display: flex; flex-direction: column; gap: 36px; }

/* Rarity colours: --r / --r2 on any [data-rarity] element, injected from RARITIES (shared.js) */

/* ---------- Hero: avatar + slots + box ---------- */
.hero { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 32px; align-items: start; }
.stage { position: relative; width: 320px; height: 320px; border-radius: 16px; overflow: hidden; box-shadow: 0 1px 0 var(--border), 0 10px 30px rgba(0,0,0,.08); }
.stage canvas { display: block; width: 100%; height: 100%; image-rendering: pixelated; }
.stage-dl {
  position: absolute; right: 10px; bottom: 10px; width: 34px; height: 34px; border-radius: 9px; border: 0; cursor: pointer;
  display: flex; align-items: center; justify-content: center; background: rgba(255,255,255,.85); color: #1f1d29;
  box-shadow: 0 1px 3px rgba(0,0,0,.2); opacity: .75; transition: opacity .15s, transform .15s;
}
.stage:hover .stage-dl, .stage-dl:focus-visible { opacity: 1; }
.stage-dl:hover { transform: translateY(-1px); }
.stage-dl .px { font-size: 16.5px; }
.preview-tag { position: absolute; top: 10px; left: 10px; padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 600; background: rgba(0,0,0,.55); color: #fff; }
.hero-side { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.hero-side h2 { margin: 0; font-size: 30px; letter-spacing: -0.01em; }
.hero-side .small { margin: -8px 0 0; }

.slots { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.slot {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px 6px 7px; border-radius: 12px;
  border: 1px solid var(--border); background: var(--bg); color: var(--fg); font: inherit; cursor: pointer; min-width: 0;
}
.slot:hover { border-color: var(--muted); }
.slot[aria-pressed="true"] { border-color: var(--fg); box-shadow: inset 0 0 0 1px var(--fg); }
/* Same background as the collection cards below (.card .art) */
.slot .art { width: 100%; aspect-ratio: 1; border-radius: 8px; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 50% 38%, color-mix(in srgb, var(--r, #a5a9ad) 85%, #fff) 0%, var(--r, #a5a9ad) 45%, var(--r2, #6c7176) 100%); }
.slot .art img { width: 76%; height: 76%; image-rendering: pixelated; filter: drop-shadow(0 2px 0 rgba(0,0,0,.18)); }
/* Backgrounds fill their square */
.slot[data-cat="backgrounds"] .art img, .card[data-cat="backgrounds"] .art img { width: 100%; height: 100%; filter: none; }
.slot[data-cat="backgrounds"] .art { overflow: hidden; }
.slot b { font-size: 11px; font-weight: 600; }
.slot span { font-size: 10px; color: var(--muted); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar-actions { display: flex; gap: 8px; }
.random-btn { width: fit-content; }
.random-btn .px { font-size: 16.5px; }
/* Locks */
.lock-tag { position: absolute; left: 10px; bottom: 10px; display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 600; background: rgba(0,0,0,.6); color: #fff; }
.lock-tag[hidden], .lock-row[hidden], .locked[hidden] { display: none; }
.lock-tag .px { font-size: 11px; }
.lock-tag.mine { background: #1f1d29; }
.lock-tag.taken { background: #b91c1c; }
.lock-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.lock-row .btn .px { font-size: 16.5px; }
.locked { display: flex; flex-direction: column; gap: 12px; }
.locked-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.locked-card { display: flex; flex-direction: column; gap: 4px; padding: 0; border: 0; background: none; cursor: pointer; font: inherit; color: var(--muted); font-size: 11px; text-align: left; }
.locked-card canvas { width: 100%; aspect-ratio: 1; border-radius: 10px; image-rendering: pixelated; box-shadow: 0 1px 0 var(--border); }
.locked-card:hover canvas { outline: 2px solid var(--fg); outline-offset: 1px; }
.locked-card.worn canvas { outline: 2px solid var(--fg); }

/* Box call-to-action */
.box-cta { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.box-cta[hidden] { display: none; }
.box-btn {
  display: flex; align-items: center; gap: 14px; width: fit-content; padding: 12px 22px 12px 14px; border-radius: 14px; border: 0; cursor: pointer;
  color: #fff; font: inherit; text-align: left;
  background: linear-gradient(135deg, #634a8c, #9d77cf 45%, #dd9a52);
  box-shadow: 0 6px 20px rgba(157,119,207,.3); transition: transform .12s, box-shadow .12s;
}
.box-btn:hover { transform: translateY(-1px); box-shadow: 0 10px 26px rgba(157,119,207,.4); }
.box-btn:disabled { opacity: .5; cursor: default; transform: none; }
.box-btn b { display: block; font-size: 16px; }
.box-btn small { display: block; font-size: 12px; opacity: .85; }
.box-icon { width: 38px; height: 38px; flex: none; display: flex; align-items: center; justify-content: center; border-radius: 9px; background: rgba(255,255,255,.16); font-size: 24px; }
.odds summary { cursor: pointer; width: fit-content; }
.odds ul { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; }
.odds li { display: inline-flex; align-items: center; gap: 6px; }

/* ---------- Collection grid (Fortnite locker cards) ---------- */
.collection { display: flex; flex-direction: column; gap: 14px; }
.collection-head { display: flex; align-items: baseline; gap: 12px; }
.collection-head h3 { margin: 0; font-size: 20px; }
.collection-head { flex-wrap: wrap; }
/* Duplicates → boxes notification */
.redeem-pill { position: relative; display: inline-flex; align-items: center; gap: 6px; margin-left: auto; height: 30px; padding: 0 12px 0 10px; border-radius: 999px;
  border: 0; cursor: pointer; font: inherit; font-size: 13px; font-weight: 600; color: #fff; background: linear-gradient(135deg, #634a8c, #9d77cf);
  box-shadow: 0 4px 12px rgba(157,119,207,.35); transition: transform .12s; }
.redeem-pill:hover { transform: translateY(-1px); }
.redeem-pill[hidden] { display: none; }
.redeem-pill .px { font-size: 16.5px; }
.redeem-pill .dot { position: absolute; top: -3px; right: -3px; width: 10px; height: 10px; border-radius: 50%; background: #ffef16; box-shadow: 0 0 0 2px var(--bg); animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.35); } }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 12px; }
.card {
  position: relative; display: flex; flex-direction: column; border-radius: 12px; overflow: hidden; cursor: pointer; border: 0; padding: 0;
  background: var(--r2); color: #fff; font: inherit; text-align: left;
  box-shadow: 0 1px 2px rgba(0,0,0,.15); transition: transform .12s, box-shadow .12s;
}
.card:hover { transform: translateY(-2px); box-shadow: 0 8px 18px rgba(0,0,0,.18); }
.card .art { aspect-ratio: 1; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 50% 38%, color-mix(in srgb, var(--r) 85%, #fff) 0%, var(--r) 45%, var(--r2) 100%); }
.card .art img { width: 76%; height: 76%; image-rendering: pixelated; filter: drop-shadow(0 2px 0 rgba(0,0,0,.18)); }
.card .meta { padding: 7px 9px 8px; background: linear-gradient(transparent, rgba(0,0,0,.25)); }
.card .meta b { display: block; font-size: 12px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card .meta span { font-size: 10px; text-transform: uppercase; letter-spacing: .06em; opacity: .85; }
.card .count { position: absolute; top: 7px; right: 7px; padding: 1px 7px; border-radius: 999px; font-size: 11px; font-weight: 700; background: rgba(0,0,0,.45); }
.card .new { position: absolute; top: 7px; left: 7px; padding: 1px 7px; border-radius: 999px; font-size: 10px; font-weight: 800; letter-spacing: .04em; background: #ffef16; color: #1f1d29; }
.card .worn { position: absolute; bottom: 44px; right: 7px; width: 22px; height: 22px; border-radius: 50%; background: #fff; color: #1f1d29; display: flex; align-items: center; justify-content: center; font-size: 12px; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.card.selected { outline: 3px solid var(--fg); outline-offset: 2px; }
.card[data-rarity="mythic"] .art { animation: shimmer 4s linear infinite; background-size: 200% 200%; }
.grid .empty { grid-column: 1 / -1; padding: 40px 0; text-align: center; color: var(--muted); }
@keyframes shimmer { 0% { filter: hue-rotate(0deg); } 50% { filter: hue-rotate(-18deg) brightness(1.08); } 100% { filter: hue-rotate(0deg); } }

/* ---------- Box opening (pixel scene) ---------- */
.opening { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 16px;
  background: #0b0912; animation: fadein .2s ease; font-family: "Silkscreen", ui-monospace, monospace; color: #fff;
  user-select: none; -webkit-user-select: none; touch-action: none; }
.opening[hidden] { display: none; }
/* The pixel canvas covers the whole overlay (no edge to crop rays, particles or the flash); the UI sits on top. */
#scene { position: absolute; inset: 0; width: 100%; height: 100%; image-rendering: pixelated; cursor: pointer; }
.opening-inner { position: absolute; left: 0; right: 0; bottom: max(6vh, 32px); display: flex; flex-direction: column; align-items: center; gap: 18px; padding: 0 16px; pointer-events: none; }
.opening-inner button { pointer-events: auto; }
.hold { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.hold[hidden] { display: none; }
.hold p { margin: 0; font-size: 14px; letter-spacing: .04em; opacity: .85; animation: blink 1.2s steps(2) infinite; }
@keyframes blink { 50% { opacity: .45; } }
/* Pixel progress bar: 16 segments */
.hold-bar { width: 260px; height: 16px; padding: 3px; background: #1f1d29; box-shadow: 0 0 0 3px #fff; }
.hold-bar span { display: block; height: 100%; width: 0; background: repeating-linear-gradient(90deg, #ffd067 0 13px, transparent 13px 16px); }
.loot { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; animation: pop .35s steps(4); }
.loot[hidden] { display: none; }
@keyframes pop { from { transform: scale(.6); opacity: 0; } }
.loot p { margin: 0; }
.loot-rarity { font-size: 14px; letter-spacing: .12em; text-transform: uppercase; display: inline-flex; align-items: center; gap: 8px; }
.loot-rarity .px { font-size: 22px; }
.loot-kind, .loot-tier { display: inline-flex; align-items: center; gap: 8px; }
.loot-kind { color: #fff; }
.loot-sep { opacity: .45; }
.loot-name { font-size: 22px; }
.loot-file { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; opacity: .55; margin-top: -2px !important; }
.loot-badge { font-size: 12px; opacity: .8; min-height: 1em; }
.loot-badge.is-new { opacity: 1; }
/* Same pill as the cards' "NOUVEAU", a bit bigger */
.new-pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 13px; font-weight: 800; letter-spacing: .04em; background: #ffef16; color: #1f1d29; }
.loot-actions { display: flex; gap: 14px; margin-top: 12px; }
.loot-actions .btn { height: 44px; padding: 0 24px; font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; font-size: 15px; font-weight: 500; }
.loot-actions .btn:not(.btn-primary) { background: rgba(255,255,255,.08); color: #fff; border-color: rgba(255,255,255,.25); }
.loot-actions .btn:not(.btn-primary):hover { background: rgba(255,255,255,.16); }
.loot-actions .btn-primary { background: #fff; color: #1f1d29; border-color: #fff; }

@media (max-width: 820px) {
  .hero { grid-template-columns: minmax(0, 1fr); }
  .stage { width: 100%; height: auto; aspect-ratio: 1; max-width: 360px; }
  .locker { padding: 20px 16px 56px; }
}
/* Collection filters: buttons on desktop, dropdowns on phones */
.filter-selects { display: none; }
@media (max-width: 640px) {
  .collection .filter-row, .collection #rarity-pills { display: none; }
  .filter-selects { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .fsel { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
  .fsel > span:first-child { font-size: 12px; color: var(--muted); }
  .fsel:first-child { grid-column: 1 / -1; }
  .fsel[hidden] { display: none; }
  .fsel-box { position: relative; display: block; }
  .fsel-box select {
    width: 100%; height: 44px; padding: 0 34px 0 12px; border-radius: 10px; border: 1px solid var(--border);
    background: var(--bg); color: var(--fg); font: inherit; font-size: 15px; appearance: none; cursor: pointer;
    text-overflow: ellipsis;
  }
  .fsel-box.with-mark select { padding-left: 34px; }
  .fsel-box select:focus-visible { outline: 2px solid var(--fg); outline-offset: 1px; }
  .fsel-box::after {
    content: ""; position: absolute; right: 14px; top: 50%; width: 7px; height: 7px; translate: 0 -70%; rotate: 45deg;
    border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted); pointer-events: none;
  }
  .fsel-mark { position: absolute; left: 12px; top: 50%; translate: 0 -50%; display: flex; pointer-events: none; }
  .fsel-mark:empty { display: none; }
}

/* `hidden` must win over the display rules above */
.avatar-actions[hidden] { display: none; }

