/* 衣橱巧搭 · 移动端换装小游戏 */
:root {
  --orange: #FF8A3D;
  --orange-deep: #E9691C;
  --ink: #3D2B24;
  --ink-2: #71584A;
  --ink-3: #A28773;
  --cream: #FFF9F1;
  --line: #F0DFC9;
  --panel-shadow: 0 -14px 36px rgba(122, 62, 24, .16);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  margin: 0;
  overflow: hidden;
  background: #EAD4BD;
  color: var(--ink);
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overscroll-behavior: none;
}
button { font: inherit; color: inherit; border: 0; background: none; padding: 0; cursor: pointer; touch-action: manipulation; }
button:disabled { cursor: default; }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }

.game {
  position: relative;
  width: 100%;
  max-width: 460px;
  height: 100vh;
  height: 100dvh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #FFF4E5;
  isolation: isolate;
}

/* ============================ 舞台 ============================ */

.stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  background: linear-gradient(185deg, var(--bg1) 0%, var(--bg2) 55%, var(--bg3) 100%);
  transition: background-color .45s ease;
}
.stage::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(62% 40% at 50% 2%, rgba(255, 255, 255, .9), transparent 72%),
    radial-gradient(42% 34% at 14% 24%, var(--glow), transparent 74%),
    radial-gradient(40% 30% at 88% 16%, rgba(255, 255, 255, .32), transparent 70%);
}
.stage::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: .3;
  background-image: radial-gradient(rgba(120, 70, 35, .16) 1px, transparent 1px);
  background-size: 15px 15px;
  -webkit-mask-image: linear-gradient(180deg, transparent 2%, #000 30%, #000 82%, transparent 100%);
  mask-image: linear-gradient(180deg, transparent 2%, #000 30%, #000 82%, transparent 100%);
}

.stage[data-theme="sakura"] {
  --bg1: #FFF7EC; --bg2: #FFE7DA; --bg3: #FFD4C8;
  --glow: rgba(255, 190, 206, .52); --pt: #FF9FB5;
  --arch: rgba(255, 251, 246, .6); --arch-line: rgba(255, 255, 255, .8);
  --floor: rgba(170, 90, 50, .2);
}
.stage[data-theme="night"] {
  --bg1: #423C6C; --bg2: #564A82; --bg3: #302A52;
  --glow: rgba(185, 165, 255, .34); --pt: #FFE2A8;
  --arch: rgba(112, 98, 165, .52); --arch-line: rgba(255, 255, 255, .3);
  --floor: rgba(18, 12, 38, .38);
}
.stage[data-theme="beach"] {
  --bg1: #F1FBF6; --bg2: #D7F1E9; --bg3: #B9E5DB;
  --glow: rgba(125, 215, 198, .34); --pt: #7FD4C4;
  --arch: rgba(255, 255, 255, .56); --arch-line: rgba(255, 255, 255, .8);
  --floor: rgba(65, 135, 120, .2);
}
.stage[data-theme="street"] {
  --bg1: #FFF6E9; --bg2: #FFE3C3; --bg3: #FFD0A4;
  --glow: rgba(255, 175, 95, .38); --pt: #FF8A3D;
  --arch: rgba(255, 250, 242, .58); --arch-line: rgba(255, 255, 255, .78);
  --floor: rgba(170, 90, 40, .2);
}
.stage[data-theme="cafe"] {
  --bg1: #F9EEE0; --bg2: #ECD8BF; --bg3: #DCBD99;
  --glow: rgba(205, 155, 105, .3); --pt: #C98B5D;
  --arch: rgba(255, 249, 240, .56); --arch-line: rgba(255, 255, 255, .7);
  --floor: rgba(120, 70, 35, .22);
}
.stage[data-theme="forest"] {
  --bg1: #F4F9EC; --bg2: #E0EEDA; --bg3: #C8E0BE;
  --glow: rgba(140, 190, 125, .3); --pt: #8DB57C;
  --arch: rgba(255, 253, 246, .56); --arch-line: rgba(255, 255, 255, .78);
  --floor: rgba(75, 120, 60, .2);
}

.beam {
  position: absolute;
  top: -16%;
  left: 2%;
  width: 160px;
  height: 82%;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, .5), transparent 72%);
  transform: rotate(14deg);
  filter: blur(14px);
  opacity: .62;
}

