/* 麻薯弹弹 · 奶油草莓软糖视觉 */
@font-face {
  font-family: "KuaiLe";
  src: url("fonts/ZCOOLKuaiLe-subset.woff2?v=1.2.1") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --cream: #fff8f1;
  --cream-2: #fffdf9;
  --paper: #fffaf6;
  --ink: #5c3a4a;
  --ink-soft: #8b6675;
  --ink-faint: #b3949f;
  --pink: #ff8eae;
  --pink-deep: #e85d85;
  --pink-soft: #ffe1e9;
  --peach: #ffc29f;
  --lemon: #ffe28a;
  --mint: #9fe8c8;
  --sky: #a9dcf4;
  --lavender: #cdbbff;
  --line: rgba(121, 69, 87, .1);
  --shadow-sm: 0 3px 0 rgba(175, 103, 124, .1), 0 8px 18px rgba(151, 78, 102, .08);
  --shadow-md: 0 5px 0 rgba(175, 103, 124, .12), 0 16px 34px rgba(151, 78, 102, .12);
  --shadow-lg: 0 8px 0 rgba(175, 103, 124, .12), 0 24px 60px rgba(151, 78, 102, .18);
  --font-display: "KuaiLe", "Noto Sans CJK SC", "PingFang SC", sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans CJK SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

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

html {
  height: 100%;
  background: #f4d8df;
}

body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  color: var(--ink);
  font-family: var(--font-body);
  background:
    radial-gradient(circle at 20% 10%, #ffe8eb 0 28%, transparent 55%),
    radial-gradient(circle at 85% 80%, #e7f8ef 0 24%, transparent 55%),
    linear-gradient(145deg, #f7dfe6, #f9eee4 55%, #e9f6ee);
  overscroll-behavior: none;
  touch-action: manipulation;
}

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

button:focus-visible {
  outline: 3px solid rgba(232, 93, 133, .55);
  outline-offset: 3px;
}

svg {
  width: 1.25em;
  height: 1.25em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.svg-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

[hidden] {
  display: none !important;
}

.app-shell {
  position: relative;
  width: 100%;
  max-width: 460px;
  height: 100%;
  margin: 0 auto;
  overflow: hidden;
  isolation: isolate;
}

/* 柔和的背景装饰 */
.ambient {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% -10%, rgba(255, 255, 255, .95) 0 28%, transparent 68%),
    linear-gradient(175deg, #fff2f3 0%, #fff9ef 46%, #fff2ee 100%);
}

.ambient::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .38;
  background-image: radial-gradient(rgba(209, 134, 156, .24) 1px, transparent 1px);
  background-size: 18px 18px;
  mask-image: linear-gradient(to bottom, transparent 0, #000 25%, #000 70%, transparent 100%);
}

.ambient-blob {
  position: absolute;
  display: block;
  border-radius: 52% 48% 61% 39% / 48% 55% 45% 52%;
  filter: blur(2px);
  opacity: .55;
  animation: blobFloat 13s ease-in-out infinite alternate;
}

.blob-a {
  width: 46vw;
  height: 34vw;
  max-width: 210px;
  max-height: 160px;
  left: -48px;
  top: 18%;
  background: linear-gradient(140deg, #ffd7e2, #ffe9c8);
}

.blob-b {
  width: 42vw;
  height: 34vw;
  max-width: 190px;
  max-height: 160px;
  right: -58px;
  top: 48%;
  background: linear-gradient(140deg, #d8f4e6, #d9ecff);
  animation-delay: -4s;
}

.blob-c {
  width: 58vw;
  height: 38vw;
  max-width: 250px;
  max-height: 170px;
  left: 20%;
  bottom: -64px;
  background: linear-gradient(140deg, #ffebbe, #ffdbe5);
  opacity: .45;
  animation-delay: -8s;
}

.ambient-dot {
  position: absolute;
  display: block;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 6px rgba(255, 255, 255, .24);
}

.dot-a { width: 7px; height: 7px; left: 12%; top: 31%; }
.dot-b { width: 5px; height: 5px; right: 14%; top: 17%; }

.ambient-star {
  position: absolute;
  color: #ffc3d2;
  font-size: 22px;
  animation: starBob 4s ease-in-out infinite;
}

.star-a { right: 11%; top: 34%; color: #f7c977; }
.star-b { left: 8%; top: 64%; font-size: 15px; color: #b7dfd0; animation-delay: -2s; }

.screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
}

.screen-home {
  opacity: 1;
  transition: opacity .24s ease, transform .3s cubic-bezier(.2,.9,.3,1);
}

.screen-home.is-leaving {
  opacity: 0;
  transform: scale(.97) translateY(8px);
  pointer-events: none;
}

.home-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: calc(var(--safe-top) + 12px) 16px calc(var(--safe-bottom) + 22px);
  display: flex;
  flex-direction: column;
  gap: 0;
}

.home-scroll::-webkit-scrollbar,
.hero-strip::-webkit-scrollbar,
.modal-sheet::-webkit-scrollbar {
  display: none;
}

/* 顶部 logo */
.home-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 42px;
  flex: none;
}

.logo-lockup {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 18px;
  letter-spacing: .01em;
  color: var(--ink);
}

.logo-mark {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(150deg, #ff99b4, #ffb783);
  box-shadow: 0 3px 0 rgba(208, 105, 129, .2), inset 0 1px 0 rgba(255, 255, 255, .55);
  transform: rotate(-8deg);
}

.logo-mark svg { width: 16px; height: 16px; stroke-width: 1.6; fill: rgba(255,255,255,.28); }

.header-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}

.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 15px;
  display: grid;
  place-items: center;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, .72);
  border: 1.5px solid rgba(255, 255, 255, .9);
  box-shadow: 0 3px 0 rgba(177, 113, 131, .07);
  transition: transform .16s ease, background .16s ease;
}

.icon-btn:active { transform: scale(.92); }
.icon-btn svg { width: 19px; height: 19px; }

/* 首页主视觉 */
.home-hero {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 172px;
  padding: 7px 0 2px;
  position: relative;
}

.hero-copy {
  position: relative;
  z-index: 2;
  width: 56%;
  padding-top: 6px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 9px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: .17em;
  color: var(--pink-deep);
}

.eyebrow i {
  width: 15px;
  height: 2px;
  border-radius: 2px;
  background: var(--pink);
  display: inline-block;
}

.eyebrow-small {
  font-size: 8px;
  letter-spacing: .14em;
  color: #c08e9f;
}

.hero-copy h1 {
  margin: 6px 0 6px;
  font-family: var(--font-display);
  font-size: clamp(48px, 13.5vw, 61px);
  line-height: .88;
  letter-spacing: .015em;
  font-weight: 400;
  color: #5b3547;
  text-shadow: 0 3px 0 rgba(255, 255, 255, .8);
}

.hero-copy h1 em {
  position: relative;
  font-style: normal;
  color: #eb668b;
  display: inline-block;
}

.hero-copy h1 em::after {
  content: "";
  position: absolute;
  left: 2px;
  right: -2px;
  bottom: 1px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 205, 113, .44);
  transform: rotate(-1.5deg);
  z-index: -1;
}

.hero-tagline {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.58;
  color: var(--ink-soft);
  font-weight: 500;
}

.hero-facts {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.hero-facts span {
  display: inline-flex;
  align-items: baseline;
  gap: 3px;
  padding: 4px 8px;
  font-size: 9px;
  line-height: 1;
  color: #a37784;
  border-radius: 9px;
  background: rgba(255, 255, 255, .7);
  border: 1px solid rgba(255, 255, 255, .8);
}

.hero-facts b {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 400;
  color: var(--pink-deep);
}

.mascot-stage {
  position: absolute;
  right: -7px;
  top: -8px;
  width: 46%;
  max-width: 196px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  z-index: 1;
}

.mascot-halo {
  position: absolute;
  width: 82%;
  height: 82%;
  border-radius: 50%;
  background:
    radial-gradient(circle at 42% 34%, rgba(255, 255, 255, .92), rgba(255, 246, 233, .3) 54%, transparent 70%);
  border: 1px dashed rgba(226, 134, 157, .27);
  box-shadow: 0 0 0 13px rgba(255, 255, 255, .18), 0 0 0 28px rgba(255, 255, 255, .09);
  animation: haloPulse 5s ease-in-out infinite;
}

.mascot-halo::before,
.mascot-halo::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .8);
}

.mascot-halo::before { inset: -9px; }
.mascot-halo::after { inset: 10px; border-style: dashed; opacity: .6; }

#home-sparkles {
  position: absolute;
  z-index: 1;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

#mascot-canvas {
  position: relative;
  z-index: 2;
  width: 88%;
  height: 88%;
  animation: mascotFloat 4.2s ease-in-out infinite;
}

.mascot-shadow {
  position: absolute;
  bottom: 12%;
  width: 42%;
  height: 8%;
  border-radius: 50%;
  background: rgba(147, 79, 101, .13);
  filter: blur(5px);
  animation: shadowBreathe 4.2s ease-in-out infinite;
}

.mascot-bubble {
  position: absolute;
  z-index: 4;
  bottom: -33px;
  left: -2%;
  max-width: 132px;
  pointer-events: none;
  padding: 7px 10px;
  border-radius: 5px 14px 14px 14px;
  background: #fff;
  color: #8f6170;
  font-size: 9.5px;
  line-height: 1.35;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(177, 100, 123, .13);
  transform-origin: top right;
  animation: bubblePop .45s cubic-bezier(.2, 1.4, .5, 1) both;
}

.mascot-bubble::after {
  content: "";
  position: absolute;
  right: 16px;
  top: -5px;
  width: 10px;
  height: 10px;
  background: #fff;
  transform: rotate(45deg);
  border-radius: 2px;
}

.float-tag {
  position: absolute;
  z-index: 3;
  font-family: var(--font-display);
  color: #e8a54a;
  pointer-events: none;
  animation: tagFloat 3.4s ease-in-out infinite;
}

.tag-a { right: 7%; top: 35%; font-size: 16px; color: #ec8aa6; transform: rotate(8deg); }
.tag-b { left: 4%; top: 26%; font-size: 19px; color: #f2b7c7; animation-delay: -1.2s; }
.tag-c { left: 15%; bottom: 14%; font-size: 15px; color: #eac36d; animation-delay: -2.3s; }

/* 选择区 */
.choose-panel {
  flex: none;
  margin-top: 1px;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 9px;
}

.section-heading h2 {
  margin: 3px 0 0;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 400;
  letter-spacing: .01em;
  color: #5d3a49;
}

.text-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 8px;
  margin-bottom: 2px;
  border-radius: 10px;
  color: #a97888;
  font-size: 10.5px;
  font-weight: 700;
  background: rgba(255, 255, 255, .64);
}

.text-btn:active { transform: scale(.95); }
.text-btn svg { width: 13px; height: 13px; }

.hero-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 3px 1px 8px;
  scrollbar-width: none;
  mask-image: linear-gradient(to right, #000 0, #000 calc(100% - 26px), transparent 100%);
  -webkit-mask-image: linear-gradient(to right, #000 0, #000 calc(100% - 26px), transparent 100%);
}

.hero-card {
  --hero-color: #ff9fb6;
  --hero-deep: #e36a8b;
  flex: 0 0 106px;
  scroll-snap-align: center;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 6px 9px;
  border-radius: 22px;
  border: 1.5px solid rgba(255, 255, 255, .95);
  background: rgba(255, 255, 255, .58);
  box-shadow: 0 2px 0 rgba(175, 105, 125, .06);
  transition: transform .2s cubic-bezier(.2,.9,.3,1), background .2s, border-color .2s, box-shadow .2s;
}

.hero-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle at 50% 22%, rgba(255, 214, 226, .35), transparent 65%);
  background: radial-gradient(circle at 50% 22%, color-mix(in srgb, var(--hero-color) 19%, transparent), transparent 65%);
  opacity: 0;
  transition: opacity .2s;
  pointer-events: none;
}

.hero-card[aria-selected="true"] {
  transform: translateY(-3px);
  background: #fffdfb;
  border-color: var(--hero-color);
  border-color: color-mix(in srgb, var(--hero-color) 65%, white);
  box-shadow: 0 7px 14px rgba(175, 105, 125, .14), 0 3px 0 rgba(175, 105, 125, .06);
  box-shadow: 0 7px 16px color-mix(in srgb, var(--hero-color) 20%, transparent), 0 3px 0 rgba(175, 105, 125, .06);
}

.hero-card[aria-selected="true"]::before { opacity: 1; }

.hero-card:active { transform: scale(.97); }

.hero-portrait {
  position: relative;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 50% 48%, color-mix(in srgb, var(--hero-color) 13%, white) 0 34%, transparent 70%);
}

.hero-portrait::after {
  content: "";
  position: absolute;
  left: 14%;
  right: 14%;
  bottom: 4%;
  height: 9%;
  border-radius: 50%;
  background: rgba(142, 78, 98, .12);
  filter: blur(3px);
}

.hero-portrait canvas {
  position: relative;
  z-index: 1;
  width: 84px;
  height: 84px;
}

.card-order {
  position: absolute;
  top: 8px;
  left: 9px;
  font-family: var(--font-display);
  font-size: 8px;
  color: color-mix(in srgb, var(--hero-deep) 62%, #8f6372);
  opacity: .52;
}

.hero-card-name {
  position: relative;
  z-index: 1;
  font-family: var(--font-display);
  font-size: 13px;
  color: var(--ink);
  white-space: nowrap;
  letter-spacing: .02em;
}

.hero-card-role {
  position: relative;
  z-index: 1;
  font-size: 8px;
  color: #ac8792;
  white-space: nowrap;
}

.hero-card-check {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--hero-color);
  box-shadow: 0 1px 3px rgba(134, 64, 86, .16);
  opacity: 0;
  transform: scale(.55);
  transition: .18s ease;
}

.hero-card-check svg { width: 10px; height: 10px; stroke-width: 3; }
.hero-card[aria-selected="true"] .hero-card-check { opacity: 1; transform: scale(1); }

/* 角色详情 */
.hero-detail {
  flex: none;
  margin-top: 1px;
  padding: 11px 12px 10px;
  border-radius: 22px;
  background: rgba(255, 255, 255, .7);
  border: 1.5px solid rgba(255, 255, 255, .9);
  box-shadow: 0 3px 0 rgba(178, 110, 128, .05);
}

.detail-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.detail-heading {
  min-width: 0;
}

.detail-role {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--pink-soft);
  color: var(--pink-deep);
  font-size: 8px;
  font-weight: 800;
  line-height: 1.5;
}

