.item-main {
  overflow: hidden;
}

.game-shell .topbar {
  height: 88px;
  padding-block: 6px;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
}

.brand-title-logo {
  display: block;
  width: 90px;
  height: auto;
  margin-bottom: -2px;
  object-fit: contain;
}

.brand-copy small {
  margin-left: 2px;
}

.category-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.wardrobe-note {
  width: 100%;
  margin: 14px 0 10px;
  padding: 8px 12px;
  border-radius: 16px;
  text-align: center;
  font-size: 13px;
  line-height: 1.45;
}

.wardrobe-note + .category-tabs {
  margin-top: 0;
}

.category-tab {
  width: 100%;
  padding-inline: 6px;
}

.clear-item .item-main {
  display: grid;
  place-items: center;
  color: #a38378;
}

.clear-symbol {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 2px dashed #c7a69a;
  border-radius: 50%;
  font-size: 28px;
  line-height: 1;
}

.item-main img {
  position: relative;
}

.item-grid .closet-item:not(.clear-item) .item-main img {
  transform: scale(2);
  transform-origin: center;
}

.canvas {
  background: #fff;
}

.layer-stack {
  transform: translateY(3%) scale(1.2);
  transform-origin: center;
}

@media (min-width: 861px) {
  .game-layout {
    width: 100%;
    max-width: 900px;
    grid-template-columns: repeat(2, minmax(0, 410px));
    justify-content: center;
    gap: 24px;
    align-items: start;
  }

  .wardrobe,
  .dress-stage {
    height: 615px;
  }

  .wardrobe {
    min-height: 0;
  }

  .dress-stage {
    width: 100%;
    justify-content: flex-start;
    gap: 10px;
  }

  .canvas {
    width: 386px;
    height: 515px;
    flex: 0 0 auto;
  }

  .dress-stage .finish-btn {
    margin-top: auto;
  }
}

@media (max-width: 860px) {
  .wardrobe,
  .dress-stage {
    height: auto;
  }

  .dress-stage {
    width: min(100%, 610px);
    margin-inline: auto;
  }

  .wardrobe-note {
    font-size: 14px;
  }
}

.item-grid[data-category="head"] .item-main img,
.item-grid[data-category="hair"] .item-main img {
  top: 10px;
}

.item-grid[data-category="accessory"] .item-main img {
  top: 5px;
}

.item-grid[data-category="top"] .closet-item[data-key="unicorn"] .item-main img {
  top: 5px;
}

.item-grid[data-category="bottom"] .item-main img {
  top: -10px;
}

.closet-item.locked .item-main img {
  filter: blur(3px);
  opacity: .62;
}

.swatch.pink {
  background: #f5a7c6;
}

.swatch.blue {
  background: #7ec7ed;
}

body.cover-active {
  overflow: hidden;
}

.cover-screen {
  position: fixed;
  inset: 0;
  z-index: 500;
  overflow: hidden;
  background: #fbe4eb;
  opacity: 1;
  transition: opacity .55s ease, visibility .55s ease;
}

.cover-screen.leaving {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.cover-artboard {
  position: absolute;
  inset: 0;
}

.cover-background {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cover-title {
  position: absolute;
  left: 74%;
  top: 28%;
  z-index: 2;
  width: clamp(330px, 30vw, 585px);
  max-width: 42vw;
  height: auto;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 8px 12px rgba(216, 102, 138, .14));
  pointer-events: none;
}

.cover-bubble {
  position: absolute;
  left: 50%;
  top: 21.5%;
  z-index: 2;
  width: clamp(105px, 10vw, 190px);
  height: auto;
  transform: translateX(-50%);
  animation: cover-float 2.8s ease-in-out infinite;
  filter: drop-shadow(0 8px 10px rgba(177, 113, 133, .12));
}

.cover-start {
  position: absolute;
  left: 76%;
  top: 61%;
  z-index: 3;
  width: clamp(100px, 8.8vw, 168px);
  padding: 0;
  border: 0;
  background: transparent;
  transform: translate(-50%, -50%);
  cursor: pointer;
  transition: filter .18s ease, transform .18s ease;
}

.cover-start img {
  display: block;
  width: 100%;
  height: auto;
}

.cover-start:hover,
.cover-start:focus-visible {
  filter: brightness(1.04) drop-shadow(0 8px 9px rgba(216, 102, 138, .22));
  transform: translate(-50%, calc(-50% - 4px)) scale(1.04);
  outline: none;
}

.cover-start:active {
  transform: translate(-50%, calc(-50% + 2px)) scale(.98);
}

.petal-field {
  position: fixed;
  inset: 0;
  z-index: 520;
  overflow: hidden;
  pointer-events: none;
}

.petal {
  position: absolute;
  top: -12vh;
  left: var(--petal-left);
  width: var(--petal-size);
  height: calc(var(--petal-size) * .68);
  border-radius: 75% 25% 70% 30%;
  background: linear-gradient(135deg, rgba(255, 231, 239, .96), rgba(241, 139, 173, .82));
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, .72);
  opacity: var(--petal-opacity);
  animation: petal-fall var(--petal-duration) linear var(--petal-delay) infinite;
}

