:root {
  --wardrobe-ink: #3e376b;
  --wardrobe-pink: #f45f95;
  --wardrobe-pink-dark: #ce3f75;
  --wardrobe-violet: #7562c4;
  --wardrobe-gold: #f7cb58;
  --wardrobe-mint: #88dfc4;
}

.wardrobe-page {
  min-height: 100svh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 8% 12%, rgba(255,255,255,.75) 0 4px, transparent 5px),
    radial-gradient(circle at 90% 18%, rgba(255,255,255,.68) 0 5px, transparent 6px),
    linear-gradient(145deg, #fff5fa, #f2efff 58%, #e8fbf6);
  color: var(--wardrobe-ink);
}

.wardrobe-page::before {
  content: "";
  position: fixed;
  z-index: -1;
  inset: 0;
  opacity: .42;
  background-image:
    radial-gradient(#f792b5 1px, transparent 1.5px),
    radial-gradient(#8f7ed5 1px, transparent 1.5px);
  background-position: 0 0, 24px 21px;
  background-size: 54px 54px, 73px 73px;
}

.wardrobe-header {
  max-width: 1180px;
}

.wardrobe-header > img {
  width: 86px;
  height: auto;
}

.favorite-button {
  justify-self: end;
  min-width: 112px;
  padding: 10px 13px;
  border: 1px solid rgba(107, 83, 177, .2);
  border-radius: 999px;
  color: #6a579f;
  background: rgba(255,255,255,.82);
  box-shadow: 0 8px 20px rgba(71, 53, 126, .13), inset 0 1px #fff;
  font-weight: 800;
}

.favorite-button[aria-pressed="true"] {
  color: #fff;
  background: linear-gradient(145deg, #ff79a6, #e44f84);
}

.favorite-button:focus-visible,
.look-option:focus-visible,
.wardrobe-actions button:focus-visible,
.completion-card button:focus-visible {
  outline: 4px solid #ffe176;
  outline-offset: 3px;
}

.wardrobe-shell {
  width: min(1160px, calc(100% - 28px));
  margin: 0 auto;
  padding: 5px 0 42px;
}

.wardrobe-intro {
  margin-bottom: 18px;
}

.wardrobe-intro h1 {
  margin-bottom: 8px;
  color: #51458e;
  font-size: clamp(35px, 6vw, 64px);
  letter-spacing: -2.2px;
  text-shadow: 0 3px #fff, 0 8px 20px rgba(72, 54, 133, .13);
}

.wardrobe-intro > p:last-child {
  margin: 0;
  color: #77708e;
  font: 16px/1.5 Arial, sans-serif;
}

.mission-card {
  display: grid;
  grid-template-columns: 58px 1fr auto;
  gap: 15px;
  align-items: center;
  margin-bottom: 18px;
  padding: 15px 18px;
  border: 1px solid rgba(112, 88, 183, .17);
  border-radius: 20px;
  background: rgba(255,255,255,.86);
  box-shadow: 0 15px 35px rgba(68, 50, 125, .13), inset 0 1px #fff;
  backdrop-filter: blur(14px);
}

.mission-icon {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 17px;
  color: #fff;
  background: linear-gradient(145deg, #ff86ad, #de4f84);
  box-shadow: 0 8px 16px rgba(212, 65, 118, .2), inset 0 1px rgba(255,255,255,.55);
  font-size: 28px;
}

.mission-card span {
  color: #dd5987;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 1.2px;
}

.mission-card h2 {
  margin: 3px 0 2px;
  color: #51467f;
  font-size: clamp(18px, 3vw, 25px);
}

.mission-card p {
  margin: 0;
  color: #857e94;
  font: 12px/1.4 Arial, sans-serif;
}

.mission-score {
  min-width: 75px;
  padding: 9px 12px;
  border-radius: 16px;
  text-align: center;
  background: #f2edff;
  box-shadow: inset 0 1px #fff;
}

.mission-score strong {
  color: #6a58b5;
  font-size: 28px;
}

.mission-score small {
  color: #958bad;
  font-size: 13px;
}

.wardrobe-game {
  display: grid;
  grid-template-columns: minmax(330px, .9fr) minmax(460px, 1.1fr);
  gap: 20px;
  align-items: stretch;
}

.brenda-dressing-card,
.closet-panel {
  border: 1px solid rgba(105, 81, 172, .18);
  border-radius: 28px;
  background: rgba(255,255,255,.9);
  box-shadow: 0 22px 50px rgba(68, 50, 125, .16), inset 0 1px #fff;
}

.brenda-dressing-card {
  position: relative;
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding: 14px;
}

.wardrobe-stage {
  position: relative;
  min-height: 520px;
  overflow: hidden;
  display: grid;
  place-items: end center;
  border: 4px solid #fff;
  border-radius: 22px;
  background:
    linear-gradient(90deg, rgba(145,113,199,.15) 0 5%, transparent 5% 95%, rgba(145,113,199,.15) 95%),
    repeating-linear-gradient(90deg, transparent 0 42px, rgba(104,76,160,.045) 43px 45px),
    linear-gradient(180deg, #fff7fb, #f8efff 65%, #e5d5f1 65% 68%, #c69f79 68%);
}

.wardrobe-stage::before,
.wardrobe-stage::after {
  content: "";
  position: absolute;
  z-index: 0;
  top: 9%;
  bottom: 16%;
  width: 13%;
  border: 2px solid rgba(120,89,170,.18);
  background: linear-gradient(90deg, rgba(143,104,194,.12), rgba(255,255,255,.5));
  box-shadow: inset 0 0 0 6px rgba(255,255,255,.2);
}

.wardrobe-stage::before {
  left: 3%;
  border-radius: 16px 4px 4px 16px;
}

.wardrobe-stage::after {
  right: 3%;
  border-radius: 4px 16px 16px 4px;
  transform: scaleX(-1);
}

.wardrobe-stage img {
  position: relative;
  z-index: 2;
  width: min(100%, 500px);
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 14px 8px rgba(72, 50, 100, .12));
}

.wardrobe-stage.is-changing img {
  animation: changeLook .38s ease;
}

@keyframes changeLook {
  45% { opacity: .35; transform: scale(.92) rotate(-2deg); }
  75% { transform: scale(1.04) rotate(1deg); }
}

.stage-spark {
  position: absolute;
  z-index: 3;
  color: #f38bb1;
  filter: drop-shadow(0 3px rgba(79,56,138,.13));
  animation: sparkle 2.2s ease-in-out infinite;
}

.spark-a { left: 18%; top: 16%; font-size: 28px; }
.spark-b { right: 16%; top: 28%; color: var(--wardrobe-gold); font-size: 30px; animation-delay: -.7s; }
.spark-c { right: 22%; bottom: 24%; color: #7fcfb8; font-size: 24px; animation-delay: -1.4s; }

@keyframes sparkle {
  50% { opacity: .45; transform: translateY(-8px) rotate(8deg) scale(.82); }
}

.brenda-look-speech {
  position: relative;
  z-index: 4;
  align-self: center;
  max-width: 86%;
  margin: -15px 0 2px;
  padding: 12px 17px;
  border: 2px solid #fff;
  border-radius: 17px;
  color: #65598c;
  background: linear-gradient(145deg, #fff, #fff1f7);
  box-shadow: 0 10px 25px rgba(65,47,120,.16);
  text-align: center;
  font-size: 13px;
  font-weight: 800;
}

.closet-panel {
  min-width: 0;
  padding: 22px;
}

.closet-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 15px;
}

.closet-heading h2 {
  margin: 3px 0 0;
  color: #50447e;
  font-size: 27px;
}

.closet-heading > span {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 17px;
  background: #f4edff;
  font-size: 28px;
}

.look-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 11px;
}

.look-option {
  min-width: 0;
  padding: 7px 7px 9px;
  border: 2px solid transparent;
  border-radius: 17px;
  color: #665d7f;
  background: #f7f4ff;
  box-shadow: inset 0 1px #fff, 0 6px 14px rgba(72,55,125,.09);
  transition: transform .17s ease, border-color .17s ease, box-shadow .17s ease;
}

.look-option:hover {
  transform: translateY(-3px);
  box-shadow: inset 0 1px #fff, 0 10px 20px rgba(72,55,125,.14);
}

.look-option.is-selected {
  border-color: #f36c9d;
  color: #c94173;
  background: #fff1f6;
  box-shadow: inset 0 1px #fff, 0 0 0 3px rgba(244,95,149,.11), 0 10px 20px rgba(72,55,125,.13);
}

.look-option img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 12px;
  background: #fff8fb;
}

.look-option span {
  display: block;
  overflow: hidden;
  margin-top: 7px;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  font-weight: 900;
}

.wardrobe-actions {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 9px;
  margin-top: 17px;
}

.wardrobe-actions button,
.completion-card button {
  min-height: 45px;
  padding: 10px 12px;
  border: 1px solid rgba(255,255,255,.72);
  border-radius: 13px;
  font-weight: 900;
  transition: transform .17s ease, box-shadow .17s ease;
}

.wardrobe-actions button:hover,
.completion-card button:hover {
  transform: translateY(-2px);
}

.check-look-button,
.completion-card button {
  color: #fff;
  background: linear-gradient(145deg, #ff75a3, #d9477d);
  box-shadow: 0 6px 0 #b93669, 0 12px 22px rgba(188,48,102,.18);
}

.check-look-button:disabled {
  cursor: wait;
  opacity: .65;
  transform: none;
}

.random-look-button {
  color: #fff;
  background: linear-gradient(145deg, #8d7bd7, #6652b2);
  box-shadow: 0 5px 0 #4d3d93;
}

.reset-look-button {
  color: #675b8d;
  background: #f1ecff;
  box-shadow: 0 5px 0 #d6ccf1;
}

.completion-overlay {
  position: fixed;
  z-index: 40;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(35, 31, 78, .62);
  backdrop-filter: blur(9px);
}

.completion-overlay.is-hidden { display: none; }

.completion-card {
  width: min(430px, 100%);
  padding: 24px;
  border: 4px solid #fff;
  border-radius: 30px;
  background: linear-gradient(155deg, #fff8fb, #f1edff);
  box-shadow: 0 28px 80px rgba(26,20,70,.35);
  text-align: center;
  animation: completionIn .4s ease;
}

.completion-card img {
  width: 116px;
  height: auto;
  border-radius: 50%;
}

.completion-card > span {
  display: block;
  margin-top: 8px;
  color: #f4b83f;
  letter-spacing: 10px;
}

.completion-card h2 {
  margin: 12px 0 7px;
  color: #55488d;
  font-size: 30px;
}

.completion-card p {
  margin: 0 0 20px;
  color: #77708b;
  font-family: Arial, sans-serif;
}

.completion-card button { min-width: 190px; }

@keyframes completionIn {
  from { opacity: 0; transform: translateY(20px) scale(.94); }
}

.wardrobe-confetti {
  position: fixed;
  z-index: 45;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.wardrobe-confetti i {
  position: absolute;
  top: -22px;
  width: 10px;
  height: 17px;
  border-radius: 3px;
  animation: wardrobeConfetti 2.8s ease-in forwards;
}

@keyframes wardrobeConfetti {
  to { transform: translate(var(--drift), 110svh) rotate(720deg); }
}

.noscript-message {
  max-width: 700px;
  margin: 20px auto;
  padding: 14px;
  border-radius: 12px;
  text-align: center;
  background: #fff;
}

@media (max-width: 900px) {
  .wardrobe-game { grid-template-columns: 1fr; }
  .wardrobe-stage { min-height: 470px; }
}

@media (max-width: 620px) {
  .wardrobe-shell { width: min(100% - 18px, 1160px); }
  .wardrobe-header { padding-inline: 10px; }
  .wardrobe-header > img { width: 66px; }
  .favorite-button { min-width: 92px; padding-inline: 9px; font-size: 11px; }
  .mission-card { grid-template-columns: 45px 1fr auto; gap: 10px; padding: 12px; }
  .mission-icon { width: 43px; height: 43px; border-radius: 13px; font-size: 22px; }
  .mission-score { min-width: 59px; padding-inline: 8px; }
  .mission-score strong { font-size: 23px; }
  .brenda-dressing-card { padding: 9px; border-radius: 22px; }
  .wardrobe-stage { min-height: 350px; }
  .closet-panel { padding: 15px; border-radius: 22px; }
  .look-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wardrobe-actions { grid-template-columns: 1fr 1fr; }
  .check-look-button { grid-column: 1 / -1; }
}

@media (prefers-reduced-motion: reduce) {
  .stage-spark,
  .wardrobe-stage.is-changing img,
  .completion-card,
  .wardrobe-confetti i { animation: none !important; }
}