.detail-heading h3 {
  margin: 3px 0 1px;
  font-family: var(--font-display);
  font-size: 17px;
  line-height: 1.2;
  font-weight: 400;
}

.detail-heading h3 small {
  margin-left: 4px;
  font-family: var(--font-body);
  font-size: 8.5px;
  font-weight: 600;
  color: #b28896;
}

.detail-quote {
  margin: 0;
  color: #aa8591;
  font-size: 9px;
  line-height: 1.4;
}

.difficulty {
  display: flex;
  align-items: center;
  gap: 3px;
  flex: none;
  padding-top: 4px;
  font-size: 7.5px;
  color: #b5909b;
}

.difficulty i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #f2e3e7;
}

.difficulty i.on { background: var(--pink); }

.detail-trait {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed rgba(182, 125, 143, .17);
}

.trait-badge {
  flex: none;
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  color: #fff;
  background: linear-gradient(145deg, var(--pink), #ffba9d);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4);
}

.trait-badge svg { width: 15px; height: 15px; fill: rgba(255,255,255,.22); }

.trait-copy { min-width: 0; }
.trait-copy span {
  display: block;
  font-size: 8px;
  font-weight: 800;
  color: #b58594;
  letter-spacing: .02em;
}

.trait-copy b {
  font-size: 10.5px;
  color: #624251;
}

.trait-copy p {
  margin: 2px 0 0;
  font-size: 9.5px;
  line-height: 1.45;
  color: #8f6c7a;
}

.detail-stats {
  display: flex;
  gap: 5px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 4px 6px;
  border-radius: 7px;
  background: #fff6f8;
  color: #a18590;
  font-size: 8px;
  line-height: 1;
  border: 1px solid rgba(255, 255, 255, .9);
}

.stat-pill svg { width: 10px; height: 10px; stroke-width: 2; color: #e386a0; }
.stat-pill b { font-size: 9.5px; color: #76535f; }

/* 开始按钮 */
.home-cta {
  position: sticky;
  bottom: calc(var(--safe-bottom) + 2px);
  z-index: 6;
  flex: none;
  margin-top: auto;
  padding-top: 12px;
  background: linear-gradient(to bottom, rgba(255, 247, 243, 0), rgba(255, 248, 244, .88) 42%, rgba(255, 248, 244, .97));
}

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 53px;
  border-radius: 19px;
  font-family: var(--font-display);
  font-size: 18px;
  letter-spacing: .04em;
  overflow: hidden;
  transition: transform .16s ease, box-shadow .16s ease, filter .16s ease;
}

.btn:active { transform: translateY(2px) scale(.99); }
.btn:disabled { opacity: .5; pointer-events: none; }

.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, #ff8fae 0%, #ff789d 56%, #f26d8a 100%);
  box-shadow: 0 5px 0 #d85879, 0 13px 24px rgba(220, 91, 122, .26), inset 0 1px 0 rgba(255, 255, 255, .45);
}

.btn-primary::after {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 15px;
  border: 1px solid rgba(255, 255, 255, .25);
  pointer-events: none;
}

.btn-start .btn-label { position: relative; z-index: 1; }

.btn-icon {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .2);
}

