/* All marketplace art is supplied game art; pawn and weapon previews are separate. */
.shop-sections { display:grid; gap:22px; }
.shop-section { border:1px solid var(--line); background:var(--panel); padding:18px; }
.shop-section-heading { display:flex; flex-wrap:wrap; justify-content:space-between; align-items:center; gap:10px; margin-bottom:15px; }
.shop-section-heading h2 { margin:0; font-size:.96rem; }
.shop-section-heading small,.shop-empty { color:var(--muted); font-size:.76rem; }
.shop-empty { margin:12px 0; }
.shop-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(min(100%,245px),1fr)); gap:14px; }
.shop-item { min-width:0; border:1px solid var(--line); background:#071a12; padding:13px; display:flex; flex-direction:column; }
/* Taller preview canvas with safe breathing room for the idle tilt:
   the full lower edge of tall pawn and weapon PNGs stays visible. */
.shop-item-art { width:100%; height:272px; display:grid; place-items:center; overflow:visible; padding:10px 5px 14px; box-sizing:border-box; }
.shop-item-art > img { width:100%; height:100%; object-fit:contain; max-width:100%; max-height:100%; }
.shop-art-pawn img { transform-origin:50% 94%; animation:shop-pawn-idle 3.8s ease-in-out infinite; }
.shop-art-weapon img { transform-origin:50% 70%; animation:shop-weapon-idle 6.2s ease-in-out infinite; }
/* Vampire's pawn cosmetics consist of the body and both wing sprites. */
.shop-item-art .pawn-preview-vampire { width:min(212px,91%); height:212px; }
.shop-item-art .pawn-preview-vampire img.pawn-preview-body { animation:none; }
@keyframes shop-pawn-idle { 0%,100%{transform:translateY(0) rotate(-.55deg)} 50%{transform:translateY(-3px) rotate(.55deg)} }
@keyframes shop-weapon-idle { 0%,100%{transform:rotate(-3deg)} 50%{transform:rotate(4deg)} }
.shop-item-copy { flex:1; }
.shop-item-copy h3 { font-size:.86rem; color:var(--text); margin:7px 0 4px; line-height:1.35; }
.shop-item-copy>span { color:var(--green); font-size:.62rem; }
.shop-item-copy p { margin:10px 0 15px; line-height:1.45; color:var(--muted); font-size:.76rem; min-height:3em; }
.shop-item-action { display:grid; gap:7px; }.shop-item-action button { width:100%; }
.shop-item-action small { color:var(--green); font-weight:bold; }
.shop-more { display:block; margin:14px auto 0; }
.shop-wallet { margin:0; color:var(--gold); font-size:.85rem; font-weight:700; white-space:nowrap; }
/* Wardrobe: pawn and equipped weapon are always shown separately. */
.wardrobe-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:15px; }
.wardrobe-panel { border:1px solid var(--line); background:var(--panel); padding:18px; min-width:0; }
.wardrobe-current { display:grid; grid-template-columns:130px minmax(0,1fr); align-items:center; gap:12px; margin-bottom:13px; border-bottom:1px solid var(--line); padding-bottom:15px; }
.wardrobe-current h2 { margin:0 0 7px; }.wardrobe-current p { color:var(--gold); font-size:.76rem; margin:0; }
.wardrobe-current-art { height:145px; width:130px; display:grid; place-items:center; }.wardrobe-current-art img { max-width:100%;max-height:100%; object-fit:contain; }
.wardrobe-choices { display:grid; grid-template-columns:repeat(auto-fill,minmax(112px,1fr)); gap:10px; }
.wardrobe-choice { display:flex; flex-direction:column; align-items:center; min-height:136px; gap:7px; background:#06180e; border:1px solid var(--line); padding:9px; }
.wardrobe-choice img { width:85px; height:85px; object-fit:contain; }.wardrobe-choice strong { font-size:.63rem; line-height:1.25; text-align:center; }
.wardrobe-choice.selected { border-color:var(--green); background:#11402a; color:var(--green); }
.wardrobe-actions { display:flex; flex-wrap:wrap; gap:10px; justify-content:flex-end; margin:18px 0; }
/* Same existing supplied spray can as in /assets/ui, no replacement or recreated icons. */
#unit-cards .unit-card { position:relative; }
#unit-cards .skin-change-button { position:absolute; top:9px; left:9px; width:33px; height:40px; border:0; background:transparent; padding:2px; display:grid; place-items:center; z-index:2; }
#unit-cards .skin-change-button img { width:100%; height:100%; object-fit:contain; transition:transform .18s ease; }
#unit-cards .skin-change-button:not(:disabled):hover img { transform:rotate(-9deg) translateY(-2px); }
#unit-cards .skin-change-button:disabled { opacity:.32; }
#unit-cards .unit-skin-label { display:block; color:var(--green); font-size:.68rem; font-weight:700; margin:5px 0; }
@media(max-width:820px) { .wardrobe-grid { grid-template-columns:minmax(0,1fr); }.shop-section { padding:12px; } }
@media(prefers-reduced-motion:reduce) { .shop-art-pawn img,.shop-art-weapon img { animation:none; } }

/* Arcade wardrobe transition — overlay survives the immediate page change. */
.wardrobe-enter-fx {
  position:fixed; inset:0; z-index:9999; pointer-events:none;
  display:none; overflow:hidden; isolation:isolate;
  border:0!important; background:transparent!important; box-shadow:none!important;
}
.wardrobe-enter-fx.active { display:block; }
.wardrobe-enter-backdrop {
  position:absolute; inset:0; opacity:0;
  background:none;
}
.wardrobe-enter-fx.active .wardrobe-enter-backdrop { animation:wardrobe-soft-dim 2.6s ease forwards; }
.wardrobe-enter-can {
  position:absolute; top:0; left:0; width:74px; height:74px;
  object-fit:contain; opacity:0; max-width:none;
  transform:translate(calc(var(--start-x) - 37px),calc(var(--start-y) - 37px)) scale(.38) rotate(-16deg);
  filter:none!important;
  border:0!important; background:transparent!important; box-shadow:none!important;
  will-change:transform,opacity;
}
.wardrobe-enter-fx.active .wardrobe-enter-can {
  /* Continuous growth + rotation during travel; disappears at the instant of the burst. */
  animation:wardrobe-can-throw 1.06s linear 1 both;
}
.wardrobe-enter-flash {
  position:absolute; left:50%; top:50%; width:22px; height:22px;
  border-radius:50%!important; opacity:0;
  background:radial-gradient(circle,rgba(223,255,222,.85) 0%,rgba(89,247,138,.55) 33%,rgba(175,108,255,.24) 59%,transparent 76%);
  transform:translate(-50%,-50%) scale(.1);
}
.wardrobe-enter-fx.active .wardrobe-enter-flash {
  animation:wardrobe-soft-flash .58s ease-out .95s forwards;
}
.wardrobe-enter-burst { position:absolute; left:50%; top:50%; width:0; height:0; }
.wardrobe-enter-burst span {
  position:absolute; left:0; top:0; width:var(--size); height:var(--size);
  margin-left:calc(var(--size) * -.5); margin-top:calc(var(--size) * -.5);
  /* The game's global square-edge rule needs an explicit exception for these sparks. */
  border-radius:50%!important; opacity:0;
  background:radial-gradient(circle at 35% 35%,rgba(255,255,255,.88),var(--color) 39%,transparent 84%);
  box-shadow:0 0 5px var(--color);
  transform:translate(0,0) scale(.2);
  will-change:transform,opacity;
}
.wardrobe-enter-fx.active .wardrobe-enter-burst span {
  animation:wardrobe-fine-particle 2.45s cubic-bezier(.15,.7,.3,1) 1 forwards;
  animation-delay:calc(.95s + var(--delay));
}
@keyframes wardrobe-soft-dim {
  0%{opacity:0} 23%{opacity:1} 48%{opacity:.65} 100%{opacity:0}
}
/* A SINGLE uninterrupted flight path: no per-waypoint easing or restarting rotation. */
@keyframes wardrobe-can-throw {
  0% { opacity:1; transform:translate(calc(var(--start-x) - 37px),calc(var(--start-y) - 37px)) scale(.38) rotate(-16deg); }
  96% { opacity:1; }
  100% { opacity:0; transform:translate(calc(50vw - 37px),calc(50vh - 37px)) scale(3.16) rotate(600deg); }
}
@keyframes wardrobe-soft-flash {
  0% {opacity:0;transform:translate(-50%,-50%) scale(.12)}
  17% {opacity:.88;transform:translate(-50%,-50%) scale(3.4)}
  100% {opacity:0;transform:translate(-50%,-50%) scale(7)}
}
/* One outward drift per particle: no repeated acceleration/deceleration at jitter points. */
@keyframes wardrobe-fine-particle {
  0% { opacity:0; transform:translate(0,0) scale(.55); }
  12% { opacity:.92; }
  100% { opacity:0; transform:translate(var(--tx),var(--ty)) scale(.24); }
}
@media(prefers-reduced-motion:reduce) { .wardrobe-enter-fx { display:none !important; } }

/* Flagbearer has a third, independent cosmetic equipment slot. */
.wardrobe-panel:has([data-wardrobe-kind="flag"]) .wardrobe-current-art img{object-fit:contain}
.wardrobe-grid:has(.wardrobe-panel:nth-child(3)){grid-template-columns:repeat(3,minmax(0,1fr))}
@media(max-width:1100px){.wardrobe-grid:has(.wardrobe-panel:nth-child(3)){grid-template-columns:minmax(0,1fr)}}


/* Old Fuse sprite has generous transparent margins. Enlarge its visible bomb
   only in the Gold Shop preview; other weapons and animations are unchanged. */
.shop-item:has(.shop-item-art > img[src$="/old_fuse.png"]) .shop-item-art > img {
  scale:1.28;
}

.shop-premium-price { color:var(--gold)!important; font-weight:800; font-size:.85rem; }

/* Long Axe: tall transparent source image must not enlarge the CSS grid row.
   Keep this preview inside the same artwork area as other premium weapons. */
.shop-item-art > img[src$="/barbarian_long_axe.png"] {
  display:block;
  width:auto;
  height:220px;
  max-width:100%;
  max-height:220px;
  min-width:0;
  min-height:0;
  object-fit:contain;
}