@keyframes cover-float {
  0%, 100% { transform: translate(-50%, 0); }
  50% { transform: translate(-50%, -10px); }
}

@keyframes petal-fall {
  0% { transform: translate3d(0, -10vh, 0) rotate(0deg); }
  45% { transform: translate3d(var(--petal-drift), 48vh, 0) rotate(190deg); }
  100% { transform: translate3d(0, 115vh, 0) rotate(430deg); }
}

@media (orientation: portrait) {
  .cover-artboard {
    inset: auto;
    left: 46%;
    top: 42%;
    width: 135vw;
    aspect-ratio: 4664 / 2631;
    transform: translate(-50%, -50%);
  }

  .cover-background {
    object-fit: fill;
  }

  .cover-bubble {
    left: 50%;
    top: 21.5%;
    width: 13%;
  }

  .cover-title {
    left: 74%;
    top: 28%;
    width: 37.5%;
    max-width: none;
  }

  .cover-start {
    left: 76%;
    top: 61%;
    width: 12%;
  }
}

@media (max-width: 520px) and (orientation: portrait) {
  .cover-artboard {
    top: 40%;
  }

  .cover-start {
    width: 14.4%;
  }

  .cover-title {
    top: 27%;
    width: 40.5%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cover-bubble,
  .petal {
    animation: none;
  }
}

.bottom-hint {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 220;
  width: calc(100% - 32px);
  max-width: 500px;
  padding: 12px 18px;
  border: 2px solid #614b45;
  border-radius: 18px;
  background: #fff9e8;
  box-shadow: 0 5px 0 #e8c7aa;
  color: #8b5366;
  font: 700 14px/1.65 'Noto Sans SC', sans-serif;
  text-align: center;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, calc(-50% + 10px)) scale(.98);
  transition: opacity .2s ease, transform .2s ease;
}

.bottom-hint.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.egg-question {
  margin: 15px 0 9px;
  font-weight: 900;
  font-size: 16px !important;
}

.egg-options {
  display: grid;
  gap: 8px;
}

.egg-option {
  width: 100%;
  padding: 10px 12px;
  border: 2px solid #d7a894;
  border-radius: 14px;
  background: #fff;
  color: #614b45;
  font: 700 14px 'Noto Sans SC', sans-serif;
  cursor: pointer;
}

.egg-option.selected {
  border-color: #614b45;
  background: #ffc3d3;
  box-shadow: 0 3px 0 #e6b1a8;
}

.media-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin-top: 14px;
}

.media-links:empty { display: none; }

.media-platform-link {
  display: grid;
  place-items: center;
  min-height: 43px;
  padding: 9px 12px;
  border: 2px solid #614b45;
  border-radius: 15px;
  background: #ffc3d3;
  box-shadow: 0 3px 0 #e6b1a8;
  color: #614b45;
  font: 800 14px 'Noto Sans SC', sans-serif;
  text-decoration: none;
  transition: transform .15s ease, filter .15s ease;
}

