/* ==========================================================================
   WARDROBE - one screen for everything cosmetic (public/js/wardrobe.js).
   Same stone-and-arcane look as the Auction House (.av-page) so the game reads as one product; the tokens are
   copied under --wd-* rather than shared so this file stands on its own. Mobile first: one column under 820px.
   ========================================================================== */
.wd-page {
  --wd-stone: #0f1113;
  --wd-stone-2: #181b1e;
  --wd-panel: #1f2327;
  --wd-line: #33383d;
  --wd-fog: #8b96a1;
  --wd-fog-dim: #5c656e;
  --wd-text: #d7dde3;
  --wd-arcane: #3ecbc0;
  --wd-arcane-bright: #6ee6da;
  --wd-gold: #d9b25b;
  --wd-danger: #e07070;
  --wd-font-display: 'Metamorphous', Georgia, serif;
  --wd-font-body: 'Public Sans', system-ui, sans-serif;

  background: var(--wd-stone);
  color: var(--wd-fog);
  font-family: var(--wd-font-body);
  border: 1px solid var(--wd-line);
  border-radius: 12px;
  padding: 14px;
}
.wd-embedded { margin: 0; }
.wd-hint { color: var(--wd-fog); font-size: 0.9rem; margin: 6px 0; }
.wd-empty { color: var(--wd-fog-dim); padding: 24px 8px; text-align: center; }

.wd-layout { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 820px) { .wd-layout { grid-template-columns: minmax(0, 1fr); } }

