:root {
  color-scheme: light;
  --ink: #2f2924;
  --muted: #756b62;
  --line: #ded6ce;
  --paper: #fffaf3;
  --soft: #f3eadf;
  --accent: #e58f2d;
  --accent-dark: #a8561b;
  --blue: #5b91bc;
  --green: #6e9860;
  --brown: #6b4b3a;
  --shadow: 0 20px 60px rgba(67, 48, 34, 0.16);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(255, 250, 243, 0.94), rgba(246, 237, 226, 0.98)),
    url("./参考/TOM4.jpg") center / cover fixed;
  font-family:
    "Microsoft YaHei",
    "PingFang SC",
    system-ui,
    sans-serif;
}

button {
  border: 0;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.app-shell {
  width: min(1440px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 24px;
}

.hidden {
  display: none !important;
}

.kicker {
  margin: 0 0 8px;
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
}

.start-screen {
  min-height: calc(100vh - 48px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 18px;
  align-items: stretch;
}

.start-copy h1,
.topbar h1 {
  margin: 0;
  font-size: clamp(34px, 6vw, 76px);
  line-height: 1;
}

.intro {
  max-width: 980px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.65;
}

.hero-board {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
  min-height: min(680px, calc(100vh - 245px));
  width: 66.666%;
  margin: 0 auto;
}

.profile-card:nth-child(1),
.profile-card:nth-child(1) .profile-copy {
  background: #fbedf3;
}

.profile-card:nth-child(1) .profile-portrait {
  background:
    radial-gradient(circle at 50% 72%, rgba(224, 120, 158, 0.2) 0 72px, transparent 74px),
    linear-gradient(180deg, rgba(255, 248, 251, 0.62), rgba(246, 210, 225, 0.52)),
    #f8e7ef;
}

.profile-card:nth-child(2),
.profile-card:nth-child(2) .profile-copy {
  background: #eaf3fb;
}

.profile-card:nth-child(2) .profile-portrait {
  background:
    radial-gradient(circle at 50% 72%, rgba(89, 151, 204, 0.2) 0 72px, transparent 74px),
    linear-gradient(180deg, rgba(248, 252, 255, 0.62), rgba(201, 226, 246, 0.54)),
    #e5f0f9;
}

.profile-card:nth-child(1).selected {
  border-color: #db789b;
  box-shadow: 0 24px 70px rgba(192, 83, 126, 0.22);
}

.profile-card:nth-child(2).selected {
  border-color: #6a9fd0;
  box-shadow: 0 24px 70px rgba(65, 123, 178, 0.22);
}

.profile-copy p {
  width: fit-content;
  color: transparent !important;
  background: linear-gradient(90deg, #d94e7c, #dc7d32, #5e963e, #258e9b, #4d70c5, #9a58b5);
  background-clip: text;
  -webkit-background-clip: text;
  font-weight: 800;
}

.profile-card {
  --look-x: 0;
  --look-y: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  min-height: 0;
  gap: 0;
  align-items: stretch;
  overflow: hidden;
  position: relative;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 8px;
  background: rgba(255, 250, 243, 0.92);
  box-shadow: var(--shadow);
  transition:
    border-color 180ms ease,
    transform 180ms ease,
    box-shadow 180ms ease;
}

.profile-card::after {
  content: "";
  position: absolute;
  inset: auto 22px 16px 22px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(229, 143, 45, 0.55), transparent);
  opacity: 0;
  transition: opacity 180ms ease;
}

.profile-card.selected {
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: 0 24px 70px rgba(168, 86, 27, 0.24);
}

.profile-card.selected::after {
  opacity: 1;
}

.profile-portrait {
  align-self: stretch;
  display: grid;
  place-items: center;
  min-height: 0;
  margin: 0;
  padding: 18px 18px 0;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  transform:
    translateX(calc(var(--look-x) * 5px))
    translateY(calc(var(--look-y) * 3px));
  background:
    radial-gradient(circle at 50% 72%, rgba(229, 143, 45, 0.22) 0 72px, transparent 74px),
    linear-gradient(180deg, rgba(255, 250, 243, 0.2), rgba(229, 143, 45, 0.12)),
    #f6efe7;
  transition: transform 160ms ease-out;
}

.profile-portrait::after {
  content: "";
  position: absolute;
  inset: 20px 18px auto;
  height: 46%;
  z-index: 0;
  border-radius: 50%;
  background:
    radial-gradient(circle at calc(48% + var(--look-x) * 18%) calc(34% + var(--look-y) * 12%), rgba(255, 255, 255, 0.34), transparent 36%),
    radial-gradient(circle at 54% 72%, rgba(91, 145, 188, 0.16), transparent 48%);
  opacity: 0.8;
  transform: translateY(calc(var(--look-y) * 8px));
  pointer-events: none;
}

.live2d-shadow {
  position: absolute;
  left: 20%;
  right: 18%;
  bottom: 9px;
  z-index: 0;
  height: 22px;
  border-radius: 50%;
  background: rgba(67, 48, 34, 0.16);
  filter: blur(7px);
  transform: translateX(calc(var(--look-x) * -8px)) scaleX(0.96);
  animation: live2d-shadow-breathe 4.6s ease-in-out infinite;
}

.live2d-rig {
  position: relative;
  z-index: 1;
  width: min(100%, 230px);
  height: 270px;
  transform-origin: 50% 88%;
  animation: live2d-body-breathe 5.2s ease-in-out infinite;
  animation-delay: var(--idle-delay);
  transition:
    transform 180ms ease-out;
  will-change: transform;
}

.live2d-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
  pointer-events: none;
  user-select: none;
}

.live2d-body {
  z-index: 1;
  filter: drop-shadow(0 18px 20px rgba(67, 48, 34, 0.18));
  transform-origin: 50% 88%;
  animation: live2d-body-soft-sway 7.2s ease-in-out infinite;
  animation-delay: var(--idle-delay);
}

.live2d-head {
  z-index: 3;
  transform-origin: 51% 33%;
  transform:
    translateX(calc(var(--look-x) * 10px))
    translateY(calc(var(--look-y) * 5px))
    rotate(calc(var(--look-x) * 4.8deg));
  animation: live2d-head-idle 6.4s ease-in-out infinite;
  animation-delay: var(--idle-delay);
  transition: transform 150ms ease-out;
}

.live2d-arm {
  z-index: 2;
  opacity: 0.98;
  filter: drop-shadow(0 8px 10px rgba(67, 48, 34, 0.08));
}

.live2d-arm-left {
  transform-origin: 35% 45%;
  animation: live2d-arm-left-idle 5.9s ease-in-out infinite;
  animation-delay: calc(var(--idle-delay) - 0.6s);
}

.live2d-arm-right {
  transform-origin: 66% 42%;
  animation: live2d-arm-right-idle 6.8s ease-in-out infinite;
  animation-delay: calc(var(--idle-delay) - 1.2s);
}

.live2d-eye-line {
  position: absolute;
  left: 39%;
  top: 22%;
  z-index: 2;
  width: 22%;
  height: 10%;
  border-radius: 50%;
  background:
    linear-gradient(90deg, transparent 0 12%, rgba(47, 41, 36, 0.38) 18% 34%, transparent 40% 58%, rgba(47, 41, 36, 0.38) 64% 82%, transparent 88%),
    linear-gradient(180deg, transparent 0 48%, rgba(255, 250, 243, 0.5) 49% 55%, transparent 56%);
  opacity: 0;
  pointer-events: none;
  transform:
    translateX(calc(var(--look-x) * 10px))
    translateY(calc(var(--look-y) * 5px))
    rotate(calc(var(--look-x) * 4deg));
  animation: live2d-blink 6.2s infinite;
  animation-delay: var(--idle-delay);
  mix-blend-mode: multiply;
}

.live2d-cheek-light {
  position: absolute;
  left: 36%;
  top: 29%;
  z-index: 4;
  width: 30%;
  height: 12%;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 50%, rgba(229, 143, 45, 0.18), transparent 34%),
    radial-gradient(circle at 72% 54%, rgba(229, 143, 45, 0.13), transparent 32%);
  opacity: 0;
  pointer-events: none;
  transform:
    translateX(calc(var(--look-x) * 10px))
    translateY(calc(var(--look-y) * 5px));
  transition: opacity 180ms ease;
}

.profile-card:hover .live2d-body,
.profile-card.selected .live2d-body {
  filter:
    drop-shadow(0 18px 20px rgba(67, 48, 34, 0.2))
    drop-shadow(0 0 12px rgba(229, 143, 45, 0.22));
}

.profile-card:hover .live2d-rig,
.profile-card.selected .live2d-rig {
  transform:
    translateX(calc(var(--look-x) * 5px))
    translateY(calc(var(--look-y) * 2px))
    scale(1.012);
}

.profile-card:hover .live2d-head,
.profile-card.selected .live2d-head {
  transform:
    translateX(calc(var(--look-x) * 17px))
    translateY(calc(var(--look-y) * 9px))
    rotate(calc(var(--look-x) * 7.5deg))
    scale(1.01);
}

.profile-card:hover .live2d-cheek-light,
.profile-card.selected .live2d-cheek-light {
  opacity: 1;
}

.profile-card.idle-glance .live2d-head {
  animation: live2d-glance 1100ms ease-in-out;
}

.profile-card.idle-tilt .live2d-rig {
  animation: live2d-idle-tilt 1350ms ease-in-out;
}

.profile-card.idle-tilt .live2d-head {
  animation: live2d-head-tilt 1350ms ease-in-out;
}

.profile-card.picked .live2d-rig {
  animation:
    live2d-pick-body 760ms cubic-bezier(0.2, 0.84, 0.22, 1),
    live2d-body-breathe 5.2s ease-in-out 760ms infinite;
}

.profile-card.picked .live2d-head {
  animation:
    live2d-pick-head 760ms cubic-bezier(0.2, 0.84, 0.22, 1),
    live2d-head-idle 6.4s ease-in-out 760ms infinite;
}

.profile-card.picked .live2d-arm-left {
  animation:
    live2d-wave-left 760ms cubic-bezier(0.2, 0.84, 0.22, 1),
    live2d-arm-left-idle 5.9s ease-in-out 760ms infinite;
}

.profile-card.picked .live2d-arm-right {
  animation:
    live2d-wave-right 760ms cubic-bezier(0.2, 0.84, 0.22, 1),
    live2d-arm-right-idle 6.8s ease-in-out 760ms infinite;
}

.profile-card.picked .live2d-eye-line {
  animation:
    live2d-fast-blink 760ms ease-out,
    live2d-blink 6.2s 760ms infinite;
}

.profile-copy {
  position: relative;
  z-index: 1;
  min-height: 118px;
  padding: 16px 18px 18px;
  background: linear-gradient(180deg, rgba(255, 250, 243, 0.72), rgba(255, 250, 243, 0.94));
}

.profile-copy span {
  display: inline-block;
  margin-bottom: 8px;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 900;
}

.profile-static {
  width: min(78%, 430px);
  height: min(94%, 620px);
  object-fit: contain;
  object-position: center bottom;
  filter: drop-shadow(0 24px 28px rgba(67, 48, 34, 0.2));
  transform-origin: center bottom;
}

.skinned-portrait {
  position: relative;
  z-index: 1;
  width: min(94%, 520px);
  height: min(100%, 680px);
  min-height: 440px;
  transform-origin: center bottom;
}

.skinned-portrait-canvas {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 24px 28px rgba(67, 48, 34, 0.2));
  transition: filter 180ms ease;
}

.skinned-portrait-shadow {
  position: absolute;
  left: 25%;
  right: 23%;
  bottom: 1.2%;
  height: 24px;
  border-radius: 50%;
  background: rgba(67, 48, 34, 0.18);
  filter: blur(9px);
  animation: skinned-shadow-breathe 4.9s ease-in-out infinite;
}

.profile-card:hover .skinned-portrait-canvas,
.profile-card.selected .skinned-portrait-canvas {
  filter:
    drop-shadow(0 24px 28px rgba(67, 48, 34, 0.2))
    drop-shadow(0 0 14px rgba(229, 143, 45, 0.2));
}

@keyframes skinned-shadow-breathe {
  0%,
  100% {
    opacity: 0.7;
    transform: scaleX(1);
  }
  50% {
    opacity: 0.52;
    transform: scaleX(0.91);
  }
}

