:root {
  color-scheme: light;
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --ink: #352d42;
  --pink: #ff5ca8;
  --pink-dark: #df3788;
  --cream: #fff8ef;
  --wood: #9b654d;
  --wood-dark: #714635;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
}

body {
  min-height: 100vh;
  min-height: 100svh;
  overflow: hidden;
  color: var(--ink);
  background: #fff2f7;
}

button {
  font: inherit;
}

#fireworks {
  position: fixed;
  inset: 0;
  z-index: 30;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.game,
.screen {
  width: 100%;
  min-height: 100vh;
  min-height: 100svh;
}

.screen {
  display: none;
}

.screen.is-active {
  display: flex;
}

.start-screen {
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(circle at 12% 16%, rgba(255, 255, 255, 0.92) 0 4%, transparent 4.2%),
    radial-gradient(circle at 88% 80%, rgba(255, 255, 255, 0.75) 0 7%, transparent 7.2%),
    linear-gradient(145deg, #ffe3ee, #fff8ea 52%, #eadfff);
}

.start-card {
  position: relative;
  width: min(520px, 100%);
  padding: 42px 38px 38px;
  overflow: hidden;
  text-align: center;
  background: rgba(255, 255, 255, 0.82);
  border: 4px solid rgba(255, 255, 255, 0.88);
  border-radius: 38px;
  box-shadow: 0 24px 70px rgba(120, 70, 98, 0.18);
  backdrop-filter: blur(8px);
}

.start-card::before,
.start-card::after {
  position: absolute;
  color: #ff96c7;
  content: "✦";
  font-size: 44px;
}

.start-card::before {
  top: 24px;
  left: 34px;
  transform: rotate(-12deg);
}

.start-card::after {
  right: 34px;
  bottom: 26px;
  color: #9e86ee;
  transform: rotate(14deg);
}

.mini-mirror {
  position: relative;
  width: 80px;
  height: 112px;
  margin: 0 auto 20px;
  padding: 7px;
  background: #8c5b48;
  border-radius: 40px 40px 14px 14px;
  box-shadow: 0 8px 0 #683f31;
}

.mini-mirror span {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(145deg, #d9f4ff 20%, #fff 21% 29%, #bfe6f1 30%);
  border-radius: 34px 34px 9px 9px;
}

.eyebrow,
.tiny-title {
  margin: 0 0 8px;
  color: var(--pink-dark);
  font-weight: 800;
  letter-spacing: 0.08em;
}

.start-card h1 {
  margin: 0;
  font-size: clamp(42px, 9vw, 68px);
  line-height: 1.08;
  letter-spacing: -0.05em;
}

.start-copy {
  margin: 18px 0 28px;
  font-size: 21px;
  font-weight: 700;
}

.big-button {
  position: relative;
  z-index: 2;
  min-width: 220px;
  min-height: 68px;
  padding: 14px 28px;
  color: #fff;
  font-size: 22px;
  font-weight: 900;
  cursor: pointer;
  background: linear-gradient(180deg, #ff72b7, #f4499d);
  border: 0;
  border-radius: 999px;
  box-shadow: 0 9px 0 #c92b79, 0 16px 28px rgba(201, 43, 121, 0.25);
  transition: transform 150ms ease, box-shadow 150ms ease;
}

.big-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 11px 0 #c92b79, 0 18px 32px rgba(201, 43, 121, 0.28);
}

.big-button:active {
  transform: translateY(7px);
  box-shadow: 0 2px 0 #c92b79, 0 8px 15px rgba(201, 43, 121, 0.2);
}

.big-button:focus-visible,
.mirror-button:focus-visible {
  outline: 5px solid #3f8cff;
  outline-offset: 5px;
}

.play-screen {
  flex-direction: column;
  padding: 14px;
  background: #fff7f2;
}

.game-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1180px, 100%);
  margin: 0 auto 12px;
  padding: 0 12px;
}

.game-header h2 {
  margin: 0;
  font-size: clamp(24px, 4vw, 40px);
  line-height: 1.1;
}