/* --- the stage: you, drawn as everyone else sees you ------------------------------------- */
.wd-stage { position: sticky; top: 8px; display: flex; flex-direction: column; gap: 12px; }
@media (max-width: 820px) { .wd-stage { position: static; } }
.wd-stage-card { background: var(--wd-panel); border: 1px solid var(--wd-line); border-radius: 12px; padding: 14px; }
.wd-stage-bg { background: radial-gradient(circle at 50% 40%, #2a3036 0%, var(--wd-stone-2) 70%); border-radius: 10px; padding: 14px 0 8px; }
.wd-portrait { width: 168px; height: 168px; margin: 0 auto; display: block; }
@media (max-width: 820px) { .wd-portrait { width: 132px; height: 132px; } }
.wd-name { text-align: center; margin-top: 12px; color: var(--wd-text); font-family: var(--wd-font-display); font-size: 1.15rem; line-height: 1.4; min-height: 1.6em; overflow-wrap: anywhere; }
.wd-name-badge { margin-right: 6px; vertical-align: middle; }
.wd-purse { display: flex; justify-content: center; gap: 16px; margin: 8px 0 12px; font-size: 0.85rem; color: var(--wd-gold); }

.wd-selected { border-top: 1px solid var(--wd-line); padding-top: 12px; }
.wd-selected-name { color: var(--wd-text); font-weight: 600; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.wd-selected-desc { margin: 4px 0 10px; font-size: 0.88rem; color: var(--wd-fog); }
.wd-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.wd-note { font-size: 0.85rem; color: var(--wd-fog-dim); }

.wd-btn { padding: 9px 16px; border-radius: 8px; border: 1px solid var(--wd-line); background: var(--wd-stone-2); color: var(--wd-text); font: inherit; font-weight: 600; cursor: pointer; width: auto; }
.wd-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.wd-btn:focus-visible, .wd-card:focus-visible, .wd-chip:focus-visible, .wd-mini:focus-visible { outline: 2px solid var(--wd-arcane); outline-offset: 2px; }
.wd-btn-primary { background: var(--wd-arcane); border-color: var(--wd-arcane); color: #06201e; }
.wd-btn-primary:hover:not(:disabled) { background: var(--wd-arcane-bright); }
.wd-btn-gold { background: var(--wd-gold); border-color: var(--wd-gold); color: #241a05; }
.wd-btn-gold:hover:not(:disabled) { filter: brightness(1.08); }
.wd-btn-ghost { background: transparent; }
.wd-btn-ghost:hover:not(:disabled) { border-color: var(--wd-fog); }

.wd-wearing { background: var(--wd-panel); border: 1px solid var(--wd-line); border-radius: 12px; padding: 10px 14px; }
.wd-wearing-head { font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--wd-fog-dim); margin-bottom: 4px; }
.wd-wearing-row { display: flex; align-items: center; gap: 8px; padding: 5px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.05); font-size: 0.88rem; }
.wd-wearing-row:last-child { border-bottom: 0; }
.wd-wearing-slot { width: 96px; flex: none; color: var(--wd-fog-dim); }
.wd-wearing-val { flex: 1; min-width: 0; color: var(--wd-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wd-dim { color: var(--wd-fog-dim); }
.wd-mini, .wd-mini-pad { width: 24px; height: 24px; flex: none; }
.wd-mini { border-radius: 6px; border: 1px solid var(--wd-line); background: transparent; color: var(--wd-fog); cursor: pointer; font-size: 1rem; line-height: 1; padding: 0; }
.wd-mini:hover { color: var(--wd-danger); border-color: var(--wd-danger); }

/* --- the browser: tabs, filters, a grid of cards that look like what they are -------------- */
.wd-tabs { display: flex; gap: 4px; overflow-x: auto; padding-bottom: 4px; border-bottom: 1px solid var(--wd-line); scrollbar-width: thin; }
.wd-tabs button { flex: none; width: auto; background: transparent; border: 0; border-bottom: 2px solid transparent; color: var(--wd-fog); padding: 8px 12px; font: inherit; cursor: pointer; white-space: nowrap; border-radius: 0; }
.wd-tabs button.active { color: var(--wd-arcane-bright); border-bottom-color: var(--wd-arcane); }
.wd-slot-hint { margin: 10px 0 6px; }
.wd-chips { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0 12px; }
.wd-chip { width: auto; padding: 4px 12px; border-radius: 999px; border: 1px solid var(--wd-line); background: transparent; color: var(--wd-fog); font: inherit; font-size: 0.82rem; cursor: pointer; }
.wd-chip-on { background: rgba(62, 203, 192, 0.14); border-color: var(--wd-arcane); color: var(--wd-arcane-bright); }

.wd-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 10px; }
.wd-card { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 8px 12px; background: var(--wd-panel); border: 1px solid var(--wd-line); border-radius: 10px; color: var(--wd-fog); font: inherit; cursor: pointer; text-align: center; width: auto; min-width: 0; transition: border-color 0.12s, transform 0.12s; }
.wd-card:hover { border-color: var(--wd-fog-dim); transform: translateY(-1px); }
.wd-card-on { border-color: var(--wd-arcane); box-shadow: 0 0 0 1px var(--wd-arcane), 0 0 14px rgba(62, 203, 192, 0.25); }
.wd-card-worn { border-color: var(--wd-gold); }
.wd-card-worn.wd-card-on { box-shadow: 0 0 0 1px var(--wd-gold), 0 0 14px rgba(217, 178, 91, 0.3); }
.wd-card-locked { background: var(--wd-stone-2); }
.wd-card-locked .wd-thumb { opacity: 0.8; }
.wd-card-name { color: var(--wd-text); font-size: 0.88rem; line-height: 1.25; overflow-wrap: anywhere; }
.wd-thumb { height: 84px; width: 100%; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.wd-thumb-portrait .pixel-icon { width: 80px; height: 80px; }
.wd-thumb-text { font-size: 0.95rem; color: var(--wd-text); overflow-wrap: anywhere; }
.wd-thumb-auto { font-size: 0.8rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--wd-fog-dim); }

.wd-tag { font-size: 0.7rem; letter-spacing: 0.06em; text-transform: uppercase; padding: 2px 8px; border-radius: 999px; background: rgba(255, 255, 255, 0.07); color: var(--wd-fog); }
.wd-tag-worn { background: rgba(217, 178, 91, 0.18); color: var(--wd-gold); }
.wd-tag-new { background: rgba(62, 203, 192, 0.18); color: var(--wd-arcane-bright); }
.wd-tag-price { background: rgba(217, 178, 91, 0.12); color: var(--wd-gold); }
.wd-tag-earned { background: rgba(164, 95, 224, 0.18); color: #c79bf0; }

@media (prefers-reduced-motion: reduce) { .wd-card { transition: none; } .wd-card:hover { transform: none; } }
