/* Dressing window (ตู้เสื้อผ้า): the same wooden sign and green leafy frame as the pet and shop windows. */
#wardrobe-dialog{--wr-ink:#4a3526;--wr-muted:#8b7358;--wr-green:#2f5b3e;--wr-gold:#d8ae5f;box-sizing:border-box;width:min(1080px,calc(100vw - 24px));max-width:none;max-height:calc(100dvh - 16px);margin:auto;padding:52px 0 0;overflow:visible;color:var(--wr-ink);border:0;background:transparent;font:14px/1.5 'Nunito Sans','Noto Sans Thai',Tahoma,sans-serif}
#wardrobe-dialog[open]{display:block}
#wardrobe-dialog::backdrop{background:radial-gradient(circle at 50% 40%,#16241a70,#070b08c9);backdrop-filter:blur(3px)}
#wardrobe-dialog *,#wardrobe-dialog *::before,#wardrobe-dialog *::after{box-sizing:border-box}
:where(#wardrobe-dialog) :where(button){font:inherit;color:inherit;cursor:pointer}
#wardrobe-dialog button:disabled{cursor:default}
#wardrobe-dialog :focus-visible{outline:3px solid #f0c75e;outline-offset:2px}
.wardrobe-frame{position:relative;display:flex;flex-direction:column;max-height:calc(100dvh - 68px);padding:10px 12px 12px;border-radius:24px;background:linear-gradient(180deg,#3d6d4a,#2f5b3e 30%,#29523a);box-shadow:0 0 0 2px #1a3323,inset 0 1px #6f9e76,0 28px 90px #050806e0}
.wardrobe-frame::before{content:'';position:absolute;inset:5px;border:2px solid #c9a55a;border-radius:20px;pointer-events:none}
.wardrobe-header{position:relative;min-height:44px}
.wardrobe-sign{position:absolute;z-index:2;left:50%;top:-46px;display:flex;flex-direction:column;align-items:center;justify-content:center;width:250px;height:82px;transform:translateX(-50%);border:3px solid var(--wr-gold);border-radius:22px;background:repeating-linear-gradient(0deg,#ffffff07 0 3px,transparent 3px 8px),linear-gradient(#80552f,#5d3a20 68%,#4a2d18);color:#fff1d2;box-shadow:inset 0 0 0 3px #5d3b22,inset 0 0 0 5px #c49a5588,0 5px 0 #34200f,0 12px 20px #0008}
.wardrobe-sign h2{margin:0;font-size:30px;font-weight:900;line-height:1.1;text-shadow:0 2px 0 #34200f}
.wardrobe-sign small{font-size:11px;letter-spacing:.2em;color:#ebd09a}
#wardrobe-close{position:absolute;z-index:3;top:-4px;right:2px;display:grid;place-items:center;width:44px;height:44px;padding:0;border:3px solid #e9dcc0;border-radius:50%;background:radial-gradient(circle at 40% 35%,#fffdf6,#ece2cc);color:#3b3024;font-size:28px;line-height:1;box-shadow:0 3px 0 #1a3323,0 4px 10px #0006}
.wardrobe-body{display:grid;grid-template-columns:210px minmax(260px,1fr) minmax(0,330px);grid-template-rows:minmax(0,1fr);flex:1 1 auto;gap:14px;min-height:0;overflow:hidden;padding:14px;border:2px solid #b8955e;border-radius:16px 16px 0 0;background:radial-gradient(90% 60% at 50% 0,#fffaf0,transparent 70%),#f5e9d2;box-shadow:inset 0 0 0 2px #fff6e499}
/* Categories */
.wardrobe-nav{display:flex;flex-direction:column;gap:10px;min-width:0;min-height:0;overflow:auto}
.wardrobe-groups{display:grid;grid-template-columns:1fr 1fr;gap:4px;padding:4px;border-radius:14px;background:#e8d7b6}
.wardrobe-groups button{min-height:36px;padding:0 6px;border:0;border-radius:10px;background:transparent;color:#6b4f35;font-weight:800;font-size:13px}
.wardrobe-groups button.active{background:linear-gradient(#468257,#2c5a3b);color:#fff6df;box-shadow:inset 0 1px #7fb08a,0 2px 0 #183221}
.wardrobe-categories{display:flex;flex-direction:column;gap:4px;min-height:0}
.wardrobe-category{display:grid;grid-template-columns:28px minmax(0,1fr) auto;align-items:center;gap:8px;min-height:38px;padding:4px 10px 4px 6px;border:1px solid transparent;border-radius:12px;background:transparent;text-align:left}
.wardrobe-category:hover{background:#fbf1de}
.wardrobe-category[aria-pressed=true]{border-color:#d3a970;background:linear-gradient(#fffaf0,#fcecc4);box-shadow:0 2px 0 #dfc59c}
.wardrobe-category-icon{display:grid;place-items:center;width:28px;height:28px;border-radius:9px;background:#efe1c4;color:#5d3a20;font-size:15px}
.wardrobe-category.is-chosen .wardrobe-category-icon{background:#dcebc9;color:#2f5b3e}
.wardrobe-category-name{overflow:hidden;font-weight:800;font-size:13.5px;white-space:nowrap;text-overflow:ellipsis}
.wardrobe-category-count{color:var(--wr-muted);font-size:11.5px;white-space:nowrap}
.wardrobe-category.is-empty .wardrobe-category-name{color:#9b8468}
.wardrobe-category.is-chosen .wardrobe-category-count{color:#3f6128;font-weight:800}
/* Preview */
.wardrobe-stage{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;min-width:0;padding:10px;border:2px solid #d4b47e;border-radius:18px;background:radial-gradient(circle at 50% 45%,#fffdf5,#f3e3c2 60%,#e7d0a6)}
#wardrobe-preview{display:block;width:min(100%,360px);height:auto;aspect-ratio:360/440}
.wardrobe-stage-tools{display:flex;gap:8px}
.wardrobe-stage-tools button{min-width:44px;min-height:40px;padding:0 14px;border:1px solid #cfae79;border-radius:12px;background:#fff7e8;color:#6b4f35;font-weight:800;font-size:15px}
.wardrobe-stage-tools button:hover{background:#fdf0da}
.wardrobe-stage-tools button[aria-pressed=true]{background:#dcebc9;border-color:#8fb779;color:#2f5b3e}
.wardrobe-model-note{margin:0;padding:6px 12px;border-radius:10px;background:#fbe6c9;color:#8a5a1f;font-size:12.5px;text-align:center}
/* Choices */
.wardrobe-options{display:flex;flex-direction:column;gap:10px;min-width:0;min-height:0;overflow:auto;padding:2px 4px 6px}
.wardrobe-options h3{margin:0;font-size:22px;font-weight:900;color:var(--wr-green)}
.wardrobe-options>p{margin:-6px 0 0;color:#6d5a47;font-size:13px;line-height:1.6}
.wardrobe-choices{display:grid;grid-template-columns:repeat(auto-fill,minmax(92px,1fr));gap:8px}
.wardrobe-choice{display:flex;flex-direction:column;align-items:center;gap:3px;min-height:112px;padding:8px 6px;border:2px solid #e0c9a3;border-radius:14px;background:linear-gradient(#fffdf7,#f8ecd5);box-shadow:0 3px 0 #dfc59c;text-align:center;transition:transform .12s,border-color .12s}
.wardrobe-choice:hover:not(:disabled){transform:translateY(-2px);border-color:#d3a970}
.wardrobe-choice[aria-pressed=true]{border-color:#e2a93a;background:linear-gradient(#fffaf0,#fcecc4);box-shadow:0 0 0 3px #f6d57c,0 3px 0 #d6a64a}
.wardrobe-choice:disabled{opacity:.6}
.wardrobe-choice-art{display:grid;place-items:center;width:58px;height:58px;overflow:hidden;border-radius:12px;background:#f3e4c6}
.wardrobe-choice-art img{width:100%;height:100%;object-fit:contain}
.wardrobe-glyph{font-size:26px;color:#6b4f35}
.wardrobe-choice strong{font-size:12.5px;font-weight:900;line-height:1.3;overflow-wrap:anywhere}
.wardrobe-choice small{color:var(--wr-muted);font-size:11px;line-height:1.3}
.wardrobe-colors{display:flex;flex-direction:column;gap:8px}
.wardrobe-colors:empty,.wardrobe-visibility:empty{display:none}
.wardrobe-swatch-row h4{margin:0 0 4px;font-size:13px;font-weight:800;color:#6b4f35}
.wardrobe-swatches{display:flex;flex-wrap:wrap;gap:6px}
.wardrobe-swatch{width:34px;height:34px;padding:0;border:3px solid #fffaf0;border-radius:50%;background:var(--swatch,#ccc);box-shadow:0 0 0 1px #c9a86f,0 2px 0 #cfb28233}
.wardrobe-swatch.is-base{background:conic-gradient(#f1e3c6 0 25%,#fffaf0 0 50%,#f1e3c6 0 75%,#fffaf0 0) 50%/12px 12px}
.wardrobe-swatch[aria-pressed=true]{box-shadow:0 0 0 3px #e2a93a,0 2px 0 #cfb28233}
.wardrobe-toggle{min-height:40px;padding:0 14px;border:1px solid #cfae79;border-radius:12px;background:#fff7e8;color:#6b4f35;font-weight:800}
.wardrobe-toggle[aria-pressed=false]{background:#ece2cf;color:#8b7358}
/* Footer */
.wardrobe-footer{display:flex;align-items:center;gap:10px;padding:10px 14px;border:2px solid #b8955e;border-top:1px dashed #d8bf94;border-radius:0 0 16px 16px;background:#efe0c2}
.wardrobe-status{flex:1;min-width:0;margin:0;color:#5f4a37;font-size:13px;font-weight:700}
.wardrobe-status.bad{color:#a2402e}
.wardrobe-primary{min-height:46px;padding:6px 24px;border:2px solid var(--wr-gold);border-radius:14px;background:linear-gradient(#468257,#2c5a3b 60%,#244c31);color:#fff6df;font-size:16px;font-weight:900;text-shadow:0 2px 0 #183221;box-shadow:inset 0 1px #7fb08a,0 4px 0 #183221}
.wardrobe-primary:hover:not(:disabled){filter:brightness(1.08)}
.wardrobe-primary:disabled,.wardrobe-secondary:disabled{border-color:#cbb99b;background:#ddd0bb;color:#8b7a6a;text-shadow:none;box-shadow:none}
.wardrobe-secondary{min-height:44px;padding:0 14px;border:1px solid #cfae79;border-radius:12px;background:#fff7e8;color:#6b4f35;font-weight:800}
.wardrobe-secondary:hover:not(:disabled){background:#fdf0da}
/* Narrow windows: preview on top, categories as a scrolling row. */
@media (max-width:820px){
 .wardrobe-body{grid-template-columns:minmax(0,1fr);grid-template-rows:none;gap:10px;overflow:auto}
 .wardrobe-nav,.wardrobe-options{overflow:visible}
 .wardrobe-stage{order:-1;padding:6px}
 #wardrobe-preview{width:auto;max-height:34dvh}
 .wardrobe-categories{flex-direction:row;overflow-x:auto;padding-bottom:4px}
 .wardrobe-category{flex:none;grid-template-columns:24px auto;min-height:40px}
 .wardrobe-category-count{display:none}
 .wardrobe-footer{flex-wrap:wrap}
 .wardrobe-status{flex-basis:100%}
}
/* Short landscape screens (phones): three columns, compact preview. */
@media (max-height:560px) and (min-width:700px){
 #wardrobe-dialog{padding-top:8px;max-height:calc(100dvh - 8px)}
 .wardrobe-frame{max-height:calc(100dvh - 16px);padding:8px 10px 10px}
 .wardrobe-header{display:flex;align-items:center;min-height:40px;padding:0 44px 4px 10px}
 .wardrobe-sign{position:static;flex-direction:row;gap:10px;width:auto;height:auto;transform:none;border:0;background:none;box-shadow:none}
 .wardrobe-sign h2{font-size:20px}.wardrobe-sign small{font-size:10px}
 #wardrobe-close{top:0;right:4px;width:38px;height:38px;font-size:22px}
 .wardrobe-body{grid-template-columns:180px minmax(150px,.7fr) minmax(0,1fr);gap:8px;padding:8px;overflow:hidden}
 .wardrobe-stage{order:0;padding:4px}
 #wardrobe-preview{width:auto;height:100%;max-height:calc(100dvh - 170px)}
 .wardrobe-stage-tools button{min-height:34px;min-width:38px;padding:0 10px;font-size:13px}
 .wardrobe-groups button{font-size:12px;min-height:32px;padding:0 4px;white-space:nowrap}
 .wardrobe-categories{flex-direction:column;overflow:visible}
 .wardrobe-category{min-height:32px;grid-template-columns:24px minmax(0,1fr) auto}.wardrobe-category-icon{width:24px;height:24px}
 .wardrobe-nav,.wardrobe-options{overflow:auto}
 .wardrobe-options h3{font-size:18px}
 .wardrobe-choice{min-height:96px}.wardrobe-choice-art{width:46px;height:46px}
 .wardrobe-footer{flex-wrap:nowrap;padding:6px 10px}.wardrobe-status{flex-basis:auto;font-size:12px}
 .wardrobe-primary{min-height:38px;padding:4px 16px;font-size:14px}.wardrobe-secondary{min-height:36px;padding:0 10px}
}
/* Item 56 (docs/fashion-shop.md "ช่องทางได้ชุด"): festival pieces to claim free, and the ทั้งหมด / มีแล้ว filter.
   Both stay hidden unless the server sent festivals / locked pieces, so the window is unchanged otherwise. */
.wardrobe-festivals{display:grid;gap:8px;margin:0 0 10px}
.wardrobe-festivals[hidden],.wardrobe-filter[hidden]{display:none}
.wardrobe-festival{display:grid;gap:6px;padding:10px 12px;border:2px solid #e6b45c;border-radius:12px;background:linear-gradient(135deg,#fff6df,#fde8f0)}
.wardrobe-festival-name{font-size:15px;color:#7a3b12}
.wardrobe-festival-time{color:var(--wr-muted);font-size:12px}
.wardrobe-festival-pieces{display:flex;flex-wrap:wrap;gap:6px}
.wardrobe-claim{min-height:36px;max-width:100%;padding:4px 12px;border:1px solid #c98a2c;border-radius:999px;background:#fff3d6;color:#6b3d0e;font:inherit;font-weight:700;cursor:pointer;overflow-wrap:anywhere}
.wardrobe-claim:disabled{cursor:default;opacity:.6}
.wardrobe-filter{display:flex;gap:6px;margin:0 0 8px}
.wardrobe-filter-button{min-height:32px;padding:0 14px;border:1px solid #c9a86a;border-radius:999px;background:#fffaf0;color:var(--wr-ink);font:inherit;font-size:13px;cursor:pointer}
.wardrobe-filter-button[aria-pressed="true"]{background:var(--wr-green);border-color:var(--wr-green);color:#fff}