.tiny-title {
  font-size: 13px;
}

.mouse-clue {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 58px;
  padding: 8px 16px;
  color: #624b71;
  font-weight: 900;
  background: #fff;
  border-radius: 999px;
  box-shadow: 0 6px 20px rgba(75, 47, 86, 0.1);
}

.mouse-icon {
  position: relative;
  width: 24px;
  height: 34px;
  border: 3px solid currentColor;
  border-radius: 13px;
}

.mouse-icon::before {
  position: absolute;
  top: 3px;
  left: 8px;
  width: 3px;
  height: 8px;
  content: "";
  background: currentColor;
  border-radius: 2px;
}

.room {
  position: relative;
  flex: 1;
  width: min(1180px, 100%);
  min-height: 520px;
  margin: 0 auto;
  overflow: hidden;
  background:
    linear-gradient(90deg, transparent 49.7%, rgba(151, 105, 91, 0.16) 50%, transparent 50.3%),
    linear-gradient(#f8e7d2 0 71%, #bf8b68 71% 73%, #a86f52 73%);
  border: 5px solid #fff;
  border-radius: 28px;
  box-shadow: 0 16px 44px rgba(87, 55, 42, 0.14);
  isolation: isolate;
}

.room::after {
  position: absolute;
  right: 0;
  bottom: 25%;
  left: 0;
  z-index: -1;
  height: 9px;
  content: "";
  background: #8e5a43;
}

.wall-light {
  position: absolute;
  z-index: -1;
  border-radius: 50%;
  filter: blur(1px);
}

.wall-light-one {
  top: -18%;
  left: 25%;
  width: 38%;
  height: 70%;
  background: rgba(255, 248, 202, 0.52);
}

.wall-light-two {
  top: -25%;
  right: -4%;
  width: 35%;
  height: 76%;
  background: rgba(255, 223, 237, 0.38);
}

.window {
  position: absolute;
  top: 8%;
  left: 8%;
  width: 22%;
  height: 29%;
  padding: 9px;
  background: #fdf7ed;
  border: 8px solid #9c654b;
  border-radius: 8px 8px 3px 3px;
  box-shadow: 0 7px 0 rgba(95, 59, 44, 0.18);
}

.window-sky {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: linear-gradient(#aee4f1 0 68%, #91c99b 68%);
}

.window-sky span {
  position: absolute;
  top: 22%;
  left: 18%;
  width: 33%;
  height: 16%;
  background: #fff;
  border-radius: 999px;
}

.window-sky span:last-child {
  top: 39%;
  left: 60%;
  width: 27%;
}

.window-bar {
  position: absolute;
  z-index: 2;
  background: #fdf7ed;
}

.window-bar-v {
  top: 0;
  bottom: 0;
  left: calc(50% - 4px);
  width: 8px;
}

.window-bar-h {
  top: calc(50% - 4px);
  right: 0;
  left: 0;
  height: 8px;
}

.bookshelf {
  position: absolute;
  bottom: 24%;
  left: 3%;
  width: 19%;
  height: 36%;
  padding: 11px 10px 0;
  background: #85523e;
  border: 8px solid #704333;
  border-bottom-width: 13px;
  border-radius: 5px 5px 2px 2px;
  box-shadow: 7px 8px 0 rgba(75, 45, 35, 0.13);
}

.shelf-row {
  display: flex;
  align-items: flex-end;
  gap: 5px;
  height: 33.33%;
  padding: 5px 5px 3px;
  border-bottom: 7px solid #6d4030;
}

.shelf-row:last-child {
  border: 0;
}

.book {
  display: block;
  width: 18%;
  height: 64%;
  border-radius: 3px 3px 0 0;
  box-shadow: inset -3px 0 rgba(0, 0, 0, 0.08);
}

.book.tall {
  height: 86%;
}

.book.coral { background: #eb7769; }
.book.blue { background: #5c9fc1; }
.book.yellow { background: #eecf65; }
.book.green { background: #70ad87; }

.shelf-decor {
  align-items: center;
  justify-content: space-around;
}

.clock {
  position: relative;
  width: 35px;
  height: 35px;
  background: #fff6df;
  border: 4px solid #dcae65;
  border-radius: 50%;
}

.clock b::before,
.clock b::after {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 3px;
  content: "";
  background: #6e584d;
  transform-origin: top;
}

.clock b::before { height: 9px; transform: rotate(0deg); }
.clock b::after { height: 7px; transform: rotate(-48deg); }

.box {
  width: 42%;
  height: 44%;
  background: #c8906a;
  border: 3px solid #704333;
  border-radius: 4px;
}

.desk {
  position: absolute;
  bottom: 22%;
  left: 27%;
  width: 34%;
  height: 29%;
}

.desk-top {
  position: absolute;
  top: 25%;
  width: 100%;
  height: 15%;
  background: #a86d50;
  border: 5px solid #764733;
  border-radius: 8px 8px 3px 3px;
  box-shadow: 0 7px 0 rgba(84, 48, 35, 0.14);
}

.desk-leg {
  position: absolute;
  top: 38%;
  bottom: 0;
  width: 7%;
  background: #7a4936;
}

.desk-leg.left { left: 8%; }
.desk-leg.right { right: 8%; }

.desk-things {
  position: absolute;
  top: 0;
  right: 6%;
  left: 5%;
  height: 27%;
}

.lamp {
  position: absolute;
  right: 4%;
  bottom: 0;
  width: 56px;
  height: 76px;
}

.lamp::before {
  position: absolute;
  top: 0;
  right: 0;
  width: 48px;
  height: 29px;
  content: "";
  background: #e8a85e;
  border-radius: 50% 50% 7px 7px;
  transform: rotate(12deg);
}

.lamp i {
  position: absolute;
  top: 23px;
  left: 25px;
  width: 6px;
  height: 44px;
  background: #765243;
  transform: rotate(8deg);
}

.lamp b {
  position: absolute;
  bottom: 0;
  left: 10px;
  width: 45px;
  height: 8px;
  background: #765243;
  border-radius: 50%;
}

.glasses {
  position: absolute;
  bottom: 2px;
  left: 20%;
  width: 76px;
  height: 24px;
}

.glasses i {
  position: absolute;
  bottom: 0;
  width: 26px;
  height: 20px;
  border: 4px solid #544958;
  border-radius: 48%;
}

.glasses i:first-child { left: 5px; }
.glasses i:nth-child(2) { right: 5px; }
.glasses b {
  position: absolute;
  top: 10px;
  left: 31px;
  width: 14px;
  height: 4px;
  background: #544958;
}

.mug {
  position: absolute;
  right: 31%;
  bottom: 0;
  width: 32px;
  height: 37px;
  background: #85b6ba;
  border-radius: 4px 4px 10px 10px;
}

.mug::after {
  position: absolute;
  top: 8px;
  right: -13px;
  width: 15px;
  height: 18px;
  content: "";
  border: 5px solid #85b6ba;
  border-left: 0;
  border-radius: 0 12px 12px 0;
}

.rug {
  position: absolute;
  right: 16%;
  bottom: 5%;
  left: 24%;
  height: 23%;
  background: repeating-linear-gradient(90deg, #e694a2 0 18px, #f7c3b2 18px 36px);
  border: 8px solid #d77c8b;
  border-radius: 50%;
  box-shadow: inset 0 0 0 10px rgba(255, 255, 255, 0.22);
  transform: perspective(400px) rotateX(62deg);
}

.runrun {
  position: absolute;
  bottom: 5%;
  left: 47%;
  z-index: 4;
  width: 94px;
  height: 175px;
  transform: scale(0.9);
  transform-origin: bottom;
}

.runrun-head {
  position: absolute;
  top: 25px;
  left: 19px;
  z-index: 2;
  width: 62px;
  height: 67px;
  background: #f1b789;
  border: 4px solid #70493d;
  border-radius: 46% 48% 45% 45%;
}

.runrun-head span {
  position: absolute;
  right: 7px;
  top: 27px;
  width: 7px;
  height: 7px;
  background: #3e3334;
  border-radius: 50%;
}

.runrun-hair {
  position: absolute;
  top: 13px;
  left: 17px;
  z-index: 3;
  width: 66px;
  height: 43px;
  background: #3c302d;
  border-radius: 50% 56% 24% 30%;
  transform: rotate(-5deg);
}

.runrun-hair::after {
  position: absolute;
  top: -6px;
  left: 15px;
  width: 22px;
  height: 26px;
  content: "";
  background: #3c302d;
  border-radius: 60% 10% 60% 10%;
  transform: rotate(-28deg);
}

.runrun-body {
  position: absolute;
  bottom: 0;
  left: 17px;
  width: 68px;
  height: 91px;
  background: linear-gradient(90deg, #63a8e0 0 50%, #5a9bd2 50%);
  border: 4px solid #3f6f9a;
  border-radius: 24px 24px 12px 12px;
}

.runrun-arm {
  position: absolute;
  top: 92px;
  right: -7px;
  z-index: 3;
  width: 65px;
  height: 22px;
  background: #f1b789;
  border: 4px solid #70493d;
  border-radius: 999px;
  transform: rotate(-27deg);
  transform-origin: left;
}

.mirror-stage {
  position: absolute;
  right: 7%;
  bottom: 8%;
  z-index: 5;
  width: 180px;
  height: 62%;
  min-height: 320px;
}

.mirror-button {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: block;
  width: 100%;
  height: 100%;
  padding: 0 0 26px;
  cursor: pointer;
  background: transparent;
  border: 0;
  transform-origin: bottom right;
  transition: transform 750ms cubic-bezier(0.22, 0.9, 0.28, 1);
}

.mirror-frame {
  position: absolute;
  inset: 0 8px 27px;
  display: block;
  padding: 13px;
  background: linear-gradient(90deg, #6c412f, #a66c4e 30%, #794935 68%, #b17b59);
  border: 5px solid #613a2b;
  border-radius: 80px 80px 18px 18px;
  box-shadow: 8px 10px 0 rgba(63, 37, 28, 0.16), inset 0 0 0 4px rgba(255, 255, 255, 0.12);
}

.mirror-glass {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: linear-gradient(145deg, #b7ddea 0 20%, #f7fdff 21% 29%, #c6e4ec 30% 62%, #ecf8f9 63% 70%, #b9dce7 71%);
  border: 4px solid #d0ad85;
  border-radius: 65px 65px 10px 10px;
}

.mirror-glass::after {
  position: absolute;
  inset: 12% 20%;
  content: "";
  background: rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  filter: blur(9px);
}

.shine {
  position: absolute;
  z-index: 2;
  width: 6px;
  height: 6px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 -14px 0 -2px #fff, 0 14px 0 -2px #fff, -14px 0 0 -2px #fff, 14px 0 0 -2px #fff;
  animation: sparkle 1.8s ease-in-out infinite;
}

.shine-one { top: 27%; left: 32%; }
.shine-two { right: 26%; bottom: 27%; animation-delay: 0.8s; }

.mirror-feet {
  position: absolute;
  right: 0;
  bottom: 4px;
  left: 0;
  display: flex;
  justify-content: space-between;
  padding: 0 20px;
}

.mirror-feet i {
  display: block;
  width: 48px;
  height: 15px;
  background: #704333;
  border-radius: 50%;
}

.click-hint {
  position: absolute;
  top: 48%;
  left: 50%;
  z-index: 4;
  display: flex;
  align-items: center;
  min-width: 126px;
  min-height: 58px;
  padding: 8px 13px;
  color: #6f3453;
  font-size: 17px;
  background: rgba(255, 255, 255, 0.94);
  border: 3px solid #ff8bc2;
  border-radius: 999px;
  box-shadow: 0 7px 16px rgba(111, 52, 83, 0.18);
  transform: translate(-50%, -50%);
  white-space: nowrap;
  animation: hint-bob 1.4s ease-in-out infinite;
}

.cursor-hand {
  margin-right: 4px;
  font-size: 27px;
  font-style: normal;
}

.mirror-button:hover .mirror-frame {
  filter: brightness(1.08);
}

.mirror-button:hover .click-hint {
  transform: translate(-50%, -54%) scale(1.05);
}

.aunt {
  position: absolute;
  bottom: 25px;
  left: 23px;
  z-index: 1;
  width: 138px;
  height: 290px;
  opacity: 0;
  transform: translateY(25px) scale(0.82);
  transform-origin: bottom;
  transition: opacity 300ms ease 420ms, transform 600ms cubic-bezier(0.18, 1.1, 0.35, 1) 370ms;
}

.aunt-head {
  position: absolute;
  top: 37px;
  left: 36px;
  z-index: 3;
  width: 72px;
  height: 82px;
  background: #f0b284;
  border: 4px solid #70483a;
  border-radius: 49% 49% 46% 46%;
}

.aunt-hair-back {
  position: absolute;
  top: 18px;
  left: 21px;
  z-index: 1;
  width: 103px;
  height: 127px;
  background: #49312d;
  border-radius: 50% 50% 42% 42%;
}

.aunt-hair-front {
  position: absolute;
  top: 25px;
  left: 29px;
  z-index: 4;
  width: 83px;
  height: 47px;
  background: #49312d;
  border-radius: 60% 55% 48% 10%;
  transform: rotate(-7deg);
}

.aunt-neck {
  position: absolute;
  top: 105px;
  left: 59px;
  z-index: 2;
  width: 25px;
  height: 25px;
  background: #f0b284;
}

.eye {
  position: absolute;
  top: 37px;
  width: 7px;
  height: 8px;
  background: #382d2c;
  border-radius: 50%;
}

.eye-left { left: 17px; }
.eye-right { right: 17px; }

.smile {
  position: absolute;
  bottom: 14px;
  left: 25px;
  width: 18px;
  height: 9px;
  border-bottom: 3px solid #b34d5a;
  border-radius: 0 0 50% 50%;
}

.aunt-dress {
  position: absolute;
  top: 120px;
  left: 25px;
  z-index: 2;
  width: 94px;
  height: 164px;
  background: linear-gradient(135deg, #c57bd7, #8a62c7);
  border: 4px solid #624287;
  border-radius: 35px 35px 16px 16px;
  clip-path: polygon(18% 0, 82% 0, 100% 100%, 0 100%);
}

.aunt-arm {
  position: absolute;
  top: 139px;
  right: 0;
  z-index: 4;
  width: 75px;
  height: 18px;
  background: #f0b284;
  border: 3px solid #70483a;
  border-radius: 999px;
  transform: rotate(34deg);
  transform-origin: left;
}

.pretend-prop {
  position: absolute;
  top: 180px;
  right: -8px;
  z-index: 5;
  width: 95px;
  height: 45px;
  transform: rotate(34deg);
}

.prop-body {
  position: absolute;
  top: 6px;
  left: 2px;
  width: 79px;
  height: 20px;
  background: #6c6878;
  border: 3px solid #453f4f;
  border-radius: 8px 4px 4px 8px;
}

.prop-tip {
  position: absolute;
  top: 8px;
  right: 0;
  width: 18px;
  height: 16px;
  background: #ff9e43;
  border: 3px solid #9f5b25;
  border-radius: 2px 8px 8px 2px;
}

.prop-handle {
  position: absolute;
  top: 23px;
  left: 24px;
  width: 18px;
  height: 20px;
  background: #6c6878;
  border: 3px solid #453f4f;
  border-radius: 2px 2px 7px 7px;
  transform: skew(-8deg);
}

.play-screen.found .mirror-button {
  transform: translateX(94%) rotate(5deg) scale(0.94);
}

.play-screen.found .aunt {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.play-screen.found .runrun-arm {
  animation: wave 600ms ease-in-out 2 alternate;
}

.result-panel {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 15;
  width: min(430px, calc(100% - 32px));
  padding: 28px;
  text-align: center;
  background: rgba(255, 255, 255, 0.94);
  border: 5px solid #ffc1de;
  border-radius: 32px;
  box-shadow: 0 22px 70px rgba(119, 48, 86, 0.25);
  opacity: 0;
  transform: translate(-50%, -45%) scale(0.86);
  transition: opacity 350ms ease, transform 500ms cubic-bezier(0.18, 1.2, 0.32, 1);
}

.result-panel.is-visible {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.result-panel h2 {
  margin: 5px 0 3px;
  font-size: clamp(30px, 6vw, 48px);
}

.result-panel p {
  margin: 5px 0 20px;
  font-size: 19px;
  font-weight: 800;
}

.result-panel .found-badge {
  display: inline-block;
  margin: 0;
  padding: 6px 14px;
  color: #b02570;
  background: #ffe2f0;
  border-radius: 999px;
}

.replay-button {
  min-height: 64px;
}

@keyframes sparkle {
  0%, 100% { opacity: 0.35; transform: scale(0.7) rotate(0); }
  50% { opacity: 1; transform: scale(1.18) rotate(45deg); }
}

@keyframes hint-bob {
  0%, 100% { transform: translate(-50%, -50%); }
  50% { transform: translate(-50%, -58%); }
}

@keyframes wave {
  from { transform: rotate(-27deg); }
  to { transform: rotate(-48deg); }
}

@media (max-width: 760px) {
  .play-screen {
    padding: 8px;
  }

  .game-header {
    margin-bottom: 8px;
  }

  .mouse-clue span:last-child,
  .tiny-title {
    display: none;
  }

  .mouse-clue {
    min-width: 58px;
    justify-content: center;
    padding: 7px;
  }

  .room {
    min-height: 0;
    border-width: 3px;
    border-radius: 20px;
  }

  .bookshelf {
    left: 2%;
    width: 23%;
  }

  .desk {
    left: 25%;
    width: 34%;
  }

  .runrun {
    left: 41%;
    transform: scale(0.72);
  }

  .mirror-stage {
    right: 3%;
    width: 150px;
    min-height: 280px;
  }

  .aunt {
    left: 9px;
    transform: translateY(25px) scale(0.72);
  }

  .play-screen.found .aunt {
    transform: translateY(0) scale(0.88);
  }

  .play-screen.found .mirror-button {
    transform: translateX(82%) rotate(5deg) scale(0.9);
  }
}

@media (max-width: 520px) and (orientation: portrait) {
  .game-header h2 {
    font-size: 24px;
  }

  .room {
    min-height: 560px;
  }

  .window {
    width: 31%;
    height: 23%;
  }

  .bookshelf {
    bottom: 25%;
    width: 28%;
    height: 33%;
  }

  .desk {
    bottom: 22%;
    left: 21%;
    width: 39%;
  }

  .glasses {
    display: none;
  }

  .runrun {
    left: 33%;
    transform: scale(0.66);
  }

  .mirror-stage {
    right: 1%;
    bottom: 7%;
    width: 136px;
    height: 56%;
    min-height: 310px;
  }

  .mirror-frame {
    right: 4px;
    left: 4px;
  }

  .click-hint {
    min-width: 84px;
    font-size: 0;
  }

  .cursor-hand {
    margin: 0;
    font-size: 30px;
  }

  .play-screen.found .mirror-button {
    transform: translateX(72%) rotate(4deg) scale(0.88);
  }
}

@media (max-height: 640px) and (orientation: landscape) {
  .play-screen {
    padding: 6px;
  }

  .game-header {
    min-height: 50px;
    margin-bottom: 4px;
  }

  .game-header h2 {
    font-size: 24px;
  }

  .tiny-title {
    display: none;
  }

  .room {
    min-height: 420px;
  }

  .runrun {
    transform: scale(0.7);
  }

  .mirror-stage {
    height: 68%;
    min-height: 280px;
  }
}

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