.sequence-portrait {
  position: relative;
  z-index: 1;
  width: min(78%, 430px);
  height: min(94%, 620px);
  min-height: 440px;
  --sequence-duration: 1.6s;
  --sequence-step: calc(var(--sequence-duration) / var(--sequence-count, 8));
  transform-origin: center bottom;
}

.sequence-shadow {
  position: absolute;
  left: 22%;
  right: 20%;
  bottom: 1%;
  height: 24px;
  border-radius: 50%;
  background: rgba(67, 48, 34, 0.18);
  filter: blur(9px);
  animation: sequence-shadow-idle 1.6s steps(1, end) infinite;
}

.sequence-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
  opacity: 0;
  filter: drop-shadow(0 24px 28px rgba(67, 48, 34, 0.2));
  pointer-events: none;
  user-select: none;
}

.sequence-frame {
  animation: sequence-frame-step var(--sequence-duration) steps(1, end) infinite;
  animation-delay: calc(var(--sequence-step) * var(--frame-offset, 0) * -1);
}

.profile-card:hover .sequence-frame,
.profile-card.selected .sequence-frame {
  filter:
    drop-shadow(0 24px 28px rgba(67, 48, 34, 0.2))
    drop-shadow(0 0 14px rgba(229, 143, 45, 0.18));
}

.profile-card.picked .sequence-portrait {
  animation: sequence-picked 860ms cubic-bezier(0.2, 0.84, 0.22, 1);
}

.material-live2d {
  position: relative;
  width: min(88%, 460px);
  height: min(98%, 660px);
  min-height: 440px;
  display: grid;
  place-items: end center;
  transform:
    translateX(calc(var(--look-x) * 8px))
    translateY(calc(var(--look-y) * 4px));
  transition: transform 150ms ease-out;
}

.material-shadow {
  position: absolute;
  left: 24%;
  right: 21%;
  bottom: 3%;
  height: 5.2%;
  border-radius: 50%;
  background: rgba(67, 48, 34, 0.18);
  filter: blur(11px);
  animation: material-shadow 5.2s ease-in-out infinite;
}

.material-sprite {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
  filter: drop-shadow(0 24px 28px rgba(67, 48, 34, 0.18));
  transform-origin: 52% 84%;
  animation: material-breathe 5.2s ease-in-out infinite;
  transition:
    filter 180ms ease,
    transform 160ms ease-out;
}

.material-face-follow {
  position: absolute;
  left: 35.5%;
  top: 11.5%;
  z-index: 2;
  width: 28%;
  height: 17%;
  transform:
    translateX(calc(var(--look-x) * 9px))
    translateY(calc(var(--look-y) * 5px))
    rotate(calc(var(--look-x) * 2.4deg));
  transition: transform 140ms ease-out;
  pointer-events: none;
}

.material-eye-line {
  position: absolute;
  top: 43%;
  width: 17%;
  height: 7%;
  border-radius: 999px;
  background: rgba(54, 31, 24, 0.65);
  opacity: 0;
  transform-origin: center;
  animation: material-blink 5.8s infinite;
}

.material-eye-line.eye-left {
  left: 25%;
}

.material-eye-line.eye-right {
  right: 23%;
}

.material-cheek {
  position: absolute;
  top: 59%;
  width: 17%;
  height: 8%;
  border-radius: 999px;
  background: rgba(230, 117, 92, 0.18);
  opacity: 0;
  transition: opacity 180ms ease;
}

.material-cheek.left {
  left: 14%;
}

.material-cheek.right {
  right: 12%;
}

.material-wave-hint {
  position: absolute;
  right: 17%;
  top: 26%;
  z-index: 3;
  width: 12%;
  height: 12%;
  border-radius: 50%;
  border: 2px solid rgba(229, 143, 45, 0.38);
  border-left-color: transparent;
  border-bottom-color: transparent;
  opacity: 0;
  transform-origin: 40% 70%;
  pointer-events: none;
}

.profile-card:hover .material-sprite,
.profile-card.selected .material-sprite {
  filter:
    drop-shadow(0 24px 28px rgba(67, 48, 34, 0.2))
    drop-shadow(0 0 14px rgba(229, 143, 45, 0.2));
  transform:
    translateX(calc(var(--look-x) * 7px))
    translateY(calc(var(--look-y) * 3px))
    rotate(calc(var(--look-x) * 1.4deg))
    scale(1.012);
}

.profile-card:hover .material-cheek,
.profile-card.selected .material-cheek {
  opacity: 1;
}

.profile-card.picked .material-sprite {
  animation:
    material-pick 900ms cubic-bezier(0.2, 0.84, 0.22, 1),
    material-breathe 5.2s ease-in-out 900ms infinite;
}

.profile-card.picked .material-face-follow {
  animation: material-look-response 900ms cubic-bezier(0.2, 0.84, 0.22, 1);
}

.profile-card.picked .material-wave-hint {
  animation: material-wave-hint 900ms ease-out;
}

.profile-card.picked .material-eye-line {
  animation:
    material-fast-blink 900ms ease-out,
    material-blink 5.8s 900ms infinite;
}

.puppet {
  --skin: #f1c3a5;
  --skin-soft: #ffd9c5;
  --hair: #4a2d22;
  --hair-deep: #2d1a14;
  --shirt: #f1b235;
  --shirt-dark: #c9801e;
  --pants: #f5eadc;
  --shoe: #efe7df;
  --shoe-line: #b9aaa0;
  position: relative;
  width: min(82%, 460px);
  height: min(96%, 660px);
  min-height: 440px;
  display: grid;
  place-items: end center;
  transform:
    translateX(calc(var(--look-x) * 8px))
    translateY(calc(var(--look-y) * 4px));
  transition: transform 140ms ease-out;
}

.puppet-shadow {
  position: absolute;
  left: 24%;
  right: 22%;
  bottom: 4%;
  height: 5%;
  border-radius: 50%;
  background: rgba(67, 48, 34, 0.18);
  filter: blur(10px);
  animation: puppet-shadow 5.4s ease-in-out infinite;
}

.puppet-root {
  position: relative;
  width: 74%;
  height: 94%;
  transform-origin: 50% 88%;
  animation: puppet-breathe 5.4s ease-in-out infinite;
}

.puppet-body,
.head-root,
.arm,
.puppet-leg,
.puppet-shoe,
.shirt,
.neck,
.head,
.face,
.hair-back,
.hair-bun,
.hair-tie,
.bang,
.ear,
.eye,
.mouth,
.cheek,
.shoulder-cover,
.sleeve,
.forearm,
.hand {
  position: absolute;
}

.puppet-body {
  left: 24%;
  top: 42%;
  width: 52%;
  height: 38%;
  transform-origin: 50% 12%;
  animation: puppet-body-sway 7.4s ease-in-out infinite;
}

.neck {
  left: 40%;
  top: -10%;
  width: 22%;
  height: 20%;
  border-radius: 0 0 45% 45%;
  background: linear-gradient(180deg, var(--skin), #e5aa8d);
  z-index: 2;
}

.shirt.torso {
  left: 15%;
  top: 12%;
  width: 70%;
  height: 50%;
  border-radius: 38% 38% 28% 28%;
  background:
    radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.18), transparent 28%),
    linear-gradient(135deg, #ffd46a, var(--shirt) 62%, var(--shirt-dark));
  z-index: 3;
  box-shadow: inset 0 -12px 0 rgba(128, 75, 20, 0.08);
}