.btn-icon svg { width: 16px; height: 16px; stroke-width: 2.2; }

.btn-sheen {
  position: absolute;
  top: -60%;
  left: -30%;
  width: 34%;
  height: 220%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .32), transparent);
  transform: rotate(22deg);
  animation: sheen 4.5s ease-in-out infinite;
}

.btn-secondary {
  color: var(--ink);
  background: #fff;
  border: 1.5px solid rgba(255, 255, 255, .9);
  box-shadow: 0 4px 0 rgba(171, 99, 121, .1), 0 9px 20px rgba(159, 84, 107, .08);
}

.btn-ghost {
  color: #9d7482;
  background: rgba(255, 255, 255, .55);
}

.btn-small {
  min-height: 44px;
  border-radius: 15px;
  font-size: 15px;
}

.btn-plain {
  min-height: 38px;
  border-radius: 12px;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 700;
}

.home-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 11px;
  flex-wrap: wrap;
}

.install-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  border-radius: 999px;
  color: #9e7484;
  font-size: 9px;
  font-weight: 700;
  background: rgba(255, 255, 255, .68);
}

.install-btn svg { width: 11px; height: 11px; }

.best-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .58);
  color: #a5828e;
  font-size: 9px;
  font-weight: 600;
}

.best-chip svg { width: 11px; height: 11px; color: #d8ad55; }

.offline-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  margin: 8px 0 0;
  color: #b0969f;
  font-size: 8px;
  letter-spacing: .02em;
}

.offline-note i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #93cfb0;
  box-shadow: 0 0 0 3px rgba(147, 207, 176, .18);
}

/* ============ 游戏界面 ============ */
.screen-game {
  padding: calc(var(--safe-top) + 9px) 12px calc(var(--safe-bottom) + 10px);
  gap: 7px;
  animation: screenIn .35s cubic-bezier(.2, .9, .3, 1) both;
}

.game-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: none;
  min-height: 44px;
  gap: 8px;
}

