/* Project X: the /dresser page (inventory layout): race chips, then the room – the stage in the middle, slot squares on both sides,
   view controls under the figure; the item picker is a popover beside the clicked slot inside the room (a bottom sheet on phones). */
.l2 .l2-dress [hidden] { display: none; }
.l2 .l2-dress__note { color: var(--text-2); }
.l2 .l2-dress__races { margin: 0 0 10px; scroll-margin-top: calc(var(--header-h) + 8px); }
.l2 .l2-dress__room { position: relative; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: radial-gradient(circle at 50% 45%, #16255e, #060c28 70%); }
.l2 .l2-dress__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 14px 16px 0; }
.l2 .l2-dress__pose { display: block; font: 700 11px var(--font-body); letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }
/* top left: the pose line, the Animation and Aura menu buttons in a row under it (they wrap into a column when narrow) */
.l2 .l2-dress__corner { position: relative; z-index: 30; min-width: 0; }
.l2 .l2-dress__acts { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 6px; margin-top: 8px; }
.l2 .l2-dress__who { text-align: right; min-width: 0; }
.l2 .l2-dress__who b { display: block; font: 700 26px var(--font-head); color: var(--text-1); margin: 0 0 8px; }
.l2 .l2-dress__segs { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.l2 .l2-dress__seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 3px; background: var(--bg-1); }
.l2 .l2-dress__seg:empty { display: none; }
.l2 .l2-dress__segbtn { min-height: var(--touch); border: 0; border-radius: 999px; padding: 0 14px; background: none; color: var(--text-2);
    font: 700 12px var(--font-body); cursor: pointer; }
.l2 .l2-dress__segbtn.is-on { background: #102a63; color: var(--gold); }
.l2 .l2-dress__body { display: grid; grid-template-columns: 76px minmax(0, 1fr) 76px; align-items: center; padding: 0 12px; }
.l2 .l2-dress__col { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.l2 .l2-dress__stage { position: relative; height: 520px; overflow: hidden; }
.l2 .l2-dress__stage::before { content: ""; position: absolute; left: 50%; top: 48%; width: 420px; height: 420px; margin: -210px 0 0 -210px;
    border: 2px solid rgba(255, 218, 132, .08); border-radius: 50%; }
.l2 .l2-dress__canvas { position: relative; display: block; width: 100%; height: 100%; touch-action: none; }
.l2 .l2-dress__stage.is-loading { opacity: .7; }
.l2 .l2-dress__ctl { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px; width: fit-content; max-width: 100%; box-sizing: border-box;
    margin: 0 auto; padding: 8px; border: 1px solid var(--line); border-radius: 12px; background: rgba(2, 8, 38, .72); }
.l2 .l2-dress__bar { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
/* the bottom row: the view controls in the middle, Copy link in the bottom right corner of the room */
.l2 .l2-dress__foot { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: end; gap: 8px; padding: 0 12px; }
.l2 .l2-dress__foot .l2-dress__ctl { grid-column: 2; }
.l2 .l2-dress__copy { grid-column: 3; justify-self: end; }
.l2 .l2-dress__tool, .l2 .l2-dress__more, .l2 .l2-dress__close { min-height: var(--touch); border: 1px solid var(--line); border-radius: 8px;
    background: var(--bg-1); color: var(--text-1); font: 700 12.5px var(--font-body); padding: 0 12px; cursor: pointer; }
.l2 .l2-dress__tool { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-width: var(--touch); padding: 0 8px; color: var(--text-2); background: #020826; }
.l2 .l2-dress__tool--txt { padding: 0 12px; }
/* the Animation and Aura menus: a popover under their button (a bottom sheet on phones), grouped, the chosen one marked */
.l2 .l2-dress__animwrap { position: relative; display: inline-flex; }
.l2 .l2-dress__tool[aria-expanded="true"] { border-color: var(--gold); color: var(--gold); }
.l2 .l2-dress__animmenu { position: absolute; z-index: 30; top: 100%; left: 0; width: 240px; margin: 6px 0 0; max-height: 340px; overflow-y: auto;
    box-sizing: border-box; padding: 6px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-1); box-shadow: 0 10px 28px rgba(0, 0, 0, .55); }
.l2 .l2-dress__animmenu[hidden] { display: none; }
.l2 .l2-dress__animgroup { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 4px; }
.l2 .l2-dress__animhead { display: block; padding: 4px 8px 2px; font: 700 10.5px var(--font-body); letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }
.l2 .l2-dress__animitem { display: flex; align-items: center; width: 100%; min-height: var(--touch); border: 0; border-radius: 6px; background: none; color: var(--text-1);
    font: 600 13px var(--font-body); text-align: left; padding: 0 10px 0 26px; cursor: pointer; position: relative; }
.l2 .l2-dress__animitem:hover, .l2 .l2-dress__animitem:focus { background: #102a63; }
.l2 .l2-dress__animitem:focus-visible { outline: 2px solid var(--focus); }
.l2 .l2-dress__animitem[aria-checked="true"] { color: var(--gold); }
.l2 .l2-dress__animitem[aria-checked="true"]::before { content: ""; position: absolute; left: 10px; top: 50%; width: 7px; height: 7px; margin-top: -4px; border-radius: 50%; background: var(--gold); }
.l2 .l2-dress__tool:hover { color: var(--text-1); border-color: #4a5f9a; background: #0a1a45; }
.l2 .l2-dress__ico { width: 16px; height: 16px; flex: none; display: block; }
.l2 .l2-dress__ico--play { display: none; }
.l2 .l2-dress__tool[aria-pressed="true"] .l2-dress__ico--pause { display: none; }
.l2 .l2-dress__tool[aria-pressed="true"] .l2-dress__ico--play { display: block; }
.l2 .l2-dress__tool[aria-pressed="true"] { border-color: var(--gold); color: var(--gold); }
/* project AB: an aura is on (the Aura menu button) */
.l2 .l2-dress__tool.is-on { border-color: var(--gold); color: var(--gold); }
.l2 .l2-dress__ico--collapse { display: none; }
.l2 .l2-dress__tool[aria-pressed="true"] .l2-dress__ico--expand { display: none; }
.l2 .l2-dress__tool[aria-pressed="true"] .l2-dress__ico--collapse { display: block; }
/* full screen: the room fills the screen, the stage takes the free height (.is-fs mirrors :fullscreen for checks) */
.l2 .l2-dress__room:fullscreen, .l2 .l2-dress__room.is-fs { display: flex; flex-direction: column; width: 100%; height: 100%; border: 0; border-radius: 0; overflow: auto;
    background: radial-gradient(circle at 50% 45%, #16255e, #060c28 70%); }
.l2 .l2-dress__room:-webkit-full-screen { display: flex; flex-direction: column; width: 100%; height: 100%; border: 0; border-radius: 0; overflow: auto;
    background: radial-gradient(circle at 50% 45%, #16255e, #060c28 70%); }
.l2 .l2-dress__room:fullscreen .l2-dress__body, .l2 .l2-dress__room.is-fs .l2-dress__body { flex: 1 0 auto; min-height: 340px; align-items: stretch; }
.l2 .l2-dress__room:fullscreen .l2-dress__body .l2-dress__stage, .l2 .l2-dress__room.is-fs .l2-dress__body .l2-dress__stage { height: auto; min-height: 300px; align-self: stretch; }
.l2 .l2-dress__room:fullscreen .l2-dress__canvas, .l2 .l2-dress__room.is-fs .l2-dress__canvas { position: absolute; top: 0; left: 0; }
.l2 .l2-dress__room:fullscreen .l2-dress__foot, .l2 .l2-dress__room.is-fs .l2-dress__foot { flex: none; margin-bottom: 8px; }
.l2 .l2-dress__lbl { display: block; font: 700 11px var(--font-body); letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); margin: 0 0 6px; }
.l2 .l2-dress__chips { display: flex; flex-wrap: wrap; gap: 6px; }
.l2 .l2-dress__chip { display: inline-flex; align-items: center; gap: 6px; min-height: var(--touch); border: 1px solid var(--line); border-radius: 999px; padding: 0 12px; font: 700 12px var(--font-body);
    color: var(--text-2); background: var(--bg-1); cursor: pointer; }
.l2 .l2-dress__race { width: 20px; height: 20px; flex: none; }
.l2 .l2-dress__sym { font-size: 14px; }
.l2 .l2-dress__chip.is-on { border-color: var(--gold); color: var(--gold); }
.l2 .l2-dress__slot { display: flex; flex-direction: column; align-items: center; width: 60px; padding: 0; border: 0; background: none; color: var(--text-2); cursor: pointer; }
.l2 .l2-dress__ic { display: flex; align-items: center; justify-content: center; box-sizing: border-box; width: 52px; height: 52px; border: 1px solid var(--line);
    border-radius: 10px; background: rgba(2, 8, 38, .7); color: var(--text-3); font: 600 15px var(--font-head); }
.l2 .l2-dress__slot.is-ghost .l2-dress__ic img { opacity: .4; }
.l2 .l2-dress__slot.is-sel .l2-dress__ic { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold); }
.l2 .l2-dress__slot[disabled] { opacity: .45; cursor: default; }
.l2 .l2-dress__slot small { display: block; margin-top: 4px; font: 700 10px var(--font-body); color: var(--text-2); }
.l2 .l2-dress__msg { min-height: 1.2em; color: var(--text-2); font-size: 13px; text-align: center; margin: 4px 12px 10px; }
.l2 .l2-dress__pick { position: absolute; z-index: 20; top: 8px; display: flex; flex-direction: column; box-sizing: border-box; width: 340px; max-height: 440px;
    border: 1px solid var(--line); border-radius: 12px; background: var(--bg-1); padding: 10px; box-shadow: 0 10px 28px rgba(0, 0, 0, .55); }
.l2 .l2-dress__pick[data-side="left"] { left: 96px; }
.l2 .l2-dress__pick[data-side="right"] { right: 96px; }
.l2 .l2-dress__pick::before { content: ""; position: absolute; top: var(--arrow, 24px); width: 11px; height: 11px; background: var(--bg-1); transform: rotate(45deg); }
.l2 .l2-dress__pick[data-side="left"]::before { left: -7px; border-left: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.l2 .l2-dress__pick[data-side="right"]::before { right: -7px; border-top: 1px solid var(--line); border-right: 1px solid var(--line); }
.l2 .l2-dress__pickhead { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.l2 .l2-dress__fold { margin-left: auto; display: inline-flex; align-items: center; justify-content: center; padding: 0 10px; }
.l2 .l2-dress__pick.is-folded .l2-dress__ico--fold { transform: rotate(180deg); }
/* folded: only the head and the worn item, so the figure shows */
.l2 .l2-dress__pick.is-folded .l2-dress__list, .l2 .l2-dress__pick.is-folded .l2-dress__more, .l2 .l2-dress__pick.is-folded .l2-dress__filters { display: none; }
.l2 .l2-dress__cur { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 6px; padding: 4px 4px 4px 6px; border: 1px solid #6b5a2a; border-radius: 8px;
    background: #102a63; color: var(--text-1); }
.l2 .l2-dress__cur[hidden] { display: none; }
.l2 .l2-dress__cur img { width: 28px; height: 28px; border-radius: 4px; flex: none; }
.l2 .l2-dress__cur .l2-dress__name { flex: 1 1 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.l2 .l2-dress__unpin { flex: none; min-width: var(--touch); padding: 0; }
.l2 .l2-dress__set { flex: 1 1 100%; min-height: var(--touch); border: 1px solid var(--gold); border-radius: 8px; background: #020826; color: var(--gold);
    font: 700 12.5px var(--font-body); padding: 0 12px; cursor: pointer; }
.l2 .l2-dress__set:hover { background: #0a1a45; }
.l2 .l2-dress__enchwrap { display: flex; align-items: center; gap: 8px; flex: 1 1 100%; color: var(--text-2); font: 700 12px var(--font-body); }
.l2 .l2-dress__ench { flex: 1 1 auto; min-width: 0; min-height: var(--touch); border: 1px solid var(--line); border-radius: 8px; background: #020826;
    color: var(--text-1); }
.l2 .l2-dress__ench:focus-visible { outline: 2px solid var(--focus); }
.l2 .l2-dress__filters { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.l2 .l2-dress__q { flex: 1 1 auto; min-width: 0; min-height: var(--touch); box-sizing: border-box; border: 1px solid var(--line); border-radius: 8px;
    background: #020826; color: var(--text-1); padding: 0 10px; flex-basis: 100%; }
.l2 .l2-dress__fld { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.l2 .l2-dress__fld[hidden], .l2 .l2-dress__fclr[hidden] { display: none; }
.l2 .l2-dress__flbl { font: 700 11px/14px var(--font-body); color: var(--text-3); text-transform: uppercase; letter-spacing: .04em; }
.l2 .l2-dress__fsel { display: flex; align-items: stretch; gap: 4px; }
.l2 .l2-dress__fclr { flex: none; min-width: var(--touch); min-height: var(--touch); border: 1px solid var(--line); border-radius: 8px; background: #020826;
    color: var(--text-1); font-size: 18px; line-height: 1; cursor: pointer; }
.l2 .l2-dress__fclr:hover { background: #102a63; }
.l2 .l2-dress__fclr:focus-visible { outline: 2px solid var(--focus); }
.l2 .l2-dress__grade, .l2 .l2-dress__type { flex: 1 1 0; min-width: 0; }
.l2 .l2-dress__grade { min-height: var(--touch); border: 1px solid var(--line); border-radius: 8px; background: #020826; color: var(--text-1); }
.l2 .l2-dress__list { list-style: none; margin: 0; padding: 0; flex: 1 1 auto; min-height: 0; overflow-y: auto; }
.l2 .l2-dress__item { display: flex; align-items: center; gap: 8px; width: 100%; min-height: var(--touch); border: 0; border-radius: 6px; background: none;
    color: var(--text-1); text-align: left; padding: 4px 6px; cursor: pointer; }
.l2 .l2-dress__item:hover, .l2 .l2-dress__item.is-on { background: #102a63; }
.l2 .l2-dress__item img { width: 28px; height: 28px; border-radius: 4px; }
.l2 .l2-dress__g { margin-left: auto; font: 800 10px/16px var(--font-body); border: 1px solid #6b5a2a; border-radius: 4px; padding: 0 5px; color: var(--gold); }
.l2 .l2-dress__none { color: var(--text-3); padding: 8px 6px; }
.l2 .l2-dress__tool:focus-visible, .l2 .l2-dress__segbtn:focus-visible, .l2 .l2-dress__chip:focus-visible, .l2 .l2-dress__slot:focus-visible, .l2 .l2-dress__item:focus-visible,
.l2 .l2-dress__set:focus-visible { outline: 2px solid var(--focus); }

@media (min-width: 900px) {
    .l2 .l2-dress__tool { min-height: 34px; min-width: 34px; }
    /* a wide popover: the head, the worn item and the filters stacked on the left, the list in its own full-height column */
    .l2 .l2-dress__pick { display: grid; grid-template-columns: 220px minmax(0, 1fr); grid-template-rows: auto auto auto 1fr auto; column-gap: 12px;
        align-items: start; width: 640px; max-height: 504px; height: 504px; }
    .l2 .l2-dress__pickhead, .l2 .l2-dress__cur, .l2 .l2-dress__filters { grid-column: 1; }
    .l2 .l2-dress__cur .l2-dress__name { white-space: normal; }
    .l2 .l2-dress__filters { flex-direction: column; flex-wrap: nowrap; }
    .l2 .l2-dress__filters > * { flex: none; width: 100%; }
    .l2 .l2-dress__fclr { min-width: 34px; min-height: 34px; }
    .l2 .l2-dress__grade { min-height: 34px; }
    .l2 .l2-dress__list { grid-column: 2; grid-row-start: 1; grid-row-end: span 4; align-self: stretch; max-height: none; overflow-y: auto; }
    .l2 .l2-dress__more { grid-column: 2; grid-row-start: 5; margin-top: 6px; }
    /* right-hand slots: mirrored - the head, the worn item and the filters by the slots, the list towards the figure */
    .l2 .l2-dress__pick[data-side="right"] { grid-template-columns: minmax(0, 1fr) 220px; }
    .l2 .l2-dress__pick[data-side="right"] .l2-dress__pickhead, .l2 .l2-dress__pick[data-side="right"] .l2-dress__cur,
    .l2 .l2-dress__pick[data-side="right"] .l2-dress__filters { grid-column: 2; }
    .l2 .l2-dress__pick[data-side="right"] .l2-dress__list, .l2 .l2-dress__pick[data-side="right"] .l2-dress__more { grid-column: 1; }
    .l2 .l2-dress__pick.is-folded, .l2 .l2-dress__pick.is-folded[data-side="right"] { grid-template-columns: 220px; width: 242px; height: auto; }
    .l2 .l2-dress__pick.is-folded[data-side="right"] .l2-dress__pickhead, .l2 .l2-dress__pick.is-folded[data-side="right"] .l2-dress__cur { grid-column: 1; }
}

@media (max-width: 899px) {
    .l2 .l2-dress__body { grid-template-columns: 54px minmax(0, 1fr) 54px; padding: 0 6px; }
    .l2 .l2-dress__slot { width: 54px; }
    .l2 .l2-dress__ic { width: 46px; height: 46px; }
    .l2 .l2-dress__stage { height: 380px; }
    .l2 .l2-dress__stage::before { width: 300px; height: 300px; margin: -150px 0 0 -150px; }
    .l2 .l2-dress__who b { font-size: 21px; }
    .l2 .l2-dress__head { padding: 12px 10px 0; }
    /* the view controls take the row, Copy link goes under them at the right */
    .l2 .l2-dress__foot { grid-template-columns: minmax(0, 1fr); padding: 0 6px; }
    .l2 .l2-dress__foot .l2-dress__ctl { grid-column: 1; }
    .l2 .l2-dress__copy { grid-column: 1; }
    .l2 .l2-dress__pick { position: fixed; display: block; left: 0; right: 0; bottom: 0; top: auto;
        width: auto; z-index: 60; max-height: 70vh; overflow-y: auto; border-radius: 14px 14px 0 0; box-shadow: 0 -8px 24px rgba(0, 0, 0, .5); }
    .l2 .l2-dress__pick[data-side="left"], .l2 .l2-dress__pick[data-side="right"] { left: 0; right: 0; }
    .l2 .l2-dress__pick::before, .l2 .l2-dress__pick[data-side="left"]::before, .l2 .l2-dress__pick[data-side="right"]::before { display: none; }
    .l2 .l2-dress__list { max-height: none; overflow-y: visible; }
    .l2 .l2-dress__animwrap { position: static; }
    /* the menus are bottom sheets here: no stacking context of the corner under the page's bottom bar */
    .l2 .l2-dress__corner { position: static; z-index: auto; }
    .l2 .l2-dress__animmenu { position: fixed; top: auto; left: 0; right: 0; bottom: 0; width: auto; margin: 0; z-index: 60; max-height: 70vh; padding: 8px 10px 12px;
        border-radius: 14px 14px 0 0; box-shadow: 0 -8px 24px rgba(0, 0, 0, .5); }
}

/* a phone: Grade and Type each on a row of its own, the label beside the select - side by side the Type select clipped its value
   ("Heavy arm") next to the clear cross */
@media (max-width: 519px) {
    .l2 .l2-dress__fld { flex: 1 1 100%; flex-direction: row; align-items: center; gap: 8px; }
    .l2 .l2-dress__flbl { flex: none; width: 44px; }
    .l2 .l2-dress__fsel { flex: 1 1 auto; min-width: 0; }
}
