/* 猫猫慢养屋 · 卡通手游风 H5
   主色 #FF8A3D，竖屏铺满，单页三态：开始 / 陪伴 / 结算 */

:root {
  --orange: #ff8a3d;
  --orange-deep: #f2701c;
  --orange-soft: #ffb46e;
  --cream: #fff7ea;
  --cream-deep: #fff0dc;
  --ink: #4a3527;
  --ink-soft: #7d604b;
  --muted: #a4866f;
  --pink: #ff6f95;
  --mint: #58c39e;
  --gold: #ffc13c;
  --shadow-soft: 0 12px 30px rgba(124, 72, 26, 0.18);
  --shadow-card: 0 18px 44px rgba(122, 69, 24, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  --font: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
}

body {
  overflow: hidden;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(120% 80% at 20% 0%, #5a3a26 0%, #2c1b12 55%, #1b1009 100%);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overscroll-behavior: none;
}

button {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  color: inherit;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
}

button:focus-visible,
.cat:focus-visible {
  outline: 3px solid rgba(255, 255, 255, 0.85);
  outline-offset: 3px;
}

img { display: block; max-width: 100%; }
[hidden] { display: none !important; }

.app {
  --safe-top: max(10px, env(safe-area-inset-top));
  --safe-bottom: max(10px, env(safe-area-inset-bottom));
  position: relative;
  width: 100%;
  max-width: 540px;
  height: 100vh;
  height: 100dvh;
  margin: 0 auto;
  overflow: hidden;
  isolation: isolate;
  background: #ffe6ca;
  box-shadow: 0 0 80px rgba(0, 0, 0, 0.55);
  -webkit-user-select: none;
  user-select: none;
}

.app::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 11;
  pointer-events: none;
  background: radial-gradient(118% 88% at 50% 42%, transparent 54%, rgba(122, 66, 26, 0.11) 100%);
}

/* ============================================================
   小屋场景
   ============================================================ */
.room {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: linear-gradient(180deg, #ffe9d1 0%, #ffdcba 43%, #f4c18a 43.2%, #eab170 100%);
}

.wall {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 43.2%;
  background:
    radial-gradient(90% 80% at 22% 8%, rgba(255, 250, 228, 0.85), transparent 55%),
    linear-gradient(180deg, #ffe7c9 0%, #ffdcb8 70%, #f8cca1 100%);
  overflow: hidden;
}

.wall::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.16) 0 1px, transparent 1px 46px);
  opacity: 0.55;
}

.wall-glow {
  position: absolute;
  left: -10%;
  top: -20%;
  width: 70%;
  height: 120%;
  background: radial-gradient(closest-side, rgba(255, 244, 190, 0.7), transparent 70%);
  filter: blur(6px);
}

/* 窗户 */
.window {
  position: absolute;
  left: 17px;
  top: calc(var(--safe-top) + 92px);
  width: clamp(96px, 27vw, 124px);
  height: clamp(112px, 17vh, 150px);
  border: 6px solid #fff6e7;
  border-radius: 15px;
  box-shadow:
    0 12px 26px rgba(143, 86, 37, 0.18),
    inset 0 0 0 2px #f0d4b4,
    0 0 0 1px rgba(173, 116, 63, 0.18);
  z-index: 1;
}

.win-sky {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: 7px;
  background: linear-gradient(170deg, #a9dcf3 0%, #d4eef4 44%, #ffe7b8 100%);
}

.sun {
  position: absolute;
  right: 12%;
  top: 9%;
  width: 28%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fffbe0, #ffd76b 60%, #ffc247 100%);
  box-shadow: 0 0 20px rgba(255, 214, 108, 0.9);
}

.cloud {
  position: absolute;
  height: 9px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.92);
}

.cloud::before,
.cloud::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  background: inherit;
}

.cloud::before { width: 11px; height: 11px; left: 7px; top: -5px; }
.cloud::after { width: 8px; height: 8px; right: 8px; top: -3px; }
.cloud-a { width: 34px; left: 8%; top: 48%; animation: drift 12s ease-in-out infinite; }
.cloud-b { width: 28px; right: 6%; top: 68%; opacity: 0.8; animation: drift 15s ease-in-out infinite reverse; }
.cloud-c { width: 22px; left: 38%; top: 22%; opacity: 0.65; animation: drift 18s ease-in-out infinite; }

.win-bar { position: absolute; background: #fff8ec; box-shadow: 0 0 0 1px rgba(191, 138, 86, 0.18); }
.win-bar-v { left: 50%; top: 0; bottom: 0; width: 5px; transform: translateX(-50%); }
.win-bar-h { top: 50%; left: 0; right: 0; height: 5px; transform: translateY(-50%); }
.win-sill {
  position: absolute;
  left: -12px;
  right: -12px;
  bottom: -14px;
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(180deg, #fff8ec, #f3d9bb);
  box-shadow: 0 4px 8px rgba(135, 82, 37, 0.16);
}

.curtain {
  position: absolute;
  left: -16px;
  top: -12px;
  width: 34px;
  height: calc(100% + 26px);
  border-radius: 16px 8px 20px 10px;
  background: linear-gradient(100deg, #ffb08c, #ff8a6a 58%, #f27758);
  box-shadow: inset -4px 0 8px rgba(168, 72, 44, 0.26);
  opacity: 0.92;
  z-index: 2;
}

.curtain::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.2) 0 3px, transparent 3px 13px);
}

/* 墙上装饰 */
.wall-art {
  position: absolute;
  right: 36%;
  top: 27%;
  width: 52px;
  height: 60px;
  display: grid;
  place-items: center;
  color: #c78752;
  background: #fff9ee;
  border: 5px solid #f3d8b8;
  border-radius: 8px;
  box-shadow: 0 8px 14px rgba(132, 80, 34, 0.12);
  transform: rotate(-2.5deg);
  z-index: 2;
}
.wall-art .mp-icon { width: 24px; height: 24px; opacity: 0.8; }

