/* 叮叮星球 · 样式（Chrome 61 基线 + 能力检测增强） */
:root {
  --st: 0px;
  --sb: 0px;
  --ink: #FFFFFF;
  --ink-soft: #B9A9F0;
  --gold: #FFD76A;
  --cyan: #7FE3FF;
  --pink: #FF8BD0;
  --grape: #B49BFF;
  --card: rgba(34, 20, 84, .92);
}

html, body {
  height: 100%;
  overflow: hidden;
  background: #1E0F57;
}
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: .92;
  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,.5), rgba(255,255,255,0));
  pointer-events: none;
}
.btn + .btn { margin-top: 16px; }
.btn:focus { box-shadow: 0 0 0 3px rgba(180,155,255,.7); }
.btn-primary {
  background: linear-gradient(180deg, #FFCB6E 0%, #FF8A5B 100%);
  box-shadow: 0 6px 0 #D2583A, 0 14px 26px rgba(255,120,80,.32);
  text-shadow: 0 2px 0 rgba(170,60,30,.4);
}
.btn-primary:active { transform: translateY(4px); box-shadow: 0 2px 0 #D2583A, 0 6px 12px rgba(255,120,80,.3); }
.btn-secondary {
  background: linear-gradient(180deg, #98A8FF 0%, #5E5CF0 100%);
  box-shadow: 0 6px 0 #3B38B8, 0 14px 26px rgba(80,76,220,.34);
  text-shadow: 0 2px 0 rgba(40,36,150,.4);
}
.btn-secondary:active { transform: translateY(4px); box-shadow: 0 2px 0 #3B38B8, 0 6px 12px rgba(80,76,220,.3); }
.btn-ghost {
  height: 48px;
  font-size: 16px;
  color: #fff;
  background: rgba(255,255,255,.14);
  box-shadow: 0 4px 0 rgba(255,255,255,.1), inset 0 0 0 1px rgba(255,255,255,.18);
}
.btn-ghost::after { display: none; }
.btn-ghost:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(255,255,255,.1), inset 0 0 0 1px rgba(255,255,255,.18); }

.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: rgba(255,255,255,.12);
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  line-height: 36px;
  white-space: nowrap;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.16);
}
.pill-btn svg {
  width: 16px; height: 16px;
  vertical-align: -3px;
  margin-right: 4px;
  fill: #fff;
}
.pill-btn svg .wave { fill: none; stroke: #fff; 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: #1C0F4A;
  background: var(--cyan);
  vertical-align: 1px;
}
.pill-btn.is-off { opacity: .62; }
.pill-btn.is-off .pill-state { background: #8C7FC0; color: #fff; }
.pill-btn:active { transform: scale(.95); }

/* ---------- 主菜单 ---------- */
.menu {
  position: absolute;
  left: 0; top: 0; right: 0; bottom: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  padding: 0 18px;
  pointer-events: none;
}
.menu-title {
  margin-top: 18px;
  margin-top: calc(var(--st) + 18px);
  margin-bottom: auto;
  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(--gold); 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 #E58D1A; }
.logo .l2 { color: var(--cyan); 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 #2A9ED6; animation-delay: .18s; }
.logo .l3 { 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 #D8489C; animation-delay: .36s; }
.logo .l4 { color: var(--grape); 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 #7352D8; 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: #fff;
  background: rgba(255,255,255,.16);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.2);
}
.menu-hint {
  font-size: 13px;
  font-weight: 800;
  color: #fff;
  padding: 5px 14px;
  border-radius: 14px;
  background: rgba(20,10,60,.4);
  margin-bottom: 12px;
  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(34,20,84,.88);
  box-shadow: 0 18px 40px rgba(10,4,40,.5), inset 0 0 0 1px rgba(255,255,255,.14);
  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: #fff; font-size: 16px; margin-left: 2px; }
.dot {
  display: inline-block;
  width: 10px; height: 10px;
  border-radius: 50%;
  margin-right: 5px;
  vertical-align: 0;
}
.dot-gold { background: radial-gradient(circle at 35% 30%, #FFFBE0, #FFD76A 60%, #E58D1A); }
.dot-cyan { background: radial-gradient(circle at 35% 30%, #F4FEFF, #7FE3FF 60%, #2A9ED6); }
.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,.16);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.22), 0 4px 0 rgba(10,4,40,.3);
  display: flex;
  align-items: center;
  justify-content: center;
}
.hud-btn svg { width: 20px; height: 20px; fill: #fff; }
.hud-btn:active { transform: translateY(2px); }
.hud-spacer { flex: 0 0 56px; width: 56px; height: 46px; }
.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 #5B3AC8, 2px 0 0 #5B3AC8, -2px 0 0 #5B3AC8, 0 -2px 0 #5B3AC8, 2px 2px 0 #5B3AC8, -2px 2px 0 #5B3AC8, 2px -2px 0 #5B3AC8, -2px -2px 0 #5B3AC8, 0 6px 0 rgba(20,8,70,.4), 0 0 18px rgba(160,130,255,.7);
}
.hud-score-num.bump { animation: bump .32s ease-out; }
@keyframes bump {
  0% { transform: scale(1); }
  35% { transform: scale(1.22); }
  100% { transform: scale(1); }
}
.best-row {
  display: flex;
  align-items: center;
  max-width: 470px;
  height: 16px;
  margin: 8px auto 0;
}
.best-txt {
  flex: 0 0 auto;
  min-width: 70px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .5px;
  color: var(--ink-soft);
}
.best-txt b { color: #fff; font-size: 12px; }
.best-track {
  flex: 1 1 auto;
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
  background: rgba(255,255,255,.16);
  box-shadow: inset 0 1px 2px rgba(10,4,40,.4);
}
.best-fill {
  width: 100%;
  height: 100%;
  border-radius: 4px;
  transform-origin: 0 50%;
  transform: scaleX(0);
  background: linear-gradient(90deg, #7FE3FF, #B49BFF, #FF8BD0);
}
.best-fill.is-gold { background: linear-gradient(90deg, #FFD76A, #FF9F4A, #FF8BD0); box-shadow: 0 0 10px rgba(255,200,90,.9); }

/* 星风按钮 */
.shake {
  position: absolute;
  right: 14px;
  bottom: 12px;
  bottom: calc(var(--sb) + 10px);
  width: 56px; height: 56px;
  border-radius: 28px;
  background: rgba(50,34,120,.78);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.2), 0 6px 14px rgba(10,4,40,.4);
  z-index: 3;
  text-align: center;
}
.shake-ring { position: absolute; left: 0; top: 0; width: 56px; height: 56px; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: rgba(255,255,255,.14); stroke-width: 3; }
.ring-fg { fill: none; stroke: #7FE3FF; stroke-width: 3; stroke-linecap: round; stroke-dasharray: 157.1; stroke-dashoffset: 0; }
.shake-ico { position: absolute; left: 17px; top: 9px; width: 22px; height: 22px; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.shake-txt { position: absolute; left: 0; right: 0; top: 33px; font-size: 11px; line-height: 14px; font-weight: 800; color: #fff; }
.shake:active { transform: scale(.94); }
.shake.is-cool { opacity: .6; }
.shake.is-ready { animation: ready 1.4s ease-in-out infinite; }
@keyframes ready {
  0%, 100% { box-shadow: inset 0 0 0 1px rgba(255,255,255,.2), 0 6px 14px rgba(10,4,40,.4), 0 0 0 rgba(127,227,255,0); }
  50% { box-shadow: inset 0 0 0 1px rgba(255,255,255,.4), 0 6px 14px rgba(10,4,40,.4), 0 0 16px rgba(127,227,255,.85); }
}

/* ---------- 弹层 ---------- */
.modal {
  position: absolute;
  left: 0; top: 0; right: 0; bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(10,4,40,.55);
  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: var(--card);
  box-shadow: 0 24px 60px rgba(8,2,36,.6), inset 0 0 0 1px rgba(255,255,255,.16);
  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 {
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
  }
  .menu-card { background: rgba(34,20,84,.78); }
  .modal-card { background: rgba(34,20,84,.9); }
}
.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: rgba(255,255,255,.08);
}
.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: var(--gold); }
.pdot {
  flex: 0 0 auto;
  display: inline-block;
  width: 22px; height: 22px;
  border-radius: 50%;
  box-shadow: inset 0 -2px 3px rgba(0,0,0,.18);
}
.pdot + .pdot { margin-left: -4px; }
.p-cyan { background: radial-gradient(circle at 35% 30%, #F4FEFF, #7FE3FF 55%, #2A9ED6); }
.p-gold { background: radial-gradient(circle at 35% 30%, #FFFCD6, #FFD644 55%, #FF9A1E); }
.p-pink { background: radial-gradient(circle at 35% 30%, #FFE0F2, #FF8BD0 55%, #D8489C); }
.p-red { background: radial-gradient(circle at 35% 30%, #FFD6A8, #FF6F43 55%, #C42B1D); }
.p-comet { background: radial-gradient(circle at 35% 30%, #FFFFFF, #FFE9A0 45%, #FFB347); box-shadow: 0 0 10px rgba(255,220,120,.9); }

/* 结算 */
.result-card { padding-top: 22px; }
.res-mode {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 800;
  color: #1C0F4A;
  background: var(--cyan);
}
.res-rank {
  margin-top: 10px;
  font-size: 28px;
  font-weight: 900;
  color: var(--gold);
  letter-spacing: 2px;
  text-shadow: 0 2px 0 rgba(200,100,20,.5);
}
.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 #5B3AC8, 3px 0 0 #5B3AC8, -3px 0 0 #5B3AC8, 0 -3px 0 #5B3AC8, 2px 2px 0 #5B3AC8, -2px 2px 0 #5B3AC8, 2px -2px 0 #5B3AC8, -2px -2px 0 #5B3AC8, 0 8px 0 rgba(20,8,70,.4), 0 0 24px rgba(160,130,255,.6);
}
.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, #FF8BD0, #FFB347);
  animation: pulse .45s ease-in-out infinite alternate;
}
@keyframes pulse {
  from { transform: scale(1); }
  to { transform: scale(1.08); }
}
.res-stats {
  display: flex;
  margin: 18px 0 20px;
  padding: 12px 6px;
  border-radius: 20px;
  background: rgba(255,255,255,.08);
}
.res-stat {
  flex: 1 1 0;
  min-width: 0;
}
.res-stat b {
  display: block;
  font-size: 22px;
  font-weight: 900;
  white-space: nowrap;
}
.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(10,4,40,.5);
}
.share-tip {
  margin: 12px 0 14px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-soft);
}

/* 轻提示 */
.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,50,160,.92);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.2);
  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.05); }
}

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

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