.arch {
  position: absolute;
  left: 50%;
  top: 64px;
  bottom: 34px;
  width: min(80%, 300px);
  transform: translateX(-50%);
  z-index: 1;
  border-radius: 180px 180px 24px 24px;
  border: 6px solid var(--arch-line);
  background: linear-gradient(180deg, rgba(255, 255, 255, .55), var(--arch) 68%, rgba(255, 255, 255, .08));
  box-shadow: 0 24px 46px rgba(120, 60, 30, .1), inset 0 0 46px rgba(255, 255, 255, .32);
}
.arch::before {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 172px 172px 18px 18px;
  border: 1px solid rgba(190, 140, 95, .18);
}
.arch::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  opacity: .55;
  background: linear-gradient(112deg, transparent 18%, rgba(255, 255, 255, .42) 36%, transparent 55%);
}
.floor {
  position: absolute;
  left: 50%;
  bottom: 36px;
  width: 270px;
  height: 56px;
  transform: translateX(-50%);
  border-radius: 50%;
  z-index: 1;
  background: radial-gradient(ellipse at center, var(--floor), transparent 68%);
  filter: blur(2px);
}

.particles { position: absolute; inset: 0; z-index: 2; overflow: hidden; pointer-events: none; }
.pt {
  position: absolute;
  top: -24px;
  opacity: 0;
  animation-name: fall;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
  transform: rotate(var(--rot, 0deg));
  will-change: transform, opacity;
}
.pt-petal { border-radius: 80% 10% 80% 10%; background: var(--pt); box-shadow: 0 0 6px rgba(255, 255, 255, .25); }
.pt-star { background: var(--pt); clip-path: polygon(50% 0, 60% 40%, 100% 50%, 60% 60%, 50% 100%, 40% 60%, 0 50%, 40% 40%); }
.pt-bubble { border: 1.4px solid var(--pt); border-radius: 50%; background: transparent; }
.pt-spark { background: var(--pt); clip-path: polygon(50% 0, 61% 39%, 100% 50%, 61% 61%, 50% 100%, 39% 61%, 0 50%, 39% 39%); }
.pt-leaf { border-radius: 60% 0 60% 0; background: var(--pt); }

@keyframes fall {
  0% { transform: translate3d(0, -24px, 0) rotate(var(--rot, 0deg)); opacity: 0; }
  12% { opacity: .85; }
  100% { transform: translate3d(28px, 720px, 0) rotate(calc(var(--rot, 0deg) + 220deg)); opacity: 0; }
}

/* ============================ 顶部主题条 ============================ */