.wall-shelf {
  position: absolute;
  right: 12px;
  top: 23%;
  width: clamp(82px, 23vw, 108px);
  height: 62px;
  z-index: 3;
}
.shelf-plank {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 2px;
  height: 8px;
  border-radius: 4px;
  background: linear-gradient(180deg, #e5b37b, #c98a4d);
  box-shadow: 0 5px 9px rgba(126, 74, 29, 0.2), inset 0 1px 0 #f8dab4;
}
.shelf-plant { position: absolute; left: 6px; bottom: 10px; width: 30px; height: 40px; }
.s-pot {
  position: absolute;
  left: 6px;
  bottom: 0;
  width: 19px;
  height: 15px;
  border-radius: 3px 3px 7px 7px;
  background: linear-gradient(180deg, #f8a268, #e27a3b);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.3);
}
.s-leaf {
  position: absolute;
  width: 13px;
  height: 21px;
  border-radius: 50% 50% 50% 4px;
  background: linear-gradient(160deg, #82c96c, #47924b);
  transform-origin: bottom center;
}
.s-leaf.l1 { left: 4px; bottom: 12px; transform: rotate(-28deg); }
.s-leaf.l2 { left: 10px; bottom: 15px; transform: rotate(2deg); }
.s-leaf.l3 { left: 16px; bottom: 11px; transform: rotate(30deg); }

.shelf-book {
  position: absolute;
  bottom: 10px;
  width: 8px;
  border-radius: 2px;
  box-shadow: inset 2px 0 0 rgba(255, 255, 255, 0.3);
}
.shelf-book.b1 { right: 32px; height: 25px; background: #7fb8c9; transform: rotate(-4deg); }
.shelf-book.b2 { right: 22px; height: 29px; background: #f2a06b; }
.shelf-book.b3 { right: 12px; height: 22px; background: #b5a2d8; transform: rotate(5deg); }

.big-plant {
  position: absolute;
  left: -18px;
  bottom: 4%;
  width: 92px;
  height: 118px;
  z-index: 2;
}
.big-plant .pot {
  position: absolute;
  left: 28px;
  bottom: 0;
  width: 38px;
  height: 32px;
  border-radius: 5px 5px 12px 12px;
  background: linear-gradient(180deg, #f5a36a, #dd7737);
  box-shadow: inset 0 3px 0 rgba(255, 255, 255, 0.27), 0 8px 14px rgba(125, 73, 30, 0.16);
}
.big-plant .leaf {
  position: absolute;
  width: 30px;
  height: 49px;
  border-radius: 60% 60% 50% 8%;
  background: linear-gradient(150deg, #8fd47a, #3f8a45);
  transform-origin: bottom center;
  box-shadow: inset 2px 2px 0 rgba(255, 255, 255, 0.18);
}
.big-plant .l1 { left: 20px; bottom: 26px; transform: rotate(-42deg); }
.big-plant .l2 { left: 34px; bottom: 31px; transform: rotate(-15deg); }
.big-plant .l3 { left: 48px; bottom: 29px; transform: rotate(18deg); }
.big-plant .l4 { left: 58px; bottom: 24px; transform: rotate(46deg); }

.sunbeam {
  position: absolute;
  left: -18%;
  top: 38%;
  width: 92%;
  height: 58%;
  background: linear-gradient(104deg, rgba(255, 240, 183, 0.55), rgba(255, 240, 183, 0) 66%);
  transform: rotate(7deg);
  filter: blur(4px);
  mix-blend-mode: screen;
  pointer-events: none;
  z-index: 4;
}

/* 地板 */
.floor {
  position: absolute;
  left: 0;
  right: 0;
  top: 43.2%;
  bottom: 0;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 228, 192, 0.55), transparent 16%),
    linear-gradient(180deg, #f7c894 0%, #eeb87d 52%, #dda066 100%);
}
.floor::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(180deg, rgba(137, 83, 37, 0.13) 0 2px, transparent 2px 58px),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.1) 0 1px, transparent 1px 74px);
  opacity: 0.85;
}
.floor-shine {
  position: absolute;
  left: 8%;
  top: 10%;
  width: 70%;
  height: 70%;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 244, 205, 0.55), transparent 75%);
  filter: blur(10px);
}

/* 猫爬架 */
.cat-tree {
  position: absolute;
  right: 2%;
  bottom: max(300px, 36%);
  width: clamp(100px, 29vw, 136px);
  height: clamp(154px, 24vh, 208px);
  z-index: 3;
  filter: drop-shadow(0 18px 16px rgba(125, 72, 28, 0.18));
}
.tree-base {
  position: absolute;
  left: 4%;
  right: 0;
  bottom: 0;
  height: 9%;
  border-radius: 50% 50% 10px 10px / 70% 70% 10px 10px;
  background: linear-gradient(180deg, #f6cf9c, #d09351);
  box-shadow: inset 0 3px 0 rgba(255, 255, 255, 0.34), 0 5px 10px rgba(116, 65, 26, 0.16);
}
.tree-post {
  position: absolute;
  left: 66%;
  bottom: 6%;
  width: 18%;
  height: 78%;
  border-radius: 9px;
  background:
    repeating-linear-gradient(180deg, #eec48f 0 8px, #d8a264 8px 10px),
    linear-gradient(90deg, #f5cf9d, #c88a4c);
  box-shadow: inset 3px 0 0 rgba(255, 255, 255, 0.28), inset -2px 0 0 rgba(145, 85, 36, 0.12);
}
.tree-platform {
  position: absolute;
  height: 11%;
  border-radius: 50%;
  background: linear-gradient(180deg, #f9d9ad, #d99c5b);
  box-shadow: 0 5px 8px rgba(124, 72, 28, 0.2), inset 0 2px 0 rgba(255, 255, 255, 0.42);
}
.tree-platform.p1 { left: 28%; bottom: 66%; width: 70%; }
.tree-platform.p2 { left: -2%; bottom: 43%; width: 58%; }
.tree-cubby {
  position: absolute;
  left: 1%;
  bottom: 6%;
  width: 53%;
  height: 33%;
  border-radius: 13px;
  background: linear-gradient(160deg, #f6d3a4, #dca367);
  box-shadow: inset 0 3px 0 rgba(255, 255, 255, 0.36), inset -3px 0 0 rgba(160, 98, 43, 0.12), 0 4px 8px rgba(124, 72, 28, 0.14);
  display: grid;
  place-items: center;
  color: rgba(150, 91, 44, 0.52);
}
.tree-cubby .mp-icon { width: 15px; height: 15px; position: absolute; right: 6px; bottom: 5px; opacity: .8; }
.cubby-hole {
  width: 70%;
  height: 68%;
  border-radius: 50% 50% 8px 8px;
  background: radial-gradient(120% 100% at 50% 100%, #8d5732, #b77a49 70%);
  box-shadow: inset 0 5px 8px rgba(77, 41, 19, 0.45), 0 2px 0 rgba(255, 255, 255, 0.2);
}
.tree-dangle { position: absolute; right: 13%; top: 18%; width: 18px; height: 70px; z-index: 2; }
.dangle-string { position: absolute; left: 8px; top: 0; width: 2px; height: 48px; background: #b98b58; }
.dangle-ball {
  position: absolute;
  left: 0;
  bottom: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: repeating-linear-gradient(45deg, #f4a261 0 4px, #ffe3b8 4px 8px);
  box-shadow: 0 3px 5px rgba(125, 72, 28, 0.2);
  animation: dangle 2.6s ease-in-out infinite;
  transform-origin: top center;
}

/* 地毯 */
.mode-game .cat-tree { bottom: 27%; }
.rug {
  position: absolute;
  left: 50%;
  bottom: max(258px, 33%);
  width: 82%;
  height: 14%;
  transform: translateX(-50%);
  border-radius: 50%;
  background:
    radial-gradient(closest-side, rgba(255, 255, 255, 0.75), transparent 70%),
    radial-gradient(closest-side, #fff1dc 0%, #ffe4c2 60%, #f7d3a6 100%);
  box-shadow: 0 12px 22px rgba(129, 77, 33, 0.18), inset 0 0 0 5px rgba(255, 255, 255, 0.5);
  transition: bottom 0.45s ease;
  z-index: 2;
}
.rug::after {
  content: "";
  position: absolute;
  inset: 14%;
  border-radius: 50%;
  border: 2px dashed rgba(214, 160, 101, 0.36);
}
.mode-game .rug { bottom: max(160px, 32%); }
.mode-end .rug { bottom: max(160px, 32%); }

/* 猫猫 */
.cat {
  position: absolute;
  left: 50%;
  bottom: max(292px, 34%);
  width: clamp(176px, 53vw, 248px);
  transform: translateX(-50%);
  z-index: 6;
  cursor: pointer;
  transition: bottom 0.45s cubic-bezier(0.2, 0.9, 0.3, 1), filter 0.4s ease;
  will-change: bottom;
}
.cat-svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
  filter: drop-shadow(0 15px 12px rgba(118, 67, 26, 0.18));
  transform-origin: 50% 94%;
  animation: breathe 3.9s ease-in-out infinite;
}
.mode-game .cat { bottom: max(196px, 24%); }
.mode-end .cat { bottom: max(180px, 23%); filter: saturate(0.82) brightness(0.9); cursor: default; }

.cat .eye-happy,
.cat .eye-sleep,
.cat .mouth-open { display: none; }

.cat.is-happy .eye-open,
.cat.is-eating .eye-open,
.cat.is-sleepy .eye-open { display: none; }
.cat.is-happy .eye-happy,
.cat.is-eating .eye-happy { display: block; }
.cat.is-happy .mouth-smile,
.cat.is-eating .mouth-smile { display: none; }
.cat.is-happy .mouth-open,
.cat.is-eating .mouth-open { display: block; }
.cat.is-sleepy .eye-sleep { display: block; }
.cat.is-sleepy .mouth-open { display: none; }

.cat .tail { transform-origin: 72% 80%; transform-box: fill-box; animation: tailWag 3s ease-in-out infinite; }
.cat.is-excited .tail { animation-duration: 1.1s; }
.cat.is-happy .tail { animation-duration: 1.8s; }
.cat .ear-l { transform-origin: 78% 92%; transform-box: fill-box; animation: earTwitch 6.5s ease-in-out infinite; }
.cat .ear-r { transform-origin: 22% 92%; transform-box: fill-box; animation: earTwitch 7.4s ease-in-out infinite reverse; }

.eye-open {
  transform-box: fill-box;
  transform-origin: center;
  animation: blink 5.4s infinite;
}

.cat.pet-bounce .cat-svg { animation: catBounce 0.46s cubic-bezier(0.2, 1.4, 0.4, 1); }
.cat.is-excited .cat-svg { animation: catExcited 0.6s ease-in-out 2; }
.cat.is-eating .cat-svg { animation: catChew 0.42s ease-in-out 3; }

.cat-blush-aura {
  position: absolute;
  left: 50%;
  top: 48%;
  width: 70%;
  height: 46%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 143, 170, 0.34), transparent 72%);
  opacity: 0;
  transition: opacity 0.25s;
  pointer-events: none;
  z-index: -1;
}
.cat.is-happy .cat-blush-aura,
.cat.is-eating .cat-blush-aura { opacity: 1; }

/* 猫猫头顶的爱心 */
.cat-hearts {
  position: absolute;
  left: 50%;
  top: 8%;
  width: 88%;
  height: 46%;
  transform: translateX(-50%);
  pointer-events: none;
}
.cat-hearts .mp-icon {
  position: absolute;
  color: #ff7e9f;
  opacity: 0;
  filter: drop-shadow(0 3px 5px rgba(196, 64, 94, 0.22));
  animation: ambientHeart 4.4s ease-in-out infinite;
}
.cat-hearts .h1 { left: 86%; top: 8%; width: 17px; height: 17px; animation-delay: 0.2s; }
.cat-hearts .h2 { left: 97%; top: 22%; width: 12px; height: 12px; animation-delay: 1.7s; }
.cat-hearts .h3 { left: 76%; top: 24%; width: 10px; height: 10px; animation-delay: 3s; }
.mode-end .cat-hearts { display: none; }

/* 玩具球 */
.toy-ball {
  position: absolute;
  left: 63%;
  bottom: max(274px, 32%);
  width: clamp(28px, 8vw, 38px);
  aspect-ratio: 1;
  border-radius: 50%;
  z-index: 5;
  background:
    radial-gradient(circle at 32% 28%, rgba(255, 255, 255, 0.62), transparent 40%),
    repeating-conic-gradient(from 0deg, #ff8a3d 0deg 28deg, #ffd29b 28deg 60deg);
  box-shadow: 0 6px 10px rgba(122, 68, 25, 0.2), inset -3px -4px 0 rgba(164, 88, 33, 0.12);
  transition: bottom 0.45s ease;
}
.mode-game .toy-ball { bottom: max(180px, 25%); }
.toy-ball.is-rolling { animation: ballRoll 0.9s cubic-bezier(0.2, 0.8, 0.3, 1); }

/* 饭盆 */
.bowl {
  position: absolute;
  left: 13%;
  bottom: max(276px, 33%);
  width: clamp(46px, 13vw, 62px);
  height: 30px;
  z-index: 5;
  transition: bottom 0.45s ease;
}
.mode-game .bowl { bottom: max(183px, 26%); }
.bowl-body {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 21px;
  border-radius: 6px 6px 16px 16px;
  background: linear-gradient(180deg, #ffd9ab, #e99751);
  box-shadow: inset 0 3px 0 rgba(255, 255, 255, 0.5), 0 6px 10px rgba(124, 71, 27, 0.16);
}
.bowl-body::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 5px;
  width: 10px;
  height: 7px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: rgba(139, 78, 30, 0.25);
}
.bowl-food {
  position: absolute;
  left: 7%;
  right: 7%;
  bottom: 15px;
  height: 13px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 25% 40%, #b56d3a 0 3px, transparent 3.5px),
    radial-gradient(circle at 55% 30%, #c47a41 0 3px, transparent 3.5px),
    radial-gradient(circle at 78% 55%, #a96131 0 3px, transparent 3.5px),
    #d18a4d;
  opacity: 0;
  transform: translateY(6px) scale(0.8);
  transition: opacity 0.25s, transform 0.3s;
  z-index: 2;
}
.bowl.is-full .bowl-food { opacity: 1; transform: none; }

/* 睡觉 zzz */
.zzz {
  position: absolute;
  left: 61%;
  bottom: 44%;
  z-index: 8;
  color: #fff6df;
  font-weight: 900;
  text-shadow: 0 2px 8px rgba(70, 35, 60, 0.35);
  opacity: 0;
  transition: opacity 0.5s;
}
.zzz span { position: absolute; font-size: 18px; animation: zfloat 2.8s ease-in-out infinite; }
.zzz span:nth-child(1) { left: 0; top: 0; }
.zzz span:nth-child(2) { left: 16px; top: -18px; font-size: 14px; animation-delay: 0.5s; }
.zzz span:nth-child(3) { left: 28px; top: -34px; font-size: 11px; animation-delay: 1s; }
.mode-end .zzz { opacity: 1; }

/* 飘落光点 */
.dust { position: absolute; inset: 0; pointer-events: none; z-index: 4; opacity: 0.7; }
.dust span {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(255, 246, 208, 0.9);
  box-shadow: 0 0 6px rgba(255, 238, 186, 0.9);
  animation: dustFloat 7s linear infinite;
}
.dust span:nth-child(1) { left: 18%; top: 46%; animation-delay: 0s; }
.dust span:nth-child(2) { left: 34%; top: 34%; animation-delay: 1.6s; }
.dust span:nth-child(3) { left: 57%; top: 41%; animation-delay: 3.2s; }
.dust span:nth-child(4) { left: 74%; top: 33%; animation-delay: 2.2s; }
.dust span:nth-child(5) { left: 46%; top: 55%; animation-delay: 4.6s; }
.dust span:nth-child(6) { left: 84%; top: 52%; animation-delay: 5.4s; }

/* ============================================================
   顶部玩家栏
   ============================================================ */
.hud-layer {
  position: absolute;
  z-index: 20;
  transition: opacity 0.32s ease, transform 0.42s cubic-bezier(0.2, 0.9, 0.3, 1);
}

.start-hud {
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  padding: calc(var(--safe-top) + 5px) 14px 0;
  pointer-events: none;
}

.player-card {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  max-width: 66%;
  padding: 7px 12px 7px 8px;
  border-radius: 22px;
  background: linear-gradient(120deg, rgba(255, 252, 246, 0.9), rgba(255, 243, 225, 0.82));
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 8px 20px rgba(124, 71, 27, 0.15), inset 0 1px 0 #fff;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.avatar-wrap { position: relative; flex: 0 0 auto; width: 50px; height: 50px; }
.avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  overflow: hidden;
  background: linear-gradient(160deg, #ffe2b8, #ffbe7c);
  border: 2px solid #fffaf2;
  box-shadow: 0 3px 7px rgba(136, 77, 28, 0.2);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-face { width: 100%; height: 100%; display: block; }
.lv-badge {
  position: absolute;
  left: 50%;
  bottom: -6px;
  transform: translateX(-50%);
  padding: 1px 7px;
  white-space: nowrap;
  border-radius: 999px;
  background: linear-gradient(180deg, #ff9d4d, #f2701c);
  color: #fff;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.2px;
  box-shadow: 0 2px 5px rgba(166, 78, 18, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.player-info { display: flex; flex-direction: column; min-width: 0; gap: 2px; }
.player-name {
  font-size: 13.5px;
  font-weight: 800;
  letter-spacing: 0.1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 150px;
}
.player-stage { font-size: 9.5px; color: var(--muted); white-space: nowrap; }
.exp-line { display: flex; align-items: center; gap: 5px; margin-top: 1px; }
.exp-track {
  width: 80px;
  height: 5px;
  border-radius: 999px;
  background: rgba(203, 157, 114, 0.3);
  overflow: hidden;
}
.exp-fill {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ffb84d, #ff8a3d);
  transition: width 0.4s ease;
}
.exp-line small { font-size: 8.5px; color: var(--muted); letter-spacing: -0.2px; }

.wallet { display: flex; flex-direction: column; gap: 5px; align-items: flex-end; }
.wallet-pill {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 96px;
  height: 31px;
  padding: 0 9px 0 4px;
  border-radius: 999px;
  background: linear-gradient(120deg, rgba(255, 252, 246, 0.92), rgba(255, 241, 219, 0.84));
  border: 1px solid rgba(255, 255, 255, 0.92);
  box-shadow: 0 6px 14px rgba(124, 71, 27, 0.13), inset 0 1px 0 #fff;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.wallet-ico {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  color: #fff;
  flex: 0 0 auto;
}
.fish-pill .wallet-ico { background: linear-gradient(160deg, #ffb347, #ff8a3d); box-shadow: 0 2px 5px rgba(221, 121, 36, 0.34); }
.heart-pill .wallet-ico { background: linear-gradient(160deg, #ff9ab7, #ff5c8a); box-shadow: 0 2px 5px rgba(214, 77, 117, 0.3); }
.wallet-ico .mp-icon { width: 15px; height: 15px; }
.wallet-pill b { font-size: 13px; font-weight: 900; font-variant-numeric: tabular-nums; }
.wallet-label { font-size: 8.5px; color: var(--muted); margin-left: auto; }

/* ============================================================
   开始面板
   ============================================================ */
.start-panel {
  left: 0;
  right: 0;
  bottom: 0;
  padding: 0 16px calc(var(--safe-bottom) + 10px);
}

.start-card {
  width: 100%;
  max-width: 470px;
  margin: 0 auto;
  padding: 15px 16px 13px;
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(255, 251, 244, 0.96), rgba(255, 243, 227, 0.98));
  border: 1px solid rgba(255, 255, 255, 0.95);
  box-shadow: var(--shadow-card);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}

.start-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.day-pill,
.mood-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 25px;
  padding: 0 10px 0 7px;
  border-radius: 999px;
  font-size: 10.5px;
  color: var(--ink-soft);
  background: #fff4e2;
  border: 1px solid rgba(236, 204, 168, 0.7);
  white-space: nowrap;
}
.day-pill { color: #d97a24; background: #fff1dd; }
.day-pill b { font-size: 12px; }
.day-pill .mp-icon { width: 14px; height: 14px; color: #f5a623; }
.mood-pill { padding-right: 11px; }
.mood-pill .mp-icon { width: 14px; height: 14px; color: var(--pink); }
.mood-pill b { font-weight: 700; font-size: 10.5px; color: var(--ink-soft); }
.mood-pill.low { background: #fff0ee; border-color: #f6cbc5; }
.mood-pill.low .mp-icon, .mood-pill.low b { color: #d96a60; }

.brand {
  margin: 9px 0 2px;
  font-size: clamp(25px, 7vw, 31px);
  line-height: 1.14;
  font-weight: 900;
  letter-spacing: 0.5px;
  color: #4a3020;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
}
.brand::after {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-left: 5px;
  border-radius: 50%;
  background: var(--orange);
  vertical-align: 9px;
  box-shadow: 0 0 0 4px rgba(255, 138, 61, 0.16);
}
.brand-sub {
  margin: 0 0 11px;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--ink-soft);
}

.quick-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin-bottom: 11px;
  padding: 7px 4px;
  border-radius: 15px;
  background: #fff4e4;
  border: 1px solid rgba(240, 211, 178, 0.72);
}
.quick { display: flex; flex-direction: column; align-items: center; gap: 1px; position: relative; }
.quick + .quick::before {
  content: "";
  position: absolute;
  left: 0;
  top: 15%;
  bottom: 15%;
  width: 1px;
  background: rgba(226, 191, 153, 0.6);
}
.quick b { font-size: 14px; font-weight: 900; color: #6b452b; font-variant-numeric: tabular-nums; }
.quick span { font-size: 8.5px; color: var(--muted); letter-spacing: 0.3px; }

.offline-note {
  display: flex;
  align-items: center;
  gap: 5px;
  margin: 0 0 9px;
  padding: 6px 10px;
  border-radius: 11px;
  background: rgba(255, 224, 186, 0.62);
  color: #a8642b;
  font-size: 10px;
  line-height: 1.3;
}
.offline-note .mp-icon { width: 14px; height: 14px; color: #e88734; }

.btn-primary {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: 61px;
  padding: 0 13px 0 11px;
  border-radius: 20px;
  overflow: hidden;
  text-align: left;
  color: #fff;
  background: linear-gradient(150deg, #ffae5c 0%, #ff8a3d 48%, #f4741d 100%);
  box-shadow:
    0 11px 22px rgba(228, 108, 28, 0.36),
    inset 0 2px 0 rgba(255, 255, 255, 0.42),
    inset 0 -3px 0 rgba(180, 75, 12, 0.18);
  transition: transform 0.14s ease, box-shadow 0.14s ease, filter 0.14s ease;
}
.btn-primary::after {
  content: "";
  position: absolute;
  left: -40%;
  top: -60%;
  width: 80%;
  height: 180%;
  background: linear-gradient(100deg, rgba(255, 255, 255, 0.36), transparent 70%);
  transform: rotate(10deg);
  pointer-events: none;
}
.btn-primary:active {
  transform: translateY(2px) scale(0.988);
  box-shadow: 0 4px 10px rgba(228, 108, 28, 0.28), inset 0 2px 0 rgba(255, 255, 255, 0.36);
  filter: saturate(1.05);
}
.btn-ico {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 39px;
  height: 39px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3);
}
.btn-ico .mp-icon { width: 23px; height: 23px; }
.btn-copy { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.btn-copy b { font-size: 16.5px; font-weight: 900; letter-spacing: 0.4px; }
.btn-copy small { font-size: 9.5px; opacity: 0.88; letter-spacing: 0.2px; }
.btn-arrow { width: 21px; height: 21px; margin-left: auto; opacity: 0.78; }

.start-btn { animation: ctaGlow 3.2s ease-in-out infinite; }

.tiny-hint {
  margin: 8px 0 0;
  text-align: center;
  font-size: 9.5px;
  color: #b28d6d;
  letter-spacing: 0.2px;
}

/* ============================================================
   局内 HUD
   ============================================================ */
.game-hud {
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: calc(var(--safe-top) + 7px) 14px 0;
  opacity: 0;
  transform: translateY(-10px);
  pointer-events: none;
}
.mode-game .game-hud { opacity: 1; transform: none; }

.game-wallet { display: flex; flex-direction: column; gap: 6px; }
.mini-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  width: fit-content;
  height: 34px;
  padding: 0 12px 0 7px;
  border-radius: 999px;
  color: #7a4a22;
  background: linear-gradient(120deg, rgba(255, 252, 246, 0.94), rgba(255, 241, 219, 0.84));
  border: 1px solid rgba(255, 255, 255, 0.95);
  box-shadow: 0 6px 14px rgba(124, 71, 27, 0.15);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  font-size: 14px;
}
.mini-pill .mp-icon { width: 20px; height: 20px; color: #ee832f; }
.mini-pill.pink .mp-icon { color: var(--pink); }
.mini-pill b { font-weight: 900; font-variant-numeric: tabular-nums; min-width: 20px; }

.timer {
  --p: 100;
  position: relative;
  flex: 0 0 auto;
  width: 63px;
  height: 63px;
  padding: 5px;
  border-radius: 50%;
  background: conic-gradient(#ff9a4d calc(var(--p) * 1%), rgba(255, 255, 255, 0.5) 0);
  box-shadow: 0 8px 20px rgba(124, 71, 27, 0.2), 0 0 0 1px rgba(255, 255, 255, 0.65);
}
.timer-inner {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: linear-gradient(180deg, #fffdf8, #fff2df);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1;
  box-shadow: inset 0 2px 4px rgba(178, 118, 62, 0.14);
}
.timer-inner b { font-size: 21px; font-weight: 900; color: #e4751e; font-variant-numeric: tabular-nums; }
.timer-inner span { font-size: 8px; color: var(--muted); margin-top: 2px; }
.timer-glow {
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  border: 2px solid rgba(255, 138, 61, 0.22);
  pointer-events: none;
}
.timer.is-urgent { animation: urgentPulse 0.9s ease-in-out infinite; }
.timer.is-urgent .timer-inner b { color: #f04f5c; }

.combo-chip {
  position: absolute;
  left: 50%;
  top: calc(var(--safe-top) + 76px);
  z-index: 22;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px 12px 5px 9px;
  border-radius: 999px;
  background: rgba(255, 251, 244, 0.93);
  border: 1px solid rgba(255, 208, 153, 0.9);
  color: #e4751e;
  box-shadow: 0 6px 16px rgba(137, 77, 29, 0.16);
  font-size: 11px;
  font-weight: 800;
  opacity: 0;
  transform: translate(-50%, -6px) scale(0.9);
  pointer-events: none;
  transition: opacity 0.18s, transform 0.22s cubic-bezier(0.2, 1.4, 0.4, 1);
}
.combo-chip .mp-icon { width: 15px; height: 15px; }
.combo-chip.is-on { opacity: 1; transform: translate(-50%, 0) scale(1); }

/* ============================================================
   局内底部
   ============================================================ */
.game-bottom {
  left: 0;
  right: 0;
  bottom: 0;
  padding: 0 16px calc(var(--safe-bottom) + 9px);
  opacity: 0;
  transform: translateY(16px);
  pointer-events: none;
}
.mode-game .game-bottom { opacity: 1; transform: none; pointer-events: auto; }

.stat-card {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
  padding: 9px 12px 10px;
  border-radius: 19px;
  background: linear-gradient(180deg, rgba(255, 252, 246, 0.95), rgba(255, 244, 231, 0.94));
  border: 1px solid rgba(255, 255, 255, 0.92);
  box-shadow: 0 10px 24px rgba(124, 71, 27, 0.17), inset 0 1px 0 #fff;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}
.stat { min-width: 0; }
.stat-head { display: flex; align-items: center; gap: 3px; margin-bottom: 5px; color: var(--muted); }
.stat-head .mp-icon { width: 13px; height: 13px; }
.stat-head span { font-size: 9px; letter-spacing: 0.2px; }
.stat-head b { margin-left: auto; font-size: 10px; color: var(--ink); font-variant-numeric: tabular-nums; }
.stat-track { height: 6px; border-radius: 999px; background: rgba(203, 161, 121, 0.28); overflow: hidden; }
.stat-fill {
  display: block;
  height: 100%;
  width: 50%;
  border-radius: inherit;
  transition: width 0.22s linear;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
}
.stat-fill.full { background: linear-gradient(90deg, #ffc163, #ff8a3d); }
.stat-fill.mood { background: linear-gradient(90deg, #ffb0c7, #ff5c8a); }
.stat-fill.energy { background: linear-gradient(90deg, #ffe27a, #ffbe2e); }

.dock {
  display: flex;
  align-items: flex-start;
  justify-content: space-around;
  gap: 4px;
  margin-top: 9px;
  padding: 6px 6px 2px;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255, 248, 238, 0.9), rgba(255, 238, 216, 0.92));
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 12px 26px rgba(124, 71, 27, 0.18), inset 0 1px 0 #fff;
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}
.act {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 2px 0 5px;
  border-radius: 17px;
  transition: transform 0.12s ease, background 0.12s ease;
}
.act:active { transform: scale(0.94); background: rgba(255, 226, 193, 0.5); }
.act.is-locked .act-orb { filter: grayscale(0.45); opacity: 0.58; }
.act.is-locked .act-name { color: #b09a86; }
.act-orb {
  position: relative;
  display: grid;
  place-items: center;
  width: clamp(50px, 14vw, 62px);
  height: clamp(50px, 14vw, 62px);
  border-radius: 50%;
  color: #b26a2b;
  background: linear-gradient(180deg, #fffaf1, #ffedda);
  border: 2px solid rgba(255, 255, 255, 0.95);
  box-shadow: 0 7px 14px rgba(139, 82, 33, 0.2), inset 0 -3px 0 rgba(235, 177, 118, 0.28);
  transition: transform 0.12s ease;
}
.act:active .act-orb { transform: translateY(1px) scale(0.97); }
.act-orb .mp-icon { width: 26px; height: 26px; }
.act-pet .act-orb { color: #dd8a34; }
.act-feed .act-orb {
  color: #fff;
  background: linear-gradient(150deg, #ffb45c, #ff8a3d 55%, #f47a22);
  box-shadow: 0 7px 14px rgba(225, 109, 28, 0.32), inset 0 2px 0 rgba(255, 255, 255, 0.35);
}
.act-play .act-orb {
  color: #fff;
  background: linear-gradient(150deg, #ff9fc0, #ff719b 60%, #f45c88);
  box-shadow: 0 7px 14px rgba(215, 78, 122, 0.28), inset 0 2px 0 rgba(255, 255, 255, 0.35);
}
.act-cost {
  position: absolute;
  top: -4px;
  right: -3px;
  min-width: 20px;
  height: 19px;
  padding: 0 5px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #4a3527;
  color: #fff8ee;
  font-style: normal;
  font-size: 9px;
  font-weight: 800;
  border: 2px solid #fff8ee;
  box-shadow: 0 2px 5px rgba(74, 53, 39, 0.26);
}
.act-name { font-size: 12px; font-weight: 800; color: #6b452b; letter-spacing: 0.2px; }
.act-sub { font-size: 8.5px; color: var(--muted); }


/* ============================================================
   飘落可点物
   ============================================================ */
.pickups { position: absolute; inset: 0; z-index: 12; pointer-events: none; overflow: hidden; }
.pickup {
  position: absolute;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  pointer-events: auto;
  border: 2px solid rgba(255, 255, 255, 0.95);
  box-shadow: 0 8px 18px rgba(124, 71, 27, 0.28), inset 0 2px 0 rgba(255, 255, 255, 0.42);
  animation: floatUp var(--dur, 5s) linear forwards;
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}
.pickup .mp-icon { width: 24px; height: 24px; }
.pickup.fish { background: linear-gradient(160deg, #ffc25c, #ff8a3d 65%, #f47622); }
.pickup.heart { background: linear-gradient(160deg, #ffa3bf, #ff5c8a 65%, #ef4b7b); }
.pickup::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px dashed rgba(255, 255, 255, 0.72);
  animation: spin 3.4s linear infinite;
}
.pickup:active { transform: scale(0.9); }
.pickup.out { animation: none; opacity: 0; transform: scale(0.6); transition: opacity 0.25s, transform 0.25s; }

/* ============================================================
   结算
   ============================================================ */
.night-veil {
  position: absolute;
  inset: 0;
  z-index: 9;
  opacity: 0;
  pointer-events: none;
  background:
    radial-gradient(2px 2px at 18% 17%, rgba(255, 246, 210, 0.9), transparent 62%),
    radial-gradient(2px 2px at 34% 11%, rgba(255, 246, 210, 0.7), transparent 62%),
    radial-gradient(1.5px 1.5px at 63% 19%, rgba(255, 246, 210, 0.8), transparent 62%),
    radial-gradient(2px 2px at 82% 13%, rgba(255, 246, 210, 0.7), transparent 62%),
    radial-gradient(1.5px 1.5px at 73% 32%, rgba(255, 246, 210, 0.55), transparent 62%),
    linear-gradient(180deg, rgba(42, 29, 70, 0.72) 0%, rgba(83, 48, 73, 0.44) 54%, rgba(255, 132, 55, 0.16) 100%);
  transition: opacity 0.55s ease;
}
.mode-end .night-veil { opacity: 1; }

.result-layer {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(var(--safe-top) + 12px) 16px calc(var(--safe-bottom) + 12px);
  background: rgba(32, 20, 34, 0.18);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.32s ease;
}
.mode-end .result-layer { opacity: 1; pointer-events: auto; }

.result-card {
  width: 100%;
  max-width: 400px;
  max-height: 100%;
  overflow-y: auto;
  padding: 18px 17px 15px;
  border-radius: 28px;
  background: linear-gradient(180deg, #fffdf8 0%, #fff5e7 62%, #ffefd9 100%);
  border: 1px solid rgba(255, 255, 255, 0.96);
  box-shadow: 0 28px 60px rgba(26, 14, 31, 0.4), inset 0 1px 0 #fff;
  transform: translateY(26px) scale(0.96);
  transition: transform 0.5s cubic-bezier(0.2, 0.9, 0.3, 1.16);
  scrollbar-width: none;
}
.result-card::-webkit-scrollbar { display: none; }
.mode-end .result-card { transform: none; }

.result-head { text-align: center; }
.result-kicker {
  display: inline-flex;
  padding: 3px 10px;
  border-radius: 999px;
  background: #fff0da;
  border: 1px solid #f5d6ae;
  color: #bc7a3f;
  font-size: 9.5px;
  letter-spacing: 0.5px;
}
.rating-badge {
  width: 72px;
  height: 72px;
  margin: 10px auto 8px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: linear-gradient(150deg, #ffc25c, #ff8a3d 62%, #f4741d);
  box-shadow: 0 10px 22px rgba(226, 113, 30, 0.32), inset 0 2px 0 rgba(255, 255, 255, 0.45);
  position: relative;
}
.rating-badge::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px dashed rgba(255, 168, 92, 0.55);
}
.rating-badge b { font-size: 31px; line-height: 1; font-weight: 900; letter-spacing: -1px; }
.rating-badge span { font-size: 8px; margin-top: 2px; opacity: 0.96; letter-spacing: 0.5px; }
.rating-badge.grade-S { background: linear-gradient(150deg, #ffd766, #ffb020 60%, #e88a00); }
.rating-badge.grade-A { background: linear-gradient(150deg, #ffb45c, #ff8a3d 60%, #ef6f19); }
.rating-badge.grade-B { background: linear-gradient(150deg, #8fd8c4, #55bfa0 60%, #32a383); }
.rating-badge.grade-C { background: linear-gradient(150deg, #b8b3ca, #8d86a8 60%, #756d8e); }

.result-head h2 {
  margin: 0 0 4px;
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 0.3px;
  color: #4a3020;
}
.result-head p { margin: 0; font-size: 10.5px; line-height: 1.45; color: var(--ink-soft); }

.result-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  margin: 13px 0 11px;
}
.res-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 9px 2px 8px;
  border-radius: 15px;
  background: #fff7eb;
  border: 1px solid rgba(240, 208, 170, 0.7);
}
.res-ico {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  color: #fff;
  margin-bottom: 2px;
}
.res-ico .mp-icon { width: 15px; height: 15px; }
.res-ico.pink { background: linear-gradient(160deg, #ff9ab7, #ff5c8a); }
.res-ico.orange { background: linear-gradient(160deg, #ffb347, #ff8a3d); }
.res-ico.mint { background: linear-gradient(160deg, #7fd7b9, #4bb894); }
.res-stat b { font-size: 16px; font-weight: 900; color: #5a3a24; font-variant-numeric: tabular-nums; }
.res-stat > span:last-child { font-size: 8.5px; color: var(--muted); }

.level-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 14px;
  background: #fff4e3;
  border: 1px solid rgba(239, 207, 169, 0.7);
}
.level-tag {
  flex: 0 0 auto;
  padding: 3px 8px;
  border-radius: 999px;
  background: linear-gradient(180deg, #ff9d4d, #f2701c);
  color: #fff;
  font-size: 9.5px;
  font-weight: 800;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4);
}
.level-progress { flex: 1 1 auto; min-width: 0; }
.level-track { height: 6px; border-radius: 999px; background: rgba(203, 161, 121, 0.3); overflow: hidden; }
.level-track span {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ffc163, #ff8a3d);
  transition: width 0.6s ease;
}
.level-progress small { display: block; margin-top: 3px; font-size: 8px; color: var(--muted); }
.level-up-tag {
  flex: 0 0 auto;
  padding: 2px 7px;
  border-radius: 999px;
  background: #ffe1b8;
  color: #d2761f;
  font-size: 8.5px;
  font-weight: 800;
  border: 1px solid #f6c78b;
}

.result-actions { margin-top: 11px; display: flex; flex-direction: column; gap: 7px; }
.result-actions .btn-primary { height: 57px; }
.btn-ghost {
  width: 100%;
  height: 42px;
  border-radius: 14px;
  background: #fffaf2;
  border: 1.5px solid #f0d3b4;
  color: #a06335;
  font-size: 12.5px;
  font-weight: 700;
  transition: transform 0.12s ease, background 0.12s ease;
}
.btn-ghost:active { transform: scale(0.985); background: #fff1df; }

/* ============================================================
   升级庆祝 / 特效 / toast
   ============================================================ */
.levelup-layer {
  position: absolute;
  inset: 0;
  z-index: 45;
  display: grid;
  place-items: center;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(circle at 50% 46%, rgba(255, 194, 92, 0.3), transparent 58%);
  transition: opacity 0.25s ease;
}
.levelup-layer.show { opacity: 1; }
.levelup-card {
  position: relative;
  width: 210px;
  padding: 18px 14px 15px;
  border-radius: 24px;
  text-align: center;
  background: linear-gradient(180deg, #fffdf7, #fff0d8);
  border: 1px solid rgba(255, 255, 255, 0.95);
  box-shadow: 0 22px 50px rgba(35, 19, 38, 0.36), inset 0 1px 0 #fff;
  transform: scale(0.7);
}
.levelup-layer.show .levelup-card { animation: levelupPop 0.65s cubic-bezier(0.2, 1.3, 0.35, 1) forwards; }
.levelup-ring {
  width: 64px;
  height: 64px;
  margin: 0 auto 7px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(150deg, #ffc25c, #ff8a3d 60%, #f2701c);
  box-shadow: 0 8px 18px rgba(228, 112, 26, 0.38), inset 0 2px 0 rgba(255, 255, 255, 0.45);
  animation: ringPulse 1.4s ease-in-out infinite;
}
.levelup-ring .mp-icon { width: 34px; height: 34px; }
.levelup-card b { display: block; font-size: 18px; font-weight: 900; color: #4a3020; letter-spacing: 1px; }
.levelup-card > span { display: block; margin-top: 3px; font-size: 10px; color: var(--ink-soft); }
.levelup-spark {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: #ffbe3d;
  animation: sparkle 1.2s ease-in-out infinite;
}
.levelup-spark.s1 { left: 14px; top: 22px; }
.levelup-spark.s2 { right: 18px; top: 38px; animation-delay: 0.2s; background: #ff8a3d; }
.levelup-spark.s3 { left: 30px; bottom: 22px; animation-delay: 0.4s; background: #ff9bb8; }
.levelup-spark.s4 { right: 28px; bottom: 16px; animation-delay: 0.6s; background: #6fd0b1; }

.fx-layer { position: absolute; inset: 0; z-index: 38; pointer-events: none; overflow: hidden; }
.fx-score {
  position: absolute;
  transform: translate(-50%, -50%);
  font-size: 15px;
  font-weight: 900;
  color: #fff;
  white-space: nowrap;
  text-shadow: 0 2px 0 rgba(176, 80, 14, 0.75), 0 0 10px rgba(255, 190, 110, 0.7);
  animation: scoreFloat 0.95s cubic-bezier(0.2, 0.7, 0.3, 1) forwards;
}
.fx-score.pink { color: #fff; text-shadow: 0 2px 0 rgba(178, 54, 93, 0.78), 0 0 9px rgba(255, 210, 226, 0.7); }
.fx-score.gold { color: #fff6c9; text-shadow: 0 2px 0 rgba(176, 105, 10, 0.78), 0 0 9px rgba(255, 240, 180, 0.7); }
.fx-heart {
  position: absolute;
  width: 15px;
  height: 15px;
  color: #ff7f9f;
  animation: heartPop 0.9s ease-out forwards;
  filter: drop-shadow(0 1px 1px rgba(188, 61, 96, 0.3));
}
.fx-heart .mp-icon { width: 100%; height: 100%; display: block; }
.fx-confetti {
  position: absolute;
  width: 7px;
  height: 11px;
  border-radius: 2px;
  animation: confettiFall 1.5s cubic-bezier(0.15, 0.6, 0.4, 1) forwards;
}

.toast {
  position: absolute;
  left: 50%;
  top: calc(var(--safe-top) + 116px);
  z-index: 60;
  max-width: calc(100% - 48px);
  padding: 9px 15px;
  border-radius: 999px;
  background: rgba(66, 45, 33, 0.93);
  color: #fff8ee;
  font-size: 11.5px;
  line-height: 1.35;
  text-align: center;
  box-shadow: 0 10px 26px rgba(55, 31, 18, 0.28);
  opacity: 0;
  transform: translate(-50%, -8px) scale(0.94);
  pointer-events: none;
  transition: opacity 0.22s, transform 0.26s cubic-bezier(0.2, 1.2, 0.4, 1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.toast.is-show { opacity: 1; transform: translate(-50%, 0) scale(1); }

/* ============================================================
   模式切换
   ============================================================ */
.mode-start .game-hud,
.mode-start .game-bottom,
.mode-start .combo-chip { opacity: 0; transform: translateY(14px); pointer-events: none; }
.mode-start .game-hud { transform: translateY(-10px); }

.mode-game .start-hud,
.mode-game .start-panel { opacity: 0; transform: translateY(14px); pointer-events: none; }
.mode-end .start-hud,
.mode-end .start-panel,
.mode-end .game-hud,
.mode-end .game-bottom,
.mode-end .combo-chip { opacity: 0; transform: translateY(14px); pointer-events: none; }

/* ============================================================
   自适应
   ============================================================ */
@media (max-width: 380px) {
  .start-hud { padding-left: 12px; padding-right: 12px; }
  .start-panel { padding-left: 12px; padding-right: 12px; }
  .player-card { padding-right: 9px; gap: 7px; }
  .avatar-wrap, .avatar { width: 44px; height: 44px; }
  .player-name { max-width: 116px; font-size: 12.5px; }
  .player-stage { font-size: 8.5px; }
  .exp-track { width: 64px; }
  .wallet-pill { min-width: 86px; height: 29px; }
  .wallet-label { display: none; }
  .brand { font-size: 24px; }
  .brand-sub { font-size: 10.5px; }
  .quick b { font-size: 12.5px; }
  .start-card { padding-left: 13px; padding-right: 13px; }
  .act-name { font-size: 11px; }
  .game-bottom { padding-left: 12px; padding-right: 12px; }
  .stat-card { gap: 6px; padding-left: 9px; padding-right: 9px; }
  .stat-head span { font-size: 8px; }
}

@media (max-height: 740px) {
  .start-card { padding-top: 11px; padding-bottom: 9px; border-radius: 24px; }
  .brand { margin-top: 6px; font-size: 24px; }
  .brand-sub { margin-bottom: 8px; }
  .quick-stats { display: none; }
  .start-meta { justify-content: flex-start; gap: 6px; }
  .mood-pill { margin-left: auto; }
  .btn-primary { height: 55px; }
  .start-btn .btn-copy b { font-size: 15.5px; }
  .tiny-hint { margin-top: 6px; }
  .cat { width: clamp(158px, 48vw, 212px); bottom: max(216px, 32%); }
  .mode-game .cat { bottom: max(184px, 24.5%); }
  .rug { bottom: max(190px, 32%); }
  .mode-game .rug { bottom: max(154px, 32%); }
  .cat-tree { bottom: max(222px, 36%); }
  .mode-game .cat-tree { bottom: 27%; }
  .toy-ball { bottom: max(206px, 32%); }
  .mode-game .toy-ball { bottom: max(170px, 25%); }
  .bowl { bottom: max(208px, 33%); }
  .mode-game .bowl { bottom: max(173px, 26%); }
  .game-bottom { padding-bottom: calc(var(--safe-bottom) + 6px); }
  .stat-card { padding-top: 7px; padding-bottom: 8px; }
  .dock { margin-top: 7px; padding-top: 4px; }
  .act { padding-bottom: 3px; }
  .result-card { padding-top: 15px; padding-bottom: 12px; }
  .rating-badge { width: 62px; height: 62px; margin: 7px auto 6px; }
  .rating-badge b { font-size: 27px; }
  .result-stats { margin: 9px 0; }
  .result-head h2 { font-size: 18px; }
  .result-actions .btn-primary { height: 52px; }
}

@media (max-height: 620px) {
  .brand-sub { display: none; }
  .brand { margin-bottom: 8px; }
  .start-card { padding-top: 9px; padding-bottom: 7px; }
  .start-btn { height: 50px; }
  .start-btn .btn-ico { width: 32px; height: 32px; }
  .start-btn .btn-copy small { display: none; }
  .tiny-hint { display: none; }
  .cat { width: clamp(140px, 42vw, 186px); bottom: max(192px, 31.5%); }
  .mode-game .cat { bottom: max(172px, 24%); }
  .cat-tree { bottom: max(198px, 36%); }
  .rug { bottom: max(166px, 32%); }
  .stat-card { padding-top: 5px; padding-bottom: 6px; }
  .result-head p { display: none; }
}

@media (min-height: 780px) {
  .floor { overflow: visible; }
  .mode-end .cat { bottom: 380px; }
  .mode-end .zzz { left: 64%; bottom: 610px; }
  .result-layer { align-items: flex-end; padding-top: 120px; }
}

@media (min-width: 560px) {
  body { display: flex; align-items: center; justify-content: center; }
  .app { height: min(940px, 100dvh); border-radius: 20px; }
}

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

/* ============================================================
   动画
   ============================================================ */
@keyframes breathe {
  0%, 100% { transform: scale(1) translateY(0); }
  50% { transform: scale(1.012, 0.992) translateY(2px); }
}
@keyframes catBounce {
  0% { transform: scale(1, 1) translateY(0); }
  28% { transform: scale(1.06, 0.92) translateY(6px); }
  58% { transform: scale(0.96, 1.06) translateY(-8px); }
  100% { transform: scale(1, 1) translateY(0); }
}
@keyframes catExcited {
  0%, 100% { transform: translateY(0) rotate(0); }
  30% { transform: translateY(-7px) rotate(-2deg); }
  65% { transform: translateY(-3px) rotate(2deg); }
}
@keyframes catChew {
  0%, 100% { transform: scale(1, 1); }
  50% { transform: scale(1.02, 0.975) translateY(2px); }
}
@keyframes tailWag {
  0%, 100% { transform: rotate(-3deg); }
  50% { transform: rotate(4deg); }
}
@keyframes earTwitch {
  0%, 86%, 100% { transform: rotate(0); }
  90% { transform: rotate(-3deg); }
  94% { transform: rotate(2deg); }
}
@keyframes blink {
  0%, 92%, 100% { transform: scaleY(1); }
  94% { transform: scaleY(0.08); }
  96% { transform: scaleY(1); }
}
@keyframes drift {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(9px); }
}
@keyframes dangle {
  0%, 100% { transform: rotate(-6deg); }
  50% { transform: rotate(7deg); }
}
@keyframes ballRoll {
  0% { transform: translateX(0) rotate(0); }
  55% { transform: translateX(28px) rotate(240deg); }
  100% { transform: translateX(0) rotate(360deg); }
}
@keyframes zfloat {
  0%, 100% { transform: translateY(0); opacity: 0.7; }
  50% { transform: translateY(-6px); opacity: 1; }
}
@keyframes dustFloat {
  0% { transform: translateY(0) scale(0.7); opacity: 0; }
  25% { opacity: 0.8; }
  100% { transform: translateY(-60px) scale(1.1); opacity: 0; }
}
@keyframes floatUp {
  0% { opacity: 0; transform: translateY(16px) scale(0.72); }
  12% { opacity: 1; transform: translateY(0) scale(1); }
  82% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-78px) scale(0.9); }
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes scoreFloat {
  0% { opacity: 0; transform: translate(-50%, -30%) scale(0.7); }
  22% { opacity: 1; transform: translate(-50%, -60%) scale(1.08); }
  100% { opacity: 0; transform: translate(-50%, -170%) scale(0.92); }
}
@keyframes ambientHeart {
  0% { opacity: 0; transform: translateY(8px) scale(0.55) rotate(-10deg); }
  22% { opacity: 0.9; transform: translateY(0) scale(1) rotate(0deg); }
  72% { opacity: 0.62; transform: translateY(-26px) scale(0.92) rotate(7deg); }
  100% { opacity: 0; transform: translateY(-46px) scale(0.8) rotate(12deg); }
}
@keyframes heartPop {
  0% { opacity: 0; transform: translate(0, 4px) scale(0.5) rotate(0); }
  25% { opacity: 1; transform: translate(var(--dx), -8px) scale(1.05) rotate(8deg); }
  100% { opacity: 0; transform: translate(calc(var(--dx) * 1.6), -42px) scale(0.7) rotate(-10deg); }
}
@keyframes confettiFall {
  0% { opacity: 1; transform: translateY(0) rotate(0); }
  100% { opacity: 0; transform: translateY(160px) rotate(540deg); }
}
@keyframes urgentPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); box-shadow: 0 8px 20px rgba(214, 72, 78, 0.35), 0 0 0 4px rgba(255, 110, 110, 0.16); }
}
@keyframes ctaGlow {
  0%, 100% { box-shadow: 0 11px 22px rgba(228, 108, 28, 0.36), inset 0 2px 0 rgba(255, 255, 255, 0.42), inset 0 -3px 0 rgba(180, 75, 12, 0.18); }
  50% { box-shadow: 0 13px 27px rgba(228, 108, 28, 0.48), inset 0 2px 0 rgba(255, 255, 255, 0.42), inset 0 -3px 0 rgba(180, 75, 12, 0.18); }
}
@keyframes levelupPop {
  0% { transform: scale(0.68); opacity: 0; }
  65% { transform: scale(1.04); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes ringPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.07); }
}
@keyframes sparkle {
  0%, 100% { opacity: 0.4; transform: scale(0.7) rotate(0); }
  50% { opacity: 1; transform: scale(1.2) rotate(45deg); }
}
