/* Примерочная (/wiki/wardrobe). Слева сцена с 3D-героем, справа панель выбора; на телефоне сцена прилипает к верху,
   панель листается под ней — героя видно, пока выбираешь. Выбранное отмечается заливкой, без рамок (владелец 13.11.2026). */
.kb-head.wr-head { padding-bottom: 0; }
.wr-head h1 { font-size: clamp(26px, 3vw, 38px); }
.wr-head .x-lead { font-size: 15px; max-width: 720px; }
.wr { width: var(--wrap); margin: 18px auto 0; display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: 20px; align-items: start; }

/* --- сцена */
.wr-stage { position: sticky; top: 84px; height: clamp(500px, calc(100vh - 310px), 860px); border-radius: 20px; overflow: hidden; isolation: isolate;
  background:
    radial-gradient(60% 34% at 50% 88%, rgb(255 226 196 / .10), transparent 70%),
    radial-gradient(90% 70% at 50% 30%, #23212e 0%, #12121a 55%, #08090c 100%); }
.wr-stage::after { content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: inherit; box-shadow: inset 0 0 120px rgb(0 0 0 / .55); }
.wr-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: grab; touch-action: none; opacity: 0; transition: opacity .5s; }
.wr-stage.ready .wr-canvas { opacity: 1; }
.wr-canvas:active { cursor: grabbing; }
.wr-load { position: absolute; inset: 0; display: flex; flex-direction: column; gap: 14px; align-items: center; justify-content: center; color: var(--dim); font-size: 15px; padding: 24px; text-align: center; pointer-events: none; }
.wr-load[hidden] { display: none; }
.wr-spin, .wr-busy { width: 28px; height: 28px; border-radius: 50%; border: 3px solid rgb(255 255 255 / .12); border-top-color: var(--accent); animation: wr-rot .8s linear infinite; }
.wr-busy { width: 18px; height: 18px; border-width: 2px; align-self: center; margin-right: 4px; }
.wr-busy[hidden] { display: none; }
@keyframes wr-rot { to { transform: rotate(360deg); } }
.wr-who { position: absolute; z-index: 2; left: 84px; top: 16px; display: flex; flex-direction: column; gap: 2px; pointer-events: none; }
.wr-who b { font-size: clamp(20px, 2.2vw, 28px); font-weight: 600; letter-spacing: -.02em; line-height: 1.1; }
.wr-who span { font-size: 13px; color: var(--dim); }
.wr-hud { position: absolute; z-index: 2; top: 14px; right: 14px; display: flex; gap: 6px; }
.wr-btn { width: 42px; height: 42px; border: 0; border-radius: 13px; background: rgb(255 255 255 / .07); color: var(--text); display: grid; place-items: center; cursor: pointer; backdrop-filter: blur(8px); transition: background .15s; }
.wr-btn:hover { background: rgb(255 255 255 / .15); }
.wr-btn[aria-pressed="true"] { background: var(--accent); color: #fff; }
.wr-hint { position: absolute; z-index: 2; left: 50%; bottom: 112px; transform: translateX(-50%); margin: 0; padding: 7px 12px; border-radius: 999px; font-size: 12.5px; color: var(--dim);
  background: rgb(7 8 11 / .6); white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity .5s; }
.wr-stage.ready .wr-hint { opacity: 1; }
.wr-stage.ready .wr-hint.off { opacity: 0; }
.wr-toast { position: absolute; z-index: 3; top: 66px; right: 14px; padding: 8px 12px; border-radius: 10px; background: var(--accent); color: #fff; font-size: 13px; }
.wr-toast[hidden] { display: none; }

/* кукла: что надето */
.wr-doll { position: absolute; z-index: 2; left: 14px; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; gap: 6px; }
.wr-slot { position: relative; }
.wr-slot-b { width: 54px; height: 54px; padding: 0; border: 0; border-radius: 14px; background: rgb(255 255 255 / .05); color: var(--faint); display: grid; place-items: center; cursor: pointer; backdrop-filter: blur(8px); transition: background .15s; }
.wr-slot-b:hover { background: rgb(255 255 255 / .13); }
.wr-slot.on .wr-slot-b { background: rgb(255 255 255 / .10); }
.wr-slot-b img { width: 44px; height: 44px; object-fit: contain; }
.wr-slot-g::before { content: attr(data-l); display: block; max-width: 50px; font-size: 9px; font-weight: 600; line-height: 1.1; text-align: center; opacity: .75; overflow-wrap: anywhere; }
.wr-slot-x { position: absolute; right: -5px; top: -5px; width: 20px; height: 20px; border: 0; border-radius: 50%; background: #2a2b33; color: var(--text); font-size: 14px; line-height: 1; cursor: pointer; display: none; place-items: center; padding: 0; }
.wr-slot:hover .wr-slot-x, .wr-slot:focus-within .wr-slot-x { display: grid; }
.wr-slot-x:hover { background: var(--accent); }
.wr-slot-n { position: absolute; left: 62px; top: 50%; transform: translateY(-50%); padding: 6px 10px; border-radius: 9px; background: rgb(7 8 11 / .85); color: var(--text); font-size: 12.5px; white-space: nowrap; text-decoration: none; display: none; }
.wr-slot:hover .wr-slot-n { display: block; }
.wr-slot-n:hover { background: var(--accent); }

/* заточка: шестнадцать делений */
.wr-level { position: absolute; z-index: 2; left: 50%; bottom: 14px; transform: translateX(-50%); width: min(560px, calc(100% - 28px)); padding: 10px 16px 8px; border-radius: 16px; background: rgb(7 8 11 / .72); backdrop-filter: blur(10px); }
.wr-level-h { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 6px; font-size: 13px; color: var(--dim); }
.wr-level-h b { font-size: 20px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; transition: color .2s; }
.wr-level-h b[data-t="1"] { color: #ffb072; } .wr-level-h b[data-t="2"] { color: #ffcf5c; } .wr-level-h b[data-t="3"] { color: #fff1b8; text-shadow: 0 0 14px rgb(255 200 90 / .7); }
.wr-pips { display: grid; grid-template-columns: repeat(16, 1fr); gap: 3px; cursor: pointer; touch-action: none; outline: none; user-select: none; }
.wr-pips button { all: unset; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 4px 0 0; }
.wr-pips i { display: block; width: 100%; height: 12px; border-radius: 4px; background: rgb(255 255 255 / .09); transition: background .12s, transform .12s; }
.wr-pips button:first-child i { background: rgb(255 255 255 / .18); }
.wr-pips button.on i { background: linear-gradient(180deg, #ffd27a, #f08a2e); }
.wr-pips button.on:nth-child(n+12) i { background: linear-gradient(180deg, #fff3c4, #ffb23e); box-shadow: 0 0 10px rgb(255 190 80 / .55); }
.wr-pips button.cur i { transform: scaleY(1.35); }
.wr-pips span { font-size: 10.5px; color: var(--faint); height: 13px; line-height: 13px; font-variant-numeric: tabular-nums; }
.wr-pips:focus-visible { box-shadow: 0 0 0 2px rgb(255 255 255 / .3); border-radius: 6px; }

/* --- панель */
.wr-panel { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.wr-looks { display: grid; grid-template-columns: 1fr auto; gap: 8px 10px; align-items: center; padding: 14px; border-radius: 16px; background: var(--glass); }
.wr-looks-t { font-size: 13px; font-weight: 600; color: var(--dim); }
.wr-dice { justify-self: end; display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border: 0; border-radius: 999px; background: rgb(255 255 255 / .08); color: var(--text); font: 600 13px var(--font); cursor: pointer; grid-row: 1; grid-column: 2; }
.wr-dice .ico { width: 16px; height: 16px; }
.wr-dice:hover { background: var(--accent); color: #fff; }
.wr-looks-b { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.wr-look { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 8px 10px 8px 8px; border: 0; border-radius: 12px; background: rgb(255 255 255 / .06); color: var(--text); cursor: pointer; text-align: left; transition: background .15s, transform .15s; }
.wr-look:hover { background: rgb(255 255 255 / .13); transform: translateY(-1px); }
.wr-look img { width: 44px; height: 44px; object-fit: contain; flex: none; }
.wr-look span { display: flex; flex-direction: column; min-width: 0; }
.wr-look b { font-size: 13.5px; font-weight: 600; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; }
.wr-look small { font-size: 12px; color: #ffcf5c; font-weight: 600; }
.wr-tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 4px; border-radius: 14px; background: var(--glass); position: sticky; top: 84px; z-index: 3; backdrop-filter: blur(14px); }
.wr-tabs button { height: 42px; border: 0; border-radius: 10px; background: none; color: var(--dim); font: 600 14px var(--font); cursor: pointer; transition: background .15s, color .15s; }
.wr-tabs button:hover { color: var(--text); }
.wr-tabs button.on { background: var(--accent); color: #fff; }
.wr-pane { display: none; flex-direction: column; gap: 10px; }
.wr-pane.on { display: flex; }
.wr-classes { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.wr-cls { position: relative; border: 0; padding: 0; border-radius: 12px; overflow: hidden; background: var(--glass); color: var(--text); cursor: pointer; aspect-ratio: 3 / 4; }
.wr-cls img { width: 100%; height: 100%; object-fit: cover; opacity: .5; transition: opacity .2s, transform .3s; }
.wr-cls span { position: absolute; left: 0; right: 0; bottom: 0; padding: 16px 4px 6px; font-size: 11px; font-weight: 600; line-height: 1.15; text-align: center; background: linear-gradient(0deg, rgb(7 8 11 / .92), transparent); }
.wr-cls:hover img { opacity: .9; transform: scale(1.04); }
.wr-cls.on img { opacity: 1; }
.wr-cls.on span { background: linear-gradient(0deg, var(--accent) 25%, transparent); }
.wr-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.wr-chips:empty { display: none; }
.wr-chip { border: 0; height: 34px; padding: 0 13px; border-radius: 10px; background: var(--glass); color: var(--dim); font: 500 13.5px var(--font); cursor: pointer; transition: background .15s, color .15s; }
.wr-chip:hover { color: var(--text); background: var(--glass-hi); }
.wr-chip.on { background: rgb(255 255 255 / .16); color: var(--text); }
.wr-chips-s .wr-chip { height: 28px; padding: 0 10px; font-size: 12.5px; border-radius: 8px; }
.wr-find { height: 40px; padding: 0 14px; border: 0; border-radius: 10px; background: var(--glass); color: var(--text); font: 400 14px var(--font); outline: none; }
.wr-find:focus { background: var(--glass-hi); }
.wr-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; max-height: min(58vh, 620px); overflow-y: auto; padding-right: 2px; overscroll-behavior: contain;
  scrollbar-width: thin; scrollbar-color: rgb(255 255 255 / .15) transparent; }
.wr-tile { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; border: 0; padding: 10px 4px 8px; border-radius: 12px; background: var(--glass); color: var(--dim); cursor: pointer; min-width: 0; transition: background .15s, transform .15s; }
.wr-tile img, .wr-none { width: 64px; height: 64px; object-fit: contain; transition: transform .2s; }
.wr-none { border-radius: 50%; background: rgb(255 255 255 / .05); position: relative; }
.wr-none::after { content: ""; position: absolute; left: 16px; right: 16px; top: 31px; height: 2px; background: var(--faint); transform: rotate(-45deg); }
.wr-tn { font-size: 11.5px; line-height: 1.2; text-align: center; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.wr-tile small { font-size: 10px; color: var(--faint); line-height: 1.2; }
.wr-tile.own small { color: #ffcf5c; font-weight: 600; }
.wr-tile:hover { background: var(--glass-hi); color: var(--text); }
.wr-tile:hover img { transform: scale(1.08); }
.wr-tile.on { background: var(--accent); color: #fff; }
.wr-tile.on small { color: rgb(255 255 255 / .85); }
.wr-sub { grid-column: 1 / -1; font-size: 13px !important; color: var(--faint); margin: 8px 0 0 !important; font-weight: 600; }
.wr-empty { grid-column: 1 / -1; color: var(--faint); font-size: 14px; padding: 8px; margin: 0; }
.wr-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.wr-clear { border: 0; height: 40px; padding: 0 14px; border-radius: 10px; background: var(--glass); color: var(--dim); font: 500 13.5px var(--font); cursor: pointer; }
.wr-clear:hover { color: var(--text); background: var(--glass-hi); }
.wr-foot .wr-go { min-height: 44px; flex: 1 1 auto; }

@media (max-width: 1000px) {
  .wr { grid-template-columns: 1fr; gap: 12px; margin-top: 12px; }
  .wr-head .x-lead { display: none; }
  .wr-stage { top: 64px; z-index: 4; height: 56vh; min-height: 360px; border-radius: 16px; }
  .wr-who { left: 14px; top: 12px; }
  .wr-hud { top: 10px; right: 10px; }
  .wr-btn { width: 38px; height: 38px; }
  .wr-doll { left: 8px; right: 8px; top: auto; bottom: 84px; transform: none; flex-direction: row; justify-content: center; gap: 4px; }
  .wr-slot-b { width: 40px; height: 40px; border-radius: 11px; }
  .wr-slot-b img { width: 34px; height: 34px; }
  .wr-slot-g::before { font-size: 7.5px; }
  .wr-slot-n { display: none !important; }
  .wr-slot.on .wr-slot-x { display: grid; width: 17px; height: 17px; font-size: 12px; right: -4px; top: -4px; }
  .wr-hint { bottom: 136px; font-size: 11.5px; }
  .wr-level { bottom: 8px; padding: 6px 12px 4px; border-radius: 14px; }
  .wr-level-h { margin-bottom: 2px; font-size: 12px; }
  .wr-level-h b { font-size: 17px; }
  .wr-pips i { height: 10px; }
  .wr-tabs { top: calc(64px + 56vh + 6px); }
  .wr-grid { max-height: none; overflow: visible; }
}
@media (max-width: 1000px) and (max-height: 640px) { .wr-stage { min-height: 300px; } .wr-tabs { top: calc(64px + max(56vh, 300px) + 6px); } }
@media (max-width: 560px) {
  .wr-classes { gap: 4px; }
  .wr-cls span { font-size: 9.5px; }
  .wr-grid { grid-template-columns: repeat(4, 1fr); gap: 5px; }
  .wr-tile img, .wr-none { width: 52px; height: 52px; }
  .wr-none::after { left: 12px; right: 12px; top: 25px; }
  .wr-look img { width: 34px; height: 34px; }
  .wr-look { padding: 6px; gap: 6px; }
}
@media (prefers-reduced-motion: reduce) { .wr-canvas, .wr-tile, .wr-tile img, .wr-cls img, .wr-look { transition: none; } }