.shirt.hem {
  left: 18%;
  top: 54%;
  width: 64%;
  height: 18%;
  border-radius: 0 0 32% 32%;
  background: linear-gradient(180deg, var(--shirt), #d98d22);
  z-index: 4;
}

.shoulder-cover {
  left: 16%;
  top: 8%;
  width: 68%;
  height: 18%;
  border-radius: 999px;
  background: linear-gradient(90deg, #f6bd45, #ffd66a 50%, #e79d2b);
  z-index: 8;
  opacity: 0.96;
}

.puppet-leg {
  top: 68%;
  width: 12%;
  height: 27%;
  border-radius: 0 0 38% 38%;
  background: linear-gradient(180deg, var(--pants), #e6d5c5);
  z-index: 1;
}

.leg-left {
  left: 39%;
  transform: rotate(1.5deg);
}

.leg-right {
  left: 51%;
  transform: rotate(-1deg);
}

.puppet-shoe {
  top: 93%;
  width: 18%;
  height: 7%;
  border-radius: 55% 45% 38% 35%;
  background: linear-gradient(180deg, white, var(--shoe));
  border-bottom: 2px solid var(--shoe-line);
  z-index: 2;
}

.shoe-left {
  left: 35%;
  transform: rotate(-4deg);
}

.shoe-right {
  left: 50%;
  transform: rotate(3deg);
}

.head-root {
  left: 16%;
  top: -38%;
  width: 68%;
  height: 46%;
  z-index: 10;
  transform-origin: 50% 74%;
  transform:
    translateX(calc(var(--look-x) * 18px))
    translateY(calc(var(--look-y) * 9px))
    rotate(calc(var(--look-x) * 7deg));
  animation: puppet-head-idle 6.8s ease-in-out infinite;
  transition: transform 140ms ease-out;
}

.hair-back {
  left: 10%;
  top: 1%;
  width: 80%;
  height: 86%;
  border-radius: 48% 50% 46% 46%;
  background: radial-gradient(circle at 42% 18%, #735043 0 12%, var(--hair) 38%, var(--hair-deep) 100%);
  z-index: 1;
}

.head {
  left: 18%;
  top: 20%;
  width: 64%;
  height: 64%;
  border-radius: 45% 45% 48% 48%;
  background: linear-gradient(180deg, var(--skin-soft), var(--skin));
  z-index: 3;
  box-shadow: inset -8px -12px 18px rgba(120, 65, 42, 0.08);
}

.face {
  inset: 0;
  transform:
    translateX(calc(var(--look-x) * 5px))
    translateY(calc(var(--look-y) * 3px));
  transition: transform 140ms ease-out;
}

.ear {
  top: 35%;
  width: 12%;
  height: 18%;
  border-radius: 50%;
  background: var(--skin);
  z-index: 2;
}

.ear-left {
  left: 12%;
}

.ear-right {
  right: 12%;
}

.hair-bun {
  left: 40%;
  top: -3%;
  width: 20%;
  height: 18%;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 30%, #6f4b3c, var(--hair-deep));
  z-index: 2;
  animation: puppet-hair 4.8s ease-in-out infinite;
}

.hair-tie {
  left: 47%;
  top: 12%;
  width: 12%;
  height: 5%;
  border-radius: 999px;
  background: #ffd94f;
  z-index: 4;
  transform: rotate(-8deg);
}

.bang {
  top: 18%;
  width: 24%;
  height: 32%;
  border-radius: 70% 20% 70% 20%;
  background: linear-gradient(180deg, #6a4739, var(--hair));
  z-index: 5;
  transform-origin: 50% 0;
  animation: puppet-bang 4.7s ease-in-out infinite;
}

.bang-left {
  left: 24%;
  transform: rotate(18deg);
}

.bang-right {
  right: 24%;
  transform: rotate(-20deg) scaleX(-1);
}

.eye {
  top: 46%;
  width: 8%;
  height: 10%;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, white 0 12%, #302019 14% 100%);
  animation: puppet-blink 5.7s infinite;
}

.eye-left {
  left: 35%;
}

.eye-right {
  right: 35%;
}

.mouth {
  left: 47%;
  top: 62%;
  width: 8%;
  height: 4%;
  border-radius: 0 0 999px 999px;
  border-bottom: 2px solid #9f5d57;
}

.cheek {
  top: 58%;
  width: 11%;
  height: 5%;
  border-radius: 999px;
  background: rgba(232, 116, 94, 0.18);
  opacity: 0;
  transition: opacity 180ms ease;
}

.cheek-left {
  left: 25%;
}

.cheek-right {
  right: 25%;
}

.profile-card:hover .cheek,
.profile-card.selected .cheek {
  opacity: 1;
}

.arm {
  top: 12%;
  width: 40%;
  height: 47%;
  transform-origin: 50% 15%;
  z-index: 5;
}

.arm-left {
  left: -8%;
  animation: puppet-left-arm-idle 6.2s ease-in-out infinite;
}

.arm-right {
  right: -8%;
  animation: puppet-right-arm-idle 6.8s ease-in-out infinite;
}

.sleeve {
  left: 27%;
  top: 0;
  width: 34%;
  height: 38%;
  border-radius: 40% 40% 35% 35%;
  background: linear-gradient(180deg, #ffd064, var(--shirt));
}

.forearm {
  left: 35%;
  top: 31%;
  width: 18%;
  height: 46%;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--skin-soft), var(--skin));
  transform-origin: 50% 0;
}

.hand {
  left: 31%;
  top: 72%;
  width: 27%;
  height: 20%;
  border-radius: 48%;
  background: var(--skin-soft);
}

.arm-left .forearm,
.arm-left .hand {
  transform: rotate(16deg);
}

.arm-right .forearm,
.arm-right .hand {
  transform: rotate(-18deg);
}

.profile-card:hover .head-root,
.profile-card.selected .head-root {
  transform:
    translateX(calc(var(--look-x) * 22px))
    translateY(calc(var(--look-y) * 11px - 2px))
    rotate(calc(var(--look-x) * 8deg - 1deg));
}

.profile-card.picked .puppet-root {
  animation:
    puppet-pick-body 900ms cubic-bezier(0.2, 0.84, 0.22, 1),
    puppet-breathe 5.4s ease-in-out 900ms infinite;
}

.profile-card.picked .head-root {
  animation:
    puppet-pick-head 900ms cubic-bezier(0.2, 0.84, 0.22, 1),
    puppet-head-idle 6.8s ease-in-out 900ms infinite;
}

.profile-card.picked .arm-left {
  animation:
    puppet-wave-left 900ms cubic-bezier(0.2, 0.84, 0.22, 1),
    puppet-left-arm-idle 6.2s ease-in-out 900ms infinite;
}

.profile-card.picked .arm-right {
  animation:
    puppet-wave-right 900ms cubic-bezier(0.2, 0.84, 0.22, 1),
    puppet-right-arm-idle 6.8s ease-in-out 900ms infinite;
}

.profile-card.picked .eye {
  animation:
    puppet-fast-blink 900ms ease-out,
    puppet-blink 5.7s 900ms infinite;
}

.profile-card h2,
.side-panel h2,
.log-panel h2,
.calendar-box h2 {
  margin: 0 0 8px;
  font-size: 18px;
}

.profile-card p,
.owner-box p,
.calendar-box p,
.game-footer p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.start-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.primary-btn,
.ghost-btn {
  min-height: 44px;
  padding: 0 18px;
  border-radius: 8px;
  font-weight: 800;
}

.primary-btn {
  color: white;
  background: var(--accent-dark);
}

.ghost-btn {
  border: 1px solid var(--line);
  background: rgba(255, 250, 243, 0.8);
}

.game-screen {
  display: grid;
  gap: 16px;
}

.topbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  padding-top: 8px;
}

.topbar h1 {
  font-size: clamp(30px, 4vw, 54px);
  line-height: 1.12;
}

.date-chip {
  min-width: 150px;
  padding: 12px 14px;
  border-radius: 8px;
  background: rgba(255, 250, 243, 0.92);
  box-shadow: var(--shadow);
}

.date-chip span,
.date-chip strong {
  display: block;
}

.date-chip span {
  color: var(--muted);
  font-size: 13px;
}

.date-chip strong {
  margin-top: 3px;
  font-size: 22px;
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
}

.stat {
  min-width: 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(255, 250, 243, 0.92);
}

.stat span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

meter {
  width: 100%;
  height: 12px;
}

.play-layout {
  display: grid;
  grid-template-columns: 280px minmax(420px, 1fr) 280px;
  gap: 16px;
  align-items: stretch;
}

.side-panel,
.log-panel {
  display: grid;
  gap: 14px;
  align-content: start;
}

.owner-box,
.task-box,
.calendar-box,
.log-panel {
  padding: 14px;
  border-radius: 8px;
  background: rgba(255, 250, 243, 0.94);
  box-shadow: var(--shadow);
}

.owner-box {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 12px;
}

.owner-box img {
  width: 72px;
  height: 72px;
  object-fit: contain;
  object-position: center bottom;
  border-radius: 8px;
  background: #f6efe7;
  transform-origin: center bottom;
  animation: live2d-tiny-idle 4.8s ease-in-out infinite;
}

.owner-box span {
  color: var(--muted);
  font-size: 13px;
}

.owner-box strong {
  display: block;
  margin: 2px 0 5px;
  font-size: 21px;
}

#task-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

#task-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
}

#task-list li.done {
  color: var(--green);
}

.scene-panel {
  min-width: 0;
}

.scene {
  min-height: 560px;
  overflow: hidden;
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.room-backdrop {
  position: relative;
  height: 560px;
  overflow: hidden;
  background:
    linear-gradient(180deg, #efe9df 0 48%, #d8d0c6 48%),
    repeating-linear-gradient(90deg, transparent 0 130px, rgba(107, 75, 58, 0.12) 130px 132px);
}

.window {
  position: absolute;
  top: 48px;
  right: 54px;
  width: 190px;
  height: 130px;
  border: 10px solid #8f5d37;
  border-radius: 8px;
  background: linear-gradient(135deg, #bfe0cf, #edf7ff 48%, #7aae77);
}

.wall-deco {
  position: absolute;
  top: 44px;
  left: 48%;
  width: 50px;
  height: 50px;
  transform: rotate(45deg);
  display: grid;
  place-items: center;
  color: #f7d267;
  background: #c93e31;
  font-weight: 900;
}

.wall-deco::first-letter {
  transform: rotate(-45deg);
}

.sofa {
  position: absolute;
  left: 50px;
  bottom: 96px;
  width: 58%;
  height: 168px;
  border-radius: 8px;
  background: linear-gradient(180deg, #55382d, #2f211d);
  box-shadow: inset 0 12px 30px rgba(255, 255, 255, 0.14);
}

.rug {
  position: absolute;
  left: 18%;
  right: 12%;
  bottom: 20px;
  height: 96px;
  border-radius: 8px;
  background:
    repeating-linear-gradient(90deg, rgba(229, 143, 45, 0.16) 0 22px, rgba(91, 145, 188, 0.12) 22px 44px),
    #f6dfcf;
}

.green-cabinet {
  position: absolute;
  left: 28px;
  bottom: 120px;
  width: 72px;
  height: 230px;
  border-radius: 8px;
  background: #4b933d;
}

.food-zone {
  position: absolute;
  right: 54px;
  bottom: 82px;
  display: flex;
  gap: 12px;
}

.bowl {
  width: 68px;
  height: 42px;
  border-radius: 14px 14px 28px 28px;
  box-shadow: inset 0 -8px 0 rgba(0, 0, 0, 0.14);
}

.bowl-food {
  background: var(--accent);
}

.bowl-water {
  background: var(--blue);
}

.tom-image {
  position: absolute;
  left: 39%;
  bottom: 74px;
  width: min(360px, 42%);
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 8px;
  border: 5px solid rgba(255, 250, 243, 0.86);
  transform-origin: center bottom;
  animation: breathe 3.2s ease-in-out infinite;
}

.tom-bubble {
  position: absolute;
  left: 42%;
  bottom: 420px;
  max-width: 280px;
  padding: 12px 14px;
  border-radius: 8px;
  color: var(--ink);
  background: rgba(255, 250, 243, 0.94);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
  line-height: 1.45;
}

.living .room-backdrop {
  background:
    linear-gradient(180deg, #efe9df 0 48%, #d8d0c6 48%),
    repeating-linear-gradient(90deg, transparent 0 130px, rgba(107, 75, 58, 0.12) 130px 132px);
}

.food .room-backdrop {
  background: linear-gradient(180deg, #f2eee7 0 46%, #d0cbc2 46%);
}

.care .room-backdrop {
  background: linear-gradient(180deg, #eef2e7 0 48%, #d9d3c9 48%);
}

.garden .room-backdrop {
  background:
    radial-gradient(circle at 24% 30%, rgba(83, 140, 73, 0.5) 0 80px, transparent 82px),
    radial-gradient(circle at 78% 32%, rgba(77, 126, 70, 0.44) 0 110px, transparent 112px),
    linear-gradient(180deg, #b8d7c7 0 50%, #8fb56c 50%);
}

.garden .sofa,
.garden .green-cabinet,
.garden .food-zone {
  display: none;
}

.garden .rug {
  left: 9%;
  right: 9%;
  bottom: 68px;
  background: #d7c19a;
}

.scene-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 10px;
}

.tab {
  min-height: 42px;
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 250, 243, 0.86);
}

.tab.active {
  color: white;
  background: var(--brown);
}

.log-list {
  display: grid;
  gap: 10px;
  max-height: 500px;
  overflow: auto;
}

.log-entry {
  padding: 10px;
  border-radius: 8px;
  background: var(--soft);
  color: var(--muted);
  line-height: 1.5;
}

.log-entry strong {
  display: block;
  color: var(--ink);
}

.action-bar {
  display: grid;
  grid-template-columns: repeat(9, minmax(80px, 1fr));
  gap: 8px;
  padding: 10px;
  border-radius: 8px;
  background: rgba(255, 250, 243, 0.94);
  box-shadow: var(--shadow);
}

.action-bar button {
  min-height: 62px;
  display: grid;
  place-items: center;
  gap: 3px;
  border-radius: 8px;
  background: var(--soft);
  color: var(--ink);
  font-weight: 800;
}

.action-bar button span {
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  border-radius: 50%;
  color: white;
  background: var(--accent-dark);
  font-size: 12px;
}

.action-bar .next-day {
  color: white;
  background: var(--accent-dark);
}

.action-bar .next-day span {
  color: var(--accent-dark);
  background: white;
}

.game-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.art-preview {
  position: fixed;
  inset: 24px;
  z-index: 20;
  overflow: auto;
  padding: 22px;
  border: 1px solid rgba(107, 75, 58, 0.18);
  border-radius: 8px;
  background: rgba(255, 250, 243, 0.98);
  box-shadow: 0 24px 80px rgba(47, 41, 36, 0.28);
}

.art-preview-header {
  position: sticky;
  top: -22px;
  z-index: 2;
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  margin: -22px -22px 18px;
  padding: 22px;
  background: rgba(255, 250, 243, 0.98);
  border-bottom: 1px solid var(--line);
}

.art-preview-header h1 {
  margin: 0;
  font-size: clamp(26px, 4vw, 44px);
  line-height: 1.05;
}

.style-note {
  margin-bottom: 16px;
  padding: 14px 16px;
  border-radius: 8px;
  background: #f0e5d8;
  color: var(--muted);
  line-height: 1.6;
}

.style-note strong {
  color: var(--ink);
}

.art-preview-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: 14px;
}

.art-card {
  min-height: 180px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.art-card img,
.art-placeholder {
  width: 100%;
  height: 240px;
  object-fit: contain;
  background:
    linear-gradient(135deg, rgba(229, 143, 45, 0.24), rgba(91, 145, 188, 0.22)),
    #f6efe7;
}

.art-placeholder {
  display: grid;
  place-items: center;
  color: var(--accent-dark);
  font-size: 38px;
  font-weight: 900;
}

.art-card > div {
  padding: 13px;
}

.art-card h2 {
  margin: 0 0 8px;
  font-size: 18px;
}

.art-card p,
.art-card li {
  color: var(--muted);
  line-height: 1.55;
}

.art-card p {
  margin: 0 0 8px;
}

.art-card ul {
  display: grid;
  gap: 5px;
  margin: 0;
  padding-left: 18px;
}

@keyframes breathe {
  0%,
  100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(3px) scale(1.012);
  }
}

@keyframes puppet-breathe {
  0%,
  100% {
    transform: translateY(0) rotate(0deg) scale(1);
  }
  42% {
    transform: translateY(2px) rotate(-0.4deg) scale(1.008, 1.014);
  }
  72% {
    transform: translateY(-1px) rotate(0.25deg) scale(0.998, 1.006);
  }
}

@keyframes material-breathe {
  0%,
  100% {
    transform: translateY(0) rotate(0deg) scale(1);
  }
  40% {
    transform: translateY(2px) rotate(-0.35deg) scale(1.006, 1.012);
  }
  72% {
    transform: translateY(-1px) rotate(0.25deg) scale(0.998, 1.006);
  }
}

@keyframes sequence-frame-step {
  0%,
  8.32% {
    opacity: 1;
  }

  8.33%,
  100% {
    opacity: 0;
  }
}

@keyframes sequence-frame-1 {
  0%,
  12.49%,
  100% {
    opacity: 1;
  }

  12.5%,
  99.99% {
    opacity: 0;
  }
}

@keyframes sequence-frame-2 {
  0%,
  12.49%,
  25%,
  100% {
    opacity: 0;
  }

  12.5%,
  24.99% {
    opacity: 1;
  }
}

@keyframes sequence-frame-3 {
  0%,
  24.99%,
  37.5%,
  100% {
    opacity: 0;
  }

  25%,
  37.49% {
    opacity: 1;
  }
}

@keyframes sequence-frame-4 {
  0%,
  37.49%,
  50%,
  100% {
    opacity: 0;
  }

  37.5%,
  49.99% {
    opacity: 1;
  }
}

@keyframes sequence-frame-5 {
  0%,
  49.99%,
  62.5%,
  100% {
    opacity: 0;
  }

  50%,
  62.49% {
    opacity: 1;
  }
}

@keyframes sequence-frame-6 {
  0%,
  62.49%,
  75%,
  100% {
    opacity: 0;
  }

  62.5%,
  74.99% {
    opacity: 1;
  }
}

@keyframes sequence-frame-7 {
  0%,
  74.99%,
  87.5%,
  100% {
    opacity: 0;
  }

  75%,
  87.49% {
    opacity: 1;
  }
}

@keyframes sequence-frame-8 {
  0%,
  87.49%,
  100% {
    opacity: 0;
  }

  87.5%,
  99.99% {
    opacity: 1;
  }
}

@keyframes sequence-shadow-idle {
  0%,
  12.49%,
  50%,
  62.49%,
  100% {
    opacity: 0.78;
    transform: scaleX(1);
  }

  25%,
  49.99% {
    opacity: 0.64;
    transform: scaleX(0.94);
  }

  62.5%,
  87.49% {
    opacity: 0.84;
    transform: scaleX(1.04);
  }
}

@keyframes sequence-picked {
  0%,
  100% {
    transform: translateY(0) rotate(0deg) scale(1);
  }

  24% {
    transform: translateY(-8px) rotate(-1.2deg) scale(1.018);
  }

  54% {
    transform: translateY(3px) rotate(0.8deg) scale(0.995);
  }

  78% {
    transform: translateY(-3px) rotate(-0.4deg) scale(1.006);
  }
}

@keyframes material-shadow {
  0%,
  100% {
    opacity: 0.78;
    transform: scaleX(1);
  }
  50% {
    opacity: 0.55;
    transform: scaleX(0.88);
  }
}

@keyframes material-blink {
  0%,
  4%,
  86%,
  92%,
  100% {
    opacity: 0;
    transform: scaleY(0.2);
  }
  2%,
  89% {
    opacity: 0.58;
    transform: scaleY(1);
  }
}

@keyframes material-fast-blink {
  0%,
  100% {
    opacity: 0;
    transform: scaleY(0.2);
  }
  25%,
  48% {
    opacity: 0.62;
    transform: scaleY(1);
  }
}

@keyframes material-pick {
  0% {
    transform: translateY(0) rotate(0deg) scale(1);
  }
  18% {
    transform: translateY(-9px) rotate(-2.1deg) scale(1.025);
  }
  38% {
    transform: translateY(5px) rotate(1.6deg) scale(0.998, 1.018);
  }
  62% {
    transform: translateY(-3px) rotate(-0.8deg) scale(1.012);
  }
  100% {
    transform: translateY(0) rotate(0deg) scale(1);
  }
}

@keyframes material-look-response {
  0%,
  100% {
    transform: translateX(0) translateY(0) rotate(0deg);
  }
  25% {
    transform: translateX(-6px) translateY(-4px) rotate(-4deg);
  }
  48% {
    transform: translateX(5px) translateY(3px) rotate(3deg);
  }
  72% {
    transform: translateX(-2px) translateY(-1px) rotate(-1.5deg);
  }
}

@keyframes material-wave-hint {
  0% {
    opacity: 0;
    transform: rotate(-20deg) scale(0.6);
  }
  24% {
    opacity: 1;
    transform: rotate(16deg) scale(1);
  }
  58% {
    opacity: 0.9;
    transform: rotate(-12deg) scale(1.16);
  }
  100% {
    opacity: 0;
    transform: rotate(24deg) scale(1.35);
  }
}

@keyframes puppet-body-sway {
  0%,
  100% {
    transform: rotate(0deg);
  }
  45% {
    transform: rotate(-0.7deg);
  }
  78% {
    transform: rotate(0.45deg);
  }
}

@keyframes puppet-shadow {
  0%,
  100% {
    opacity: 0.75;
    transform: scaleX(1);
  }
  50% {
    opacity: 0.52;
    transform: scaleX(0.86);
  }
}

@keyframes puppet-head-idle {
  0%,
  100% {
    transform:
      translateX(calc(var(--look-x) * 18px))
      translateY(calc(var(--look-y) * 9px))
      rotate(calc(var(--look-x) * 7deg));
  }
  36% {
    transform:
      translateX(calc(var(--look-x) * 19px - 2px))
      translateY(calc(var(--look-y) * 9px + 1px))
      rotate(calc(var(--look-x) * 7deg - 1.4deg));
  }
  70% {
    transform:
      translateX(calc(var(--look-x) * 19px + 1px))
      translateY(calc(var(--look-y) * 9px - 1px))
      rotate(calc(var(--look-x) * 7deg + 0.8deg));
  }
}

@keyframes puppet-hair {
  0%,
  100% {
    transform: rotate(0deg);
  }
  50% {
    transform: rotate(-4deg);
  }
}

@keyframes puppet-bang {
  0%,
  100% {
    translate: 0 0;
  }
  50% {
    translate: 1px 2px;
  }
}

@keyframes puppet-blink {
  0%,
  4%,
  86%,
  92%,
  100% {
    transform: scaleY(1);
  }
  2%,
  89% {
    transform: scaleY(0.08);
  }
}

@keyframes puppet-fast-blink {
  0%,
  100% {
    transform: scaleY(1);
  }
  24%,
  48% {
    transform: scaleY(0.08);
  }
}

@keyframes puppet-left-arm-idle {
  0%,
  100% {
    transform: rotate(5deg);
  }
  50% {
    transform: rotate(1deg) translateY(2px);
  }
}

@keyframes puppet-right-arm-idle {
  0%,
  100% {
    transform: rotate(-5deg);
  }
  54% {
    transform: rotate(-1deg) translateY(2px);
  }
}

@keyframes puppet-pick-body {
  0% {
    transform: translateY(0) rotate(0deg) scale(1);
  }
  24% {
    transform: translateY(-10px) rotate(-1deg) scale(1.02);
  }
  50% {
    transform: translateY(4px) rotate(0.8deg) scale(1);
  }
  75% {
    transform: translateY(-3px) rotate(-0.35deg) scale(1.01);
  }
  100% {
    transform: translateY(0) rotate(0deg) scale(1);
  }
}

@keyframes puppet-pick-head {
  0% {
    transform: translateY(0) rotate(0deg) scale(1);
  }
  18% {
    transform: translateY(-8px) rotate(-5deg) scale(1.03);
  }
  38% {
    transform: translateY(8px) rotate(4deg) scale(0.99, 1.02);
  }
  60% {
    transform: translateY(-3px) rotate(-2deg) scale(1.01);
  }
  100% {
    transform: translateY(0) rotate(0deg) scale(1);
  }
}

@keyframes puppet-wave-left {
  0%,
  100% {
    transform: rotate(5deg) translateY(0);
  }
  18% {
    transform: rotate(-24deg) translateY(-8px);
  }
  34% {
    transform: rotate(-42deg) translateY(-14px);
  }
  50% {
    transform: rotate(-24deg) translateY(-10px);
  }
  66% {
    transform: rotate(-38deg) translateY(-12px);
  }
}

@keyframes puppet-wave-right {
  0%,
  100% {
    transform: rotate(-5deg) translateY(0);
  }
  18% {
    transform: rotate(20deg) translateY(-6px);
  }
  38% {
    transform: rotate(10deg) translateY(-8px);
  }
  58% {
    transform: rotate(22deg) translateY(-6px);
  }
}

.profile-card.idle-glance .head-root {
  animation: puppet-glance 1200ms ease-in-out;
}

.profile-card.idle-tilt .puppet-root {
  animation: puppet-curious-tilt 1400ms ease-in-out;
}

.profile-card.idle-tilt .head-root {
  animation: puppet-head-curious 1400ms ease-in-out;
}

@keyframes puppet-glance {
  0%,
  100% {
    transform: translateX(0) translateY(0) rotate(0deg);
  }
  25%,
  62% {
    transform: translateX(12px) translateY(-2px) rotate(5deg);
  }
  80% {
    transform: translateX(-4px) translateY(0) rotate(-2deg);
  }
}

@keyframes puppet-curious-tilt {
  0%,
  100% {
    transform: translateY(0) rotate(0deg) scale(1);
  }
  44% {
    transform: translateY(-4px) rotate(-1.2deg) scale(1.01);
  }
  75% {
    transform: translateY(1px) rotate(0.7deg) scale(1.004);
  }
}

@keyframes puppet-head-curious {
  0%,
  100% {
    transform: translateX(0) translateY(0) rotate(0deg);
  }
  44% {
    transform: translateX(-5px) translateY(-4px) rotate(-6deg);
  }
  75% {
    transform: translateX(2px) translateY(1px) rotate(2deg);
  }
}

@keyframes live2d-body-breathe {
  0%,
  100% {
    transform: translateY(0) rotate(0deg) scale(1);
  }
  34% {
    transform: translateY(1px) rotate(-0.35deg) scale(1.006, 1.012);
  }
  68% {
    transform: translateY(-1px) rotate(0.28deg) scale(0.998, 1.006);
  }
}

@keyframes live2d-body-soft-sway {
  0%,
  100% {
    transform: translateX(0) rotate(0deg);
  }
  42% {
    transform: translateX(-1px) rotate(-0.32deg);
  }
  70% {
    transform: translateX(1px) rotate(0.22deg);
  }
}

@keyframes live2d-shadow-breathe {
  0%,
  100% {
    opacity: 0.74;
    transform: scaleX(1);
  }
  50% {
    opacity: 0.55;
    transform: scaleX(0.9);
  }
}

@keyframes live2d-blink {
  0%,
  3%,
  88%,
  94%,
  100% {
    opacity: 0;
    transform:
      translateX(calc(var(--look-x) * 10px))
      translateY(calc(var(--look-y) * 5px))
      scaleY(0.25);
  }
  1.5%,
  90.5% {
    opacity: 0.52;
    transform:
      translateX(calc(var(--look-x) * 10px))
      translateY(calc(var(--look-y) * 5px))
      scaleY(1);
  }
}

@keyframes live2d-fast-blink {
  0%,
  100% {
    opacity: 0;
    transform: scaleY(0.2);
  }
  34%,
  52% {
    opacity: 0.5;
    transform: scaleY(1);
  }
}

@keyframes live2d-head-idle {
  0%,
  100% {
    transform:
      translateX(calc(var(--look-x) * 10px))
      translateY(calc(var(--look-y) * 5px))
      rotate(calc(var(--look-x) * 4.8deg));
  }
  38% {
    transform:
      translateX(calc(var(--look-x) * 12px - 1px))
      translateY(calc(var(--look-y) * 5px + 1px))
      rotate(calc(var(--look-x) * 5.2deg - 0.9deg));
  }
  72% {
    transform:
      translateX(calc(var(--look-x) * 11px + 1px))
      translateY(calc(var(--look-y) * 5px - 1px))
      rotate(calc(var(--look-x) * 5deg + 0.6deg));
  }
}

@keyframes live2d-arm-left-idle {
  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(1px) rotate(-1.2deg);
  }
}

@keyframes live2d-arm-right-idle {
  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }
  54% {
    transform: translateY(1px) rotate(1deg);
  }
}

@keyframes live2d-glance {
  0%,
  100% {
    transform: translateX(0) translateY(0) rotate(0deg);
  }
  24%,
  60% {
    transform: translateX(8px) translateY(-1px) rotate(3.6deg);
  }
  78% {
    transform: translateX(-3px) translateY(0) rotate(-1.6deg);
  }
}

@keyframes live2d-idle-tilt {
  0%,
  100% {
    transform: translateY(0) rotate(0deg) scale(1);
  }
  42% {
    transform: translateY(-3px) rotate(-1deg) scale(1.01);
  }
  72% {
    transform: translateY(1px) rotate(0.6deg) scale(1.004);
  }
}

@keyframes live2d-head-tilt {
  0%,
  100% {
    transform: translateX(0) translateY(0) rotate(0deg);
  }
  42% {
    transform: translateX(-3px) translateY(-3px) rotate(-4.2deg);
  }
  72% {
    transform: translateX(2px) translateY(1px) rotate(1.8deg);
  }
}

@keyframes live2d-pick-body {
  0% {
    transform: translateY(0) rotate(0deg) scale(1);
  }
  22% {
    transform: translateY(-9px) rotate(-1.1deg) scale(1.025);
  }
  48% {
    transform: translateY(4px) rotate(0.8deg) scale(0.998, 1.01);
  }
  72% {
    transform: translateY(-2px) rotate(-0.35deg) scale(1.01);
  }
  100% {
    transform: translateY(0) rotate(0deg) scale(1);
  }
}

@keyframes live2d-pick-head {
  0% {
    transform: translateY(0) rotate(0deg) scale(1);
  }
  18% {
    transform: translateY(-7px) rotate(-5deg) scale(1.025);
  }
  36% {
    transform: translateY(7px) rotate(4deg) scale(0.995, 1.018);
  }
  56% {
    transform: translateY(-3px) rotate(-2.2deg) scale(1.012);
  }
  78% {
    transform: translateY(1px) rotate(1deg) scale(1.004);
  }
  100% {
    transform: translateY(0) rotate(0deg) scale(1);
  }
}

@keyframes live2d-wave-left {
  0%,
  100% {
    transform: translateX(0) translateY(0) rotate(0deg);
  }
  18% {
    transform: translateX(-4px) translateY(-8px) rotate(-9deg);
  }
  34% {
    transform: translateX(3px) translateY(-11px) rotate(9deg);
  }
  50% {
    transform: translateX(-3px) translateY(-8px) rotate(-8deg);
  }
  66% {
    transform: translateX(2px) translateY(-5px) rotate(5deg);
  }
}

@keyframes live2d-wave-right {
  0%,
  100% {
    transform: translateX(0) translateY(0) rotate(0deg);
  }
  18% {
    transform: translateX(4px) translateY(-8px) rotate(9deg);
  }
  34% {
    transform: translateX(-3px) translateY(-12px) rotate(-10deg);
  }
  50% {
    transform: translateX(3px) translateY(-8px) rotate(8deg);
  }
  66% {
    transform: translateX(-2px) translateY(-5px) rotate(-5deg);
  }
}

@keyframes live2d-tiny-idle {
  0%,
  100% {
    transform: translateY(0) rotate(0deg) scale(1);
  }
  50% {
    transform: translateY(1px) rotate(-0.8deg) scale(1.015);
  }
}

@media (max-width: 1100px) {
  .hero-board {
    min-height: min(620px, calc(100vh - 245px));
  }

  .status-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .play-layout {
    grid-template-columns: 1fr;
  }

  .side-panel {
    grid-template-columns: repeat(3, 1fr);
  }

  .action-bar {
    grid-template-columns: repeat(5, 1fr);
  }

  .art-preview-grid {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
  }
}

@media (max-width: 760px) {
  .app-shell {
    padding: 14px;
  }

  .profile-card {
    min-height: 500px;
  }

  .profile-portrait {
    min-height: 372px;
    padding: 14px 14px 0;
  }

  .puppet,
  .material-live2d,
  .skinned-portrait,
  .sequence-portrait,
  .profile-static {
    width: min(88%, 280px);
    height: 360px;
    min-height: 340px;
  }

  .topbar,
  .game-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .status-grid,
  .side-panel {
    grid-template-columns: 1fr 1fr;
  }

  .scene,
  .room-backdrop {
    min-height: 470px;
    height: 470px;
  }

  .tom-image {
    left: 30%;
    width: 56%;
  }

  .tom-bubble {
    left: 18px;
    right: 18px;
    bottom: 372px;
    max-width: none;
  }

  .action-bar {
    grid-template-columns: repeat(3, 1fr);
  }

  .art-preview {
    inset: 12px;
    padding: 14px;
  }

  .art-preview-header {
    top: -14px;
    flex-direction: column;
    margin: -14px -14px 14px;
    padding: 14px;
  }

  .art-preview-grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .live2d-rig,
  .live2d-layer,
  .live2d-shadow,
  .live2d-eye-line,
  .skinned-portrait-shadow,
  .sequence-frame,
  .sequence-shadow,
  .sequence-portrait,
  .owner-box img,
  .tom-image {
    animation: none;
  }

  .profile-card,
  .profile-portrait,
  .live2d-rig,
  .live2d-layer,
  .sequence-frame {
    transition: none;
  }

  .sequence-frame-1 {
    opacity: 1;
  }
}

@media (max-width: 520px) {
  .start-screen {
    min-height: auto;
  }

  .hero-board {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .profile-card {
    min-height: 500px;
  }

  .status-grid,
  .side-panel,
  .scene-tabs {
    grid-template-columns: 1fr;
  }

  .action-bar {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Main game: the 3D room is the primary workspace. */
.game-screen {
  gap: 12px;
}

.game-screen .topbar {
  align-items: center;
}

.game-screen .topbar h1 {
  font-size: 34px;
  line-height: 1.1;
}

.game-screen .status-grid {
  gap: 8px;
}

.game-screen .stat {
  min-height: 58px;
  padding: 9px 11px;
}

.play-layout {
  grid-template-columns: minmax(0, 1fr) 292px;
  grid-template-areas:
    "scene side"
    "scene log";
  grid-template-rows: auto minmax(0, 1fr);
  align-items: stretch;
}

.scene-panel {
  grid-area: scene;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
}

.side-panel {
  grid-area: side;
}

.log-panel {
  grid-area: log;
  min-height: 0;
  max-height: 310px;
  overflow: hidden;
}

.log-panel .log-list {
  max-height: 248px;
  overflow: auto;
}

.scene {
  height: min(72vh, 820px);
  min-height: 620px;
  background: #dce7e6;
}

.tom-world {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: inherit;
  overflow: hidden;
  background: #dce7e6;
}

#tom-world-canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
  touch-action: none;
}

#tom-world-canvas:active {
  cursor: grabbing;
}

.legacy-tom-image {
  display: none;
}

.tom-world-status {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 7px 12px;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 8px;
  color: #2f2924;
  background: rgba(255, 250, 243, 0.86);
  box-shadow: 0 8px 24px rgba(47, 41, 36, 0.12);
  backdrop-filter: blur(8px);
  font-size: 13px;
  font-weight: 800;
  pointer-events: none;
}

.world-live-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #6e9860;
  box-shadow: 0 0 0 4px rgba(110, 152, 96, 0.16);
}

.camera-reset {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 50%;
  color: #2f2924;
  background: rgba(255, 250, 243, 0.88);
  box-shadow: 0 8px 24px rgba(47, 41, 36, 0.14);
  backdrop-filter: blur(8px);
  font-size: 23px;
  line-height: 1;
}

.camera-reset:hover {
  background: #fffaf3;
}

.tom-world-loading {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: grid;
  place-items: center;
  color: #2f2924;
  background: #dce7e6;
  font-weight: 800;
  transition: opacity 220ms ease;
  pointer-events: none;
}

.tom-world-loading.hidden {
  display: grid !important;
  opacity: 0;
}

.tom-world .tom-bubble {
  left: 16px;
  right: auto;
  bottom: 16px;
  max-width: min(420px, calc(100% - 88px));
  border: 1px solid rgba(255, 255, 255, 0.58);
  background: rgba(255, 250, 243, 0.9);
  backdrop-filter: blur(8px);
}

.scene-tabs {
  margin-top: 8px;
}

.action-bar {
  position: sticky;
  bottom: 10px;
  z-index: 8;
}

@media (max-width: 1100px) {
  .play-layout {
    grid-template-columns: 1fr;
    grid-template-areas:
      "scene"
      "side"
      "log";
    grid-template-rows: auto;
  }

  .scene {
    height: min(68vh, 760px);
    min-height: 580px;
  }

  .side-panel {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .log-panel {
    max-height: 240px;
  }
}

@media (max-width: 760px) {
  .game-screen .topbar h1 {
    font-size: 28px;
  }

  .scene,
  .tom-world {
    height: min(64vh, 650px);
    min-height: 520px;
  }

  .side-panel {
    grid-template-columns: 1fr 1fr;
  }

  .side-panel .owner-box {
    grid-column: 1 / -1;
  }

  .tom-world .tom-bubble {
    left: 12px;
    bottom: 12px;
  }
}

@media (max-width: 520px) {
  .action-bar {
    position: sticky;
    bottom: 0;
    isolation: isolate;
    contain: layout paint style;
    background: #fffaf3;
    box-shadow: 0 -6px 20px rgba(47, 41, 36, 0.12);
  }

  .action-bar button {
    background: #f3ece2;
  }

  .scene,
  .tom-world {
    height: 58vh;
    min-height: 470px;
  }

  .side-panel {
    grid-template-columns: 1fr;
  }

  .scene-tabs {
    grid-template-columns: repeat(2, 1fr);
  }

  .tom-world-status {
    top: 10px;
    left: 10px;
    max-width: calc(100% - 64px);
  }

  .camera-reset {
    top: 10px;
    right: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tom-world-loading {
    transition: none;
  }
}

/* Desktop single-screen game workspace. */
body:has(.game-v3:not(.hidden)) {
  overflow: hidden;
}

.app-shell:has(.game-v3:not(.hidden)) {
  width: 100vw;
  max-width: none;
  height: 100vh;
  padding: 0;
}

.game-v3 {
  box-sizing: border-box;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 338px;
  grid-template-rows: 68px minmax(0, 1fr) 76px;
  grid-template-areas:
    "hud hud"
    "workspace mission"
    "actions mission";
  gap: 8px;
  width: 100%;
  height: 100vh;
  padding: 8px 12px;
  overflow: hidden;
  background: #e9ece7;
}

.game-v3.hidden {
  display: none;
}

.game-hud {
  grid-area: hud;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 338px;
  align-items: center;
  gap: 10px;
  min-height: 0;
}

.hud-brand {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hud-brand strong {
  font-size: 19px;
  letter-spacing: 0;
}

.hud-brand span {
  color: #655f58;
  font-size: 12px;
  font-weight: 700;
}

.game-v3 .status-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(90px, 1fr));
  gap: 6px;
}

.hud-profile {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 104px;
  gap: 7px;
  min-width: 0;
  height: 100%;
}

.game-v3 .stat {
  min-height: 48px;
  padding: 6px 9px;
  border: 1px solid #d8d7d1;
  border-radius: 6px;
  background: #f7f7f3;
  box-shadow: none;
}

.game-v3 .stat span {
  font-size: 14px;
}

.game-v3 .date-chip {
  min-width: 0;
  padding: 8px 10px;
  border-radius: 6px;
}

.game-workspace {
  grid-area: workspace;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  grid-template-areas: "scene";
  align-items: stretch;
  min-height: 0;
  gap: 8px;
}

.game-v3 .scene-panel {
  grid-area: scene;
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  min-width: 0;
  min-height: 0;
}

.game-v3 .scene,
.game-v3 .tom-world {
  width: 100%;
  height: 100%;
  min-height: 0;
  border-radius: 6px;
}

.game-v3 #tom-world-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.game-v3 .scene-tabs[hidden] {
  display: none !important;
}

.mission-panel {
  grid-area: mission;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: 380px auto minmax(110px, 1fr);
  gap: 7px;
  min-width: 0;
  min-height: 0;
}

.mission-panel > * {
  grid-area: auto !important;
  min-width: 0;
}

.mission-panel > .compact-log {
  height: 100%;
  max-height: none;
  grid-template-rows: auto minmax(0, 1fr);
  align-content: stretch;
}

.compact-owner {
  display: grid;
  grid-template-columns: 44px 1fr;
  align-items: center;
  gap: 9px;
  min-height: 0;
  padding: 7px 9px;
  border: 1px solid #d8d7d1;
  border-radius: 6px;
  background: #f7f7f3;
}

.compact-owner img {
  width: 48px;
  height: 54px;
  border-radius: 4px;
  object-fit: contain;
  object-position: center bottom;
}

.hud-owner-card {
  grid-template-columns: 52px minmax(0, 1fr);
  height: 100%;
  box-sizing: border-box;
}

.hud-owner-card strong {
  font-size: 16px;
}

.game-v3[data-owner="zhuzhu"] .hud-owner-card,
.game-v3[data-owner="zhuzhu"] .hud-owner-card * {
  color: #cf5f83;
}

.game-v3[data-owner="erke"] .hud-owner-card,
.game-v3[data-owner="erke"] .hud-owner-card * {
  color: #3f73b7;
}

.game-v3 .date-chip,
.game-v3 .date-chip span,
.game-v3 .date-chip strong {
  color: #fff;
}

.game-v3 .date-chip {
  background: var(--accent-dark);
}

.bond-stat {
  overflow: hidden;
}

.bond-hearts {
  display: grid;
  grid-template-columns: repeat(8, minmax(12px, 1fr));
  align-items: center;
  gap: 2px;
  height: 21px;
  margin-top: 4px;
  color: #d66a8d;
}

.bond-heart {
  position: relative;
  display: block;
  height: 20px;
  font-size: 18px;
  line-height: 20px;
  text-align: center;
}

.bond-heart::before {
  content: "♡";
  color: #bdafb3;
}

.bond-heart.full::before {
  content: "♥";
  color: #df6e95;
}

.bond-heart.filled::after {
  position: absolute;
  inset: 0;
  width: 100%;
  color: transparent;
  content: "♥";
  background: linear-gradient(90deg, #df6e95 var(--heart-fill), transparent var(--heart-fill));
  background-clip: text;
  -webkit-background-clip: text;
}

.compact-owner p {
  margin: 2px 0 0;
  color: #6b655e;
  font-size: 10px;
  line-height: 1.25;
}

.activity-panel {
  display: flex;
  min-height: 0;
  flex-direction: column;
  padding: 12px;
  border: 1px solid #cbc9c2;
  border-radius: 6px;
  background: #f8f8f4;
  overflow: hidden;
}

.activity-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.activity-heading span {
  color: #767069;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.activity-heading h2 {
  margin: 1px 0 0;
  font-size: 19px;
  line-height: 1.15;
}

.icon-btn {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  padding: 0;
  border: 1px solid #d5d2ca;
  border-radius: 50%;
  background: #fff;
  font-size: 19px;
}

.activity-progress {
  height: 5px;
  margin: 10px 0;
  border-radius: 4px;
  background: #dddcd6;
  overflow: hidden;
}

.activity-progress i {
  display: block;
  width: 0;
  height: 100%;
  background: #648b65;
  transition: width 180ms ease;
}

.activity-body {
  min-height: 0;
  flex: 1;
  overflow: auto;
}

.activity-lead {
  margin: 0;
  color: #5f5a54;
  font-size: 13px;
  line-height: 1.55;
}

.activity-options,
.health-tools,
.walk-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin-top: 10px;
}

.activity-options button,
.health-tools button,
.walk-controls button,
.activity-primary {
  min-height: 42px;
  padding: 8px;
  border: 1px solid #cfccc4;
  border-radius: 6px;
  color: #322f2b;
  background: #fff;
  font-weight: 800;
}

.activity-options button:hover,
.health-tools button:hover,
.walk-controls button:hover,
.activity-primary:hover {
  border-color: #648b65;
  background: #eef4eb;
}

.activity-primary {
  width: 100%;
  margin-top: 10px;
  color: #fff;
  background: #5d7e5d;
}

.activity-primary:hover {
  color: #2f3c2f;
}

.activity-note {
  margin: 9px 0 0;
  padding: 8px;
  border-left: 3px solid #d09a5a;
  color: #554f48;
  background: #f4eee3;
  font-size: 12px;
}

.tap-field {
  position: relative;
  height: 126px;
  margin-top: 9px;
  border: 1px solid #c7d4c6;
  border-radius: 6px;
  background: #e4eee2;
  overflow: hidden;
}

.moving-target {
  position: absolute;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: #c75f4d;
  box-shadow: 0 4px 10px rgba(44, 38, 32, 0.2);
}

.litter-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 10px;
}

.litter-clump {
  min-height: 48px;
  border: 0;
  border-radius: 50%;
  background: #8d735d;
  box-shadow: inset 0 -6px 0 rgba(0, 0, 0, 0.1);
}

.litter-clump.cleared {
  visibility: hidden;
}

.walk-map {
  position: relative;
  height: 126px;
  margin-top: 8px;
  border: 1px solid #aebfa9;
  border-radius: 6px;
  background:
    linear-gradient(90deg, transparent 48%, #d8c9a5 48%, #d8c9a5 52%, transparent 52%),
    linear-gradient(#98bd88, #b7d09f);
  overflow: hidden;
}

.walk-route {
  position: absolute;
  left: 14px;
  right: 14px;
  top: 58px;
  height: 10px;
  border-radius: 8px;
  background: #e7dcc3;
}

.walk-marker {
  position: absolute;
  top: 44px;
  left: 8%;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #5d463f;
  box-shadow: 0 4px 8px rgba(0,0,0,.2);
  transition: left 180ms ease;
}

.side-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}

.game-v3 .task-box,
.game-v3 .calendar-box,
.compact-log {
  min-height: 0;
  padding: 8px 9px;
  border: 1px solid #d8d7d1;
  border-radius: 6px;
  background: #f7f7f3;
}

.game-v3 .task-box h2,
.game-v3 .calendar-box h2,
.compact-log h2 {
  margin: 0 0 5px;
  font-size: 12px;
}

.game-v3 .task-box ul {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px 6px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 13px;
  line-height: 1.45;
}

.game-v3 .calendar-box p {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
}

.compact-log {
  overflow: hidden;
}

.compact-log .log-list {
  max-height: 100%;
  overflow: auto;
  font-size: 13px;
  line-height: 1.42;
}

.compact-log .log-entry {
  padding: 6px 0;
}

.ending-overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  background:
    linear-gradient(135deg, rgba(19, 12, 18, 0.74), rgba(25, 36, 52, 0.66)),
    url("./source3/通关截图1.jpg") center / cover;
  backdrop-filter: blur(9px);
}

.ending-overlay.hidden {
  display: none;
}

.ending-dialog {
  width: min(560px, calc(100vw - 40px));
  padding: 38px 44px 34px;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 24px;
  background: linear-gradient(145deg, rgba(255, 249, 252, 0.94), rgba(255, 235, 244, 0.88));
  text-align: center;
  box-shadow: 0 30px 100px rgba(28, 15, 25, 0.48), inset 0 1px rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(18px);
}

.game-v3[data-owner="erke"] .ending-dialog {
  background: linear-gradient(145deg, rgba(247, 252, 255, 0.95), rgba(219, 238, 255, 0.9));
}

.ending-overlay.runaway .ending-dialog {
  filter: saturate(0.78);
}

.ending-mark {
  color: #df6e95;
  font-size: 54px;
}

.ending-dialog h2 {
  margin: 8px 0;
  font-size: 28px;
}

.ending-dialog p {
  margin: 0 0 20px;
  color: #665f58;
  font-size: 15px;
  line-height: 1.6;
}

.ending-dialog .ending-unlock-note {
  margin: 14px auto 0;
  padding-top: 14px;
  border-top: 1px solid rgba(102, 95, 88, 0.18);
  color: #8a6472;
  font-size: 13px;
}

.game-v3[data-owner="erke"] .ending-dialog .ending-unlock-note {
  color: #55758f;
}

/* 影片回顾 */
.film-gallery {
  --gallery-accent: #ef719f;
  --gallery-accent-dark: #a92f62;
  --gallery-glow: rgba(239, 113, 159, 0.34);
  position: fixed;
  inset: 0;
  z-index: 70;
  overflow: auto;
  padding: clamp(22px, 4vw, 58px);
  color: #fff8fb;
  background:
    radial-gradient(circle at 12% 18%, var(--gallery-glow), transparent 30%),
    radial-gradient(circle at 88% 72%, rgba(255, 207, 225, 0.2), transparent 34%),
    linear-gradient(145deg, #2c1423 0%, #6e2448 48%, #26111f 100%);
}

.film-gallery[data-owner="erke"] {
  --gallery-accent: #74b9ee;
  --gallery-accent-dark: #276b9f;
  --gallery-glow: rgba(83, 169, 232, 0.34);
  color: #f4faff;
  background:
    radial-gradient(circle at 12% 18%, var(--gallery-glow), transparent 30%),
    radial-gradient(circle at 88% 72%, rgba(161, 218, 255, 0.18), transparent 34%),
    linear-gradient(145deg, #101e31 0%, #194d74 48%, #0c1828 100%);
}

.film-gallery::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.34;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, black, transparent 90%);
}

.film-gallery-header {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  width: min(1320px, 100%);
  margin: 0 auto 24px;
}

.film-gallery-header .kicker { color: rgba(255, 255, 255, 0.66); }
.film-gallery-header h1 {
  margin: 0;
  font-size: clamp(42px, 7vw, 92px);
  line-height: 0.92;
  letter-spacing: -0.07em;
  text-shadow: 0 12px 40px var(--gallery-glow);
}
.film-gallery-header p:last-child { margin: 16px 0 0; color: rgba(255, 255, 255, 0.72); }
.film-gallery-header .ghost-btn {
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(12px);
}

.gallery-mode-switch,
.film-owner-switch {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: min(620px, 100%);
  margin: 0 auto 28px;
  padding: 5px;
  border: 1px solid rgba(255, 255, 255, 0.17);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(14px);
}
.gallery-mode-switch {
  width: min(420px, 100%);
  margin-bottom: 12px;
}
.film-owner-switch { margin-bottom: 28px; }
.gallery-mode-switch button,
.film-owner-switch button {
  padding: 12px 18px;
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.62);
  background: transparent;
  font-weight: 800;
}
.gallery-mode-switch button.active,
.film-owner-switch button.active {
  color: white;
  background: linear-gradient(135deg, var(--gallery-accent), var(--gallery-accent-dark));
  box-shadow: 0 8px 28px var(--gallery-glow);
}

.film-gallery-stage {
  position: relative;
  width: min(1320px, 100%);
  margin: 0 auto;
  padding: clamp(18px, 3vw, 34px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 28px;
  background: rgba(5, 4, 9, 0.28);
  box-shadow: 0 32px 100px rgba(0, 0, 0, 0.28), inset 0 1px rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(18px);
}
.film-gallery.music-playing .film-gallery-stage {
  animation: gallery-stage-pulse 3.6s ease-in-out infinite;
}
.film-gallery.music-playing::after {
  content: "";
  position: fixed;
  inset: 12% 18%;
  z-index: -1;
  border-radius: 50%;
  background: radial-gradient(circle, var(--gallery-glow), transparent 68%);
  filter: blur(36px);
  animation: gallery-aurora 5s ease-in-out infinite alternate;
  pointer-events: none;
}
.film-gallery-ribbon {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
  color: rgba(255, 255, 255, 0.48);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.14em;
}
.film-gallery-ribbon i { flex: 1; height: 1px; background: rgba(255, 255, 255, 0.15); }
.film-gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.film-gallery-grid.music-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.film-card {
  min-width: 0;
  overflow: hidden;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 18px;
  color: white;
  text-align: left;
  background: rgba(255, 255, 255, 0.075);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.2);
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}
.film-card.unlocked:hover {
  transform: translateY(-5px);
  border-color: var(--gallery-accent);
  box-shadow: 0 20px 42px rgba(0, 0, 0, 0.28), 0 0 30px var(--gallery-glow);
}
.film-card.locked { cursor: not-allowed; opacity: 0.58; }
.film-card-screen {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(0, 0, 0, 0.28));
}
.film-card-screen video { width: 100%; height: 100%; object-fit: cover; }
.film-play-mark {
  position: absolute;
  left: 50%; top: 50%;
  display: grid;
  place-items: center;
  width: 52px; height: 52px;
  padding-left: 4px;
  border: 1px solid rgba(255, 255, 255, 0.52);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.36);
  backdrop-filter: blur(8px);
  transform: translate(-50%, -50%);
}
.film-number { position: absolute; right: 10px; bottom: 8px; color: rgba(255, 255, 255, 0.58); font-size: 11px; font-weight: 900; }
.film-lock-art { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; gap: 3px; }
.film-lock-art b { color: rgba(255, 255, 255, 0.52); font: 900 64px/1 Georgia, serif; }
.film-lock-art i { color: rgba(255, 255, 255, 0.32); font-size: 9px; font-style: normal; letter-spacing: 0.28em; }
.film-card-copy { display: grid; gap: 5px; padding: 14px 16px 16px; }
.film-card-copy strong { font-size: 15px; }
.film-card-copy small { color: rgba(255, 255, 255, 0.55); font-size: 11px; }
.film-card.failure .film-card-copy strong { color: #ffd3df; }
.film-gallery[data-owner="erke"] .film-card.failure .film-card-copy strong { color: #cfeaff; }

.stop-gallery-music {
  position: absolute;
  top: 20px;
  right: 26px;
  z-index: 2;
  padding: 9px 15px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  color: white;
  background: rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(12px);
}
.music-card {
  position: relative;
  display: grid;
  grid-template-columns: 128px minmax(0, 1fr);
  min-height: 144px;
  overflow: hidden;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 20px;
  color: white;
  text-align: left;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(0, 0, 0, 0.18));
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.22);
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}
.music-card:hover,
.music-card.playing {
  transform: translateY(-4px);
  border-color: var(--gallery-accent);
  box-shadow: 0 22px 46px rgba(0, 0, 0, 0.3), 0 0 34px var(--gallery-glow);
}
.music-art {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(circle, rgba(255, 255, 255, 0.2), transparent 42%),
    linear-gradient(145deg, var(--gallery-accent-dark), rgba(4, 5, 14, 0.72));
}
.music-art::after {
  content: "";
  position: absolute;
  inset: -45%;
  background: conic-gradient(transparent, rgba(255, 255, 255, 0.24), transparent 28%);
  animation: music-shimmer 7s linear infinite;
}
.music-index { position: absolute; left: 10px; top: 9px; color: rgba(255, 255, 255, 0.55); font-size: 10px; font-weight: 900; }
.music-orbit {
  position: absolute;
  width: 78px;
  height: 78px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 50%;
  opacity: 0.52;
}
.music-orbit i {
  position: absolute;
  top: 50%; left: 50%;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 0 14px white;
  transform-origin: 0 0;
}
.music-orbit i:nth-child(1) { transform: rotate(0deg) translateX(39px); }
.music-orbit i:nth-child(2) { transform: rotate(120deg) translateX(39px); }
.music-orbit i:nth-child(3) { transform: rotate(240deg) translateX(39px); }
.music-card.playing .music-orbit { opacity: 0.9; animation: music-orbit-spin 4.8s linear infinite; }
.music-visualizer {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  width: 72px;
  height: 54px;
}
.music-visualizer i {
  width: 4px;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.68);
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.28);
}
.music-card.playing .music-visualizer i {
  animation: music-eq 0.78s ease-in-out infinite alternate;
  animation-delay: calc(var(--bar) * -0.09s);
  background: white;
  box-shadow: 0 0 14px white, 0 0 26px var(--gallery-accent);
}
.music-card-copy { display: grid; align-content: center; gap: 7px; padding: 18px; min-width: 0; }
.music-card-copy strong { font-size: 17px; }
.music-card-copy small { color: rgba(255, 255, 255, 0.56); }
.music-card-copy em { color: var(--gallery-accent); font-size: 11px; font-style: normal; font-weight: 900; }

