/* ============================ The Atelier (wardrobe) ============================ */
#wardrobe.screen { display: block; padding: 0; overflow: hidden; background: radial-gradient(120% 90% at 68% 42%, rgba(0,0,0,0) 55%, rgba(24,16,10,.28) 100%); color: var(--ink); }
#wardrobe.hidden { display: none !important; }
#wardrobe { --glass: rgba(255, 251, 243, .84); --glass-2: rgba(255, 251, 243, .66); --edge: rgba(255, 255, 255, .72); --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif; --ink-d: #3f3a2c; }
.wd-stage-hit { position: absolute; inset: 0; cursor: grab; touch-action: none; }
.wd-stage-hit.grab { cursor: grabbing; }

/* ---------- the panel ---------- */
.wd-panel { position: absolute; left: 18px; top: 18px; bottom: 18px; width: min(520px, 44vw); display: flex; flex-direction: column; background: var(--glass); backdrop-filter: blur(22px) saturate(1.35); -webkit-backdrop-filter: blur(22px) saturate(1.35); border: 1px solid var(--edge); border-radius: 28px; box-shadow: 0 30px 80px rgba(40,28,14,.28), 0 2px 0 rgba(255,255,255,.6) inset; overflow: hidden; animation: wd-in .5s cubic-bezier(.2,.9,.3,1.05); }
@keyframes wd-in { from { transform: translateX(-24px); opacity: 0; } to { transform: none; opacity: 1; } }
.wd-head { display: flex; align-items: center; gap: 14px; padding: 20px 22px 8px; }
.wd-title { flex: 1; line-height: 1; }
.wd-title small { display: block; font-size: 10px; letter-spacing: 3.5px; font-weight: 800; color: #a0896a; }
.wd-title h2 { font-family: var(--serif); font-weight: 600; font-size: 38px; color: var(--ink-d); letter-spacing: .5px; font-style: italic; }
.wd-coins { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; font-size: 16px; padding: 8px 14px; border-radius: 999px; background: linear-gradient(180deg, #fff6df, #f6e2b3); border: 1px solid #e8cf93; color: #6b4a1a; box-shadow: 0 2px 8px rgba(176,122,42,.18); }
.wd-x { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: #fffdf8; color: var(--ink); font-size: 16px; cursor: pointer; transition: transform .15s, background .15s; }
.wd-x:hover { transform: rotate(90deg); background: #fff; }

.wd-collection { padding: 4px 22px 12px; }
.wd-col-top { font-size: 12.5px; color: var(--ink-2); display: flex; align-items: baseline; gap: 6px; }
.wd-col-top b { font-size: 17px; color: var(--ink-d); }
.wd-col-top span { margin-left: auto; font-weight: 700; color: #a0896a; }
.wd-col-bar { display: flex; gap: 3px; margin-top: 7px; height: 7px; }
.wd-col-bar i { position: relative; border-radius: 99px; background: color-mix(in srgb, var(--r) 18%, #efe9da); overflow: hidden; }
.wd-col-bar em { position: absolute; inset: 0 auto 0 0; background: var(--r); border-radius: 99px; transition: width .6s; }

.wd-slots { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 3px; padding: 2px 14px 10px; }
.wd-slots::-webkit-scrollbar { display: none; }
.wd-slots button { position: relative; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 8px 2px 6px; border-radius: 16px; border: 1px solid transparent; background: transparent; color: var(--ink); cursor: pointer; transition: background .15s, transform .15s; }
.wd-slots button:hover { background: rgba(255,255,255,.7); transform: translateY(-1px); }
.wd-slots button .ico { font-size: 20px; line-height: 1.1; filter: saturate(.9); }
.wd-slots button b { font-size: 11px; font-weight: 800; letter-spacing: .3px; white-space: nowrap; }
.wd-slots button small { font-size: 10px; color: var(--ink-3); font-weight: 700; }
.wd-slots button.on { background: var(--ink-d); color: #fbf4e4; border-color: var(--ink-d); box-shadow: 0 6px 16px rgba(63,58,44,.3); }
.wd-slots button.on small { color: #d8cdb0; }
.wd-slots .dot { position: absolute; top: 6px; right: 10px; width: 8px; height: 8px; border-radius: 50%; background: #e8759a; box-shadow: 0 0 0 2px #fffbf3; }
.wd-slots .dot.gold { background: #e0b13f; animation: wd-pulse 1.4s infinite; }
.wd-slot-sep { flex: none; width: 1px; margin: 8px 4px; background: var(--line); }
@keyframes wd-pulse { 50% { transform: scale(1.35); } }

.wd-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 0 18px 12px; border-bottom: 1px solid rgba(160,137,106,.18); }
.wd-search { flex: 1 1 100%; display: flex; align-items: center; gap: 8px; padding: 0 14px; height: 40px; border-radius: 14px; background: #fffdf8; border: 1px solid var(--line); box-shadow: 0 1px 0 rgba(0,0,0,.03) inset; }
.wd-search span { font-size: 18px; color: var(--ink-3); }
.wd-search input { flex: 1; border: 0; background: transparent; font: inherit; font-size: 14px; color: var(--ink-d); outline: none; user-select: text; }
.wd-seg { display: inline-flex; padding: 3px; border-radius: 12px; background: rgba(160,137,106,.13); }
.wd-seg button { border: 0; background: transparent; padding: 6px 12px; border-radius: 9px; font-size: 12px; font-weight: 800; color: var(--ink-2); cursor: pointer; }
.wd-seg button.on { background: #fffdf8; color: var(--ink-d); box-shadow: 0 1px 4px rgba(0,0,0,.1); }
.wd-rarity { display: inline-flex; gap: 4px; }
.wd-rarity button { border: 1.5px solid color-mix(in srgb, var(--r) 55%, transparent); background: transparent; color: color-mix(in srgb, var(--r) 70%, #3f3a2c); padding: 4px 9px; border-radius: 99px; font-size: 10.5px; font-weight: 800; letter-spacing: .6px; text-transform: uppercase; cursor: pointer; }
.wd-rarity button.on { background: var(--r); color: #fff; border-color: var(--r); }
#wd-sort { margin-left: auto; border: 1px solid var(--line); background: #fffdf8; border-radius: 10px; padding: 6px 8px; font: inherit; font-size: 12px; font-weight: 700; color: var(--ink-d); }

.wd-body { flex: 1; overflow-y: auto; padding: 14px 16px 18px; scrollbar-width: thin; scrollbar-color: rgba(160,137,106,.4) transparent; }
.wd-empty, .wd-intro { color: var(--ink-2); font-size: 13px; margin: 2px 4px 12px; line-height: 1.45; }

/* ---------- item cards ---------- */
.wd-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 12px; perspective: 900px; }
.wd-card { --r: #8dbb6f; --rx: 0deg; --ry: 0deg; --gx: 50%; --gy: 0%; position: relative; display: flex; flex-direction: column; padding: 0; border: 0; border-radius: 18px; background: #fffdf8; cursor: pointer; text-align: left; color: var(--ink-d); box-shadow: 0 1px 0 rgba(255,255,255,.9) inset, 0 0 0 1px rgba(160,137,106,.16), 0 4px 14px rgba(60,44,20,.07); transform: rotateX(var(--rx)) rotateY(var(--ry)); transform-style: preserve-3d; transition: transform .18s ease-out, box-shadow .2s; }
.wd-card:hover, .wd-card:focus-visible { box-shadow: 0 0 0 2px color-mix(in srgb, var(--r) 70%, #fff), 0 14px 30px color-mix(in srgb, var(--r) 30%, rgba(60,44,20,.2)); outline: none; }
.wd-thumb { position: relative; aspect-ratio: 1; border-radius: 18px 18px 12px 12px; overflow: hidden; background: radial-gradient(90% 80% at 50% 38%, color-mix(in srgb, var(--r) 14%, #fffaf0) 0%, color-mix(in srgb, var(--r) 30%, #f1e8d6) 100%); }
.wd-thumb::after { content: ''; position: absolute; left: 12%; right: 12%; bottom: 7%; height: 9%; border-radius: 50%; background: radial-gradient(closest-side, rgba(60,40,20,.2), transparent); }
.wd-thumb img { position: relative; z-index: 1; width: 100%; height: 100%; object-fit: contain; opacity: 0; transform: scale(.94) translateZ(20px); transition: opacity .35s, transform .35s; }
.wd-card.ready .wd-thumb img { opacity: 1; transform: scale(1); }
.wd-card:hover .wd-thumb img { transform: scale(1.06); }
.shimmer { position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, rgba(255,255,255,.55) 50%, transparent 70%); background-size: 250% 100%; animation: wd-shimmer 1.3s infinite; }
.wd-card.ready .shimmer { display: none; }
@keyframes wd-shimmer { from { background-position: 150% 0; } to { background-position: -100% 0; } }
.glare { position: absolute; inset: 0; z-index: 2; pointer-events: none; opacity: 0; background: radial-gradient(60% 50% at var(--gx) var(--gy), rgba(255,255,255,.55), transparent 70%); transition: opacity .2s; }
.wd-card:hover .glare { opacity: 1; }
.none-ico { position: absolute; inset: 0; display: grid; place-items: center; font-size: 42px; opacity: .45; filter: grayscale(.4); }
.none-ico i { position: absolute; width: 58%; height: 3px; background: #b99a76; transform: rotate(-35deg); border-radius: 3px; }
.wd-meta { display: flex; flex-direction: column; gap: 2px; padding: 9px 11px 11px; }
.wd-meta b { font-size: 13px; font-weight: 800; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wd-r { font-size: 9.5px; font-weight: 800; letter-spacing: 1.2px; text-transform: uppercase; color: color-mix(in srgb, var(--r) 80%, #3f3a2c); }
.wd-meta .price { margin-top: 3px; font-size: 12.5px; font-weight: 800; color: #6b4a1a; display: inline-flex; align-items: center; gap: 4px; }
.wd-meta .price .coin { width: 12px; height: 12px; }
.wd-meta .price.tag { font-size: 11px; color: #7a4f8a; }
.wd-meta .own { margin-top: 3px; font-size: 11.5px; font-weight: 800; color: var(--moss-3); }
.wd-meta .own.eq { color: #2f6b3a; }
.wd-badges { position: absolute; top: 8px; left: 8px; right: 8px; z-index: 3; display: flex; gap: 4px; pointer-events: none; }
.wd-badges i { font-style: normal; display: grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 99px; font-size: 11px; font-weight: 900; background: rgba(255,253,248,.92); box-shadow: 0 2px 6px rgba(0,0,0,.12); }
.wd-badges .b-eq { background: #5c9a47; color: #fff; }
.wd-badges .b-new { background: linear-gradient(135deg, #f28bb0, #e8759a); color: #fff; font-size: 9px; letter-spacing: 1px; }
.wd-badges .b-set, .wd-badges .b-dye { margin-left: auto; }
.wd-badges .b-set + .b-dye { margin-left: 0; }
.wd-card.equipped { box-shadow: 0 0 0 2px #7fb266, 0 6px 18px rgba(92,154,71,.2); }
.wd-card.trying:not(.equipped) { box-shadow: 0 0 0 2px var(--ink-d), 0 10px 24px rgba(63,58,44,.22); }
.wd-card.selected::before { content: ''; position: absolute; inset: -5px; border-radius: 22px; border: 2px dashed color-mix(in srgb, var(--r) 70%, #3f3a2c); pointer-events: none; }
.wd-card:not(.owned) .wd-thumb img { filter: saturate(.92); }
/* rarity finishes */
.wd-card.r-rare .wd-thumb { background: radial-gradient(90% 80% at 50% 38%, #f3f8ff 0%, #cfe0f6 100%); }
.wd-card.r-epic .wd-thumb { background: radial-gradient(90% 80% at 50% 38%, #fbf5ff 0%, #e2cff3 100%); }
.wd-card.r-epic .wd-thumb::before { content: ''; position: absolute; inset: 0; background: radial-gradient(2px 2px at 20% 30%, #fff, transparent), radial-gradient(1.5px 1.5px at 75% 22%, #fff, transparent), radial-gradient(2px 2px at 64% 70%, #fff, transparent), radial-gradient(1.5px 1.5px at 32% 78%, #fff, transparent); animation: wd-twinkle 3s infinite alternate; }
.wd-card.r-legendary { background: linear-gradient(180deg, #fff9e8, #fff3d6); }
.wd-card.r-legendary .wd-thumb { background: radial-gradient(90% 80% at 50% 38%, #fffaf0 0%, #f4d998 100%); }
.wd-card.r-legendary .wd-thumb::before { content: ''; position: absolute; inset: -40%; background: conic-gradient(from 0deg, transparent 0 70%, rgba(255,236,170,.9) 78%, transparent 86%); animation: wd-spin 5s linear infinite; }
.wd-card.r-legendary { box-shadow: 0 0 0 1px #e8c56a, 0 6px 20px rgba(224,177,63,.25); }
@keyframes wd-spin { to { transform: rotate(360deg); } }
@keyframes wd-twinkle { from { opacity: .3; } to { opacity: 1; } }

/* ---------- the cart (panel footer) ---------- */
.wd-cart { padding: 12px 16px 14px; border-top: 1px solid rgba(160,137,106,.22); background: linear-gradient(180deg, rgba(255,248,232,.7), rgba(255,244,222,.95)); animation: wd-up .3s ease-out; }
@keyframes wd-up { from { transform: translateY(20px); opacity: 0; } }
.wd-cart-items { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; max-height: 64px; overflow-y: auto; }
.wd-cart .chip { font-size: 11.5px; font-weight: 700; padding: 5px 9px; border-radius: 99px; background: #fffdf8; border: 1px solid color-mix(in srgb, var(--r) 45%, #e3e2d2); color: var(--ink-d); }
.wd-cart-actions { display: flex; gap: 8px; }
.wd-cart-actions .wd-btn { flex: 1; }

/* ---------- buttons ---------- */
.wd-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 11px 14px; border-radius: 13px; border: 1px solid var(--line); background: #fffdf8; color: var(--ink-d); font: inherit; font-size: 13px; font-weight: 800; cursor: pointer; transition: transform .1s, box-shadow .15s, filter .15s; white-space: nowrap; }
.wd-btn:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 6px 14px rgba(60,44,20,.12); }
.wd-btn:active:not(:disabled) { transform: translateY(1px); }
.wd-btn:disabled { opacity: .55; cursor: not-allowed; }
.wd-btn .coin { width: 13px; height: 13px; }
.wd-btn.primary { background: linear-gradient(180deg, #9ccb7e, #7fb266); border-color: #6f9f58; color: #20361a; box-shadow: 0 3px 0 #5d8c47; }
.wd-btn.gold { background: linear-gradient(180deg, #ffe7a3, #f2c45a); border-color: #d9a441; color: #5a3a0a; box-shadow: 0 3px 0 #c08a2a; }
.wd-btn.gold.glow { animation: wd-glow 1.6s infinite; }
@keyframes wd-glow { 50% { box-shadow: 0 3px 0 #c08a2a, 0 0 22px rgba(242,196,90,.8); } }
.wd-btn.plum { background: linear-gradient(180deg, #d9c6ee, #b99ad8); border-color: #9c7cc0; color: #3a1f55; }
.wd-btn.ghost { background: rgba(255,253,248,.7); }
.wd-btn.ghost.danger { color: #b04a4a; flex: 0 0 auto; padding: 11px 12px; }
.wd-btn.done { background: #e6f1dd; color: #3f6b2f; border-color: #bfd9ae; opacity: 1; }

/* ---------- stage HUD ---------- */
.wd-hud { position: absolute; top: 18px; right: 78px; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; pointer-events: none; }
.wd-hud-row { display: flex; gap: 4px; padding: 5px; border-radius: 18px; background: var(--glass-2); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border: 1px solid var(--edge); box-shadow: 0 8px 24px rgba(40,28,14,.14); pointer-events: auto; }
.wd-hud-row button { display: flex; flex-direction: column; align-items: center; gap: 1px; min-width: 56px; padding: 6px 8px; border: 0; border-radius: 13px; background: transparent; color: var(--ink-d); cursor: pointer; transition: background .15s; }
.wd-hud-row button span { font-size: 18px; line-height: 1.1; }
.wd-hud-row button small { font-size: 9.5px; font-weight: 800; letter-spacing: .2px; white-space: nowrap; }
.wd-hud-row button:hover { background: rgba(255,255,255,.75); }
.wd-hud-row button.on { background: var(--ink-d); color: #fbf4e4; }
.wd-hud-row.small button { flex-direction: row; min-width: 0; padding: 7px 11px; font-size: 12px; font-weight: 800; }
.wd-hud-row .sep { width: 1px; margin: 4px 3px; background: rgba(160,137,106,.3); }
.wd-hint { font-size: 11px; font-weight: 700; color: rgba(255,251,243,.92); text-shadow: 0 1px 6px rgba(0,0,0,.45); letter-spacing: .4px; }

/* ---------- detail card ---------- */
.wd-detail { --r: #8dbb6f; position: absolute; right: 18px; bottom: 18px; width: min(390px, 34vw); padding: 18px 20px 18px; border-radius: 24px; background: var(--glass); backdrop-filter: blur(22px) saturate(1.3); -webkit-backdrop-filter: blur(22px) saturate(1.3); border: 1px solid var(--edge); box-shadow: 0 24px 60px rgba(40,28,14,.25); overflow: hidden; animation: wd-up .35s cubic-bezier(.2,.9,.3,1.1); }
.wd-detail::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 5px; background: linear-gradient(90deg, var(--r), color-mix(in srgb, var(--r) 40%, #fff), var(--r)); }
.wd-detail.r-legendary::before { height: 6px; background: linear-gradient(90deg, #e0b13f, #fff0b8, #e0b13f, #fff0b8, #e0b13f); background-size: 200% 100%; animation: wd-slide 3s linear infinite; }
@keyframes wd-slide { to { background-position: -200% 0; } }
.wd-d-top { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.wd-d-rarity { font-size: 10.5px; font-weight: 900; letter-spacing: 2px; text-transform: uppercase; color: #fff; background: var(--r); padding: 3px 9px; border-radius: 99px; }
.wd-d-slot { font-size: 12px; font-weight: 700; color: var(--ink-2); }
.wd-d-new { margin-left: auto; font-size: 10px; font-weight: 900; letter-spacing: 1px; color: #c24f7a; }
.wd-detail h3 { font-family: var(--serif); font-size: 27px; font-weight: 600; color: var(--ink-d); margin: 8px 0 4px; line-height: 1.1; }
.wd-d-desc { font-size: 13.5px; color: #6a6450; line-height: 1.45; margin-bottom: 12px; }
.wd-d-set { position: relative; display: flex; gap: 10px; align-items: center; width: 100%; padding: 9px 12px; margin-bottom: 12px; border-radius: 14px; border: 1px solid color-mix(in srgb, var(--s) 45%, #e3e2d2); background: color-mix(in srgb, var(--s) 10%, #fffdf8); cursor: pointer; text-align: left; overflow: hidden; font: inherit; color: var(--ink-d); }
.wd-d-set > span:first-child { font-size: 22px; }
.wd-d-set b { display: block; font-size: 13px; }
.wd-d-set small { font-size: 11.5px; color: var(--ink-2); }
.wd-d-set i { position: absolute; left: 0; bottom: 0; height: 3px; background: var(--s); }
.wd-d-dyes small { display: block; font-size: 10.5px; font-weight: 800; letter-spacing: 1.2px; text-transform: uppercase; color: var(--ink-3); margin-bottom: 6px; }
.wd-d-dyes > div { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.wd-d-dyes .sw { width: 24px; height: 24px; border-radius: 50%; border: 2px solid #fffdf8; background: var(--c); box-shadow: 0 0 0 1px rgba(0,0,0,.12), 0 2px 5px rgba(0,0,0,.12); cursor: pointer; transition: transform .12s; }
.wd-d-dyes .sw:hover { transform: scale(1.15); }
.wd-d-dyes .sw.on { box-shadow: 0 0 0 2px var(--ink-d), 0 3px 8px rgba(0,0,0,.2); transform: scale(1.12); }
.wd-d-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.wd-d-actions .wd-btn { flex: 1 1 auto; }

/* ---------- sets ---------- */
.wd-set { --s: #8dbb6f; margin-bottom: 14px; padding: 14px 14px 12px; border-radius: 20px; background: linear-gradient(180deg, color-mix(in srgb, var(--s) 9%, #fffdf8), #fffdf8); border: 1px solid color-mix(in srgb, var(--s) 30%, #e3e2d2); box-shadow: 0 4px 14px rgba(60,44,20,.06); }
.wd-set.done:not(.claimed) { box-shadow: 0 0 0 2px #e8c56a, 0 10px 30px rgba(224,177,63,.28); }
.wd-set header { display: flex; gap: 12px; align-items: flex-start; }
.wd-set header .ico { font-size: 30px; width: 46px; height: 46px; display: grid; place-items: center; border-radius: 14px; background: color-mix(in srgb, var(--s) 20%, #fff); flex: none; }
.wd-set h4 { font-family: var(--serif); font-size: 19px; font-weight: 600; color: var(--ink-d); }
.wd-set header p { font-size: 12.5px; color: var(--ink-2); line-height: 1.35; }
.wd-set .count { margin-left: auto; font-weight: 900; font-size: 15px; color: color-mix(in srgb, var(--s) 70%, #3f3a2c); }
.wd-set-bar { height: 5px; border-radius: 99px; background: color-mix(in srgb, var(--s) 16%, #efe9da); margin: 10px 0; overflow: hidden; }
.wd-set-bar i { display: block; height: 100%; background: var(--s); border-radius: 99px; transition: width .6s; }
.wd-set-items { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.wd-set-items .mini { position: relative; aspect-ratio: 1; border-radius: 12px; border: 1px solid rgba(160,137,106,.2); background: radial-gradient(circle at 50% 40%, #fffaf0, color-mix(in srgb, var(--r) 25%, #efe6d2)); padding: 0; cursor: pointer; overflow: hidden; }
.wd-set-items .mini img { width: 100%; height: 100%; object-fit: contain; filter: grayscale(.85) opacity(.55); transition: filter .2s; }
.wd-set-items .mini.got img { filter: none; }
.wd-set-items .mini span { position: absolute; right: 3px; bottom: 2px; font-size: 11px; font-weight: 900; color: #5c9a47; }
.wd-set footer { display: flex; align-items: center; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.wd-set .reward { display: flex; align-items: center; gap: 10px; flex: 1 1 180px; }
.wd-set .reward img { width: 52px; height: 52px; border-radius: 14px; background: radial-gradient(circle at 50% 40%, #fffaf0, #f4d998); object-fit: contain; box-shadow: 0 0 0 1px #e8c56a; }
.wd-set .reward small { display: block; font-size: 9.5px; font-weight: 900; letter-spacing: 1.5px; color: #b0894a; }
.wd-set .reward b { display: block; font-size: 13px; }
.wd-set .reward span { font-size: 12px; font-weight: 800; color: #6b4a1a; display: inline-flex; align-items: center; gap: 3px; }
.wd-set .acts { display: flex; gap: 6px; }

/* ---------- saved looks ---------- */
.wd-look-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.wd-look { padding: 8px; border-radius: 18px; background: #fffdf8; border: 1px solid rgba(160,137,106,.2); box-shadow: 0 4px 14px rgba(60,44,20,.06); }
.wd-look .thumb { aspect-ratio: 1; border-radius: 13px; background: radial-gradient(circle at 50% 40%, #fffaf0, #eadfc8); overflow: hidden; }
.wd-look .thumb img { width: 100%; height: 100%; object-fit: contain; }
.wd-look input { width: 100%; margin: 8px 0 6px; border: 0; border-bottom: 1px dashed var(--line); background: transparent; font: inherit; font-weight: 800; font-size: 13px; color: var(--ink-d); padding: 3px 2px; user-select: text; }
.wd-look .acts { display: flex; flex-wrap: wrap; gap: 5px; }
.wd-look .acts .wd-btn { padding: 7px 8px; font-size: 11.5px; flex: 1 1 auto; }
.wd-look.empty { display: grid; min-height: 200px; background: transparent; border: 2px dashed rgba(160,137,106,.3); box-shadow: none; }
.wd-add { border: 0; background: transparent; color: var(--ink-2); font: inherit; font-weight: 800; font-size: 12px; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; }
.wd-add span { font-size: 28px; color: var(--ink-3); }
.wd-code { display: flex; gap: 8px; margin-top: 14px; }
.wd-code input { flex: 1; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; font: inherit; font-size: 13px; background: #fffdf8; user-select: text; }

/* ---------- crates inside the atelier ---------- */
.wd-crates .case-shop { margin: 0; }

/* ---------- toast + photo flash ---------- */
.wd-msg { position: absolute; left: calc(18px + min(520px, 44vw) + (100vw - min(520px, 44vw) - 36px) / 2); top: 22px; transform: translate(-50%, -20px); max-width: 44vw; padding: 11px 18px; border-radius: 99px; background: rgba(63,58,44,.92); color: #fbf4e4; font-weight: 700; font-size: 13.5px; opacity: 0; pointer-events: none; transition: opacity .3s, transform .3s; box-shadow: 0 10px 30px rgba(0,0,0,.25); text-align: center; }
.wd-msg.show { opacity: 1; transform: translate(-50%, 0); animation: wd-msg 4s forwards; }
.wd-msg.good { background: rgba(62,98,48,.94); }
@keyframes wd-msg { 0%, 85% { opacity: 1; } 100% { opacity: 0; } }
.wd-flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
.wd-flash.go { animation: wd-flash .6s ease-out; }
@keyframes wd-flash { from { opacity: .85; } to { opacity: 0; } }
.wd-guest { font-size: 11.5px; color: var(--ink-2); padding: 8px 18px 12px; border-top: 1px solid rgba(160,137,106,.15); }
.wd-guest .text-btn { font-size: 11.5px; }

/* ---------- small screens: the panel becomes a bottom sheet, the stage sits above it ---------- */
@media (max-width: 899px) {
  .wd-panel { left: 0; right: 0; top: auto; bottom: 0; width: auto; height: 58vh; border-radius: 26px 26px 0 0; animation: wd-sheet .45s cubic-bezier(.2,.9,.3,1.05); }
  @keyframes wd-sheet { from { transform: translateY(40px); opacity: 0; } }
  .wd-head { padding: 14px 16px 4px; }
  .wd-title h2 { font-size: 28px; }
  .wd-collection { padding: 2px 16px 8px; }
  .wd-grid { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 9px; }
  .wd-hud { top: calc(10px + env(safe-area-inset-top)); right: 8px; left: 8px; align-items: stretch; gap: 5px; }
  .wd-hud-row { overflow-x: auto; scrollbar-width: none; }
  .wd-hud-row button { min-width: 50px; padding: 5px 6px; }
  .wd-hud-row button small { font-size: 8.5px; }
  .wd-hint { display: none; }
  .wd-detail { left: 8px; right: 8px; width: auto; bottom: calc(58vh + 8px); padding: 12px 14px; border-radius: 18px; }
  .wd-detail h3 { font-size: 20px; margin: 4px 0 2px; }
  .wd-d-desc { display: none; }
  .wd-d-set { display: none; }
  .wd-d-dyes > div { flex-wrap: nowrap; overflow-x: auto; }
  .wd-msg { left: 50%; top: auto; bottom: calc(58vh + 12px); max-width: 90vw; }
}
@media (max-width: 899px) and (max-height: 520px) {
  .wd-panel { height: auto; top: 8px; bottom: 8px; left: auto; right: 8px; width: 52vw; border-radius: 22px; }
  .wd-detail { bottom: 8px; left: 8px; right: auto; width: 40vw; }
  .wd-hud { left: 8px; right: auto; width: 44vw; }
}
.wd-modes { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 6px; }
.wd-slots .wd-modes button { flex-direction: row; justify-content: center; gap: 7px; padding: 8px 6px; border: 1px solid rgba(160,137,106,.22); background: rgba(255,253,248,.6); }
.wd-slots .wd-modes button .ico { font-size: 16px; }
.wd-slots .wd-modes button.on { background: var(--ink-d); border-color: var(--ink-d); }
.wd-slots button b { overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
@media (max-width: 899px) { .wd-slots { grid-template-columns: repeat(8, 68px); overflow-x: auto; scrollbar-width: none; } .wd-modes { grid-column: 1 / -1; } }

/* only the item list scrolls and shrinks; everything else in the panel keeps its size */
.wd-head, .wd-collection, .wd-slots, .wd-tools, .wd-cart, .wd-guest { flex-shrink: 0; }
.wd-body { min-height: 0; }

@media (max-width: 899px) {
  .wd-panel { height: 60vh; }
  .wd-hud { flex-direction: row; align-items: center; gap: 6px; right: 62px; }
  .wd-hud-row { flex: 1 1 auto; padding: 3px; border-radius: 14px; }
  .wd-hud-row button { min-width: 36px; padding: 5px 4px; }
  .wd-hud-row button small { display: none; }
  .wd-hud-row button span { font-size: 17px; }
  #wd-focus { display: none; }
  .wd-collection { display: none; }
  .wd-head { padding: 12px 14px 4px; }
  .wd-title small { display: none; }
  .wd-title h2 { font-size: 24px; }
  .wd-coins { padding: 6px 11px; font-size: 14px; }
  .wd-x { width: 34px; height: 34px; }
  .wd-slots { padding: 2px 10px 8px; }
  .wd-slots button { padding: 6px 2px 4px; }
  .wd-slots button .ico { font-size: 17px; }
  .wd-slots .wd-modes button { padding: 6px 4px; font-size: 11px; }
  .wd-tools { gap: 6px; padding: 0 12px 8px; }
  .wd-search { height: 36px; }
  .wd-rarity { display: none; }
  #wd-sort { margin-left: auto; }
  .wd-body { padding: 10px 10px 14px; }
  .wd-meta { padding: 7px 8px 8px; }
  .wd-meta b { font-size: 12px; }
  .wd-cart { padding: 8px 10px 10px; }
  .wd-cart-items { display: none; }
  .wd-cart .wd-btn { padding: 9px 8px; font-size: 12px; }
  .wd-guest { display: none; }
  .wd-detail { bottom: calc(60vh + 8px); padding: 10px 12px; }
  .wd-detail::before { height: 4px; }
  .wd-d-top { display: none; }
  .wd-detail h3 { font-size: 18px; margin: 0 0 6px; }
  .wd-d-dyes small { display: none; }
  .wd-d-dyes > div { margin-bottom: 8px; }
  .wd-d-actions .wd-btn { padding: 8px 10px; font-size: 12px; }
  .wd-msg { bottom: calc(60vh + 12px); }
}
@media (max-width: 899px) { .wd-modes { position: sticky; left: 0; width: calc(100vw - 20px); } }

/* You: skin tone and eye colour */
.wd-modes { grid-template-columns: repeat(4, 1fr); }
.wd-you-card { padding: 16px 16px 8px; border-radius: 20px; background: linear-gradient(180deg, #fff6ec, #fffdf8); border: 1px solid #eadfcd; box-shadow: 0 4px 14px rgba(60,44,20,.06); }
.wd-you-card h4 { font-family: var(--serif); font-size: 21px; font-weight: 600; color: var(--ink-d); }
.wd-you-card header p { font-size: 12.5px; color: var(--ink-2); line-height: 1.4; margin: 4px 0 14px; }
.wd-you-row small { display: block; font-size: 10.5px; font-weight: 800; letter-spacing: 1.2px; text-transform: uppercase; color: var(--ink-3); margin-bottom: 8px; }
.wd-you-row small em { font-style: normal; letter-spacing: .3px; text-transform: none; color: var(--ink); font-weight: 700; margin-left: 6px; }
.wd-you-sw { display: flex; flex-wrap: wrap; gap: 9px; margin-bottom: 16px; }
.wd-you-sw .sw { width: 36px; height: 36px; border-radius: 50%; border: 3px solid #fffdf8; background: radial-gradient(circle at 34% 30%, rgba(255,255,255,.45), transparent 42%), var(--c); box-shadow: 0 0 0 1px rgba(0,0,0,.12), 0 3px 7px rgba(0,0,0,.14); cursor: pointer; transition: transform .12s, box-shadow .12s; }
.wd-you-sw.eyes .sw { background: radial-gradient(circle, #16110e 0 26%, transparent 28%), radial-gradient(circle at 36% 32%, rgba(255,255,255,.5), transparent 40%), var(--c); }
.wd-you-sw .sw:hover { transform: scale(1.1); }
.wd-you-sw .sw.on { box-shadow: 0 0 0 2px var(--ink-d), 0 4px 10px rgba(0,0,0,.22); transform: scale(1.1); }
@media (max-width: 899px) { .wd-you-card { padding: 12px 12px 4px; } .wd-you-card header p { margin-bottom: 10px; } .wd-you-sw { gap: 5px; margin-bottom: 10px; } .wd-you-sw .sw { width: 29px; height: 29px; border-width: 2px; } }

/* Lighter graphics tiers: frosted-glass blur over a live 3D canvas is recomputed every frame, so low and medium use
   near-opaque panels instead (the look stays the same, the compositor does far less work). */
:root[data-gfx="low"] #wardrobe, :root[data-gfx="medium"] #wardrobe { --glass: rgba(255, 251, 243, .965); --glass-2: rgba(255, 251, 243, .9); }
:root[data-gfx="low"] #wardrobe *, :root[data-gfx="medium"] #wardrobe * { backdrop-filter: none !important; -webkit-backdrop-filter: none !important; }