.player-card {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.player-avatar {
  position: relative;
  width: 43px;
  height: 43px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: rgba(255, 255, 255, .72);
  border: 1.5px solid rgba(255, 255, 255, .9);
  box-shadow: 0 2px 0 rgba(170, 104, 123, .08);
  overflow: hidden;
}

.player-avatar canvas { width: 48px; height: 48px; }

.player-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.micro-label {
  font-size: 6.5px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: .14em;
  color: #c29aa6;
}

.player-copy strong {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 400;
  letter-spacing: .02em;
  white-space: nowrap;
}

.round-badge {
  display: flex;
  align-items: baseline;
  gap: 3px;
  flex: none;
  padding: 5px 10px 6px;
  border-radius: 13px;
  color: #8c6170;
  background: rgba(255, 255, 255, .66);
  border: 1.5px solid rgba(255, 255, 255, .9);
}

.round-word {
  font-size: 7px;
  font-weight: 800;
  letter-spacing: .1em;
  color: #c19aa4;
  margin-right: 2px;
}

.round-badge strong {
  font-family: var(--font-display);
  font-size: 20px;
  line-height: 1;
  font-weight: 400;
  color: var(--pink-deep);
}

.round-total { font-size: 8px; color: #b696a0; font-weight: 700; }

.pause-btn { width: 36px; height: 36px; flex: none; }
.pause-btn svg { width: 16px; height: 16px; fill: currentColor; stroke: none; }

/* 生命 / 弹性 */
.meters {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  flex: none;
}

@media (max-width: 359px) {
  .meters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .meter-str { grid-column: 1 / -1; }
}

.meter {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  padding: 6px 8px;
  border-radius: 14px;
  background: rgba(255, 255, 255, .65);
  border: 1.5px solid rgba(255, 255, 255, .9);
  box-shadow: 0 2px 0 rgba(174, 109, 127, .05);
}

.meter-icon {
  width: 20px;
  height: 20px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 7px;
  color: #fff;
}

.meter-icon svg { width: 12px; height: 12px; fill: currentColor; stroke: none; }
.meter-hp .meter-icon { background: linear-gradient(145deg, #ff92a9, #f46788); }
.meter-en .meter-icon { background: linear-gradient(145deg, #ffd76f, #f0b842); color: #8a6622; }
.meter-str .meter-icon { background: linear-gradient(145deg, #9fe3c8, #5cbf9a); color: #235a47; }
.meter-str .meter-fill { background: linear-gradient(90deg, #b7f0d8, #57c39c); }
.meter-str .meter-fill.is-low { background: linear-gradient(90deg, #ffb08a, #ef7d63) !important; }
.meter-en .meter-icon svg { stroke: currentColor; stroke-width: 1.8; fill: rgba(255,255,255,.35); }

.meter-body { min-width: 0; flex: 1; }

.meter-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px;
  margin-bottom: 3px;
  line-height: 1;
}

.meter-top span { font-size: 7.5px; font-weight: 800; color: #b18d99; }
.meter-top b { font-size: 8.5px; font-weight: 800; color: #795660; font-variant-numeric: tabular-nums; white-space: nowrap; }

.meter-rail {
  position: relative;
  height: 7px;
  border-radius: 999px;
  background: #f5e7e9;
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(142, 77, 96, .09);
}

.meter-fill {
  display: block;
  height: 100%;
  width: 100%;
  border-radius: inherit;
  transition: width .22s cubic-bezier(.2, .9, .3, 1), background .2s;
}

.meter-hp .meter-fill { background: linear-gradient(90deg, #ff9dac, #f56f8e); }
.meter-en .meter-fill { background: linear-gradient(90deg, #ffe590, #f3c44e); }

.meter-fill.is-low { background: linear-gradient(90deg, #ff886e, #ee5963) !important; animation: lowBar .8s ease-in-out infinite alternate; }

.meter-shine {
  position: absolute;
  top: 1px;
  left: 3px;
  right: 3px;
  height: 2px;
  border-radius: 2px;
  background: rgba(255, 255, 255, .5);
  pointer-events: none;
}

/* 场地外框 */
.arena-shell {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.arena-caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 5px;
  min-height: 14px;
  font-size: 8px;
  font-weight: 700;
  color: #a67f8c;
  letter-spacing: .01em;
}

.arena-caption > span:first-child { display: inline-flex; align-items: center; gap: 5px; }

.live-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #ef8ba4;
  box-shadow: 0 0 0 3px rgba(239, 139, 164, .16);
}

#spawn-timer {
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .55);
  color: #8b6f9a;
  font-size: 7.5px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  transition: background .2s, color .2s;
}

#spawn-timer.is-soon {
  color: #fff;
  background: #e0748f;
  animation: lowBar .8s ease-in-out infinite alternate;
}

.arena-caption > span:nth-child(2) { margin-left: auto; }

#round-progress {
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .55);
  color: #9c6f7d;
  font-size: 7.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

#enemy-count {
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .55);
  color: #a98691;
  font-size: 7.5px;
  font-variant-numeric: tabular-nums;
  transition: background .2s, color .2s;
}

#enemy-count.is-crowded {
  color: #d94e6c;
  background: #ffe9ee;
  font-weight: 800;
}

.arena-frame {
  position: relative;
  flex: 1;
  min-height: 180px;
  border-radius: 28px;
  overflow: hidden;
  background: #fff2f0;
  box-shadow: 0 4px 0 rgba(163, 94, 116, .08), 0 14px 30px rgba(156, 84, 107, .1);
  isolation: isolate;
}

#game-canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.arena-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .55);
  pointer-events: none;
}

.aim-hint {
  position: absolute;
  left: 50%;
  bottom: 15%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  border-radius: 999px;
  color: #9c6e7d;
  font-size: 9px;
  font-weight: 700;
  white-space: nowrap;
  background: rgba(255, 255, 255, .78);
  border: 1px solid rgba(255, 255, 255, .9);
  box-shadow: 0 4px 12px rgba(151, 90, 109, .1);
  pointer-events: none;
  transition: opacity .25s, transform .25s;
  z-index: 3;
}

.aim-hint.hidden { opacity: 0; transform: translateX(-50%) translateY(5px); }
.aim-hint .hand { display: inline-block; animation: handBounce 1.5s ease-in-out infinite; }

.combo-flare {
  position: absolute;
  z-index: 4;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: baseline;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(255,255,255,.9), rgba(255,240,210,.92));
  box-shadow: 0 4px 15px rgba(234, 135, 96, .16);
  pointer-events: none;
  transition: opacity .2s, transform .2s;
}

.combo-flare.hidden { opacity: 0; transform: translateX(-50%) translateY(-5px) scale(.9); }
.combo-flare b { font-family: var(--font-display); font-size: 19px; line-height: 1; color: #fb6f8f; font-weight: 400; }
.combo-flare span { font-size: 8px; font-weight: 800; color: #c08067; letter-spacing: .04em; }

.status-badges {
  position: absolute;
  z-index: 4;
  top: 12px;
  left: 10px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  pointer-events: none;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 7px;
  border-radius: 999px;
  font-size: 7.5px;
  font-weight: 800;
  color: #6b5560;
  background: rgba(255, 255, 255, .85);
  box-shadow: 0 2px 8px rgba(110, 74, 86, .1);
  backdrop-filter: blur(4px);
  animation: chipIn .25s ease-out both;
}

.status-chip svg { width: 9px; height: 9px; }
.status-chip.chill { color: #568bb3; }
.status-chip.charge { color: #bd8b2c; }
.status-chip.star { color: #8d6dd3; }
.status-chip.buff-attack { color: #c07a1d; background: #fff6e4; }
.status-chip.buff-speed { color: #2f9c7f; background: #eafaf4; }
.status-chip.buff-bounce { color: #7a5fd0; background: #f3efff; }
.status-chip.buff-shrink { color: #d1547c; background: #fff0f5; }
.status-chip.buff-shield { color: #2f8fae; background: #eaf8ff; }

.arena-toast {
  position: absolute;
  z-index: 6;
  left: 50%;
  top: 46%;
  transform: translate(-50%, -50%) scale(.9);
  max-width: 80%;
  padding: 7px 12px;
  border-radius: 12px;
  background: rgba(94, 55, 69, .85);
  color: #fff;
  font-size: 9.5px;
  font-weight: 700;
  text-align: center;
  line-height: 1.45;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
  backdrop-filter: blur(4px);
}

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

.game-tip {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 21px;
  padding: 0 4px;
  font-size: 8.3px;
  line-height: 1.4;
  color: #a27f8a;
  text-align: center;
}

.game-tip svg { width: 10px; height: 10px; color: #eab556; flex: none; }

/* 底部道具口袋 */
.dock {
  flex: none;
  padding: 7px 8px 7px;
  border-radius: 20px;
  background: rgba(255, 255, 255, .62);
  border: 1.5px solid rgba(255, 255, 255, .92);
  box-shadow: 0 3px 0 rgba(173, 106, 125, .05);
}

.dock-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 3px 5px;
}

.dock-title {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-display);
  font-size: 10.5px;
  color: #73606a;
}

.dock-title svg { width: 11px; height: 11px; color: #c596a5; }

.dock-note { font-size: 6.8px; color: #b4929e; font-weight: 600; }

.item-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.item-btn {
  --item-color: #ffacc8;
  --item-deep: #e96b94;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: 54px;
  padding: 5px 3px 4px;
  border-radius: 13px;
  background: #fff6f9;
  background: color-mix(in srgb, var(--item-color) 16%, #fff);
  border: 1.5px solid #ffe7ef;
  border: 1.5px solid color-mix(in srgb, var(--item-color) 28%, white);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .65);
  transition: transform .14s ease, filter .14s, background .2s;
}

.item-btn:active { transform: translateY(2px) scale(.97); }

.item-btn.is-empty {
  filter: grayscale(.52);
  opacity: .55;
}

.item-icon {
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  color: var(--item-deep);
  background: rgba(255, 255, 255, .7);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .7);
}

.item-icon svg { width: 15px; height: 15px; }

.item-name {
  font-size: 8.5px;
  font-weight: 800;
  line-height: 1;
  color: #75535f;
  white-space: nowrap;
}

.item-count {
  position: absolute;
  top: 3px;
  right: 4px;
  min-width: 14px;
  height: 14px;
  padding: 0 4px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: var(--item-deep);
  background: #fff;
  font-size: 7.5px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 1px 3px rgba(139, 79, 98, .12);
}

.item-btn.is-empty .item-count { color: #a99ba0; }

.item-btn.is-pulsing { animation: itemPulse .38s ease; }

/* ============ 轮次登场卡 ============ */
.wave-overlay {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 245, 249, .94), rgba(255, 241, 239, .78) 55%, rgba(252, 235, 238, .62));
  backdrop-filter: blur(9px);
  animation: overlayIn .25s ease both;
}

.wave-card {
  position: relative;
  width: min(100%, 330px);
  padding: 28px 20px 20px;
  border-radius: 32px;
  text-align: center;
  background:
    radial-gradient(circle at 50% 10%, rgba(255, 255, 255, .95), transparent 48%),
    linear-gradient(170deg, #fffdfb, #fff4f2 65%, #ffeceb);
  border: 2px solid rgba(255, 255, 255, .9);
  box-shadow: 0 10px 0 rgba(200, 133, 148, .1), 0 28px 60px rgba(161, 92, 112, .18);
  animation: wavePop .48s cubic-bezier(.2, 1.35, .5, 1) both;
}

.wave-card::before {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: 26px;
  border: 1px dashed rgba(235, 154, 173, .3);
  pointer-events: none;
}

.wave-ribbon {
  display: inline-flex;
  padding: 5px 12px;
  border-radius: 999px;
  background: #fff1f4;
  color: #c37587;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .04em;
}

.wave-ribbon span { color: #ec6e8f; }

.wave-art {
  position: relative;
  width: 148px;
  height: 142px;
  margin: 5px auto 0;
  display: grid;
  place-items: center;
}

.wave-ring {
  position: absolute;
  width: 116px;
  height: 116px;
  border-radius: 50%;
  background: radial-gradient(circle, #fff7ef 0 35%, #fff 62%, transparent 66%);
  box-shadow: 0 0 0 9px rgba(255, 255, 255, .45), 0 0 0 20px rgba(255, 255, 255, .2);
  animation: waveRing 3.6s ease-in-out infinite;
}

#wave-enemy-canvas {
  position: relative;
  z-index: 2;
  width: 142px;
  height: 142px;
  animation: enemyFloat 3.2s ease-in-out infinite;
}

.wave-spark { position: absolute; z-index: 3; font-family: var(--font-display); }
.s1 { right: 5px; top: 24px; color: #ffc062; font-size: 17px; animation: tagFloat 2.8s ease-in-out infinite; }
.s2 { left: 8px; top: 52px; color: #f6a4ba; font-size: 13px; animation: tagFloat 3.4s ease-in-out -1s infinite; }
.s3 { right: 22px; bottom: 13px; color: #e7a6c9; font-size: 16px; animation: tagFloat 3s ease-in-out -2s infinite; }

.wave-tag {
  display: inline-block;
  padding: 4px 9px;
  border-radius: 999px;
  background: #fff5e5;
  color: #bd9252;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .03em;
}

.wave-card h2 {
  margin: 7px 0 9px;
  font-family: var(--font-display);
  font-size: 27px;
  line-height: 1.1;
  font-weight: 400;
  color: #583545;
  letter-spacing: .02em;
}

.wave-trait {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px;
  border-radius: 15px;
  text-align: left;
  background: rgba(255, 255, 255, .68);
  border: 1px solid rgba(255, 255, 255, .9);
}

.wave-trait-label {
  flex: none;
  padding: 2px 6px;
  border-radius: 5px;
  background: #ffe8ee;
  color: #cc6c85;
  font-size: 7.5px;
  font-weight: 900;
  line-height: 1.5;
}

.wave-trait b { display: block; font-size: 10px; color: #6c4a56; }
.wave-trait p { margin: 2px 0 0; font-size: 9px; line-height: 1.5; color: #967580; }

.wave-field {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin: 8px 0 0;
  padding: 4px 9px;
  border-radius: 999px;
  background: #f2eeff;
  color: #6f5aa8;
  font-size: 8.5px;
  font-weight: 700;
}

.wave-reward {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin: 8px 0 0;
  padding: 4px 9px;
  border-radius: 999px;
  background: #effaf4;
  color: #5c947a;
  font-size: 8.5px;
  font-weight: 700;
}

.wave-reward span {
  padding: 1px 5px;
  border-radius: 5px;
  background: #d7f2e3;
  color: #478a68;
  font-size: 7.5px;
  font-weight: 900;
}

.wave-rule {
  margin: 9px 0 0;
  padding: 5px 8px;
  border-radius: 8px;
  background: #fff4f5;
  color: #b0798a;
  font-size: 8.5px;
  line-height: 1.45;
  text-align: center;
}

.wave-rule b {
  color: #e05f80;
  font-size: 10px;
}

.wave-start {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-top: 13px;
  color: #b58e99;
  font-size: 8.5px;
  font-weight: 700;
}

.wave-start i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #e8a1b2;
  animation: dots 1.1s ease-in-out infinite;
}

.wave-start i:nth-child(3) { animation-delay: .15s; }
.wave-start i:nth-child(4) { animation-delay: .3s; }

/* ============ 弹窗 ============ */
.modal-root {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 12px 12px calc(12px + var(--safe-bottom));
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(67, 36, 49, .35);
  backdrop-filter: blur(6px);
  animation: fadeIn .2s ease both;
}

.modal-sheet {
  position: relative;
  z-index: 1;
  width: min(100%, 420px);
  max-height: calc(100dvh - 34px);
  overflow-y: auto;
  scrollbar-width: none;
  padding: 24px 20px calc(18px + var(--safe-bottom));
  border-radius: 30px;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 255, 255, .98), transparent 35%),
    linear-gradient(170deg, #fffdf9 0%, #fff7f3 65%, #fff0f0 100%);
  border: 2px solid rgba(255, 255, 255, .95);
  box-shadow: 0 10px 0 rgba(190, 117, 135, .12), 0 30px 60px rgba(101, 52, 68, .25);
  animation: sheetUp .34s cubic-bezier(.2, 1, .3, 1) both;
}

.modal-sheet::before {
  content: "";
  position: absolute;
  top: 8px;
  left: 50%;
  width: 36px;
  height: 4px;
  margin-left: -18px;
  border-radius: 999px;
  background: rgba(176, 126, 141, .16);
}

.modal-close {
  position: absolute;
  z-index: 2;
  top: 13px;
  right: 13px;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: #a78490;
  background: rgba(255, 255, 255, .7);
}

.modal-close:active { transform: scale(.92); }
.modal-close svg { width: 15px; height: 15px; }

.modal-kicker {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin: 1px 0 5px;
  color: #d08396;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.modal-kicker::before {
  content: "✦";
  font-size: 10px;
  color: #f0b95e;
}

.modal-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 26px;
  line-height: 1.2;
  font-weight: 400;
  color: #583746;
  letter-spacing: .01em;
}

.modal-sub {
  margin: 7px 0 0;
  font-size: 10.5px;
  line-height: 1.65;
  color: #967581;
}

.modal-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 17px;
}

.modal-actions .btn { min-height: 48px; font-size: 16px; }
.modal-actions-row { display: flex; gap: 8px; }
.modal-actions-row .btn { flex: 1; }

.modal-note {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin-top: 13px;
  padding: 8px 9px;
  border-radius: 11px;
  background: #fff9ec;
  color: #a88e65;
  font-size: 8.5px;
  line-height: 1.5;
}

.modal-note svg { width: 12px; height: 12px; flex: none; margin-top: 1px; color: #d9b76e; }

/* 暂停弹窗 */
.pause-head {
  display: flex;
  align-items: center;
  gap: 11px;
  padding-right: 26px;
}

.pause-mascot {
  width: 48px;
  height: 48px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: #fff1f4;
  color: var(--pink-deep);
}

.pause-mascot svg { width: 23px; height: 23px; fill: currentColor; stroke: none; }

.pause-head .modal-title { font-size: 24px; }
.pause-head .modal-sub { margin-top: 3px; }

.pause-run-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-top: 14px;
}

.pause-run-stats div {
  padding: 8px 5px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .65);
  text-align: center;
}

.pause-run-stats b {
  display: block;
  font-family: var(--font-display);
  font-size: 18px;
  line-height: 1.2;
  font-weight: 400;
  color: #6b4755;
}

.pause-run-stats span { font-size: 7.5px; color: #b08995; }

/* 玩法步骤 */
.guide-steps {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 15px;
}

.guide-step {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px;
  border-radius: 15px;
  background: rgba(255, 255, 255, .7);
  border: 1px solid rgba(255, 255, 255, .95);
}

.step-number {
  flex: none;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #fff0f4;
  color: #dc6f8d;
  font-family: var(--font-display);
  font-size: 13px;
}

.guide-step h3 { margin: 1px 0 3px; font-size: 10.5px; color: #664653; }
.guide-step p { margin: 0; font-size: 9px; line-height: 1.55; color: #96747f; }
.guide-step em { font-style: normal; color: #dc6f8d; font-weight: 800; }

.guide-tip {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 10px;
  padding: 8px 10px;
  border-radius: 11px;
  background: #f2fbf6;
  color: #6e9b81;
  font-size: 8.5px;
  line-height: 1.5;
}

.guide-tip svg { width: 13px; height: 13px; flex: none; color: #75b991; }

/* 设置 */
.settings-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: 14px;
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 10px 11px;
  border-radius: 14px;
  background: rgba(255, 255, 255, .7);
  border: 1px solid rgba(255, 255, 255, .9);
  text-align: left;
}

.toggle-label {
  display: flex;
  align-items: center;
  gap: 8px;
}

.toggle-label > span:first-child {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #fff0f3;
  color: #d57c91;
}

.toggle-label svg { width: 14px; height: 14px; }
.toggle-label b { display: block; font-size: 10px; color: #6b4c58; }
.toggle-label small { display: block; margin-top: 1px; font-size: 7.5px; color: #b1909b; }

.switch {
  position: relative;
  flex: none;
  width: 38px;
  height: 22px;
  border-radius: 999px;
  background: #eadde0;
  transition: background .18s;
}

.switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 4px rgba(122, 71, 87, .18);
  transition: transform .18s cubic-bezier(.2, .9, .3, 1);
}

.toggle-row[aria-pressed="true"] .switch { background: #ff93ae; }
.toggle-row[aria-pressed="true"] .switch::after { transform: translateX(16px); }

.settings-danger {
  margin-top: 13px;
  padding-top: 12px;
  border-top: 1px dashed rgba(177, 122, 139, .2);
}

.danger-btn {
  width: 100%;
  min-height: 38px;
  border-radius: 11px;
  color: #bf6f7f;
  font-size: 9.5px;
  font-weight: 700;
  background: #fff5f3;
  border: 1px solid #ffe3e0;
}

.settings-foot {
  margin-top: 12px;
  text-align: center;
  font-size: 7.5px;
  color: #b69ba3;
}

/* 奖励 */
.reward-head { text-align: center; padding-right: 0; }
.reward-head .modal-title { font-size: 25px; }
.reward-list { display: flex; flex-direction: column; gap: 7px; margin-top: 15px; }

.reward-card {
  --item-color: #ffacc8;
  --item-deep: #e96b94;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  border-radius: 16px;
  text-align: left;
  background: rgba(255, 255, 255, .8);
  border: 1.5px solid rgba(255, 255, 255, .95);
  box-shadow: 0 3px 0 rgba(175, 105, 125, .05);
  transition: transform .15s ease, border-color .15s, box-shadow .15s;
}

.reward-card:active {
  transform: scale(.985);
  border-color: var(--item-color);
  box-shadow: 0 5px 14px rgba(175, 105, 125, .16);
  box-shadow: 0 5px 15px color-mix(in srgb, var(--item-color) 25%, transparent);
}

.reward-icon {
  flex: none;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  color: var(--item-deep);
  background: #fff0f5;
  background: color-mix(in srgb, var(--item-color) 26%, #fff);
}

.reward-icon svg { width: 20px; height: 20px; }

.reward-copy { flex: 1; min-width: 0; }
.reward-copy b { display: block; font-size: 10.5px; color: #634551; }
.reward-copy p { margin: 2px 0 0; font-size: 8.5px; line-height: 1.45; color: #9b7b86; }

.reward-plus {
  flex: none;
  padding: 3px 7px;
  border-radius: 7px;
  background: #fff4f7;
  background: color-mix(in srgb, var(--item-color) 18%, white);
  color: var(--item-deep);
  font-size: 9px;
  font-weight: 900;
}

.reward-foot {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  margin-top: 11px;
  color: #b38c75;
  font-size: 8px;
  font-weight: 600;
}

.reward-foot svg { width: 10px; height: 10px; color: #d8ad55; }

/* 结算 */
.result-hero {
  position: relative;
  height: 112px;
  margin: 0 auto 2px;
  display: grid;
  place-items: center;
}

.result-halo {
  position: absolute;
  width: 104px;
  height: 104px;
  border-radius: 50%;
  background: radial-gradient(circle, #fff7d6 0 24%, rgba(255, 244, 206, .6) 48%, transparent 70%);
  animation: haloPulse 3.8s ease-in-out infinite;
}

.result-canvas { position: relative; z-index: 1; width: 128px; height: 128px; }

.result-badge {
  position: absolute;
  z-index: 2;
  right: calc(50% - 72px);
  top: 8px;
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #d79c2f;
  background: #fff8d9;
  box-shadow: 0 3px 9px rgba(190, 148, 55, .18);
  animation: tagFloat 3s ease-in-out infinite;
}

.result-badge svg { width: 14px; height: 14px; }

.result-head { text-align: center; }
.result-head .modal-title { font-size: 27px; }
.result-head .modal-sub { max-width: 280px; margin-left: auto; margin-right: auto; }

.result-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
  margin-top: 15px;
}

.result-stat {
  padding: 7px 3px;
  border-radius: 11px;
  background: rgba(255, 255, 255, .68);
  text-align: center;
  border: 1px solid rgba(255, 255, 255, .9);
}

.result-stat b {
  display: block;
  font-family: var(--font-display);
  font-size: 17px;
  line-height: 1.2;
  font-weight: 400;
  color: #64414e;
}

.result-stat span { font-size: 6.8px; color: #ad8c96; }
.result-head .modal-actions { margin-top: 16px; }

.hero-roll-call {
  display: flex;
  justify-content: center;
  gap: 4px;
  margin-top: 10px;
}

.hero-roll-call i {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 8px;
  font-style: normal;
  background: #fff5f7;
  color: #ce9aa8;
}

.hero-roll-call i.beaten { background: #f0fff7; color: #78b68e; }

/* 安装 */
.install-hero {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px;
  border-radius: 17px;
  background: linear-gradient(140deg, #fff5e8, #fff0f4);
  border: 1px solid rgba(255, 255, 255, .9);
}

.install-hero-icon {
  flex: none;
  width: 45px;
  height: 45px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(140deg, #ff97b2, #ffc17f);
  box-shadow: 0 3px 0 rgba(188, 105, 124, .12);
}

.install-hero-icon svg { width: 22px; height: 22px; }
.install-hero b { display: block; font-size: 11px; color: #674752; }
.install-hero p { margin: 3px 0 0; font-size: 8.5px; line-height: 1.5; color: #9d7c86; }

.install-steps {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: 12px;
}

.install-step {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .68);
  font-size: 9.5px;
  color: #7d5c68;
  line-height: 1.45;
}

.install-step .step-number { width: 21px; height: 21px; font-size: 11px; border-radius: 7px; }
.install-step b { color: #684754; }

/* 全局提示 */
.toast {
  position: fixed;
  z-index: 200;
  left: 50%;
  bottom: calc(var(--safe-bottom) + 96px);
  transform: translate(-50%, 12px);
  max-width: calc(100% - 40px);
  padding: 8px 14px;
  border-radius: 12px;
  background: rgba(82, 48, 61, .88);
  color: #fff;
  font-size: 10px;
  line-height: 1.4;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
  backdrop-filter: blur(6px);
}

.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* 横屏提示 */
.rotate-hint {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 22px;
  background: linear-gradient(160deg, #fff4f1, #ffeef1);
}

.rotate-card {
  text-align: center;
  padding: 28px;
  border-radius: 28px;
  background: #fffdfb;
  box-shadow: var(--shadow-md);
}

.rotate-phone {
  display: block;
  width: 38px;
  height: 60px;
  margin: 0 auto 14px;
  border: 3px solid #dc8ba0;
  border-radius: 10px;
  animation: rotatePhone 2.4s ease-in-out infinite;
}

.rotate-card b { font-family: var(--font-display); font-size: 20px; font-weight: 400; color: #694754; }
.rotate-card p { margin: 5px 0 0; font-size: 10px; color: #ad8b96; }

.noscript {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: grid;
  place-items: center;
  padding: 20px;
  background: #fff5f3;
  color: #7a5360;
  font-size: 14px;
  text-align: center;
}

/* 动画 */
@keyframes blobFloat {
  from { transform: translate3d(0, 0, 0) rotate(0deg) scale(1); }
  to { transform: translate3d(10px, -14px, 0) rotate(7deg) scale(1.04); }
}
@keyframes starBob {
  0%, 100% { transform: translateY(0) rotate(-6deg); opacity: .7; }
  50% { transform: translateY(-6px) rotate(6deg); opacity: 1; }
}
@keyframes mascotFloat {
  0%, 100% { transform: translateY(0) rotate(-1deg); }
  50% { transform: translateY(-6px) rotate(1deg); }
}
@keyframes shadowBreathe {
  0%, 100% { transform: scaleX(1); opacity: .8; }
  50% { transform: scaleX(.88); opacity: .55; }
}
@keyframes haloPulse {
  0%, 100% { transform: scale(1); opacity: .86; }
  50% { transform: scale(1.035); opacity: 1; }
}
@keyframes bubblePop {
  from { opacity: 0; transform: translateY(5px) scale(.85); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes tagFloat {
  0%, 100% { transform: translateY(0) rotate(4deg); }
  50% { transform: translateY(-5px) rotate(-4deg); }
}
@keyframes sheen {
  0%, 62% { transform: translateX(-130%) rotate(22deg); }
  82%, 100% { transform: translateX(520%) rotate(22deg); }
}
@keyframes screenIn {
  from { opacity: 0; transform: translateY(10px) scale(.99); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes handBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-2px); }
}
@keyframes chipIn {
  from { opacity: 0; transform: translateY(-4px) scale(.9); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes itemPulse {
  0% { transform: scale(1); }
  45% { transform: scale(.92); }
  100% { transform: scale(1); }
}
@keyframes lowBar {
  from { filter: brightness(1); }
  to { filter: brightness(1.18); }
}
@keyframes overlayIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes wavePop {
  from { opacity: 0; transform: translateY(18px) scale(.9); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes waveRing {
  0%, 100% { transform: scale(1); opacity: .9; }
  50% { transform: scale(1.06); opacity: 1; }
}
@keyframes enemyFloat {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-5px) rotate(2deg); }
}
@keyframes dots {
  0%, 100% { opacity: .3; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(-2px); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes sheetUp {
  from { opacity: 0; transform: translateY(26px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes rotatePhone {
  0%, 25% { transform: rotate(0deg); }
  70%, 100% { transform: rotate(90deg); }
}

/* 矮屏适配 */
@media (max-height: 720px) {
  .home-scroll { padding-top: calc(var(--safe-top) + 8px); }
  .home-hero { min-height: 148px; }
  .hero-copy h1 { font-size: clamp(42px, 12vw, 52px); }
  .mascot-stage { width: 43%; top: -10px; }
  .hero-portrait { width: 62px; height: 62px; }
  .hero-portrait canvas { width: 72px; height: 72px; }
  .hero-card { flex-basis: 98px; padding: 6px 5px 7px; }
  .hero-card-name { font-size: 12px; }
  .detail-trait { margin-top: 6px; padding-top: 6px; }
  .home-cta { margin-top: 8px; }
  .btn { min-height: 49px; }
  .screen-game { gap: 5px; padding-top: calc(var(--safe-top) + 6px); }
  .dock { padding: 5px 7px; }
  .item-btn { min-height: 49px; }
  .game-tip { min-height: 18px; font-size: 7.8px; }
  .arena-caption { min-height: 13px; }
}

@media (max-width: 359px) {
  .home-scroll { padding-left: 12px; padding-right: 12px; }
  .hero-copy h1 { font-size: 45px; }
  .hero-copy { width: 55%; }
  .hero-tagline { font-size: 11px; }
  .section-heading h2 { font-size: 18px; }
  .hero-card { flex-basis: 94px; }
  .hero-portrait { width: 58px; height: 58px; }
  .hero-portrait canvas { width: 68px; height: 68px; }
  .detail-heading h3 { font-size: 15px; }
  .detail-heading h3 small { display: none; }
  .screen-game { padding-left: 9px; padding-right: 9px; }
  .dock-note { display: none; }
  .item-bar { gap: 4px; }
  .item-btn { min-height: 46px; }
  .item-name { font-size: 8px; }
  .player-copy strong { font-size: 13.5px; }
  .round-badge { padding-left: 7px; padding-right: 7px; }
  .round-word { display: none; }
  .wave-card { padding-left: 16px; padding-right: 16px; }
  .modal-sheet { padding-left: 16px; padding-right: 16px; }
}

@media (max-height: 760px) {
  .home-hero { min-height: 120px; padding-top: 2px; }
  .hero-copy h1 { font-size: 40px; margin: 4px 0 4px; }
  .hero-facts { display: none; }
  .hero-tagline { font-size: 10px; line-height: 1.45; }
  .hero-strip { padding: 1px 1px 4px; }
  .hero-portrait { width: 46px; height: 46px; }
  .hero-portrait canvas { width: 56px; height: 56px; }
  .hero-card { flex-basis: 84px; padding: 5px 4px 6px; border-radius: 18px; }
  .hero-card-name { font-size: 11.5px; }
  .hero-card-role { font-size: 7px; }
  .section-heading { margin-bottom: 6px; }
  .section-heading h2 { font-size: 17px; }
  .mascot-bubble { display: none; }
  .hero-detail { padding: 8px 10px; border-radius: 18px; }
  .detail-quote { display: none; }
  .detail-heading h3 { font-size: 15px; }
  .detail-trait { margin-top: 5px; padding-top: 5px; }
  .detail-trait p { display: none; }
  .detail-stats { margin-top: 5px; gap: 4px; }
  .detail-stats .stat-pill:nth-child(4) { display: none; }
  .home-cta { padding-top: 8px; }
  .btn { min-height: 44px; font-size: 16px; }
  .home-meta { margin-top: 6px; }
  .offline-note { display: none; }
}


@media (max-height: 580px) {
  .arena-caption { display: none; }
  .game-tip { display: none; }
  .screen-game { gap: 4px; }
  .dock-head { padding-bottom: 3px; }
  .item-btn { min-height: 44px; }
  .item-icon { width: 20px; height: 20px; }
  .item-icon svg { width: 13px; height: 13px; }
  .home-meta { display: none; }
}

@media (orientation: landscape) and (max-height: 560px) and (pointer: coarse) {
  .rotate-hint { display: flex; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
  .ambient-blob, .ambient-star, .mascot-halo, .mascot-shadow, #mascot-canvas, .btn-sheen { animation: none !important; }
}

/* 平板/桌面预览时把手机舞台居中，保留柔和外框 */
@media (min-width: 520px) and (min-height: 700px) {
  body { padding: 18px 0; }
  .app-shell {
    height: calc(100% - 36px);
    border-radius: 38px;
    box-shadow: 0 24px 70px rgba(126, 76, 92, .2), 0 3px 0 rgba(255, 255, 255, .8) inset;
    border: 1px solid rgba(255, 255, 255, .7);
  }
}
