.game-shell[data-view="wardrobe"] {
  width: min(100%, 52rem);
  padding-inline: 0;
  background: #f5e9d9;
  box-shadow: 0 0 65px #271c1726;
}
body:has(.game-shell[data-view="wardrobe"]:not([hidden])) {
  background: linear-gradient(155deg, #f8efe4, #e8d8c7);
}

.wardrobe-content {
  display: grid;
  flex: 1;
  grid-template-rows: auto minmax(0, 1fr);
  gap: clamp(8px, 2.8vw, 14px);
  min-height: 0;
}
.wardrobe-showcase {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: clamp(11px, 4.8vw, 28px);
  min-width: 0;
  padding: clamp(8px, 3.2vw, 16px);
  overflow: hidden;
  border: 1px solid #c69a746e;
  border-top-color: #fffef5;
  border-radius: 10px 27px 10px 27px;
  background:
    radial-gradient(ellipse at 100% 100%, #e5a57563, transparent 59%),
    linear-gradient(133deg, #f5e2c7, #fff6e8 57%, #ead1b9);
  box-shadow: inset 0 0 0 1px #fff7e7ba, 0 4px 12px #8e5b3527;
}
.wardrobe-showcase::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: auto -23% -38% 43%;
  height: 85%;
  border: 1px solid #fff5e5d6;
  border-radius: 50%;
  transform: rotate(-24deg);
  pointer-events: none;
}
.wardrobe-stage {
  position: relative;
  width: min(50vw, clamp(88px, 21dvh, 177px));
  aspect-ratio: 9 / 16;
  overflow: hidden;
  border: 1px solid #b18a63;
  border-top-color: #ffe7b4;
  border-radius: 7px 15px 7px 15px;
  background: #c7bb8c var(--lobby-art, url("assets/lobby.webp")) center / cover no-repeat;
  box-shadow: 0 0 0 2px #fff1d5, 0 3px 8px #5f392b4d;
}
.wardrobe-stage .lobby-character {
  position: absolute;
  z-index: 1;
  inset: auto auto 14% 50%;
  width: 59%;
  height: auto;
  aspect-ratio: 339 / 416;
  transform: translateX(-50%);
  filter: drop-shadow(0 4px 4px #342a1759);
}
.wardrobe-stage .weather-canvas { z-index: 2; }
.wardrobe-stage[data-light-preset="cloud"]:not([data-lobby-lit]) { filter: brightness(.88) saturate(.82); }
.wardrobe-stage[data-light-preset="night"]:not([data-lobby-lit]) { filter: brightness(.64) saturate(.69); }
.wardrobe-stage[data-light-preset] .lobby-character { filter: none; }
.wardrobe-stage[data-light-shadow]:not([data-lobby-lit]) .lobby-character {
  filter: drop-shadow(var(--light-offset, 0px) 4px 4px #291c1454);
}
.wardrobe-caption {
  display: grid;
  justify-items: start;
  gap: clamp(7px, 2.5vw, 14px);
}
.wardrobe-caption h3 {
  margin: 0;
  color: var(--collection-ink);
  font: 700 clamp(19px, 6vw, 31px)/1.18 var(--font-title);
  letter-spacing: .055em;
}
.wardrobe-caption span {
  padding-inline-start: 9px;
  border-inline-start: 2px solid #b18359;
  color: var(--collection-muted);
  font-size: var(--text-label);
  font-weight: 650;
}

.wardrobe-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  min-height: 0;
}
#wardrobe-tabs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.wardrobe-picker {
  flex: 1;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 6px 4px 9px;
}
.wardrobe-light-controls {
  padding: 3px 10px;
  border: 1px solid #c2926969;
  border-top-color: #fffaf0;
  border-radius: 7px 16px;
  background: linear-gradient(145deg, #fff8ea, #efe0ca);
  color: #57392c;
  font-size: var(--text-label);
  font-weight: 650;
}
.wardrobe-light-mode,
.wardrobe-light-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 43px;
  border-bottom: 1px solid #c39c7949;
}
.wardrobe-light-dropdown {
  position: relative;
  z-index: 2;
  width: min(51%, 170px);
}
.wardrobe-light-dropdown summary {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 37px;
  padding: 4px 29px 4px 10px;
  border: 1px solid #bd9971;
  border-top-color: #d4b089;
  border-radius: 6px 12px;
  background: linear-gradient(148deg, #fff9ed, #f1dec6);
  box-shadow: inset 0 1px #fff8e5, 0 1px 3px #76503127;
  color: inherit;
  font-size: var(--text-small);
  line-height: 1.2;
  cursor: pointer;
  list-style: none;
}
.wardrobe-light-dropdown summary::-webkit-details-marker { display: none; }
.wardrobe-light-dropdown summary::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 12px;
  width: 6px;
  height: 6px;
  border-right: 1.5px solid #724d35;
  border-bottom: 1.5px solid #724d35;
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}
.wardrobe-light-dropdown[open] summary::after { transform: translateY(-28%) rotate(225deg); }
.wardrobe-light-dropdown ul {
  position: absolute;
  inset: calc(100% + 4px) 0 auto;
  display: grid;
  gap: 2px;
  max-height: min(210px, 48dvh);
  overflow-y: auto;
  margin: 0;
  padding: 4px;
  border: 1px solid #af825e;
  border-top-color: #fffaf0;
  border-radius: 6px 12px;
  background: #fff5e6;
  box-shadow: 0 5px 12px #65452e4d;
  list-style: none;
}
.wardrobe-light-dropdown ul button {
  width: 100%;
  min-height: 32px;
  padding: 4px 7px;
  border: 1px solid transparent;
  border-radius: 4px 8px;
  background: transparent;
  color: #634330;
  font-size: var(--text-small);
  text-align: start;
}
.wardrobe-light-dropdown ul button[aria-pressed="true"] {
  border-color: #bb966d;
  background: linear-gradient(145deg, #f1dbb8, #ebcfaa);
  color: #4c3124;
  font-weight: 750;
}
.wardrobe-light-dropdown :is(summary, button):focus-visible { outline: 2px solid #a06b42; outline-offset: -1px; }
.wardrobe-light-controls fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
.wardrobe-light-controls fieldset:disabled { opacity: .52; }
.wardrobe-light-direction {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 2px 8px;
  padding-block: 9px 3px;
  border-bottom: 1px solid #c39c7949;
}
.wardrobe-light-direction output { min-width: 60px; text-align: end; color: #785439; font-size: var(--text-small); }
.wardrobe-light-direction input { grid-column: 1 / -1; width: 100%; height: 27px; margin: 0; accent-color: #946541; }
.wardrobe-light-toggle:last-child { border: 0; }
.wardrobe-light-toggle input { width: 18px; height: 18px; accent-color: #946541; }
.wardrobe-picker .inventory-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(6px, 2vw, 10px);
}
.wardrobe-picker .inventory-tile {
  padding: 5px;
  border-color: #be986d88;
  border-top-color: #fffaf0;
  border-radius: 6px 14px 6px 14px;
  background: linear-gradient(148deg, #fff9ec, #eedac3);
  box-shadow: inset 0 0 0 1px #fff4e3, 0 2px 4px #6f3d211e;
  color: #51352a;
}
.wardrobe-picker .inventory-tile[aria-pressed="true"] {
  border-color: #a66f46;
  border-top-color: #e9c08e;
  background: linear-gradient(144deg, #fff3d8, #efd0aa);
  box-shadow: inset 0 0 0 1px #fff8e6, 0 3px 7px #8b563d42;
}
.wardrobe-picker .inventory-tile[data-locked="true"] img { filter: grayscale(.62); opacity: .73; }
.wardrobe-picker .inventory-badge {
  inset: 5px 4px auto auto;
  padding: 2px 4px;
  background: #80563e;
  color: #fff5e5;
}
.wardrobe-picker .inventory-tile[data-locked="true"] .inventory-badge { background: #766452; }
.wardrobe-picker .inventory-name { padding-block: 3px; }
.wardrobe-picker[data-dress="background"] .inventory-tile { aspect-ratio: 4 / 5; }
.wardrobe-picker[data-dress="background"] .inventory-tile img {
  width: 100%;
  border-radius: 4px 8px 4px 8px;
}
.wardrobe-picker[data-dress="effect"] .inventory-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(5px, 1.5vw, 8px);
  width: min(100%, 26.5rem);
  margin-inline: auto;
}
.wardrobe-picker[data-dress="effect"] .inventory-tile {
  --effect-selection-light: #fae1ad;
  aspect-ratio: auto;
  height: clamp(4rem, 17vw, 5.35rem);
  padding: 4px 2px 6px;
}
.wardrobe-picker[data-dress="effect"] [data-item="rain"] { --effect-selection-light: #bce6de; }
.wardrobe-picker[data-dress="effect"] [data-item="snow"] { --effect-selection-light: #cce3f8; }
.wardrobe-picker[data-dress="effect"] [data-item="petals"] { --effect-selection-light: #f5cddd; }
.wardrobe-picker[data-dress="effect"] [data-item="leaves"] { --effect-selection-light: #f8d495; }
.wardrobe-picker[data-dress="effect"] .inventory-tile[aria-pressed="true"] {
  isolation: isolate;
  border-color: #c6955b;
  border-radius: 10px;
  background:
    radial-gradient(ellipse at 50% 40%, #fffbf3 3%, var(--effect-selection-light) 55%, transparent 94%),
    linear-gradient(155deg, #fffaec 12%, #ecd1ab);
  box-shadow: inset 0 0 0 2px #fff8e7, 0 3px 8px #8b572f3c;
}
.wardrobe-picker[data-dress="effect"] .inventory-tile[aria-pressed="true"]::before {
  content: "";
  position: absolute;
  z-index: 1;
  inset: -2px;
  pointer-events: none;
  border: clamp(12px, 4vw, 18px) solid transparent;
  border-image: url("assets/garden-ui/effect-selection-frame.webp") 24% stretch;
}
.wardrobe-picker[data-dress="effect"] .inventory-tile img {
  width: 80%;
  filter: drop-shadow(0 2px 2px #8357363a);
}
.wardrobe-picker[data-dress="effect"] .inventory-tile[aria-pressed="true"] img {
  filter: drop-shadow(0 3px 3px #83573658);
}
.wardrobe-picker[data-dress="effect"] .inventory-name { padding: 0; }
.wardrobe-picker[data-dress="effect"] .inventory-badge {
  z-index: 2;
  inset: -2px -2px auto auto;
  width: clamp(18px, 5vw, 23px);
  aspect-ratio: 1;
  padding: 0;
  background: url("assets/garden-ui/effect-applied-seal.webp") center / contain no-repeat;
  filter: drop-shadow(0 1px 2px #4f412851);
  font-size: 0;
  pointer-events: none;
}
.wardrobe-picker[data-dress="effect"] .inventory-tile:focus-visible {
  outline: 2px solid #8b5d3e;
  outline-offset: 1px;
}
@media (prefers-reduced-motion: no-preference) {
  .wardrobe-picker[data-dress="effect"] .inventory-tile[aria-pressed="true"]::after {
    content: "";
    position: absolute;
    z-index: -1;
    inset: 3px;
    border-radius: 7px;
    background: linear-gradient(115deg, transparent 41%, #fff7dc86 46%, #fffdf3bb 50%, transparent 58%) 100% 0 / 240% 100%;
    animation: wardrobe-effect-glint .62s ease-out both;
    pointer-events: none;
  }
  .wardrobe-picker[data-dress="effect"] .inventory-tile[aria-pressed="true"] img {
    animation: wardrobe-effect-lift .34s cubic-bezier(.22,.67,.35,1) both;
  }
  @keyframes wardrobe-effect-glint {
    from { opacity: .15; background-position: 100% 0; }
    34% { opacity: .95; }
    to { opacity: 0; background-position: 0 0; }
  }
  @keyframes wardrobe-effect-lift {
    from { transform: translateY(1px) scale(.94); }
    60% { transform: translateY(-1px) scale(1.045); }
    to { transform: none; }
  }
}
.wardrobe-actions {
  display: flex;
  flex: none;
  justify-content: center;
  padding-block-start: 9px;
  border-top: 1px solid #ba936c65;
}
.wardrobe-actions .player-dialog-action {
  width: min(74%, 14rem);
  margin: 0;
  padding: 5px 12px;
  box-shadow: inset 0 0 0 1px #ffedcd47, 0 3px 5px #83533534;
}
.wardrobe-actions .player-dialog-action:disabled { opacity: .72; }
.wardrobe-source { display: grid; justify-items: center; gap: 8px; }
.wardrobe-source .wallpaper-preview { margin: 0; max-height: min(43dvh, 23rem); }
.wardrobe-source p { margin: 0; color: #6e4f3b; text-align: center; font-size: var(--text-label); }

@media (min-width: 675px) {
  .wardrobe-content {
    grid-template-rows: minmax(0, 1fr);
    grid-template-columns: minmax(0, .8fr) minmax(0, 1fr);
  }
  .wardrobe-showcase {
    grid-template-columns: minmax(0, 1fr);
    align-content: center;
    justify-items: center;
  }
  .wardrobe-stage { width: min(28dvh, 219px, 100%); }
  .wardrobe-caption { justify-items: center; text-align: center; }
}
