/* The character wardrobe (wardrobe.html) */
.wardrobe { max-width: 900px; margin: 0 auto; padding: 16px; display: grid; gap: 20px; color: #fff; grid-template-columns: 280px 1fr; align-items: start; }
.preview { background: #1c2a4d; border-radius: 16px; padding: 16px; text-align: center; position: sticky; top: calc(var(--barh, 64px) + 8px); }
.minibar { display: none; }
.preview canvas { width: 240px; height: 240px; background: repeating-conic-gradient(#ededed 0% 25%, #e5e5e5 0% 50%) 0 0 / 40px 40px; border-radius: 12px; image-rendering: pixelated; max-width: 100%; }
.actions { display: grid; gap: 8px; }
.actions button { margin-top: 0; }
.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.tabs button { width: auto; margin: 0; padding: 8px 12px; background: #2b3b63; color: #fff; font-weight: 600; border-radius: 8px; }
.tabs button[aria-selected="true"] { background: #fca311; color: #14213d; }
.parts { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; background: #b3bccc; padding: 12px; border-radius: 14px; }
.part { position: relative; margin: 0; padding: 6px; background: rgba(255, 255, 255, .22); border: none; border-radius: 12px; cursor: pointer; width: auto; color: #14213d; }
.part:hover { background: rgba(255, 255, 255, .45); }
.part canvas { width: 72px; height: 72px; display: block; margin: 0 auto; image-rendering: pixelated; }
.part[aria-pressed="true"] { background: #fff; box-shadow: 0 2px 8px rgba(20, 33, 61, .35); }
.part.locked { opacity: .55; cursor: not-allowed; }
.part .need { position: absolute; left: 4px; right: 4px; bottom: 4px; font-size: .7rem; background: rgba(20, 33, 61, .8); color: #fff; border-radius: 4px; padding: 1px 0; }
.part .none { height: 72px; }
.colourrow { display: flex; align-items: flex-start; gap: 10px; margin: 10px 0; }
.colourrow .name { width: 90px; font-weight: 600; }
.swatch { width: 34px; height: 34px; padding: 0; margin: 0; border-radius: 50%; border: 3px solid transparent; cursor: pointer; }
.swatch[aria-pressed="true"] { border-color: #fff; }
.swatch.locked { opacity: .35; cursor: not-allowed; }

/* swatches in tidy rows of six (12 body colours = two full rows) */
.swatches { display: grid; grid-template-columns: repeat(6, 36px); gap: 6px; }
.colourrow .name { padding-top: 6px; }

/* Ched, rarity and the crate */
.need .ched-ico { width: .9em; height: .9em; }
.ched { background: #fca311; color: #14213d; font-weight: 800; padding: 4px 10px; border-radius: 999px; }
.crate { margin-top: 16px; padding-top: 12px; border-top: 1px solid #2c3e66; }
.crate h2 { margin: 0 0 4px; font-size: 1.05rem; }
.crate button { margin-top: 8px; }
.odds { font-size: .78rem; color: #aab4cc; margin: 8px 0 0; }
.part.rar-uncommon { box-shadow: inset 0 0 0 3px #5fc46a; }
.part.rar-rare { box-shadow: inset 0 0 0 3px #5b8cff; }
.part.rar-epic { box-shadow: inset 0 0 0 3px #b78bf5; }
.part[aria-pressed="true"] { box-shadow: 0 2px 8px rgba(20, 33, 61, .35), inset 0 0 0 3px #fca311; }
dialog#shopdlg { border: none; border-radius: 18px; padding: 22px; width: min(380px, 92vw); text-align: center; background: #fff; color: #14213d; }
dialog#shopdlg::backdrop { background: rgba(10, 18, 36, .7); }
#dlg-pic { width: 144px; height: 144px; image-rendering: pixelated; background: repeating-conic-gradient(#ededed 0% 25%, #e5e5e5 0% 50%) 0 0 / 36px 36px; border-radius: 12px; }
.rarity { font-weight: 800; margin: 8px 0; }
.rarity.rar-common { color: #6b7388; } .rarity.rar-uncommon { color: #3a8f44; } .rarity.rar-rare { color: #3560cc; } .rarity.rar-epic { color: #8559c9; }
.dlg-actions { display: grid; gap: 8px; }
.dlg-actions button { margin-top: 0; }

dialog#cratedlg { border: none; border-radius: 20px; padding: 14px 14px 18px; width: min(360px, 94vw); text-align: center; background: linear-gradient(180deg, #1c2a4d, #0d1830); color: #fff; }
dialog#cratedlg::backdrop { background: rgba(5, 10, 22, .8); }
#crate-canvas { width: 100%; max-width: 320px; height: auto; image-rendering: pixelated; cursor: pointer; }
#crate-reveal h2 { margin: 4px 0; }
#crate-reveal .rarity.rar-common { color: #c6ccd9; } #crate-reveal .rarity.rar-uncommon { color: #7be08a; }
#crate-reveal .rarity.rar-rare { color: #6f9bff; } #crate-reveal .rarity.rar-epic { color: #c39bff; }

@media (max-width: 720px) {
  .wardrobe { grid-template-columns: 1fr; }
  /* the big card (character, Save, crate) is taller than a phone screen, so it must not stick: it scrolls away, and a small
     picture of the character stays under the top bar while the parts scroll */
  .preview { position: static; }
  .minibar { display: flex; justify-content: center; position: sticky; top: var(--barh, 64px); z-index: 5; padding: 6px 0; margin: 0 -16px 8px; background: #14213d; border-bottom: 1px solid #2b3b63; }
  .minibar canvas { width: 96px; height: 96px; background: repeating-conic-gradient(#ededed 0% 25%, #e5e5e5 0% 50%) 0 0 / 24px 24px; border-radius: 10px; image-rendering: pixelated; }
}
