.dress-game{max-width:820px;margin:auto}.dress-game .game-toolbar{gap:8px}.dress-game .game-toolbar h2{font-size:clamp(19px,4vw,26px);white-space:normal;text-align:center}.dress-instruction{font-size:15px;line-height:1.4;text-align:center;margin:4px 0 12px;color:var(--muted)}.dress-workspace{--dress-height:clamp(270px,calc(100dvh - 285px),490px);display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.12fr);gap:14px;height:var(--dress-height)}.dress-doll-panel{display:flex;flex-direction:column;min-width:0;min-height:0;border:1px solid #eaf1fb;border-radius:23px;background:linear-gradient(#fffdf7,#eaf1fb);padding:9px}.dress-gender{display:flex;gap:4px;padding:3px;background:#eaf1fb;border-radius:12px;flex-shrink:0}.dress-gender button{min-height:35px;flex:1;padding:5px;border-radius:9px;background:transparent;font-size:14px;font-weight:700}.dress-gender button[aria-pressed=true]{background:var(--primary);color:white}.dress-stage{display:flex;justify-content:center;align-items:center;flex:1;min-height:0;min-width:0}.dress-figure{position:relative;flex:none}.dress-art{position:absolute;inset:0;pointer-events:none}.dress-art svg{display:block;width:100%;height:100%}.dress-target{position:absolute;border:2px dashed #536579;background:#f6d86222;border-radius:25%;min-width:0;min-height:0;touch-action:manipulation}.dress-target.is-over{background:#c9d8ed77;border:3px solid #3566a8;box-shadow:0 0 0 5px #eaf1fb99}.dress-target:focus-visible{outline:3px solid #266ac9;outline-offset:4px}.dress-wardrobe{display:flex;flex-direction:column;gap:9px;min-height:0;min-width:0}.dress-groups{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:5px;flex-shrink:0}.dress-groups button{background:#eaf1fb;border:1px solid #c9d8ed;border-radius:11px;min-height:39px;padding:5px 4px;font-size:13px;font-weight:700;line-height:1.2}.dress-groups button[aria-pressed=true]{background:var(--primary);border-color:var(--primary);color:white}.dress-items{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));align-content:start;gap:8px;overflow-y:auto;overflow-x:hidden;min-height:0;padding:3px 4px 7px;scrollbar-width:thin;scrollbar-color:#89a2c3 #eaf1fb;overscroll-behavior:contain}.dress-item{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;min-width:0;min-height:115px;padding:8px 5px;background:white;border:2px solid #c9d8ed;border-bottom-width:4px;border-radius:16px;touch-action:none;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none;gap:5px}.dress-item-art{height:70px;width:100%;display:block;pointer-events:none}.dress-item-art svg{display:block;width:100%;height:100%}.dress-item>span:not(.dress-item-art){font-size:13px;font-weight:700;line-height:1.25;text-align:center;pointer-events:none;overflow-wrap:anywhere}.dress-item.is-selected{background:#eaf1fb;border-color:#3566a8;box-shadow:0 0 0 1px #3566a8}.dress-item.is-worn{border-color:#89a2c3}.dress-item .dress-item-check{position:absolute;right:5px;top:1px;font-size:18px;color:#3566a8}.dress-message{font-size:14px;font-weight:650;line-height:1.4;text-align:center;color:var(--primary);min-height:40px;margin:9px 0 0}.dress-ready{padding:9px 12px;border-radius:12px;background:#eaf1fb;font-size:14px;color:var(--primary);font-weight:650;text-align:center}.dress-worn{display:flex;flex-wrap:wrap;justify-content:center;gap:6px;margin:7px 0 0}.dress-worn button{min-height:36px;padding:6px 9px;border-radius:12px;background:white;border:1px solid #c9d8ed;font-size:12px;font-weight:650}.dress-worn button span{font-size:16px;margin-left:3px}.dress-drag-ghost{position:fixed;z-index:80;pointer-events:none;transform:translate(-50%,-50%);width:100px;height:115px;filter:drop-shadow(0 3px 4px #3566a830)}.dress-drag-ghost svg{display:block;width:100%;height:100%}.dress-game button:focus-visible{outline:3px solid #266ac9;outline-offset:2px}.high-contrast .dress-item,.high-contrast .dress-doll-panel{border-color:var(--line)}
@media(max-width:600px){.dress-game .game-button{min-height:38px;padding:7px;font-size:12px}.dress-instruction{font-size:13px;margin:2px 0 8px}.dress-workspace{gap:8px}.dress-doll-panel{border-radius:17px;padding:5px}.dress-gender{gap:2px;padding:2px}.dress-gender button{font-size:12px;min-height:33px}.dress-groups{gap:4px}.dress-groups button{font-size:11px;min-height:34px;border-radius:9px;padding:4px 2px}.dress-wardrobe{gap:6px}.dress-items{gap:5px;padding:2px 2px 5px}.dress-item{min-height:96px;padding:5px 3px;gap:3px;border-radius:12px}.dress-item-art{height:57px}.dress-item>span:not(.dress-item-art){font-size:11px}.dress-message{font-size:12px;min-height:34px}.dress-ready{font-size:12px}.dress-worn{gap:4px}.dress-worn button{font-size:11px;min-height:33px;padding:5px 7px}}
@media(max-height:650px) and (orientation:portrait){.dress-workspace{--dress-height:clamp(250px,calc(100dvh - 260px),370px)}.dress-game .game-button{min-height:34px}.dress-instruction{font-size:12px}.dress-groups button{min-height:30px}.dress-item{min-height:83px}.dress-item-art{height:45px}.dress-message{margin-top:5px;min-height:30px}}
@media(max-height:500px) and (orientation:landscape){.dress-workspace{--dress-height:clamp(155px,calc(100dvh - 205px),260px);grid-template-columns:minmax(0,1fr) minmax(0,1.4fr);gap:12px}.dress-doll-panel{flex-direction:row;padding:4px;gap:4px}.dress-gender{flex-direction:column;align-self:flex-start;width:67px}.dress-gender button{font-size:11px;min-height:33px;padding:5px 3px}.dress-stage{height:100%}.dress-groups{grid-template-columns:repeat(3,minmax(0,1fr));gap:4px}.dress-groups button{font-size:11px;min-height:28px;padding:4px}.dress-wardrobe{gap:4px}.dress-items{grid-template-columns:repeat(3,minmax(0,1fr));gap:5px}.dress-item{min-height:76px;padding:3px}.dress-item-art{height:45px}.dress-item>span:not(.dress-item-art){font-size:11px}.dress-instruction{font-size:12px;margin:1px 0 5px}.dress-message{font-size:12px;min-height:18px;margin-top:4px}.dress-ready{font-size:12px;padding:5px}.dress-worn{margin-top:5px}}

.dress-tray-controls{display:flex;gap:5px;flex-shrink:0}.dress-tray-controls button{min-height:34px;border:1px solid #c9d8ed;background:#eaf1fb;border-radius:10px;padding:5px 9px;font-size:12px;font-weight:700}.dress-tray-controls button:last-child{flex:1}.dress-tray-controls button:disabled{opacity:.4}

/* Keep the outfit controls within reach on portrait phones. */
.dress-worn{flex-wrap:nowrap;justify-content:flex-start;overflow-x:auto;max-width:100%;padding-bottom:4px;scrollbar-width:thin}
.dress-worn button{flex:0 0 auto;white-space:nowrap}
@media(max-width:600px) and (orientation:portrait){.dress-workspace{--dress-height:clamp(240px,calc(100dvh - 365px),430px)}}
@media(max-height:650px) and (orientation:portrait){.dress-workspace{--dress-height:clamp(210px,calc(100dvh - 330px),300px)}}

/* Soft wooden-toy finish: the garment colours remain the child's visual guide. */
.dress-game .dress-doll-panel{background:linear-gradient(150deg,#fffdf9 0%,#f0f5fc 68%,#e4edf9 100%);border:1px solid #c9d8ed;box-shadow:inset 0 1px 0 #fff,0 6px 16px #24344b08}
.dress-game .dress-stage{position:relative;background:radial-gradient(ellipse at 50% 45%,#ffffffc9,transparent 69%);border-radius:16px}
.dress-game .dress-gender{border:1px solid #d2dff0;background:#e8eff9;box-shadow:inset 0 1px 3px #24344b09}
.dress-game .dress-gender button[aria-pressed=true]{background:linear-gradient(#4275b7,#3566a8);box-shadow:0 2px 5px #24344b1c,inset 0 1px 0 #ffffff38}
.dress-game .dress-groups button{display:flex;justify-content:flex-start;align-items:center;gap:5px;text-align:left;background:linear-gradient(#ffffff,#eef3fb);box-shadow:inset 0 1px 0 #fff,0 2px 0 #dbe5f2;color:var(--ink)}
.dress-game .dress-groups button[aria-pressed=true]{color:#fff;background:linear-gradient(#4275b7,#3566a8);box-shadow:inset 0 1px 0 #ffffff35,0 2px 0 #244b80}
.dress-group-icon{display:block;flex:0 0 22px;width:22px;height:22px;opacity:.9}
.dress-game .dress-groups button span{min-width:0}
.dress-game .dress-items{background:#eaf0f8;border:1px solid #d5e0ee;border-radius:17px;padding:7px 7px 10px;box-shadow:inset 0 2px 4px #24344b08;scroll-padding-block:7px}
.dress-game .dress-item{background:linear-gradient(145deg,#fff,#f9fbfe);border-color:#d3dfed;border-bottom-color:#bdcfe5;box-shadow:0 3px 6px #24344b0a,inset 0 1px 0 #fff}
.dress-game .dress-item-art{filter:drop-shadow(0 3px 1px #24344b12)}
.dress-game .dress-item.is-worn{border-color:#9cb8d9;border-bottom-color:#7399c7}
.dress-game .dress-item.is-selected{background:#e5effd;border-color:var(--primary);box-shadow:0 0 0 3px #3566a830,inset 0 1px 0 #fff}
.dress-game .dress-item-check{display:grid;place-content:center;right:4px;top:3px;width:21px;height:21px;border-radius:50%;background:#e7f0fc;border:1px solid #b6cce7;color:#244b80;font-size:14px}
.dress-game .dress-target{border:2.5px dashed var(--primary);background:#f2b59a34;box-shadow:0 0 0 4px #ffffffb0,inset 0 0 0 2px #ffffffa1;border-radius:22%}
.dress-game .dress-target.is-over{border-style:solid;background:#c6d9f260;box-shadow:0 0 0 5px #3566a833,inset 0 0 0 2px #fff}
.dress-game .dress-tray-controls button{background:linear-gradient(#fff,#eef3fb);box-shadow:0 2px 0 #d5e1f0}
.dress-game .dress-worn button{background:#f8fbff;border-color:#b6cce7;color:#244b80;box-shadow:0 1px 2px #24344b08}
.dress-worn-piece.is-settling{transform-box:fill-box;transform-origin:center;animation:dress-piece-settle 280ms ease-out 1}
@keyframes dress-piece-settle{0%{transform:translateY(-3px) scale(1.035)}65%{transform:translateY(1px) scale(.995)}100%{transform:none}}
.high-contrast .dress-game .dress-doll-panel,.high-contrast .dress-game .dress-items{background:var(--paper);border-color:var(--line)}
.high-contrast .dress-game .dress-item{border-color:var(--line);background:white}
.high-contrast .dress-game .dress-item.is-selected{border-color:var(--primary);box-shadow:0 0 0 3px var(--primary)}
.high-contrast .dress-game .dress-groups button{border-color:var(--line)}
@media(max-width:600px){.dress-game .dress-groups button{gap:3px;padding:4px}.dress-group-icon{flex-basis:17px;width:17px;height:17px}.dress-game .dress-items{padding:5px 4px 7px;border-radius:13px}.dress-game .dress-item-check{width:18px;height:18px;font-size:12px}.dress-game .dress-item.is-selected{box-shadow:0 0 0 2px #3566a838}}
@media(max-width:350px){.dress-group-icon{flex-basis:14px;width:14px;height:14px}.dress-game .dress-groups button{gap:2px;font-size:10px;padding:4px 2px}}
@media(max-height:500px) and (orientation:landscape){.dress-game .dress-items{padding:4px 5px 6px}.dress-group-icon{flex-basis:16px;width:16px;height:16px}}
@media(prefers-reduced-motion:reduce){.dress-worn-piece.is-settling{animation:none}}

/* The target remains easy to tap even when the doll scales down on a phone. */
.dress-game .dress-target{min-width:44px;min-height:44px}
.dress-game .dress-icon-button{width:64px;min-width:64px;height:64px;font-size:38px;color:var(--primary)}
