/* =====================================================================
   Boutique de cosmétiques, casino et garde-robe (ui/shop.js). Papier crème, cuir, police pixel.
   ===================================================================== */
.shop-screen { position: absolute; inset: 0; z-index: 60; display: grid; place-items: center; background: rgba(20, 14, 24, 0.45);
  font-family: var(--pixel); word-spacing: 0.1em; animation: shop-in 0.18s ease-out; }
@keyframes shop-in { from { opacity: 0; } }
.shop-screen button { font-family: var(--pixel); }
.shop { width: min(980px, 94vw); height: min(640px, 90vh); display: flex; flex-direction: column; gap: 8px; padding: 14px 16px;
  background: var(--paper); color: var(--ink); border-radius: 14px; box-shadow: var(--card-frame); }
.shop-head { display: flex; align-items: center; gap: 10px; }
.shop-face { width: 44px; height: 44px; image-rendering: pixelated; border-radius: 8px; background: var(--paper-2); box-shadow: inset 0 0 0 2px rgba(120, 85, 50, 0.3); }
.shop-tabs { display: flex; gap: 4px; flex: 1; }
.shop-title { flex: 1; margin: 0; font-family: var(--pixel); font-weight: normal; font-size: 1.15em; color: var(--ink); }
.shop-tab { border: none; cursor: pointer; padding: 8px 14px; border-radius: 9px 9px 4px 4px; background: rgba(120, 85, 50, 0.14); color: var(--ink-soft); font-size: 0.95em; }
.shop-tab:hover { background: #fff8e4; }
.shop-tab.on { background: #fff3c8; color: var(--ink); box-shadow: inset 0 -3px 0 #e0a030; }
.shop-coins { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; background: linear-gradient(180deg, #fff3c8, #f5d36a);
  box-shadow: inset 0 0 0 2px #cf9a22; font-size: 1.05em; }
.shop-coins b { font-weight: normal; }
.coin-ico { font-style: normal; }
.coin-ico::before { content: ''; display: inline-block; width: 1em; height: 1em; margin-left: 4px; vertical-align: -0.12em;
  background: var(--coin-img) center / contain no-repeat; image-rendering: pixelated; }
.shop-coins .coin-ico::before { margin: 0; }
.shop-msg { margin: 0; min-height: 1.3em; font-size: 0.85em; color: var(--ink-soft); }
.shop-msg.good { color: #2f7a3a; }
.shop-msg.bad { color: #a3301e; }
.shop-body { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding-right: 4px; }

/* boutique */
.shop-filters { display: flex; gap: 6px; flex-wrap: wrap; }
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.shop-card { position: relative; display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 10px 8px; border-radius: 10px; text-align: center;
  background: var(--paper-2, #fff8e4); box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--r) 55%, transparent), 0 2px 0 rgba(80, 50, 30, 0.15); }
.shop-card.mine { background: linear-gradient(180deg, color-mix(in srgb, var(--r) 14%, var(--paper)), var(--paper)); }
.shop-pv { height: 76px; display: grid; place-items: center; }
.shop-fig { image-rendering: pixelated; display: block; }
.shop-icon { font-size: 40px; line-height: 1; }
.shop-name { font-weight: normal; font-size: 0.85em; line-height: 1.2; }
.shop-rar { font-size: 0.68em; padding: 1px 7px; border-radius: 999px; color: #fff; background: var(--r); text-shadow: 0 1px 0 rgba(0, 0, 0, 0.3); }
.shop-own { font-size: 0.72em; color: #2f7a3a; }
.shop-only { font-size: 0.72em; color: var(--ink-soft); padding: 5px 0; }
.shop .btn.small { padding: 5px 10px; font-size: 0.78em; font-family: var(--pixel); }
.shop .btn.ghost { color: var(--ink); border-color: rgba(120, 85, 50, 0.4); background: rgba(255, 255, 255, 0.5); }
.shop-earn { margin: 4px 0 0; font-size: 0.75em; color: var(--ink-soft); }

/* casino */
.casino { display: flex; gap: 24px; align-items: flex-start; justify-content: center; flex-wrap: wrap; padding-top: 10px; }
.casino-machine { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 18px 28px; border-radius: 16px;
  background: linear-gradient(180deg, #7a2a3a, #4a1626); box-shadow: inset 0 0 0 3px #e0a030, 0 4px 0 rgba(60, 20, 30, 0.4); }
.casino-reel { --r: #8fa3b0; width: 130px; height: 130px; display: grid; place-items: center; border-radius: 12px; background: #fff8e4;
  box-shadow: inset 0 0 0 4px var(--r), inset 0 6px 12px rgba(0, 0, 0, 0.2); transition: box-shadow 0.1s; }
.casino-reel .shop-icon { font-size: 60px; }
.casino-reel.win { animation: reel-win 0.6s ease-out; }
.casino-reel.win.r-legendary, .casino-reel.win.r-epic { animation: reel-win 0.6s ease-out, reel-glow 1.2s ease-in-out 3; }
@keyframes reel-win { 0% { transform: scale(0.8); } 60% { transform: scale(1.12); } 100% { transform: scale(1); } }
@keyframes reel-glow { 50% { box-shadow: inset 0 0 0 4px var(--r), 0 0 26px 6px var(--r); } }
.casino-result { min-height: 54px; display: flex; flex-direction: column; align-items: center; gap: 4px; color: #fff3c8; }
.casino-result b { font-weight: normal; }
.casino-spin { font-family: var(--pixel); font-size: 1.05em; padding: 10px 22px; }
.casino-odds { border-collapse: collapse; font-size: 0.85em; background: var(--paper-2, #fff8e4); border-radius: 10px; box-shadow: inset 0 0 0 2px rgba(120, 85, 50, 0.25); }
.casino-odds caption { text-align: left; padding: 0 0 6px; color: var(--ink-soft); }
.casino-odds td { padding: 6px 12px; }
.casino-have { color: var(--ink-soft); }

/* garde-robe */
.wardrobe { display: flex; gap: 20px; align-items: flex-start; flex-wrap: wrap; }
.wr-stage { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px; border-radius: 12px; background: var(--paper-2, #fff8e4);
  box-shadow: inset 0 0 0 2px rgba(120, 85, 50, 0.25); }
.wr-podium { display: flex; align-items: center; gap: 6px; }
.wr-pv { min-width: 112px; min-height: 168px; display: grid; place-items: center; }
.wr-title { margin: 0; min-height: 1.2em; color: #a8741a; font-size: 0.9em; }
.wr-fields { flex: 1; min-width: 300px; display: flex; flex-direction: column; gap: 10px; }
.wr-row { display: flex; gap: 10px; align-items: flex-start; }
.wr-label { min-width: 8.5em; padding-top: 5px; font-size: 0.82em; color: var(--ink-soft); }
.wr-opts { display: flex; flex-wrap: wrap; gap: 5px; flex: 1; }
.wr-opt { border: none; cursor: pointer; border-radius: 7px; padding: 4px 8px; font-size: 0.76em; color: var(--ink-soft); background: rgba(255, 255, 255, 0.55);
  box-shadow: inset 0 0 0 2px rgba(120, 85, 50, 0.25); }
.wr-opt:hover { background: #fff8e4; }
.wr-opt.on { background: #fff3c8; color: var(--ink); box-shadow: inset 0 0 0 2px #e0a030; }
.wr-opt.sw { padding: 3px; }
.shop-swatch { display: block; width: 22px; height: 22px; border-radius: 5px; background: linear-gradient(135deg, var(--c3) 0 25%, var(--c) 25% 70%, var(--c2) 70%); }

[data-theme="dark"] .shop-card, [data-theme="dark"] .wr-stage, [data-theme="dark"] .casino-odds { background: rgba(255, 255, 255, 0.06); }
[data-theme="dark"] .shop-tab.on, [data-theme="dark"] .wr-opt.on { background: rgba(224, 160, 48, 0.25); }

@media (max-width: 640px) {
  .shop { padding: 10px; height: 94vh; }
  .shop-tab { padding: 6px 8px; font-size: 0.8em; }
  .shop-face { display: none; }
  .wr-label { min-width: 0; width: 100%; }
  .wr-row { flex-direction: column; gap: 4px; }
}
