/* 噗噗果冻 · 样式（Chrome 61 基线 + 能力检测增强） */
:root {
  --st: 0px;
  --sb: 0px;
  --ink: #5A3A7A;
  --ink-soft: #8D6BAE;
  --pink: #FF7EB3;
  --yellow: #FFCB45;
  --mint: #4FDDB0;
  --sky: #62B8FF;
  --grape: #AE86FF;
}

html, body {
  height: 100%;
  overflow: hidden;
  background: #F1E0FF;
}
html { touch-action: manipulation; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

#app {
  position: fixed;
  left: 0; top: 0; right: 0; bottom: 0;
  overflow: hidden;
}
#stage {
  position: absolute;
  left: 0; top: 0;
  width: 100%; height: 100%;
  display: block;
  touch-action: none;
}
#safeProbe {
  position: absolute;
  left: 0; top: 0;
  width: 1px; height: 0;
  visibility: hidden;
  pointer-events: none;
  padding-top: 0;
  padding-top: var(--safe-area-inset-top, env(safe-area-inset-top, 0px));
  padding-bottom: 0;
  padding-bottom: var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px));
}

.is-hidden { display: none !important; }

button {
  font: inherit;
  color: inherit;
  border: 0;
  background: none;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  outline: none;
}

/* ---------- 按钮 ---------- */
.btn {
  position: relative;
  display: block;
  width: 100%;
  height: 58px;
  border-radius: 29px;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 1px;
  color: #fff;
  transition: transform .12s ease, box-shadow .12s ease;
}
.btn small {
  font-size: 13px;
  font-weight: 700;
  margin-left: 8px;
  opacity: .9;
  letter-spacing: 0;
}
.btn::after {
  content: "";
  position: absolute;
  left: 22px; right: 22px; top: 6px;
  height: 14px;
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(255,255,255,.55), rgba(255,255,255,0));
  pointer-events: none;
}
.btn + .btn { margin-top: 16px; }
.btn:focus { box-shadow: 0 0 0 3px rgba(174,134,255,.6); }
.btn-primary {
  background: linear-gradient(180deg, #FFA1CA 0%, #FF6FA8 100%);
  box-shadow: 0 6px 0 #E0508C, 0 14px 26px rgba(224,80,140,.32);
  text-shadow: 0 2px 0 rgba(196,52,110,.35);
}
.btn-primary:active { transform: translateY(4px); box-shadow: 0 2px 0 #E0508C, 0 6px 12px rgba(224,80,140,.3); }
.btn-secondary {
  background: linear-gradient(180deg, #84EBCB 0%, #46C2E6 100%);
  box-shadow: 0 6px 0 #2B9FB4, 0 14px 26px rgba(43,159,180,.28);
  text-shadow: 0 2px 0 rgba(30,120,140,.35);
}
.btn-secondary:active { transform: translateY(4px); box-shadow: 0 2px 0 #2B9FB4, 0 6px 12px rgba(43,159,180,.28); }
.btn-ghost {
  height: 48px;
  font-size: 16px;
  color: var(--ink);
  background: #fff;
  box-shadow: 0 4px 0 #E2D2F4, 0 8px 18px rgba(130,90,180,.12);
}
.btn-ghost::after { display: none; }
.btn-ghost:active { transform: translateY(3px); box-shadow: 0 1px 0 #E2D2F4; }

.text-btn {
  display: block;
  margin: 14px auto 0;
  padding: 6px 14px;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-soft);
}

.pill-btn {
  display: inline-block;
  height: 36px;
  padding: 0 14px;
  border-radius: 18px;
  background: #F4ECFF;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  line-height: 36px;
  white-space: nowrap;
  box-shadow: inset 0 -2px 0 rgba(150,110,200,.15);
}
.pill-btn svg {
  width: 16px; height: 16px;
  vertical-align: -3px;
  margin-right: 4px;
  fill: var(--ink);
}
.pill-btn svg .wave { fill: none; stroke: var(--ink); stroke-width: 2; stroke-linecap: round; }
.pill-state {
  display: inline-block;
  margin-left: 5px;
  padding: 0 6px;
  height: 18px;
  line-height: 18px;
  border-radius: 9px;
  font-size: 11px;
  color: #fff;
  background: var(--mint);
  vertical-align: 1px;
}
.pill-btn.is-off { opacity: .62; }
.pill-btn.is-off .pill-state { background: #B9A7CC; }
.pill-btn:active { transform: scale(.95); }

/* ---------- 主菜单 ---------- */
.menu {
  position: absolute;
  left: 0; top: 0; right: 0; bottom: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: 0 18px;
  pointer-events: none;
}
.menu-title {
  margin-top: 18px;
  margin-top: calc(var(--st) + 18px);
  text-align: center;
}
.logo {
  font-size: 62px;
  line-height: 1.05;
  font-weight: 900;
  letter-spacing: 2px;
  white-space: nowrap;
}
.logo span {
  display: inline-block;
  animation: bob 2.6s ease-in-out infinite;
}
.logo .l1 { color: var(--pink);   text-shadow: 0 3px 0 #fff, 3px 0 0 #fff, -3px 0 0 #fff, 0 -3px 0 #fff, 2px 2px 0 #fff, -2px 2px 0 #fff, 2px -2px 0 #fff, -2px -2px 0 #fff, 0 8px 0 #E2508F; }
.logo .l2 { color: var(--yellow); text-shadow: 0 3px 0 #fff, 3px 0 0 #fff, -3px 0 0 #fff, 0 -3px 0 #fff, 2px 2px 0 #fff, -2px 2px 0 #fff, 2px -2px 0 #fff, -2px -2px 0 #fff, 0 8px 0 #EE9A12; animation-delay: .18s; }
.logo .l3 { color: var(--mint);   text-shadow: 0 3px 0 #fff, 3px 0 0 #fff, -3px 0 0 #fff, 0 -3px 0 #fff, 2px 2px 0 #fff, -2px 2px 0 #fff, 2px -2px 0 #fff, -2px -2px 0 #fff, 0 8px 0 #1FAE86; animation-delay: .36s; }
.logo .l4 { color: var(--sky);    text-shadow: 0 3px 0 #fff, 3px 0 0 #fff, -3px 0 0 #fff, 0 -3px 0 #fff, 2px 2px 0 #fff, -2px 2px 0 #fff, 2px -2px 0 #fff, -2px -2px 0 #fff, 0 8px 0 #2F84DC; animation-delay: .54s; }
@keyframes bob {
  0%, 100% { transform: translateY(0) rotate(-4deg) scale(1, 1); }
  45% { transform: translateY(-9px) rotate(4deg) scale(.96, 1.05); }
  60% { transform: translateY(-6px) rotate(3deg) scale(1.04, .97); }
}
.tagline {
  display: inline-block;
  margin-top: 14px;
  padding: 6px 16px;
  border-radius: 16px;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--ink);
  background: rgba(255,255,255,.75);
  box-shadow: 0 4px 12px rgba(150,100,200,.15);
}
.menu-hint {
  font-size: 13px;
  font-weight: 800;
  color: #fff;
  padding: 5px 14px;
  border-radius: 14px;
  background: rgba(120,80,170,.32);
  animation: hint 2.2s ease-in-out infinite;
}
@keyframes hint {
  0%, 100% { opacity: .55; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(5px); }
}
.menu-card {
  pointer-events: auto;
  width: 100%;
  max-width: 380px;
  margin-bottom: 20px;
  margin-bottom: calc(var(--sb) + 20px);
  padding: 18px 20px 16px;
  border-radius: 30px;
  background: rgba(255,255,255,.88);
  box-shadow: 0 18px 40px rgba(120,70,180,.24), inset 0 1px 0 rgba(255,255,255,.9);
  animation: rise .6s cubic-bezier(.2,1.3,.4,1) both;
}
@keyframes rise {
  from { transform: translateY(40px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.menu-stats {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
}
.stat-chip {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-soft);
  white-space: nowrap;
}
.stat-chip + .stat-chip { margin-left: 18px; }
.stat-chip b { color: var(--ink); font-size: 16px; margin-left: 2px; }
.dot {
  display: inline-block;
  width: 10px; height: 10px;
  border-radius: 50%;
  margin-right: 5px;
  vertical-align: 0;
}
.dot-pink { background: radial-gradient(circle at 35% 30%, #FFD0E4, #FF7EB3 60%, #E2508F); }
.dot-mint { background: radial-gradient(circle at 35% 30%, #C8FAE8, #4FDDB0 60%, #1FAE86); }
.menu-row {
  display: flex;
  justify-content: center;
  margin-top: 16px;
}
.menu-row > * + * { margin-left: 10px; }

/* ---------- HUD ---------- */
.hud {
  position: absolute;
  left: 0; right: 0; top: 0;
  padding: 10px 14px 0;
  padding-top: calc(var(--st) + 10px);
  pointer-events: none;
}
.hud-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 470px;
  margin: 0 auto;
}
.hud-btn {
  pointer-events: auto;
  flex: 0 0 auto;
  width: 46px; height: 46px;
  border-radius: 23px;
  background: rgba(255,255,255,.88);
  box-shadow: 0 4px 0 rgba(150,100,200,.25);
  display: flex;
  align-items: center;
  justify-content: center;
}
.hud-btn svg { width: 20px; height: 20px; fill: var(--ink); }
.hud-btn:active { transform: translateY(2px); }
.hud-score {
  flex: 1 1 auto;
  min-width: 0;
  text-align: center;
}
.hud-label {
  display: block;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 3px;
  color: var(--ink-soft);
}
.hud-score-num {
  display: inline-block;
  font-size: 36px;
  font-weight: 900;
  line-height: 1.05;
  color: #fff;
  text-shadow: 0 2px 0 #7A4FA0, 2px 0 0 #7A4FA0, -2px 0 0 #7A4FA0, 0 -2px 0 #7A4FA0, 2px 2px 0 #7A4FA0, -2px 2px 0 #7A4FA0, 2px -2px 0 #7A4FA0, -2px -2px 0 #7A4FA0, 0 6px 0 rgba(90,50,140,.28);
}
.hud-score-num.bump { animation: bump .32s ease-out; }
@keyframes bump {
  0% { transform: scale(1); }
  35% { transform: scale(1.22); }
  100% { transform: scale(1); }
}
.hud-timer {
  flex: 0 0 auto;
  min-width: 78px;
  height: 46px;
  padding: 0 12px;
  border-radius: 23px;
  background: rgba(255,255,255,.88);
  box-shadow: 0 4px 0 rgba(150,100,200,.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
}
.hud-timer-num { font-size: 22px; }
.hud-timer-unit { font-size: 12px; margin-left: 2px; color: var(--ink-soft); }
.hud-timer.is-urgent {
  color: #fff;
  background: linear-gradient(180deg, #FF93A8, #FF5C7A);
  box-shadow: 0 4px 0 #D63E5E;
  animation: pulse .5s ease-in-out infinite alternate;
}
.hud-timer.is-urgent .hud-timer-unit { color: #fff; }
@keyframes pulse {
  from { transform: scale(1); }
  to { transform: scale(1.08); }
}
.fever {
  position: relative;
  max-width: 470px;
  height: 14px;
  margin: 10px auto 0;
}
.fever-track {
  height: 14px;
  border-radius: 7px;
  overflow: hidden;
  background: rgba(255,255,255,.62);
  box-shadow: inset 0 2px 3px rgba(120,70,170,.2);
}
.fever-fill {
  width: 100%;
  height: 100%;
  border-radius: 7px;
  transform-origin: 0 50%;
  transform: scaleX(0);
  background: linear-gradient(90deg, #FF7EB3, #FFCB45, #4FDDB0, #62B8FF, #AE86FF, #FF7EB3);
  background-size: 200% 100%;
  animation: flow 1.8s linear infinite;
}
@keyframes flow {
  from { background-position: 0 0; }
  to { background-position: -200% 0; }
}
.fever-label {
  position: absolute;
  right: 10px; top: 0;
  font-size: 10px;
  line-height: 14px;
  font-weight: 900;
  letter-spacing: 1px;
  color: var(--ink-soft);
}
.hud.is-fever .fever-track { box-shadow: 0 0 14px rgba(255,214,90,.95), inset 0 2px 3px rgba(120,70,170,.2); }
.hud.is-fever .hud-label { color: #FFE9A8; }
.hud.is-fever .fever-label { color: #fff; text-shadow: 0 1px 2px rgba(110,60,160,.8); animation: pulse .35s ease-in-out infinite alternate; }

/* ---------- 弹层 ---------- */
.modal {
  position: absolute;
  left: 0; top: 0; right: 0; bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(64,36,104,.42);
  animation: fadeIn .25s ease both;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal-card {
  width: 100%;
  max-width: 360px;
  max-height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 26px 22px 18px;
  border-radius: 32px;
  text-align: center;
  background: rgba(255,255,255,.96);
  box-shadow: 0 24px 60px rgba(60,20,110,.35), inset 0 1px 0 #fff;
  animation: popIn .45s cubic-bezier(.2,1.4,.4,1) both;
}
@keyframes popIn {
  from { transform: scale(.72); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
@supports ((-webkit-backdrop-filter: blur(10px)) or (backdrop-filter: blur(10px))) {
  .menu-card, .modal-card {
    background: rgba(255,255,255,.8);
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
  }
  .modal-card { background: rgba(255,255,255,.93); }
}
.modal-title {
  font-size: 24px;
  font-weight: 900;
  margin-bottom: 16px;
}
.pause-toggles { margin: 0 0 20px; }

.how-list {
  list-style: none;
  text-align: left;
  margin-bottom: 20px;
}
.how-list li {
  display: flex;
  align-items: center;
  padding: 10px 12px;
  border-radius: 18px;
  background: #F7F1FF;
}
.how-list li + li { margin-top: 10px; }
.how-list p {
  flex: 1 1 auto;
  min-width: 0;
  margin-left: 10px;
  font-size: 14px;
  line-height: 1.5;
  font-weight: 600;
}
.how-list b { color: #E2508F; }
.jelly {
  flex: 0 0 auto;
  display: inline-block;
  width: 22px; height: 22px;
  border-radius: 50%;
  box-shadow: inset 0 -2px 3px rgba(0,0,0,.12);
}
.jelly + .jelly { margin-left: -4px; }
.j-pink { background: radial-gradient(circle at 35% 30%, #FFD0E4, #FF7EB3 55%, #E2508F); }
.j-yellow { background: radial-gradient(circle at 35% 30%, #FFF3C2, #FFCB45 55%, #EE9A12); }
.j-gold { background: radial-gradient(circle at 35% 30%, #FFFBE0, #FFC83A 55%, #F08A16); box-shadow: 0 0 10px rgba(255,200,60,.8); }
.j-rainbow { background: linear-gradient(135deg, #FF7EB3, #FFCB45, #4FDDB0, #62B8FF, #AE86FF); }

/* 结算 */
.result-card { padding-top: 22px; }
.res-mode {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 800;
  color: #fff;
  background: var(--grape);
}
.res-rank {
  margin-top: 10px;
  font-size: 28px;
  font-weight: 900;
  color: #E2508F;
  letter-spacing: 2px;
}
.res-label {
  margin-top: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-soft);
}
.res-score {
  font-size: 58px;
  line-height: 1.1;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 3px 0 #7A4FA0, 3px 0 0 #7A4FA0, -3px 0 0 #7A4FA0, 0 -3px 0 #7A4FA0, 2px 2px 0 #7A4FA0, -2px 2px 0 #7A4FA0, 2px -2px 0 #7A4FA0, -2px -2px 0 #7A4FA0, 0 8px 0 rgba(90,50,140,.25);
}
.res-new {
  display: inline-block;
  margin-top: 6px;
  padding: 4px 14px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 900;
  color: #fff;
  background: linear-gradient(90deg, #FF7EB3, #FFB347);
  animation: pulse .45s ease-in-out infinite alternate;
}
.res-stats {
  display: flex;
  margin: 18px 0 20px;
  padding: 12px 6px;
  border-radius: 20px;
  background: #F7F1FF;
}
.res-stat {
  flex: 1 1 0;
  min-width: 0;
}
.res-stat b {
  display: block;
  font-size: 22px;
  font-weight: 900;
}
.res-stat span {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-soft);
}
.res-share {
  display: flex;
  margin-top: 14px;
}
.res-share .btn { flex: 1 1 0; min-width: 0; font-size: 15px; letter-spacing: 0; }
.res-share .btn + .btn { margin-top: 0; margin-left: 10px; }

.share-card { padding: 16px 16px 14px; }
.share-img {
  display: block;
  width: 100%;
  max-width: 100%;
  border-radius: 20px;
  box-shadow: 0 8px 20px rgba(100,60,150,.2);
}
.share-tip {
  margin: 12px 0 14px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-soft);
}

/* 倒计时 */
.countdown {
  position: absolute;
  left: 0; right: 0; top: 42%;
  margin-top: -60px;
  text-align: center;
  pointer-events: none;
  font-size: 112px;
  line-height: 1;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 4px 0 #7A4FA0, 4px 0 0 #7A4FA0, -4px 0 0 #7A4FA0, 0 -4px 0 #7A4FA0, 3px 3px 0 #7A4FA0, -3px 3px 0 #7A4FA0, 3px -3px 0 #7A4FA0, -3px -3px 0 #7A4FA0, 0 12px 0 rgba(90,50,140,.3);
}
.countdown.anim { animation: cd .7s cubic-bezier(.2,1.5,.4,1) both; }
@keyframes cd {
  0% { transform: scale(2.2); opacity: 0; }
  40% { transform: scale(.92); opacity: 1; }
  70% { transform: scale(1.04); }
  100% { transform: scale(1); opacity: 1; }
}

/* 轻提示 */
.toast {
  position: absolute;
  left: 50%;
  bottom: 90px;
  bottom: calc(var(--sb) + 90px);
  max-width: 80%;
  padding: 10px 20px;
  border-radius: 22px;
  font-size: 15px;
  font-weight: 800;
  color: #fff;
  background: rgba(70,40,110,.88);
  transform: translateX(-50%);
  pointer-events: none;
  animation: toastIn .3s ease both;
}
@keyframes toastIn {
  from { opacity: 0; transform: translate(-50%, 12px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* 小屏适配 */
@media (max-height: 640px) {
  .logo { font-size: 48px; }
  .tagline { margin-top: 8px; font-size: 13px; }
  .menu-card { padding: 14px 16px 12px; }
  .btn { height: 52px; font-size: 18px; }
  .menu-stats { margin-bottom: 12px; }
  .menu-row { margin-top: 12px; }
  .res-score { font-size: 46px; }
}
@media (max-width: 340px) {
  .logo { font-size: 50px; }
  .pill-btn { padding: 0 10px; font-size: 13px; }
}
@media (hover: hover) {
  .btn:hover { filter: brightness(1.04); }
}

/* 品牌水印 */
.brand {
  margin-top: 10px;
  text-align: center;
  font-size: 11px;
  line-height: 14px;
  font-weight: 700;
  letter-spacing: .6px;
  color: var(--ink-soft);
  opacity: .62;
}
.result-card .text-btn + .brand { margin-top: 4px; }

/* 层级 */
#stage { z-index: 0; }
.hud { z-index: 2; }
.countdown { z-index: 3; }
.menu { z-index: 4; }
.modal { z-index: 10; }
.toast { z-index: 20; }