.media-platform-link[data-platform="Ytb"] { background: #ffd2d2; }
.media-platform-link[data-platform="Bilibili"] { background: #cdeef8; }
.media-platform-link[data-platform="微博"] { background: #ffe1bb; }
.media-platform-link[data-platform="小红书"] { background: #ffd1da; }
.media-platform-link:hover,
.media-platform-link:focus-visible { transform: translateY(-2px); filter: brightness(1.03); }

.game-dialog .media-notes {
  margin: 12px 0 2px;
  color: #9f6577;
  font-size: 12px;
  line-height: 1.7;
}

.character-voice-hitbox {
  position: absolute;
  left: 20%;
  top: 3%;
  z-index: 25;
  width: 60%;
  height: 92%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.character-voice-hitbox:focus-visible {
  outline: 3px dashed #dc758e;
  outline-offset: -8px;
  border-radius: 28px;
}

.decorate-screen[hidden] { display: none; }

.decorate-screen {
  min-height: 100vh;
  background: radial-gradient(#fff 1.5px, transparent 1.5px) 0 0/24px 24px, #fff3cf;
}

.decorate-topbar { position: sticky; top: 0; z-index: 50; }

.decorate-back {
  padding: 10px 18px;
  border: 2px solid #614b45;
  border-radius: 999px;
  background: #ffc3d3;
  color: #614b45;
  font: 800 14px 'Noto Sans SC', sans-serif;
  box-shadow: 0 3px 0 #d8a6a5;
  cursor: pointer;
}

.decorate-layout {
  display: grid;
  grid-template-columns: minmax(300px, 410px) minmax(320px, 460px);
  justify-content: center;
  align-items: center;
  gap: 24px;
  max-width: 930px;
  margin: 0 auto;
  padding: 26px 16px 36px;
}

.sticker-closet {
  display: flex;
  flex-direction: column;
  height: 575px;
  min-height: 0;
  padding: 22px;
  border: 3px solid #614b45;
  border-radius: 30px;
  background: #fffdf5;
  box-shadow: 0 6px 0 #e8c7aa;
}

.decorate-kicker { color: #dc758e; font-size: 12px; font-weight: 900; letter-spacing: 1.5px; }
.sticker-closet h1 { margin: 4px 0 18px; font-size: 28px; }

.sticker-tray {
  display: grid;
  flex: 1;
  min-height: 0;
  align-content: start;
  overflow-y: auto;
  overflow-x: hidden;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 2px 4px 8px 2px;
}

.sticker-tray button {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  min-width: 0;
  padding: 6.4px;
  border: 2px solid #e2c5b6;
  border-radius: 17px;
  background: #fff8dd;
  cursor: pointer;
}

.sticker-tray img { width: 80%; height: 80%; min-width: 0; min-height: 0; object-fit: contain; }

.sticker-tools { flex-shrink: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 9px; margin-top: 16px; }
.sticker-tools button {
  display: grid;
  place-items: center;
  min-width: 0;
  height: 42px;
  border: 2px solid #614b45;
  border-radius: 13px;
  background: #ffe394;
  color: #614b45;
  font: 900 24px/1 sans-serif;
  box-shadow: 0 3px 0 #e8c7aa;
  cursor: pointer;
}

.sticker-tools .delete-sticker { background: #ffd1d1; }
.delete-sticker svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.finished-look-area { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.decorate-tip { margin: 0; color: #b55d79; font: 700 14px 'Noto Sans SC', sans-serif; text-align: center; }
.finished-card {
  position: relative;
  width: min(100%, 390px);
  aspect-ratio: 3 / 4;
  overflow: hidden;
  border: 3px solid #614b45;
  border-radius: 31px;
  background: #fff;
  box-shadow: 0 8px 0 #e6c4a6;
  touch-action: none;
}

.finished-layer-stack,
.finished-layer-stack .wear-layer,
.placed-stickers { position: absolute; inset: 0; width: 100%; height: 100%; }
.finished-layer-stack { transform: translateY(3%) scale(1.2); transform-origin: center; }
.finished-layer-stack .wear-layer { object-fit: contain; pointer-events: none; }
.placed-stickers { z-index: 160; pointer-events: none; }
.placed-sticker { position: absolute; width: 24%; max-height: 24%; object-fit: contain; cursor: grab; pointer-events: auto; touch-action: none; }
.placed-sticker.selected { filter: drop-shadow(0 0 3px #dc758e) drop-shadow(0 0 3px #dc758e); }
.finished-card-label { position: absolute; right: 16px; top: 18px; z-index: 170; padding: 7px 10px; border: 2px solid #614b45; border-radius: 12px; background: #fffdf5; text-align: center; font-size: 10px; line-height: 1.1; transform: rotate(4deg); }
.finished-card-label b { font-size: 14px; }

.save-to-album {
  min-width: 190px;
  margin-top: 8px;
  padding: 13px 26px;
  border: 3px solid #614b45;
  border-radius: 999px;
  background: #ffc3d3;
  box-shadow: 0 5px 0 #e8c7aa;
  color: #614b45;
  font: 900 16px 'Noto Sans SC', sans-serif;
  cursor: pointer;
  transition: transform .15s ease, filter .15s ease;
}

.save-to-album:hover,
.save-to-album:focus-visible { transform: translateY(-2px); filter: brightness(1.03); }
.save-to-album:disabled { cursor: wait; opacity: .7; transform: none; }

.save-preview {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 48vh;
  margin: 16px auto 10px;
  border: 2px solid #614b45;
  border-radius: 18px;
  background: #fff;
}

.save-help {
  margin-bottom: 0;
  color: #8b6a61;
  font-size: 13px !important;
}

@media (max-width: 760px) {
  .decorate-layout { grid-template-columns: 1fr; }
  .finished-look-area { order: -1; }
  .finished-card { width: min(100%, 360px); }
  .sticker-closet { width: min(100%, 560px); height: 575px; margin: auto; }
}

@media (max-width: 520px) {
  .game-shell .topbar { height: 76px; }
  .brand-title-logo { width: 74px; }
  .brand-copy small { font-size: 9px; letter-spacing: .5px; }
}

@media (min-width: 761px) {
  .sticker-closet {
    align-self: stretch;
    height: auto;
    contain: size;
  }
}