.hud {
  position: absolute;
  top: max(10px, env(safe-area-inset-top));
  left: 12px;
  right: 12px;
  z-index: 9;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  pointer-events: none;
}
.quest {
  pointer-events: auto;
  flex: 0 1 auto;
  max-width: 238px;
  padding: 8px 10px 9px;
  border-radius: 18px;
  background: rgba(255, 250, 243, .94);
  border: 1px solid rgba(255, 255, 255, .92);
  box-shadow: 0 10px 24px rgba(139, 72, 30, .16);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.quest-top { display: flex; align-items: center; gap: 5px; }
.quest-kicker {
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .12em;
  color: #D5631A;
  background: #FFE6D0;
  border-radius: 999px;
  padding: 2px 6px;
  white-space: nowrap;
}
.quest-round { font-size: 9px; font-weight: 700; color: #A88C76; white-space: nowrap; }
.quest-shuffle {
  margin-left: auto;
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #9A7A5E;
  background: #F5E8D7;
  transition: transform .25s ease, background .2s ease;
}
.quest-shuffle:active { transform: rotate(90deg) scale(.92); background: #FFE2C8; }
.quest-shuffle .mp-icon { width: 13px; height: 13px; }
.quest-name {
  margin-top: 3px;
  font-size: 17px;
  font-weight: 900;
  line-height: 1.2;
  letter-spacing: .01em;
  color: var(--ink);
}
.quest-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.tag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 9.5px;
  font-weight: 800;
  color: #927865;
  background: #F3E7D8;
  transition: background .25s ease, color .25s ease, transform .25s ease;
}
.tag b {
  min-width: 11px;
  height: 11px;
  padding: 0 2px;
  display: inline-grid;
  place-items: center;
  border-radius: 99px;
  font-size: 8px;
  background: rgba(255, 255, 255, .35);
}
.tag.is-on {
  color: #fff;
  background: linear-gradient(135deg, #FFB073, #FF7F2D);
  box-shadow: 0 3px 8px rgba(255, 127, 45, .28);
  animation: tagOn .34s cubic-bezier(.2, 1.2, .4, 1);
}
@keyframes tagOn { 0% { transform: scale(.86); } 100% { transform: scale(1); } }

.hud-right {
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
}
.coins {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 9px 5px 6px;
  border-radius: 999px;
  color: #FFF6E4;
  background: rgba(61, 43, 34, .88);
  font-size: 13px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 6px 14px rgba(61, 43, 34, .2);
}
.coin {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  color: #8A5600;
  background: radial-gradient(circle at 35% 30%, #FFF0B6, #FFC94F 58%, #E89A1C);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .45);
}
.coin .mp-icon { width: 10px; height: 10px; }
.best {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 3px 8px;
  border-radius: 999px;
  color: #A3866E;
  background: rgba(255, 250, 242, .82);
  font-size: 9px;
  font-weight: 800;
  box-shadow: 0 3px 8px rgba(120, 70, 30, .08);
}
.best .mp-icon { width: 10px; height: 10px; color: #F5B731; }
.best b { color: #D5631A; font-size: 10px; }
.coins.bump { animation: coinBump .36s cubic-bezier(.2, 1.3, .4, 1); }
@keyframes coinBump { 0% { transform: scale(1); } 45% { transform: scale(1.12); } 100% { transform: scale(1); } }

/* ============================ 模特 ============================ */

.doll-wrap {
  position: absolute;
  top: 58px;
  left: 0;
  right: 0;
  bottom: 52px;
  z-index: 3;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  pointer-events: none;
}
.doll {
  height: 100%;
  width: min(88%, 330px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  filter: drop-shadow(0 18px 18px rgba(120, 60, 30, .16));
  animation: dollIn .8s cubic-bezier(.2, .9, .25, 1.05) both;
  transform-origin: 50% 95%;
}
.doll svg { width: 100%; height: 100%; display: block; overflow: visible; }
.doll.pop { animation: dollPop .36s cubic-bezier(.2, .9, .3, 1.2); }
.stage[data-theme="night"] .doll {
  filter: drop-shadow(0 0 9px rgba(255, 240, 210, .26)) drop-shadow(0 18px 18px rgba(20, 10, 40, .4));
}
@keyframes dollIn { from { opacity: 0; transform: translateY(18px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes dollPop { 0% { transform: scale(1); } 45% { transform: scale(1.012); } 100% { transform: scale(1); } }

.eye-anim {
  transform-box: fill-box;
  transform-origin: center;
  animation: blink 6.6s infinite;
}
@keyframes blink { 0%, 93%, 100% { transform: scaleY(1); } 95.5%, 97.5% { transform: scaleY(.08); } }

/* ============================ 契合度 ============================ */

.meter {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 8px;
  z-index: 7;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  border-radius: 15px;
  background: rgba(255, 250, 242, .84);
  border: 1px solid rgba(255, 255, 255, .86);
  box-shadow: 0 7px 18px rgba(120, 65, 30, .1);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.meter-label { font-size: 9px; font-weight: 900; letter-spacing: .04em; color: #9A7E67; white-space: nowrap; }
.meter-track {
  flex: 1;
  height: 7px;
  border-radius: 99px;
  overflow: hidden;
  background: #EAD8C2;
  box-shadow: inset 0 1px 2px rgba(120, 70, 30, .12);
}
.meter-fill {
  height: 100%;
  width: 4%;
  border-radius: inherit;
  background: linear-gradient(90deg, #FFC578, #FF8A3D 65%, #F26E18);
  box-shadow: 0 0 8px rgba(255, 138, 61, .4);
  transition: width .45s cubic-bezier(.2, .8, .2, 1);
}
.meter-num {
  min-width: 24px;
  text-align: right;
  color: #E9691C;
  font-size: 15px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}
.meter-unit { margin-left: -4px; color: #B49479; font-size: 8px; font-weight: 800; }
.meter.is-hot { border-color: rgba(255, 168, 96, .9); }
.meter.is-hot .meter-num { color: #F25F00; }
.meter-num.bump { animation: numBump .35s cubic-bezier(.2, 1.2, .4, 1); }
@keyframes numBump { 0% { transform: scale(1); } 40% { transform: scale(1.22); } 100% { transform: scale(1); } }

/* ============================ 衣橱面板 ============================ */

.panel {
  position: relative;
  z-index: 10;
  flex: 0 0 auto;
  padding: 7px 0 calc(7px + env(safe-area-inset-bottom));
  border-radius: 26px 26px 0 0;
  background: linear-gradient(180deg, #FFF9F1, #FFF3E3);
  box-shadow: var(--panel-shadow);
}
.panel::before {
  content: "";
  position: absolute;
  top: 5px;
  left: 50%;
  width: 38px;
  height: 4px;
  transform: translateX(-50%);
  border-radius: 99px;
  background: #EBD7BE;
}

.tabs { display: flex; gap: 1px; padding: 9px 10px 2px; }
.tab {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 5px 1px 6px;
  border-radius: 13px;
  color: #A08671;
  font-size: 10px;
  font-weight: 800;
  transition: background .22s ease, color .22s ease, transform .15s ease, box-shadow .22s ease;
}
.tab .mp-icon { width: 20px; height: 20px; }
.tab.is-active {
  color: #fff;
  background: linear-gradient(160deg, #FFA55F, #F3731D);
  box-shadow: 0 6px 14px rgba(243, 115, 29, .3);
}
.tab:active { transform: scale(.96); }

.subrow {
  height: 34px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 7px;
  overflow: hidden;
}
.sub-label { flex: 0 0 auto; color: #AB8C73; font-size: 9.5px; font-weight: 800; white-space: nowrap; }
.sub-name {
  color: #6D5547;
  font-size: 11.5px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sub-tags { flex: 0 0 auto; display: flex; gap: 4px; margin-left: auto; }
.mini-tag { padding: 2px 6px; border-radius: 99px; color: #9A7C64; background: #F4E7D6; font-size: 9px; font-weight: 700; }
.hair-colors { flex: 1; display: flex; align-items: center; justify-content: space-between; gap: 5px; }
.swatch {
  flex: 0 0 auto;
  width: 25px;
  height: 25px;
  border-radius: 50%;
  border: 2px solid #FFF9F1;
  box-shadow: 0 0 0 1px #E4CFB6, inset 0 -4px 6px rgba(40, 20, 10, .16);
  transition: transform .18s ease, box-shadow .18s ease;
}
.swatch.is-on {
  transform: scale(1.08);
  box-shadow: 0 0 0 2px #FF8A3D, 0 3px 7px rgba(255, 138, 61, .35), inset 0 -3px 5px rgba(40, 20, 10, .12);
}
.sub-count { flex: 0 0 auto; color: #B59B84; font-size: 9px; font-weight: 700; }

.items {
  display: flex;
  gap: 9px;
  padding: 2px 16px 7px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}
.items::-webkit-scrollbar, .hair-colors::-webkit-scrollbar { display: none; }
.item {
  position: relative;
  flex: 0 0 80px;
  padding: 5px 5px 0;
  border-radius: 15px;
  border: 1.5px solid #F0E0CD;
  background: #FFFDF9;
  box-shadow: 0 2px 5px rgba(140, 80, 35, .05);
  scroll-snap-align: start;
  text-align: left;
  transition: transform .16s ease, border-color .2s ease, background .2s ease, box-shadow .2s ease;
}
.item:active { transform: scale(.96); }
.item.is-on {
  border-color: #FF8A3D;
  background: linear-gradient(180deg, #FFF4E6, #FFEAD4);
  box-shadow: 0 5px 14px rgba(255, 138, 61, .2);
}
.item-thumb {
  height: 64px;
  border-radius: 11px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 38%, #FFFCF7, #F8EDDF);
}
.item-thumb svg { width: 100%; height: 100%; display: block; }
.item-name {
  display: block;
  padding: 5px 0 6px;
  color: #715848;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.item.is-on .item-name { color: #D5621B; }
.item-badge {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: linear-gradient(135deg, #FFA45D, #F26E18);
  box-shadow: 0 3px 7px rgba(242, 110, 24, .35);
}
.item-badge::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 4px;
  width: 6px;
  height: 3px;
  border-left: 1.6px solid #fff;
  border-bottom: 1.6px solid #fff;
  transform: rotate(-45deg);
}
.item.locked .item-thumb { filter: grayscale(.6) opacity(.66); }
.lock-chip {
  position: absolute;
  right: 6px;
  bottom: 29px;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 2px 6px 2px 4px;
  border-radius: 99px;
  color: #FFE8BE;
  background: rgba(57, 40, 31, .8);
  font-size: 8.5px;
  font-weight: 800;
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}
.lock-chip .mp-icon { width: 9px; height: 9px; }

.cta-wrap { padding: 1px 16px; }
.cta {
  position: relative;
  width: 100%;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  overflow: hidden;
  border-radius: 16px;
  color: #fff;
  background: linear-gradient(135deg, #FFA85F, #F26E18 75%);
  font-size: 15px;
  font-weight: 900;
  letter-spacing: .04em;
  box-shadow: 0 9px 20px rgba(242, 110, 24, .3);
  transition: transform .14s ease, box-shadow .2s ease;
}
.cta:active { transform: translateY(1px) scale(.994); box-shadow: 0 5px 12px rgba(242, 110, 24, .3); }
.cta::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 18%, rgba(255, 255, 255, .32) 45%, transparent 62%);
  transform: translateX(-130%);
  animation: sheen 4.2s infinite;
}
.cta > * { position: relative; z-index: 1; }
.cta-spark {
  width: 15px;
  height: 15px;
  background: #FFE9A9;
  clip-path: polygon(50% 0, 60% 40%, 100% 50%, 60% 60%, 50% 100%, 40% 60%, 0 50%, 40% 40%);
  filter: drop-shadow(0 0 4px rgba(255, 240, 180, .7));
}
@keyframes sheen { 0%, 55% { transform: translateX(-130%); } 80%, 100% { transform: translateX(130%); } }

/* ============================ 弹层 ============================ */

.mask {
  position: absolute;
  inset: 0;
  z-index: 40;
  background: rgba(54, 33, 22, .45);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s ease;
}
.mask.is-open { opacity: 1; pointer-events: auto; }
.sheet {
  position: absolute;
  left: 50%;
  bottom: 0;
  z-index: 41;
  width: 100%;
  max-height: 88%;
  overflow-y: auto;
  padding: 12px 20px calc(16px + env(safe-area-inset-bottom));
  border-radius: 30px 30px 0 0;
  background: linear-gradient(180deg, #FFFDF8, #FFF4E5);
  box-shadow: 0 -20px 60px rgba(80, 40, 20, .32);
  transform: translate(-50%, 108%);
  visibility: hidden;
  transition: transform .44s cubic-bezier(.18, .9, .26, 1.04), visibility 0s .44s;
  scrollbar-width: none;
}
.sheet::-webkit-scrollbar { display: none; }
.sheet.is-open {
  transform: translate(-50%, 0);
  visibility: visible;
  transition: transform .44s cubic-bezier(.18, .9, .26, 1.04), visibility 0s 0s;
}
.sheet-handle { width: 40px; height: 4px; margin: 0 auto 10px; border-radius: 99px; background: #E7D3BA; }
.sheet-close {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #8F735D;
  background: #F3E5D4;
}
.sheet-close .mp-icon { width: 16px; height: 16px; }

.result-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.result-kicker { color: #DB6A1F; font-size: 9px; font-weight: 900; letter-spacing: .18em; }
.result-theme { margin-top: 3px; color: #9A806A; font-size: 12px; font-weight: 700; }
.score-row { display: flex; align-items: center; gap: 15px; margin: 12px 0 10px; }
.score-ring { position: relative; width: 92px; height: 92px; flex: 0 0 auto; }
.score-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-fill {
  stroke-dasharray: 232.5;
  stroke-dashoffset: 232.5;
  transition: stroke-dashoffset .95s cubic-bezier(.2, .8, .2, 1);
}
.score-num {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: baseline;
  justify-content: center;
  padding-top: 31px;
  color: #E9691C;
  font-size: 27px;
  font-weight: 900;
  letter-spacing: -.03em;
  font-variant-numeric: tabular-nums;
}
.score-num small { margin-left: 2px; color: #B08E73; font-size: 9px; font-weight: 800; letter-spacing: 0; }
.result-main { min-width: 0; }
.result-main h3 { margin: 0; font-size: 21px; font-weight: 900; letter-spacing: -.01em; }
.stars { display: flex; gap: 3px; margin-top: 5px; }
.star-svg {
  width: 22px;
  height: 22px;
  fill: #E7D7C2;
  opacity: 0;
  transform: scale(.7);
  animation: starPop .4s cubic-bezier(.2, 1.4, .4, 1) forwards;
}
.star-svg.on { fill: #FFC044; filter: drop-shadow(0 2px 3px rgba(240, 160, 20, .3)); }
@keyframes starPop { to { opacity: 1; transform: scale(1); } }
.comment { margin: 7px 0 0; color: #8C7260; font-size: 11.5px; line-height: 1.6; }
.breakdown { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.bd {
  padding: 4px 9px;
  border-radius: 99px;
  border: 1px solid #F4DEBE;
  color: #8C5A2C;
  background: #FFF0D8;
  font-size: 10px;
  font-weight: 800;
}
.reward {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 12px 0 2px;
  padding: 10px 13px;
  border-radius: 15px;
  border: 1px dashed #E9B775;
  background: linear-gradient(135deg, #FFF4DA, #FFE7BE);
}
.reward-label { color: #95704A; font-size: 11px; font-weight: 800; }
.reward b { color: #C57419; font-size: 19px; font-weight: 900; letter-spacing: -.02em; }
.reward small { color: #A47D4D; font-size: 10px; font-weight: 800; }
.sheet-actions { display: flex; gap: 9px; margin-top: 12px; }
.btn-primary {
  flex: 1.3;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 15px;
  color: #fff;
  background: linear-gradient(135deg, #FFA45D, #F26E18);
  font-size: 14px;
  font-weight: 900;
  letter-spacing: .03em;
  box-shadow: 0 8px 18px rgba(242, 110, 24, .28);
  transition: transform .14s ease;
}
.btn-primary:active { transform: scale(.985); }
.btn-primary:disabled { color: #A78F7A; background: #E4D4C1; box-shadow: none; }
.btn-ghost {
  flex: .8;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 15px;
  color: #8E725D;
  background: #F6EADA;
  font-size: 13px;
  font-weight: 800;
  transition: transform .14s ease;
}
.btn-ghost:active { transform: scale(.985); }
.next-hint { margin: 9px 0 0; text-align: center; color: #B2947B; font-size: 9.5px; font-weight: 700; }

.result-confetti { position: absolute; top: 20px; left: 0; right: 0; height: 70px; overflow: hidden; pointer-events: none; }
.result-confetti i {
  position: absolute;
  top: -10px;
  width: 6px;
  height: 9px;
  border-radius: 2px;
  opacity: 1;
  transform: rotate(var(--r, 0deg));
  animation: confetti .9s .1s ease-out forwards;
}
@keyframes confetti {
  0% { transform: translateY(0) rotate(var(--r, 0deg)); opacity: 1; }
  100% { transform: translateY(92px) rotate(calc(var(--r, 0deg) + 90deg)); opacity: 0; }
}

.unlock-top { display: flex; align-items: center; gap: 14px; margin: 12px 0 4px; }
.unlock-thumb {
  flex: 0 0 auto;
  width: 92px;
  height: 92px;
  overflow: hidden;
  border-radius: 18px;
  border: 1px solid #F0DFC9;
  background: radial-gradient(circle at 50% 38%, #FFFCF7, #F7E9D6);
}
.unlock-thumb svg { width: 100%; height: 100%; display: block; }
.unlock-info { min-width: 0; }
.unlock-info h3 { margin: 0 0 5px; font-size: 19px; font-weight: 900; }
.unlock-info .sub-tags { margin-left: 0; justify-content: flex-start; }
.unlock-price { display: flex; align-items: center; gap: 4px; margin-top: 8px; color: #C57419; }
.unlock-price b { font-size: 20px; font-weight: 900; }
.unlock-price > span { color: #A47D4D; font-size: 10px; font-weight: 800; }
.coin.small { width: 16px; height: 16px; }
.coin.small .mp-icon { width: 9px; height: 9px; }
.unlock-balance { margin-top: 3px; color: #A88D77; font-size: 10px; font-weight: 700; }
.unlock-note { margin: 10px 0 2px; color: #907562; font-size: 11px; line-height: 1.55; }
.unlock-note.warn { padding: 7px 10px; border-radius: 10px; color: #C4732D; background: #FFF1DF; }

/* ============================ 浮层提示 ============================ */

.toast {
  position: absolute;
  top: 84px;
  left: 50%;
  z-index: 60;
  max-width: 82%;
  padding: 8px 14px;
  border-radius: 99px;
  color: #FFF6E7;
  background: rgba(55, 37, 28, .9);
  font-size: 11px;
  font-weight: 700;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -6px);
  transition: opacity .25s ease, transform .25s ease;
  box-shadow: 0 8px 20px rgba(50, 30, 20, .25);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.tag-float {
  position: absolute;
  bottom: 56px;
  z-index: 8;
  padding: 3px 9px;
  border-radius: 99px;
  color: #fff;
  background: linear-gradient(135deg, #FFA45D, #F26E18);
  font-size: 11px;
  font-weight: 900;
  box-shadow: 0 4px 10px rgba(240, 110, 20, .3);
  pointer-events: none;
  animation: floatUp .9s ease-out forwards;
}
@keyframes floatUp {
  0% { opacity: 0; transform: translate(-50%, 6px) scale(.85); }
  20% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -30px) scale(1); }
}

/* ============================ 适配 ============================ */

@media (min-width: 600px) {
  body {
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(1200px 700px at 50% 10%, #FFF8EE, #EAD4BD 60%, #DFC2A5);
  }
  .game {
    height: min(920px, 94dvh);
    border-radius: 38px;
    box-shadow: 0 40px 100px rgba(96, 48, 18, .35), 0 0 0 1px rgba(255, 255, 255, .6);
  }
}

@media (max-height: 710px) {
  .quest { padding: 6px 9px 7px; }
  .quest-name { font-size: 15px; }
  .doll-wrap { top: 52px; bottom: 47px; }
  .tabs { padding-top: 7px; }
  .tab { padding: 4px 1px 5px; }
  .tab .mp-icon { width: 18px; height: 18px; }
  .subrow { height: 31px; }
  .item { flex-basis: 74px; }
  .item-thumb { height: 56px; }
  .items { padding-bottom: 5px; }
  .cta { height: 46px; font-size: 14px; }
  .score-ring { width: 80px; height: 80px; }
  .score-num { padding-top: 26px; font-size: 24px; }
}

@media (max-width: 350px) {
  .hud { left: 9px; right: 9px; }
  .quest { max-width: 214px; }
  .quest-name { font-size: 15.5px; }
  .swatch { width: 24px; height: 24px; }
  .item { flex-basis: 76px; }
  .items { padding-left: 13px; padding-right: 13px; }
  .subrow { padding: 0 13px; }
  .cta-wrap { padding: 1px 13px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}
