/* «Гардероб» — the bought half of the cabinet. The geometry is Gear's
   (css/views/gear.css): a header card with the preview plate, then two
   columns under a @container scene breakpoint — shelves left, the clan and
   the rule card right. The preview plate carries the SAME identity classes
   the match card does (identity.css), so the plate is not a drawing of the
   look, it is the look. */

#view.wd-host,
#scene.shell-scene #view.wd-host { max-width: none; padding: 0; overflow-x: hidden; }

.wd-view { display: flex; flex-direction: column; gap: 11px; padding: 12px 15px 12px; min-width: 0; }

/* ── Header ─────────────────────────────────────────────────────────────── */
.wd-head { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; min-width: 0; }
.wd-head.hidden { display: none; }
.wd-head-mark { font-size: 19px; line-height: 1; flex: 0 0 auto; }
.wd-head-copy { display: contents; }
.wd-head-title { font-family: var(--font-display); font-size: 14px; font-weight: 800; flex: 1 1 auto; min-width: 0; }
.wd-head-lead { font-size: 10px; line-height: 1.5; color: var(--text-soft); max-width: 600px; text-wrap: pretty; flex: 1 1 100%; }

/* ── The preview plate ──────────────────────────────────────────────────── */
.wd-prev { display: flex; flex-direction: column; gap: 5px; min-width: 0; flex: 1 1 100%; }
.wd-prev-lbl { display: none; }
.wd-prev-plate { display: flex; align-items: center; gap: 11px; padding: 11px 12px; border-radius: 13px; border: 1px solid rgba(var(--t-violet), 0.22); background: rgba(20, 13, 38, 0.6); min-width: 0; }
.wd-prev-av { position: relative; width: 40px; height: 40px; flex: 0 0 auto; border-radius: 10px; display: grid; place-items: center; font-size: 17px; line-height: 1; background: linear-gradient(135deg, var(--violet-600), #241638); border: 1px solid rgba(var(--t-gold), 0.34); }
.wd-prev-pet { position: absolute; right: -14px; bottom: -12px; width: 34px; height: 34px; display: grid; place-items: center; }
.wd-prev-pet.is-glyph { width: 20px; height: 20px; right: -7px; bottom: -6px; border: 1px solid rgba(233, 185, 73, .6); border-radius: 50%; background: #11101bee; font-size: 11px; }
.wd-prev-pet-art { display: block; width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .7)); }
.wd-prev-lines { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.wd-prev-rank { font: 800 9px/1.2 var(--font-display); letter-spacing: .1em; text-transform: uppercase; opacity: .95; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wd-prev-row { display: flex; align-items: baseline; gap: 6px; min-width: 0; flex-wrap: wrap; }
.wd-prev-badge { flex: 0 0 auto; max-width: 64px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border: 1px solid rgba(104, 255, 218, .48); border-radius: 5px; padding: 2px 4px; background: rgba(13, 38, 35, .8); color: #9fffe0; font: 900 8px/1 var(--font-mono); }
.wd-prev-name { font-size: 14px; font-weight: 800; overflow-wrap: anywhere; }
.wd-prev-tag { font-size: 9px; font-weight: 800; color: var(--gold); }
.wd-prev-status { font: 700 9px/1.2 var(--font-mono); color: rgba(122, 255, 215, .72); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wd-prev-bare { font-size: 10px; color: var(--text-faint); }
.wd-prev-skel { display: inline-block; width: 116px; height: 13px; border-radius: 4px; background: linear-gradient(90deg, rgba(var(--t-violet), 0.1), rgba(var(--t-violet), 0.22), rgba(var(--t-violet), 0.1)); background-size: 200% 100%; animation: wdSkel 1.3s linear infinite; }
@keyframes wdSkel { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.wd-prev-fail { font-size: 11px; font-weight: 700; color: var(--danger-soft); }
.wd-prev-retry { padding: 2px 8px; border-radius: 6px; border: 1px solid rgba(var(--t-violet), 0.26); background: var(--panel-soft); color: var(--text-soft); font: inherit; font-size: 9.5px; font-weight: 700; cursor: pointer; }

/* ── Columns, groups, panels ────────────────────────────────────────────── */
.wd-cols { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; min-width: 0; }
.wd-col { display: flex; flex-direction: column; gap: 11px; min-width: 0; }
.wd-col.hidden { display: none; }
.wd-group { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.wd-group-head { font: 800 10px/1.2 var(--font-display); letter-spacing: .14em; text-transform: uppercase; color: var(--gold); padding: 6px 2px 0; }
.wd-panel { display: flex; flex-direction: column; gap: 7px; padding: 10px 11px; border-radius: 13px; border: 1px solid rgba(var(--t-violet), 0.18); background: rgba(20, 13, 38, 0.42); min-width: 0; }
.wd-panel.is-empty { opacity: .82; }
.wd-panel-ranks { gap: 8px; }
.wd-panel-head { font: 800 11px/1.2 var(--font-display); letter-spacing: .04em; }
.wd-list { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.wd-note { font-size: 9.5px; color: var(--text-faint); }
.wd-rank-cats { margin-top: 2px; flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.wd-rank-cats .shop-rank-cat { flex: 0 0 auto; white-space: nowrap; }
.wd-rank-search { font-size: 12px; padding: 8px 10px; }

/* ── Rows: a 38px well, the name, the grade, the state ──────────────────── */
.wd-row { --g: var(--g-common, 154, 160, 173); display: flex; align-items: center; gap: 9px; width: 100%; min-height: 48px; padding: 6px 8px; border-radius: 10px; border: 1px solid rgba(var(--g), .26); background: rgba(255, 255, 255, .025); color: var(--text); text-align: left; font: inherit; cursor: pointer; min-width: 0; }
.wd-row.is-none { border-style: dashed; }
.wd-row.is-on { border-color: rgba(var(--t-gold), .6); background: rgba(var(--t-gold), .08); box-shadow: 0 0 0 1px rgba(var(--t-gold), .25); }
.wd-row.is-busy { opacity: .6; cursor: progress; }
.wd-row:disabled { cursor: default; }
.wd-row.grade-mythic { border-color: rgba(233, 185, 73, .6); background: linear-gradient(90deg, rgba(58, 42, 8, .35), rgba(27, 20, 48, .35)); }
@media (hover: hover) { .wd-row:not(:disabled):hover { border-color: rgba(var(--t-gold), .45); } }
.wd-well { flex: 0 0 auto; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 9px; border: 1px solid rgba(var(--t-violet), .24); background: #0b0e16; font-size: 17px; line-height: 1; overflow: hidden; }
.wd-well.is-bare { color: var(--text-faint); }
.wd-well.is-pet { overflow: visible; background: radial-gradient(circle at 50% 60%, rgba(108, 255, 218, .12), transparent 60%), #0b0e16; }
.wd-well.is-rank { font-size: 19px; }
.wd-well.is-swatch { background: #141826; }
.wd-well-img { display: block; width: 100%; height: 100%; object-fit: cover; }
.wd-well-img.is-pet { object-fit: contain; transform: scale(1.15); }
.wd-swatch { display: inline-block; font: 900 15px/1 var(--font-display); }
.wd-swatch.is-tag { font: 800 10px/1 var(--font-mono); padding: 2px 4px; border: 1px solid rgba(var(--t-gold), .45); border-radius: 5px; }
.wd-row-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.wd-row-name { font-size: 12.5px; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wd-row-sub { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.wd-row-cat { font: 600 9px/1.2 var(--font-mono); color: var(--text-faint); }
.wd-badge { flex: 0 0 auto; padding: 3px 7px; border-radius: 999px; background: rgba(var(--t-gold), .18); color: var(--gold); font: 800 9px/1 var(--font-display); letter-spacing: .06em; text-transform: uppercase; }
.wd-wear { flex: 0 0 auto; color: var(--text-faint); font: 700 9.5px/1 var(--font-display); }
.wd-empty-slot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; border-radius: 10px; border: 1px dashed rgba(var(--t-violet), .22); }
.wd-empty-text { font-size: 10px; color: var(--text-faint); }
.wd-link { padding: 5px 10px; border-radius: 8px; border: 1px solid rgba(var(--t-gold), .4); background: rgba(var(--t-gold), .08); color: var(--gold); font: 800 10px/1 var(--font-display); cursor: pointer; }

/* ── The rule card (right column) ───────────────────────────────────────── */
.wd-rulecard { display: flex; flex-direction: column; gap: 7px; padding: 11px 12px; border-radius: 13px; border: 1px solid rgba(var(--t-gold), .22); background: rgba(20, 13, 38, 0.5); }
.wd-rule-title { font: 800 11px/1.2 var(--font-display); color: var(--gold); }
.wd-rule { font-size: 10px; line-height: 1.5; color: var(--text-soft); text-wrap: pretty; }
.wd-rule-acts { display: flex; flex-wrap: wrap; gap: 6px; }

@container scene (min-width: 900px) {
  .wd-rank-cats { flex-wrap: wrap; overflow-x: visible; }
  .wd-view { gap: 13px; padding: 16px 18px 18px; }
  .wd-head { flex-wrap: nowrap; }
  .wd-head-lead { flex: 1 1 auto; }
  .wd-prev { flex: 0 1 420px; }
  .wd-prev-lbl { display: block; font-size: 9px; letter-spacing: .1em; text-transform: uppercase; color: var(--text-faint); }
  .wd-cols { grid-template-columns: minmax(0, 1.4fr) minmax(280px, 1fr); }
  .wd-col-a { grid-column: 1; }
  .wd-col-b { grid-column: 2; }
}
@media (prefers-reduced-motion: reduce) { .wd-prev-skel { animation: none; } }