.film-player {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: block;
  padding: 0;
  color: white;
  background: #050505;
}
.film-player-frame { position: absolute; inset: 0; display: grid; place-items: center; overflow: hidden; }
.film-player video { width: 100%; height: 100%; object-fit: contain; background: #000; }
.film-player-controls {
  position: absolute;
  left: 50%;
  bottom: 24px;
  z-index: 3;
  display: none;
  justify-content: center;
  gap: 12px;
  transform: translateX(-50%);
}
.film-player.is-ended[data-mode="gallery"] .film-player-controls {
  display: flex;
}
.film-player-controls button {
  min-width: 142px;
  padding: 12px 20px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  color: white;
  background: rgba(255, 255, 255, 0.12);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(14px);
}
.film-player-controls button:hover { background: rgba(255, 255, 255, 0.2); }
.film-player-message {
  position: absolute;
  left: 50%; top: 50%;
  display: grid;
  gap: 10px;
  width: min(520px, calc(100vw - 48px));
  padding: 26px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 18px;
  background: rgba(20, 20, 20, 0.86);
  text-align: center;
  transform: translate(-50%, -50%);
  backdrop-filter: blur(16px);
}
.film-player-message strong { font-size: 19px; }
.film-player-message span { color: rgba(255, 255, 255, 0.66); font-size: 13px; line-height: 1.6; }

@keyframes music-eq {
  0% { height: 8px; transform: scaleY(0.72); }
  100% { height: 48px; transform: scaleY(1); }
}
@keyframes music-orbit-spin { to { transform: rotate(360deg); } }
@keyframes music-shimmer { to { transform: rotate(360deg); } }
@keyframes gallery-stage-pulse {
  0%, 100% { box-shadow: 0 32px 100px rgba(0, 0, 0, 0.28), inset 0 1px rgba(255, 255, 255, 0.1); }
  50% { box-shadow: 0 32px 110px rgba(0, 0, 0, 0.34), 0 0 44px var(--gallery-glow), inset 0 1px rgba(255, 255, 255, 0.16); }
}
@keyframes gallery-aurora {
  from { transform: translate3d(-5%, -3%, 0) scale(0.92); opacity: 0.48; }
  to { transform: translate3d(5%, 4%, 0) scale(1.12); opacity: 0.9; }
}

@media (max-width: 900px) {
  .film-gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .film-gallery-grid.music-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 600px) {
  .film-gallery { padding: 18px 12px 30px; }
  .film-gallery-header { align-items: flex-end; }
  .film-gallery-header h1 { font-size: 52px; }
  .film-gallery-header p:last-child { display: none; }
  .film-gallery-grid { grid-template-columns: 1fr; }
  .film-gallery-grid.music-grid { grid-template-columns: 1fr; }
  .film-gallery-stage { padding: 12px; border-radius: 20px; }
  .music-card { grid-template-columns: 104px minmax(0, 1fr); }
  .stop-gallery-music { position: static; margin: 0 0 14px auto; }
  .film-player-controls button { min-width: 0; flex: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .film-gallery.music-playing .film-gallery-stage,
  .film-gallery.music-playing::after,
  .music-art::after,
  .music-card.playing .music-orbit,
  .music-card.playing .music-visualizer i {
    animation: none;
  }
}

.game-v3 .action-bar {
  grid-area: actions;
  position: static;
  z-index: 5;
  display: grid;
  grid-template-columns: repeat(8, minmax(74px, 1fr)) 92px;
  gap: 6px;
  min-height: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
}

.game-v3 .action-bar button {
  min-height: 68px;
  padding: 6px;
  border-radius: 6px;
  font-size: 14px;
}

.game-v3 .action-bar button span {
  display: block;
  margin: 0 auto 3px;
  font-size: 18px;
}

.game-v3 .action-bar button.active {
  color: #fff;
  border-color: #5f7b5d;
  background: #5f7b5d;
}

.utility-actions {
  display: none;
}

.utility-actions .ghost-btn {
  min-height: 30px;
  padding: 5px 8px;
  font-size: 10px;
}

@media (max-width: 1100px) {
  .game-v3 {
    min-width: 1000px;
  }
}

/* 奶油蓝天主界面 */
body {
  background:
    radial-gradient(ellipse at 16% 10%, rgba(255, 255, 255, 0.94) 0 8%, transparent 20%),
    radial-gradient(ellipse at 84% 16%, rgba(255, 253, 243, 0.82) 0 7%, transparent 19%),
    linear-gradient(180deg, #bfe1f1 0%, #d9edf5 34%, #fff8e9 100%);
}

.start-screen {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: 26px clamp(10px, 2vw, 30px) 20px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 34px;
  background:
    radial-gradient(ellipse at 14% 18%, rgba(255, 255, 255, 0.86) 0 7%, transparent 17%),
    radial-gradient(ellipse at 90% 32%, rgba(255, 252, 237, 0.75) 0 8%, transparent 19%),
    linear-gradient(180deg, rgba(218, 239, 248, 0.92), rgba(255, 248, 231, 0.9));
  box-shadow: 0 26px 80px rgba(83, 130, 157, 0.2), inset 0 1px rgba(255, 255, 255, 0.95);
}

.start-screen::before,
.start-screen::after {
  content: "";
  position: absolute;
  z-index: -1;
  width: 420px;
  height: 150px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.58);
  filter: blur(2px);
  pointer-events: none;
}
.start-screen::before { top: -82px; left: 16%; transform: rotate(-7deg); }
.start-screen::after { right: 8%; bottom: -94px; transform: rotate(8deg); background: rgba(255, 248, 230, 0.72); }

.start-copy {
  position: relative;
  z-index: 3;
  text-align: center;
  font-family: "YouYuan", "幼圆", "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
}
.start-copy h1 {
  margin: 0;
  color: #fffdf5;
  font-family: "YouYuan", "幼圆", "Arial Rounded MT Bold", "Microsoft YaHei UI", sans-serif;
  font-size: clamp(42px, 5.4vw, 76px);
  font-weight: 900;
  line-height: 1.08;
  letter-spacing: 0.02em;
  -webkit-text-stroke: 2px rgba(76, 127, 157, 0.68);
  paint-order: stroke fill;
  text-shadow:
    0 4px 0 rgba(107, 159, 187, 0.34),
    0 14px 34px rgba(70, 122, 151, 0.22),
    0 -1px rgba(255, 255, 255, 0.9);
}
.start-copy .intro {
  width: fit-content;
  max-width: calc(100% - 32px);
  margin: 14px auto 0;
  padding: 9px 22px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 999px;
  color: #53798d;
  background: rgba(255, 253, 244, 0.72);
  box-shadow: 0 10px 28px rgba(74, 120, 145, 0.1), inset 0 1px rgba(255, 255, 255, 0.9);
  font-family: "YouYuan", "幼圆", "Microsoft YaHei UI", sans-serif;
  font-size: clamp(15px, 1.5vw, 19px);
  font-weight: 800;
  letter-spacing: 0.04em;
  backdrop-filter: blur(10px);
}
.hero-board,
.start-actions { position: relative; z-index: 3; }

.start-actions .primary-btn,
.start-actions .ghost-btn {
  border-radius: 999px;
  font-family: "YouYuan", "幼圆", "Microsoft YaHei UI", sans-serif;
  box-shadow: 0 10px 24px rgba(66, 112, 139, 0.12);
}
.start-actions .primary-btn {
  color: #fffef8;
  background: linear-gradient(135deg, #78acc8, #4f86a7);
  box-shadow: 0 12px 30px rgba(67, 125, 158, 0.28), inset 0 1px rgba(255, 255, 255, 0.36);
}
.start-actions .ghost-btn {
  border-color: rgba(106, 151, 176, 0.28);
  color: #52758a;
  background: rgba(255, 252, 241, 0.76);
  backdrop-filter: blur(10px);
}

.profile-copy p {
  font-family: "YouYuan", "幼圆", "Microsoft YaHei UI", sans-serif;
  font-size: 20px;
  line-height: 1.2;
  letter-spacing: 0.04em;
}
.hud-owner-card p {
  margin-top: 2px;
  font-family: "YouYuan", "幼圆", "Microsoft YaHei UI", sans-serif;
  font-size: 15px;
  font-weight: 900;
  line-height: 1.15;
}

/* 主界面左右 TOM.丁 SVG 轮播 */
.tom-side-stories {
  position: absolute;
  z-index: 1;
  top: 132px;
  bottom: 72px;
  width: 15.5%;
  pointer-events: none;
}
.tom-side-stories-left { left: 0; }
.tom-side-stories-right { right: 0; }
.tom-side-scene {
  position: absolute;
  width: min(100%, 230px);
  height: 42%;
  overflow: visible;
  opacity: 0;
  filter: drop-shadow(0 16px 18px rgba(64, 112, 140, 0.12));
  animation: tom-side-scene-cycle 18s ease-in-out infinite;
}
.tom-side-scene:nth-child(1) { top: 2%; left: 3%; transform: rotate(-3deg); }
.tom-side-scene:nth-child(2) { top: 30%; right: -4%; transform: rotate(4deg) scale(0.92); animation-delay: 6s; }
.tom-side-scene:nth-child(3) { bottom: -2%; left: 8%; transform: rotate(-5deg) scale(0.88); animation-delay: 12s; }
.tom-side-stories-right .tom-side-scene:nth-child(1) { top: 8%; right: 6%; left: auto; transform: rotate(5deg) scale(0.93); animation-delay: -3s; }
.tom-side-stories-right .tom-side-scene:nth-child(2) { top: 36%; left: -4%; right: auto; transform: rotate(-4deg) scale(0.88); animation-delay: 3s; }
.tom-side-stories-right .tom-side-scene:nth-child(3) { bottom: -4%; right: 4%; left: auto; transform: rotate(3deg); animation-delay: 9s; }
.tom-side-scene .cat {
  fill: #fff8e9;
  stroke: #5f91ac;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
  transform-box: fill-box;
  transform-origin: center;
  animation: tom-cat-bob 2.6s ease-in-out infinite;
}
.tom-side-scene .cat circle:not(:first-of-type) { fill: #537487; stroke: none; }
.tom-side-scene .tail,
.tom-side-scene .paw { fill: none; stroke: #5f91ac; stroke-width: 5; }
.tom-side-scene .tail { transform-box: fill-box; transform-origin: 85% 50%; animation: tom-tail-swish 1.7s ease-in-out infinite alternate; }
.tom-side-scene .paw { animation: tom-paw-wave 1.3s ease-in-out infinite alternate; transform-box: fill-box; transform-origin: 30% 20%; }
.ground-line { fill: none; stroke: rgba(99, 143, 165, 0.38); stroke-width: 5; stroke-linecap: round; }
.cloud { fill: rgba(255, 255, 255, 0.7); stroke: rgba(116, 163, 186, 0.22); stroke-width: 2; animation: tom-cloud-float 4.8s ease-in-out infinite alternate; }
.toy-ball,
.yarn-ball { fill: #f9c1a7; stroke: #b87576; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; transform-box: fill-box; transform-origin: center; animation: tom-toy-roll 2.4s ease-in-out infinite alternate; }
.yarn-ball path { fill: none; }
.butterfly { fill: #f7d68b; stroke: #ba8296; stroke-width: 3; transform-box: fill-box; transform-origin: center; animation: tom-butterfly 1.7s ease-in-out infinite; }
.butterfly path:last-child { fill: none; }
.box { fill: #eab88e; stroke: #9d7369; stroke-width: 4; }
.box-flap { fill: #f1c6a1; stroke: #9d7369; stroke-width: 4; stroke-linejoin: round; }
.cat-in-box .paw { animation-duration: 0.9s; }
.feather { fill: #f5d785; stroke: #98769f; stroke-width: 3; transform-box: fill-box; transform-origin: 40% 100%; animation: tom-feather 2.2s ease-in-out infinite; }
.cat-rolling { animation: tom-cat-roll 3.2s ease-in-out infinite !important; }
.cat-sneaking { animation-duration: 3.1s !important; }

@keyframes tom-side-scene-cycle {
  0%, 4% { opacity: 0; }
  10%, 29% { opacity: 0.76; }
  35%, 100% { opacity: 0; }
}
@keyframes tom-cat-bob { 0%, 100% { translate: 0 2px; } 50% { translate: 0 -7px; } }
@keyframes tom-tail-swish { from { rotate: -9deg; } to { rotate: 12deg; } }
@keyframes tom-paw-wave { from { rotate: -4deg; } to { rotate: 12deg; } }
@keyframes tom-toy-roll { from { translate: -8px 0; rotate: -18deg; } to { translate: 11px -2px; rotate: 26deg; } }
@keyframes tom-cloud-float { from { translate: -4px 0; } to { translate: 8px 3px; } }
@keyframes tom-butterfly { 0%,100% { translate: 0 2px; scale: 0.9 1; } 50% { translate: 9px -13px; scale: 1.08 0.86; } }
@keyframes tom-feather { 0%,100% { rotate: -12deg; translate: -3px 0; } 50% { rotate: 14deg; translate: 5px -9px; } }
@keyframes tom-cat-roll { 0%,100% { rotate: -18deg; translate: -3px 0; } 50% { rotate: 18deg; translate: 7px -5px; } }

/* 音量设置 */
.volume-settings {
  position: fixed;
  inset: 0;
  z-index: 85;
  display: grid;
  place-items: center;
  overflow: auto;
  padding: 28px;
  background:
    radial-gradient(ellipse at 16% 18%, rgba(255, 255, 255, 0.74), transparent 25%),
    radial-gradient(ellipse at 86% 76%, rgba(255, 247, 224, 0.68), transparent 28%),
    linear-gradient(145deg, rgba(107, 165, 195, 0.88), rgba(205, 233, 244, 0.94) 48%, rgba(255, 245, 223, 0.94));
  backdrop-filter: blur(16px);
}
.volume-settings-panel {
  position: relative;
  width: min(920px, 100%);
  overflow: hidden;
  padding: clamp(24px, 4vw, 48px);
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 34px;
  background: linear-gradient(145deg, rgba(255, 255, 252, 0.84), rgba(244, 250, 251, 0.68));
  box-shadow: 0 36px 110px rgba(50, 96, 124, 0.28), inset 0 1px rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(24px);
}
.volume-settings-panel::before {
  content: "";
  position: absolute;
  width: 360px; height: 180px;
  right: -90px; top: -90px;
  border-radius: 50%;
  background: rgba(185, 223, 239, 0.46);
  filter: blur(2px);
}
.volume-settings-header { position: relative; display: flex; justify-content: space-between; gap: 20px; margin-bottom: 28px; }
.volume-settings-header span { color: #6c9ab1; font-size: 12px; font-weight: 900; letter-spacing: 0.18em; }
.volume-settings-header h1 {
  margin: 5px 0 7px;
  color: #416f88;
  font-family: "YouYuan", "幼圆", "Microsoft YaHei UI", sans-serif;
  font-size: clamp(34px, 5vw, 56px);
  line-height: 1;
}
.volume-settings-header p { margin: 0; color: #70838c; font-size: 14px; }
.volume-close {
  align-self: flex-start;
  width: 44px; height: 44px;
  border: 1px solid rgba(89, 135, 160, 0.24);
  border-radius: 50%;
  color: #527d93;
  background: rgba(255, 255, 255, 0.62);
  font-size: 26px;
  box-shadow: 0 8px 24px rgba(70, 114, 138, 0.12);
}
.volume-control-grid { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.volume-card {
  position: relative;
  overflow: hidden;
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.74);
  border-radius: 26px;
  background: rgba(255, 253, 246, 0.68);
  box-shadow: 0 18px 42px rgba(69, 112, 135, 0.12), inset 0 1px white;
}
.volume-card-effect { background: linear-gradient(145deg, rgba(255, 250, 239, 0.78), rgba(249, 230, 221, 0.56)); }
.volume-card-art { display: flex; align-items: end; gap: 6px; height: 48px; margin-bottom: 18px; }
.volume-card-art > i { width: 8px; border-radius: 999px; background: linear-gradient(180deg, #8ec5df, #568ea9); animation: volume-bar 1.2s ease-in-out infinite alternate; }
.volume-card-art > i:nth-child(1) { height: 18px; animation-delay: -.2s; }
.volume-card-art > i:nth-child(2) { height: 38px; animation-delay: -.8s; }
.volume-card-art > i:nth-child(3) { height: 26px; animation-delay: -.45s; }
.volume-card-art > i:nth-child(4) { height: 46px; animation-delay: -.95s; }
.volume-card-art > i:nth-child(5) { height: 30px; animation-delay: -.6s; }
.sound-ripples { position: relative; display: grid; place-items: center; width: 70px; }
.sound-ripples i { position: absolute; width: 18px; height: 18px; border: 2px solid #cf8d8a; border-radius: 50%; background: transparent; animation: volume-ripple 2s ease-out infinite; }
.sound-ripples i:nth-child(2) { animation-delay: .6s; }
.sound-ripples i:nth-child(3) { animation-delay: 1.2s; }
.volume-card-heading { display: flex; align-items: center; gap: 12px; }
.volume-card-heading > span { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 14px; color: white; background: linear-gradient(135deg, #89bfd9, #5b90aa); font-size: 20px; }
.volume-card-effect .volume-card-heading > span { background: linear-gradient(135deg, #e9ad9e, #be7f8c); }
.volume-card-heading h2 { margin: 0; color: #456d82; font: 900 22px/1.2 "YouYuan", "幼圆", "Microsoft YaHei UI", sans-serif; }
.volume-card-heading p { margin: 3px 0 0; color: #819096; font-size: 12px; }
.volume-slider-row { display: grid; grid-template-columns: minmax(0, 1fr) 52px; align-items: center; gap: 12px; margin: 25px 0 18px; }
.volume-slider-row input[type="range"] {
  --volume-level: 50%;
  width: 100%;
  height: 9px;
  appearance: none;
  border-radius: 999px;
  outline: none;
  background: linear-gradient(90deg, #6ca6c2 var(--volume-level), rgba(95, 139, 161, 0.16) var(--volume-level));
  box-shadow: inset 0 1px 3px rgba(47, 84, 105, 0.15);
}
.volume-card-effect input[type="range"] { background: linear-gradient(90deg, #cf8d8a var(--volume-level), rgba(174, 119, 127, 0.16) var(--volume-level)); }
.volume-slider-row input[type="range"]::-webkit-slider-thumb {
  width: 24px; height: 24px;
  appearance: none;
  border: 4px solid white;
  border-radius: 50%;
  background: #5f99b5;
  box-shadow: 0 5px 14px rgba(60, 103, 126, 0.26);
}
.volume-card-effect input[type="range"]::-webkit-slider-thumb { background: #c68386; }
.volume-slider-row output { color: #557c90; font-size: 14px; font-weight: 900; text-align: right; }
.volume-preview-button {
  width: 100%;
  padding: 11px 16px;
  border: 1px solid rgba(88, 139, 165, 0.24);
  border-radius: 999px;
  color: #4f7c92;
  background: rgba(255, 255, 255, 0.62);
  font-weight: 900;
  box-shadow: 0 8px 22px rgba(65, 109, 132, 0.1);
}
.volume-card-effect .volume-preview-button { border-color: rgba(190, 126, 136, 0.24); color: #a36f77; }
.volume-settings-footer { display: flex; align-items: center; gap: 12px; margin-top: 22px; color: #7c8d94; font-size: 12px; text-align: center; }
.volume-settings-footer span { flex: 1; height: 1px; background: linear-gradient(90deg, transparent, rgba(89, 133, 154, 0.22)); }
.volume-settings-footer span:last-child { transform: scaleX(-1); }

@keyframes volume-bar { to { transform: scaleY(0.48); opacity: 0.62; } }
@keyframes volume-ripple { from { transform: scale(0.4); opacity: 0.9; } to { transform: scale(2.4); opacity: 0; } }

/* 播放控件与停止音乐控件的可读性和质感 */
.film-player-controls button {
  color: #422b3e;
  border-color: rgba(255, 255, 255, 0.76);
  background: linear-gradient(145deg, rgba(255, 253, 247, 0.96), rgba(235, 223, 232, 0.9));
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.32), inset 0 1px rgba(255, 255, 255, 0.95);
  font-weight: 900;
}
.film-player-controls button:hover { color: #263f53; background: linear-gradient(145deg, #fffdf6, #dcebf3); }
.stop-gallery-music {
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 11px 20px;
  border: 1px solid rgba(255, 255, 255, 0.52);
  color: #3b2240;
  background:
    linear-gradient(135deg, rgba(255, 246, 222, 0.96), rgba(239, 184, 210, 0.92) 52%, rgba(181, 214, 238, 0.94));
  box-shadow: 0 12px 32px rgba(18, 8, 25, 0.32), 0 0 26px var(--gallery-glow), inset 0 1px rgba(255, 255, 255, 0.96);
  font-family: "YouYuan", "幼圆", "Microsoft YaHei UI", sans-serif;
  font-weight: 900;
  letter-spacing: 0.05em;
  transition: transform 180ms ease, box-shadow 180ms ease;
}
.stop-gallery-music::before {
  content: "";
  width: 10px;
  height: 10px;
  border: 2px solid currentColor;
  border-radius: 3px;
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.76);
  transform: rotate(45deg);
}
.stop-gallery-music:hover { transform: translateY(-2px); box-shadow: 0 16px 38px rgba(18, 8, 25, 0.4), 0 0 38px var(--gallery-glow), inset 0 1px white; }

@media (max-width: 1120px) {
  .tom-side-stories { display: none; }
  .hero-board { width: 88%; }
}
@media (max-width: 680px) {
  .start-screen { padding-inline: 8px; border-radius: 22px; }
  .start-copy h1 { font-size: 38px; -webkit-text-stroke-width: 1px; }
  .start-copy .intro { padding-inline: 14px; font-size: 14px; }
  .hero-board { width: 100%; }
  .volume-settings { padding: 12px; }
  .volume-settings-panel { padding: 22px 16px; border-radius: 24px; }
  .volume-control-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .tom-side-scene,
  .tom-side-scene *,
  .volume-card-art *,
  .sound-ripples * { animation: none !important; }
  .tom-side-scene:first-child { opacity: 0.65; }
}
